From: Date: Mon, 10 Mar 2008 15:32:54 +0000 (-0400) Subject: Fixed headers for includes. X-Git-Tag: _20~1^2~63 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8af90ac15d8ba8ec464e5ad402ed2d27b95f81e3;p=m6w6%2Flibmemcached Fixed headers for includes. Also remerged back in patch for behavior_set() (lost in bad merge) --- diff --git a/clients/Makefile.am b/clients/Makefile.am index ccc90358..0dbec9f3 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = +INCLUDES = -I$(top_builddir) LDADDS = $(top_builddir)/libmemcached/libmemcached.la bin_PROGRAMS = memcat memcp memstat memrm memflush memslap memerror diff --git a/clients/memslap.c b/clients/memslap.c index 164fc099..ee1920c7 100644 --- a/clients/memslap.c +++ b/clients/memslap.c @@ -148,11 +148,10 @@ void scheduler(memcached_server_st *servers, conclusions_st *conclusion) /* We set this after we have loaded */ { - unsigned int value= 1; if (opt_non_blocking_io) - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 1); if (opt_tcp_nodelay) - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, 1); } @@ -377,7 +376,7 @@ pairs_st *load_create_data(memcached_st *memc, unsigned int number_of, clone= memcached_clone(NULL, memc); /* We always used non-blocking IO for load since it is faster */ - memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL ); + memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); pairs= pairs_generate(number_of, 400); *actual_loaded= execute_set(clone, pairs, number_of); diff --git a/docs/memcached_behavior.pod b/docs/memcached_behavior.pod index 74a3a732..2268e845 100755 --- a/docs/memcached_behavior.pod +++ b/docs/memcached_behavior.pod @@ -10,14 +10,14 @@ C Client Library for memcached (libmemcached, -lmemcached) #include - unsigned long long + uint64_t memcached_behavior_get (memcached_st *ptr, memcached_behavior flag); memcached_return memcached_behavior_set (memcached_st *ptr, memcached_behavior flag, - void *data); + uint64_t data); =head1 DESCRIPTION @@ -111,6 +111,11 @@ memcached_behavior_get() returns either the current value of the get, or 0 or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set() returns whether or not the behavior was enabled. +=head1 NOTES + +memcached_behavior_set() in version .17 was changed from taking a pointer +to data value, to taking a uin64_t. + =head1 HOME To find out more information please check: diff --git a/libmemcached/memcached.h b/libmemcached/memcached.h index 3178866d..d3ec176e 100644 --- a/libmemcached/memcached.h +++ b/libmemcached/memcached.h @@ -266,7 +266,7 @@ memcached_return memcached_flush(memcached_st *ptr, time_t expiration); memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbosity); void memcached_quit(memcached_st *ptr); char *memcached_strerror(memcached_st *ptr, memcached_return rc); -memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, void *data); +memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, uint64_t data); uint64_t memcached_behavior_get(memcached_st *ptr, memcached_behavior flag); /* All of the functions for adding data to the server */ diff --git a/libmemcached/memcached_behavior.c b/libmemcached/memcached_behavior.c index ce598fc0..9269439b 100644 --- a/libmemcached/memcached_behavior.c +++ b/libmemcached/memcached_behavior.c @@ -9,24 +9,17 @@ We quit all connections so we can reset the sockets. */ -void set_behavior_flag(memcached_st *ptr, memcached_flags temp_flag, void *data) +void set_behavior_flag(memcached_st *ptr, memcached_flags temp_flag, uint64_t data) { - uint8_t truefalse; - if (data) - truefalse= *(unsigned int *)data; - else - truefalse= 0; - - if (truefalse) ptr->flags|= temp_flag; else - ptr->flags+= temp_flag; + ptr->flags&= ~temp_flag; } memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, - void *data) + uint64_t data) { switch (flag) { @@ -45,10 +38,10 @@ memcached_return memcached_behavior_set(memcached_st *ptr, memcached_quit(ptr); break; case MEMCACHED_BEHAVIOR_DISTRIBUTION: - ptr->distribution= *(memcached_server_distribution *)(data); + ptr->distribution= (memcached_server_distribution)(data); break; case MEMCACHED_BEHAVIOR_HASH: - ptr->hash= *(memcached_hash *)(data); + ptr->hash= (memcached_hash)(data); break; case MEMCACHED_BEHAVIOR_CACHE_LOOKUPS: set_behavior_flag(ptr, MEM_USE_CACHE_LOOKUPS, data); @@ -67,38 +60,22 @@ memcached_return memcached_behavior_set(memcached_st *ptr, ptr->user_data= data; break; case MEMCACHED_BEHAVIOR_POLL_TIMEOUT: - { - int32_t timeout= (*((int32_t *)data)); - - ptr->poll_timeout= timeout; - break; - } + ptr->poll_timeout= (int32_t)data; + break; case MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT: - { - int32_t timeout= (*((int32_t *)data)); - - ptr->connect_timeout= timeout; - break; - } + ptr->connect_timeout= (int32_t)data; + break; case MEMCACHED_BEHAVIOR_RETRY_TIMEOUT: - { - ptr->retry_timeout= (int32_t)data; - break; - } + ptr->retry_timeout= (int32_t)data; + break; case MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE: - { - ptr->send_size= (*((int *)data)); - memcached_quit(ptr); - break; - } + ptr->send_size= (int32_t)data; + memcached_quit(ptr); + break; case MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE: - { - ptr->recv_size= (*((int *)data)); - memcached_quit(ptr); - break; - } - - + ptr->recv_size= (int32_t)data; + memcached_quit(ptr); + break; } return MEMCACHED_SUCCESS; diff --git a/tests/Makefile.am b/tests/Makefile.am index 664ce008..f739b4b0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = +INCLUDES = -I$(top_builddir) LDADDS = $(top_builddir)/libmemcached/libmemcached.la EXTRA_DIST = output.res output2.res\ diff --git a/tests/atomsmasher.c b/tests/atomsmasher.c index a039fc4d..6ff68ca9 100644 --- a/tests/atomsmasher.c +++ b/tests/atomsmasher.c @@ -113,23 +113,21 @@ infinite: memcached_return pre_nonblock(memcached_st *memc) { - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); return MEMCACHED_SUCCESS; } memcached_return pre_md5(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_MD5; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MD5); return MEMCACHED_SUCCESS; } memcached_return pre_hsieh(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_HSIEH; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_HSIEH); return MEMCACHED_SUCCESS; } @@ -138,7 +136,7 @@ memcached_return enable_consistent(memcached_st *memc) { memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT; memcached_hash hash; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value); pre_hsieh(memc); value= (memcached_server_distribution)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION); diff --git a/tests/function.c b/tests/function.c index f36110ea..76138d1b 100644 --- a/tests/function.c +++ b/tests/function.c @@ -2,7 +2,6 @@ Sample test application. */ #include -#include #include #include #include @@ -63,12 +62,10 @@ uint8_t server_list_null_test(memcached_st *ptr) uint8_t server_sort_test(memcached_st *ptr) { - unsigned int setting; memcached_server_st *server_list; memcached_return rc; - setting= 1; - memcached_behavior_set(ptr, MEMCACHED_BEHAVIOR_SORT_HOSTS, &setting); + memcached_behavior_set(ptr, MEMCACHED_BEHAVIOR_SORT_HOSTS, 1); server_list= memcached_server_list_append(NULL, "arg", 0, &rc); assert(server_list); @@ -269,7 +266,7 @@ uint8_t cas2_test(memcached_st *memc) rc= memcached_flush(memc, 0); assert(rc == MEMCACHED_SUCCESS); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, set); for (x= 0; x < 3; x++) { @@ -312,7 +309,7 @@ uint8_t cas_test(memcached_st *memc) rc= memcached_flush(memc, 0); assert(rc == MEMCACHED_SUCCESS); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, set); rc= memcached_set(memc, key, strlen(key), value, strlen(value), @@ -505,7 +502,7 @@ uint8_t bad_key_test(memcached_st *memc) clone= memcached_clone(NULL, memc); assert(clone); - (void)memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, &set); + (void)memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set); string= memcached_get(clone, key, strlen(key), &string_length, &flags, &rc); @@ -514,7 +511,7 @@ uint8_t bad_key_test(memcached_st *memc) assert(!string); set= 0; - (void)memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, &set); + (void)memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set); string= memcached_get(clone, key, strlen(key), &string_length, &flags, &rc); assert(rc == MEMCACHED_NOTFOUND); @@ -1124,36 +1121,36 @@ uint8_t behavior_test(memcached_st *memc) unsigned long long value; unsigned int set= 1; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK); assert(value == 1); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY); assert(value == 1); set= MEMCACHED_HASH_MD5; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH); assert(value == MEMCACHED_HASH_MD5); set= 0; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK); assert(value == 0); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY); assert(value == 0); set= MEMCACHED_HASH_DEFAULT; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH); assert(value == MEMCACHED_HASH_DEFAULT); set= MEMCACHED_HASH_CRC; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, set); value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH); assert(value == MEMCACHED_HASH_CRC); @@ -1183,8 +1180,8 @@ uint8_t user_supplied_bug1(memcached_st *memc) /* We just keep looking at the same values over and over */ srandom(10); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &setter); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter); /* add key */ @@ -1222,13 +1219,13 @@ uint8_t user_supplied_bug2(memcached_st *memc) unsigned long long total; setter= 1; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &setter); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter); #ifdef NOT_YET setter = 20 * 1024576; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, setter); setter = 20 * 1024576; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, setter); getter = memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE); getter = memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE); @@ -1279,13 +1276,13 @@ uint8_t user_supplied_bug3(memcached_st *memc) size_t key_lengths[KEY_COUNT]; setter= 1; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &setter); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter); #ifdef NOT_YET setter = 20 * 1024576; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, setter); setter = 20 * 1024576; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, setter); getter = memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE); getter = memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE); #endif @@ -1648,10 +1645,10 @@ uint8_t user_supplied_bug10(memcached_st *memc) memcached_st *mclone= memcached_clone(NULL, memc); int32_t timeout; - memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, &set); - memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, &set); + memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, set); + memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, set); timeout= 2; - memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout); + memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout); value = (char*)malloc(value_length * sizeof(char)); @@ -1689,10 +1686,10 @@ uint8_t user_supplied_bug11(memcached_st *memc) int32_t timeout; memcached_st *mclone= memcached_clone(NULL, memc); - memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, &set); - memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, &set); + memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, set); + memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, set); timeout= -1; - memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout); + memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout); timeout= (int32_t)memcached_behavior_get(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT); @@ -1797,7 +1794,7 @@ uint8_t user_supplied_bug13(memcached_st *memc) uint8_t user_supplied_bug14(memcached_st *memc) { int setter= 1; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &setter); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter); memcached_return rc; char *key= "foo"; char *value; @@ -2043,7 +2040,7 @@ uint8_t generate_buffer_data(memcached_st *memc) int latch= 0; latch= 1; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, &latch); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, latch); generate_data(memc); return 0; @@ -2160,7 +2157,7 @@ uint8_t delete_buffer_generate(memcached_st *memc) unsigned int x; latch= 1; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, &latch); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, latch); for (x= 0; x < global_count; x++) { @@ -2211,79 +2208,70 @@ uint8_t add_host_test1(memcached_st *memc) memcached_return pre_nonblock(memcached_st *memc) { - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); return MEMCACHED_SUCCESS; } memcached_return pre_murmur(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_MURMUR; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MURMUR); return MEMCACHED_SUCCESS; } memcached_return pre_md5(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_MD5; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MD5); return MEMCACHED_SUCCESS; } memcached_return pre_crc(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_CRC; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_CRC); return MEMCACHED_SUCCESS; } memcached_return pre_hsieh(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_HSIEH; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_HSIEH); return MEMCACHED_SUCCESS; } memcached_return pre_hash_fnv1_64(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_FNV1_64; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_FNV1_64); return MEMCACHED_SUCCESS; } memcached_return pre_hash_fnv1a_64(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_FNV1A_64; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_FNV1A_64); return MEMCACHED_SUCCESS; } memcached_return pre_hash_fnv1_32(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_FNV1_32; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_FNV1_32); return MEMCACHED_SUCCESS; } memcached_return pre_hash_fnv1a_32(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_FNV1A_32; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_FNV1A_32); return MEMCACHED_SUCCESS; } memcached_return pre_hash_ketama(memcached_st *memc) { - memcached_hash value= MEMCACHED_HASH_KETAMA; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_KETAMA); return MEMCACHED_SUCCESS; } @@ -2345,7 +2333,7 @@ memcached_return enable_consistent(memcached_st *memc) { memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT; memcached_hash hash; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, &value); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value); pre_hsieh(memc); value= (memcached_server_distribution)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION); @@ -2368,7 +2356,7 @@ memcached_return enable_cas(memcached_st *memc) memc->hosts[0].minor_version >= 2 && memc->hosts[0].micro_version >= 4) { - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, set); return MEMCACHED_SUCCESS; } @@ -2423,8 +2411,8 @@ memcached_return pre_udp(memcached_st *memc) memcached_return pre_nodelay(memcached_st *memc) { - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL); - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, NULL); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, 0); return MEMCACHED_SUCCESS; } @@ -2435,7 +2423,7 @@ memcached_return poll_timeout(memcached_st *memc) timeout= 100; - memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout); + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout); timeout= (int32_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT); diff --git a/tests/server.h b/tests/server.h index d287f11e..26452f54 100644 --- a/tests/server.h +++ b/tests/server.h @@ -5,7 +5,7 @@ extern "C" { #endif -#include +#include typedef struct server_startup_st server_startup_st;