Fix for OSX.
authorBrian Aker <brian@tangent.org>
Thu, 28 Apr 2011 23:05:58 +0000 (16:05 -0700)
committerBrian Aker <brian@tangent.org>
Thu, 28 Apr 2011 23:05:58 +0000 (16:05 -0700)
clients/include.am
libmemcached/dump.cc
libmemcached/quit.cc
libmemcached/response.cc
libmemcached/stats.cc
tests/basic.cc
tests/include.am
tests/virtual_buckets.cc

index 05b1ed7e32e1574238a92888a8400286a32f8069..a744cf789b39b852b2928632b9dc4ceac01fb798 100644 (file)
@@ -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 \
index 18c159748bdd1e70d24e5fd78f6fd4ac285cdc3f..d5aa292ae62104542e3abb1406581289b321d8e2 100644 (file)
@@ -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++)
index 2efe909b0feff46e2310d15051c9e68697e37734..cd5d9ecd9e7275dcb20a235de8936a22e2c382f8 100644 (file)
@@ -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) {} ;
       }
 
 
index 572aef58bfc8864d7dce676857195696de7482ab..4035a5b952670f4c3829f919b9e13f2f209a5b56 100644 (file)
@@ -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);
   }
 
index 08934ba67960f697f8f03b000fa87e31ced5cc45..3c269be142ef7fa6f59f3621f65d73a3ec1c93bb 100644 (file)
@@ -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:
index fea343d5ba48483d4a07582045e5d1e359503b7f..85e96591ec93f9a8ac895f9dffd0f5106e68ba5f 100644 (file)
@@ -40,6 +40,8 @@
 #include <libtest/test.h>
 #include "tests/basic.h"
 
+#include <cstring>
+
 test_return_t basic_init_test(memcached_st *junk)
 {
   (void)junk;
index 44954b110ffe35d200c7b2dd9b0699dc1b2f72e7..727e76a265428df2f8ddacce3e1cfc12102ff1b6 100644 (file)
@@ -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)
 
index 73db3001caf2ec41ed9cf629887a073dc3438e66..308fa1d809502b23d836fb67c933445a7ba83553 100644 (file)
@@ -41,6 +41,8 @@
 
 #include <libmemcached/memcached.h>
 
+#include <cstring>
+
 struct libtest_string_t {
   const char *c_str;
   size_t size;