C++: double underscores are reserved
[awesomized/libmemcached] / src / libmemcached / hosts.cc
index 0ce66130829bea0b63c83c9e2b6399cd468dbe5c..ad01decd70faa1c4e494714db853cfb8011aac0d 100644 (file)
 
 #include "libmemcached/common.h"
 #include "libmemcached/assert.hpp"
+#include "p9y/gettimeofday.hpp"
+#include "p9y/random.hpp"
 
 #include <cmath>
-#include <sys/time.h>
 
 /* Protoypes (static) */
 static memcached_return_t update_continuum(Memcached *ptr);
@@ -310,7 +311,7 @@ static memcached_return_t server_add(Memcached *memc, const memcached_string_t &
   memcached_instance_st *instance =
       memcached_instance_fetch(memc, memcached_server_count(memc) - 1);
 
-  if (__instance_create_with(memc, instance, hostname, port, weight, type) == NULL) {
+  if (instance_create_with(memc, instance, hostname, port, weight, type) == NULL) {
     return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
   }
 
@@ -345,15 +346,14 @@ memcached_return_t memcached_server_push(memcached_st *shell, const memcached_se
 
     ptr->state.is_parsing = true;
     for (uint32_t x = 0; x < count; ++x, ++original_host_size) {
-      WATCHPOINT_ASSERT(list[x].hostname[0] != 0);
+      WATCHPOINT_ASSERT(list[x].hostname[0]);
 
       // We have extended the array, and now we will find it, and use it.
       memcached_instance_st *instance = memcached_instance_fetch(ptr, original_host_size);
       WATCHPOINT_ASSERT(instance);
 
       memcached_string_t hostname = {memcached_string_make_from_cstr(list[x].hostname)};
-      if (__instance_create_with(ptr, instance, hostname, list[x].port, list[x].weight,
-                                 list[x].type)
+      if (instance_create_with(ptr, instance, hostname, list[x].port, list[x].weight, list[x].type)
           == NULL)
       {
         ptr->state.is_parsing = false;
@@ -396,15 +396,14 @@ memcached_return_t memcached_instance_push(memcached_st *ptr,
   // We use original_host_size since size will now point to the first new
   // instance allocated.
   for (uint32_t x = 0; x < number_of_hosts; ++x, ++original_host_size) {
-    WATCHPOINT_ASSERT(list[x]._hostname[0] != 0);
+    WATCHPOINT_ASSERT(list[x]._hostname[0]);
 
     // We have extended the array, and now we will find it, and use it.
     memcached_instance_st *instance = memcached_instance_fetch(ptr, original_host_size);
     WATCHPOINT_ASSERT(instance);
 
     memcached_string_t hostname = {memcached_string_make_from_cstr(list[x]._hostname)};
-    if (__instance_create_with(ptr, instance, hostname, list[x].port(), list[x].weight,
-                               list[x].type)
+    if (instance_create_with(ptr, instance, hostname, list[x].port(), list[x].weight, list[x].type)
         == NULL)
     {
       ptr->state.is_parsing = false;