From: Monty Taylor Date: Wed, 13 May 2009 19:24:36 +0000 (-0700) Subject: A few 32-bit fixes. X-Git-Tag: 0.29-2~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c144d7aae17a093784028edb3b877af846f842d1;p=awesomized%2Flibmemcached A few 32-bit fixes. --- diff --git a/libmemcached/memcached_connect.c b/libmemcached/memcached_connect.c index e9ae0c76..66525183 100644 --- a/libmemcached/memcached_connect.c +++ b/libmemcached/memcached_connect.c @@ -218,7 +218,7 @@ static memcached_return network_connect(memcached_server_st *ptr) (void)set_socket_options(ptr); - int flags; + int flags= 0; if (ptr->root->connect_timeout) { flags= fcntl(ptr->fd, F_GETFL, 0); diff --git a/libmemcached/memcached_storage.c b/libmemcached/memcached_storage.c index ea8b1d24..97ca33cc 100644 --- a/libmemcached/memcached_storage.c +++ b/libmemcached/memcached_storage.c @@ -341,7 +341,9 @@ memcached_return memcached_cas_by_key(memcached_st *ptr, static inline uint8_t get_com_code(memcached_storage_action verb, bool noreply) { - uint8_t ret; + /* 0 isn't a value we want, but GCC 4.2 seems to think ret can otherwise + * be used uninitialized in this function. FAIL */ + uint8_t ret= 0; if (noreply) switch (verb) diff --git a/tests/function.c b/tests/function.c index cfa5f597..cd7a82ca 100644 --- a/tests/function.c +++ b/tests/function.c @@ -2557,7 +2557,7 @@ static test_return string_alloc_with_size_toobig(memcached_st *memc) { memcached_string_st *string; - string= memcached_string_create(memc, NULL, INT64_MAX); + string= memcached_string_create(memc, NULL, SIZE_MAX); assert(string == NULL); return 0; @@ -2604,7 +2604,7 @@ static test_return string_alloc_append_toobig(memcached_st *memc) rc= memcached_string_append(string, buffer, SMALL_STRING_LEN); assert(rc == MEMCACHED_SUCCESS); } - rc= memcached_string_append(string, buffer, INT64_MAX); + rc= memcached_string_append(string, buffer, SIZE_MAX); assert(rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE); memcached_string_free(string);