From: Brian Aker Date: Thu, 28 Apr 2011 23:05:58 +0000 (-0700) Subject: Fix for OSX. X-Git-Tag: 0.51~11^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=e5571ea8efc87c103d98c8633a5b26a0a1df3519;p=m6w6%2Flibmemcached Fix for OSX. --- diff --git a/clients/include.am b/clients/include.am index 05b1ed7e..a744cf78 100644 --- a/clients/include.am +++ b/clients/include.am @@ -46,9 +46,6 @@ noinst_HEADERS+= \ noinst_LTLIBRARIES+= clients/libutilities.la clients_libutilities_la_SOURCES= clients/utilities.cc -noinst_LTLIBRARIES+= clients/libgenexec.la -clients_libgenexec_la_SOURCES= clients/generator.cc clients/execute.cc - clients_memcat_SOURCES= clients/memcat.cc clients_memcat_LDADD= $(CLIENTS_LDADDS) @@ -74,7 +71,8 @@ clients_memerror_SOURCES= clients/memerror.cc clients_memerror_LDADD= $(CLIENTS_LDADDS) clients_memslap_SOURCES = clients/memslap.cc -clients_memslap_LDADD = $(PTHREAD_LIBS) clients/libgenexec.la $(CLIENTS_LDADDS) +clients_memslap_SOURCES+= clients/generator.cc clients/execute.cc +clients_memslap_LDADD = $(PTHREAD_LIBS) $(CLIENTS_LDADDS) clients_memaslap_SOURCES= \ clients/memaslap.c \ @@ -84,7 +82,8 @@ clients_memaslap_SOURCES= \ clients/ms_stats.c \ clients/ms_task.c \ clients/ms_thread.c -clients_memaslap_LDADD= $(LTLIBEVENT) clients/libgenexec.la $(CLIENTS_LDADDS) +clients_memaslap_SOURCES+= clients/generator.cc clients/execute.cc +clients_memaslap_LDADD= $(LTLIBEVENT) $(CLIENTS_LDADDS) clients_memcapable_SOURCES= \ clients/memcapable.cc \ diff --git a/libmemcached/dump.cc b/libmemcached/dump.cc index 18c15974..d5aa292a 100644 --- a/libmemcached/dump.cc +++ b/libmemcached/dump.cc @@ -51,7 +51,7 @@ static memcached_return_t ascii_dump(memcached_st *ptr, memcached_dump_fn *callb string_ptr= buffer; string_ptr+= 5; /* Move past ITEM */ - for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++); + for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {} ; key= string_ptr; key[(size_t)(end_ptr-string_ptr)]= 0; for (callback_counter= 0; callback_counter < number_of_callbacks; callback_counter++) diff --git a/libmemcached/quit.cc b/libmemcached/quit.cc index 2efe909b..cd5d9ecd 100644 --- a/libmemcached/quit.cc +++ b/libmemcached/quit.cc @@ -85,7 +85,7 @@ void memcached_quit_server(memcached_server_st *ptr, bool io_death) { ssize_t nread; while (memcached_io_read(ptr, buffer, sizeof(buffer)/sizeof(*buffer), - &nread) == MEMCACHED_SUCCESS); + &nread) == MEMCACHED_SUCCESS) {} ; } diff --git a/libmemcached/response.cc b/libmemcached/response.cc index 572aef58..4035a5b9 100644 --- a/libmemcached/response.cc +++ b/libmemcached/response.cc @@ -162,7 +162,8 @@ static memcached_return_t textual_value_fetch(memcached_server_write_instance_st string_ptr++; if (end_ptr == string_ptr) goto read_error; - for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++); + + for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++) {}; result->item_flags= (uint32_t) strtoul(next_ptr, &string_ptr, 10); if (end_ptr == string_ptr) @@ -173,7 +174,7 @@ static memcached_return_t textual_value_fetch(memcached_server_write_instance_st if (end_ptr == string_ptr) goto read_error; - for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++); + for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++) {}; value_length= (size_t)strtoull(next_ptr, &string_ptr, 10); if (end_ptr == string_ptr) @@ -188,7 +189,7 @@ static memcached_return_t textual_value_fetch(memcached_server_write_instance_st else { string_ptr++; - for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++); + for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++) {}; result->item_cas= strtoull(next_ptr, &string_ptr, 10); } diff --git a/libmemcached/stats.cc b/libmemcached/stats.cc index 08934ba6..3c269be1 100644 --- a/libmemcached/stats.cc +++ b/libmemcached/stats.cc @@ -77,7 +77,7 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, char *key, char else if (!strcmp("rusage_user", key)) { char *walk_ptr; - for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++); + for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++) {}; *walk_ptr= 0; walk_ptr++; memc_stat->rusage_user_seconds= (uint32_t) strtol(value, (char **)NULL, 10); @@ -86,7 +86,7 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, char *key, char else if (!strcmp("rusage_system", key)) { char *walk_ptr; - for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++); + for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++) {}; *walk_ptr= 0; walk_ptr++; memc_stat->rusage_system_seconds= (uint32_t) strtol(value, (char **)NULL, 10); @@ -371,12 +371,12 @@ static memcached_return_t ascii_stats_fetch(memcached_stat_st *memc_stat, string_ptr= buffer; string_ptr+= 5; /* Move past STAT */ - for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++); + for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {}; key= string_ptr; key[(size_t)(end_ptr-string_ptr)]= 0; string_ptr= end_ptr + 1; - for (end_ptr= string_ptr; !(isspace(*end_ptr)); end_ptr++); + for (end_ptr= string_ptr; !(isspace(*end_ptr)); end_ptr++) {}; value= string_ptr; value[(size_t)(end_ptr-string_ptr)]= 0; string_ptr= end_ptr + 2; @@ -398,7 +398,9 @@ static memcached_return_t ascii_stats_fetch(memcached_stat_st *memc_stat, } } else + { break; + } } error: diff --git a/tests/basic.cc b/tests/basic.cc index fea343d5..85e96591 100644 --- a/tests/basic.cc +++ b/tests/basic.cc @@ -40,6 +40,8 @@ #include #include "tests/basic.h" +#include + test_return_t basic_init_test(memcached_st *junk) { (void)junk; diff --git a/tests/include.am b/tests/include.am index 44954b11..727e76a2 100644 --- a/tests/include.am +++ b/tests/include.am @@ -64,18 +64,17 @@ tests_testapp_SOURCES= \ tests/replication.cc \ tests/string.cc \ tests/virtual_buckets.cc +tests_testapp_SOURCES+= clients/generator.cc clients/execute.cc tests_testapp_DEPENDENCIES= \ $(BUILT_SOURCES) \ $(TESTS_LDADDS) \ - clients/libgenexec.la \ libhashkit/libhashkit.la \ libmemcached/libmemcachedinternal.la tests_testapp_LDADD= \ $(LIBSASL) \ $(TESTS_LDADDS) \ - clients/libgenexec.la \ libhashkit/libhashkit.la \ libmemcached/libmemcachedinternal.la @@ -86,17 +85,14 @@ tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES) $(LIBSASL) check_PROGRAMS+= tests/testplus tests_atomsmasher_SOURCES= tests/atomsmasher.c -tests_atomsmasher_DEPENDENCIES= \ - clients/libgenexec.la \ - $(TESTS_LDADDS) +tests_atomsmasher_SOURCES+= clients/generator.cc clients/execute.cc +tests_atomsmasher_DEPENDENCIES= $(TESTS_LDADDS) tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES) $(LIBSASL) tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING) tests_testudp_SOURCES= tests/mem_udp.c -tests_testudp_DEPENDENCIES= \ - clients/libgenexec.la \ - $(TESTS_LDADDS) +tests_testudp_DEPENDENCIES= $(TESTS_LDADDS) tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES) $(LIBSASL) diff --git a/tests/virtual_buckets.cc b/tests/virtual_buckets.cc index 73db3001..308fa1d8 100644 --- a/tests/virtual_buckets.cc +++ b/tests/virtual_buckets.cc @@ -41,6 +41,8 @@ #include +#include + struct libtest_string_t { const char *c_str; size_t size;