From 7fe53e85cc43c3fed83b482e83dc12de3fe696d6 Mon Sep 17 00:00:00 2001 From: "Vanilla I. Shu" Date: Fri, 5 Aug 2011 01:34:25 +0000 Subject: [PATCH] Fix build on 8.2/i386. Submitted by: paulbeard at gmail.com, dougb@ --- .../files/patch-tests__mem_functions.cc | 38 ++++++++++++++++ .../files/patch-tests__namespace.cc | 43 +++++++++++++++++++ .../libmemcached/files/patch-tests__plus.cpp | 19 ++++++++ .../files/patch-tests__replication.cc | 15 +++++++ 4 files changed, 115 insertions(+) create mode 100644 databases/libmemcached/files/patch-tests__mem_functions.cc create mode 100644 databases/libmemcached/files/patch-tests__namespace.cc create mode 100644 databases/libmemcached/files/patch-tests__plus.cpp create mode 100644 databases/libmemcached/files/patch-tests__replication.cc diff --git a/databases/libmemcached/files/patch-tests__mem_functions.cc b/databases/libmemcached/files/patch-tests__mem_functions.cc new file mode 100644 index 000000000000..6b49f4c84e25 --- /dev/null +++ b/databases/libmemcached/files/patch-tests__mem_functions.cc @@ -0,0 +1,38 @@ +--- tests/mem_functions.cc.orig 2011-08-05 09:20:08.000000000 +0800 ++++ tests/mem_functions.cc 2011-08-05 09:29:52.000000000 +0800 +@@ -3629,7 +3629,7 @@ static test_return_t pre_nonblock_binary + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); + test_compare(MEMCACHED_SUCCESS, + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1)); +- test_compare(1UL, memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)); ++ test_compare(1UL, (unsigned long)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)); + } + else + { +@@ -4401,7 +4401,7 @@ static test_return_t connection_pool_tes + uint64_t number_value; + test_compare(MEMCACHED_SUCCESS, + memcached_increment(mmc[x], key, keylen, 1, &number_value)); +- test_compare(number_value, (x+1)); ++ test_compare(number_value, (uint64_t)(x+1)); + } + + // Release them.. +@@ -4951,7 +4951,7 @@ static test_return_t ketama_compatibilit + test_compare(MEMCACHED_SUCCESS, + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED, 1)); + +- test_compare(1UL, memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED)); ++ test_compare(1UL, (unsigned long)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED)); + + test_compare(MEMCACHED_SUCCESS, memcached_behavior_set_distribution(memc, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA)); + test_compare(MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA, memcached_behavior_get_distribution(memc)); +@@ -5882,7 +5882,7 @@ static test_return_t regression_bug_6554 + + test_compare(MEMCACHED_SUCCESS, rc); + test_true(value); +- test_compare(100UL, value_length); ++ test_compare(100UL, (unsigned long)value_length); + free(value); + } + diff --git a/databases/libmemcached/files/patch-tests__namespace.cc b/databases/libmemcached/files/patch-tests__namespace.cc new file mode 100644 index 000000000000..fc6eb9e32694 --- /dev/null +++ b/databases/libmemcached/files/patch-tests__namespace.cc @@ -0,0 +1,43 @@ +--- tests/namespace.cc.orig 2011-08-05 09:20:13.000000000 +0800 ++++ tests/namespace.cc 2011-08-05 09:21:03.000000000 +0800 +@@ -58,13 +58,13 @@ test_return_t memcached_increment_namesp + memcached_increment(memc, + test_literal_param("number"), + 1, &new_number)); +- test_compare(1UL, new_number); ++ test_compare(1UL, (unsigned long)new_number); + + test_compare(MEMCACHED_SUCCESS, + memcached_increment(memc, + test_literal_param("number"), + 1, &new_number)); +- test_compare(2UL, new_number); ++ test_compare(2UL, (unsigned long)new_number); + + memcached_st *clone= memcached_clone(NULL, memc); + +@@ -86,7 +86,7 @@ test_return_t memcached_increment_namesp + test_literal_param("number"), + 0, 0, 0); + test_true(value); +- test_compare(2UL, strlen(value)); ++ test_compare(2UL, (unsigned long)strlen(value)); + test_strcmp("10", value); + free(value); + +@@ -94,13 +94,13 @@ test_return_t memcached_increment_namesp + memcached_increment(clone, + test_literal_param("number"), + 1, &new_number)); +- test_compare(11UL, new_number); ++ test_compare(11UL, (unsigned long)new_number); + + test_compare(MEMCACHED_SUCCESS, + memcached_increment(memc, + test_literal_param("number"), + 1, &new_number)); +- test_compare(3UL, new_number); ++ test_compare(3UL, (unsigned long)new_number); + + memcached_free(clone); + diff --git a/databases/libmemcached/files/patch-tests__plus.cpp b/databases/libmemcached/files/patch-tests__plus.cpp new file mode 100644 index 000000000000..482d6f166c65 --- /dev/null +++ b/databases/libmemcached/files/patch-tests__plus.cpp @@ -0,0 +1,19 @@ +--- tests/plus.cpp.orig 2011-08-05 09:23:49.000000000 +0800 ++++ tests/plus.cpp 2011-08-05 09:25:22.000000000 +0800 +@@ -128,13 +128,13 @@ test_return_t increment_test(memcached_s + test_compare(int_inc_value, int_ret_value); + + test_true(mcach.increment(key, 1, &int_ret_value)); +- test_compare(2UL, int_ret_value); ++ test_compare(2UL, (unsigned long)int_ret_value); + + test_true(mcach.increment(key, 1, &int_ret_value)); +- test_compare(3UL, int_ret_value); ++ test_compare(3UL, (unsigned long)int_ret_value); + + test_true(mcach.increment(key, 5, &int_ret_value)); +- test_compare(8UL, int_ret_value); ++ test_compare(8UL, (unsigned long)int_ret_value); + + return TEST_SUCCESS; + } diff --git a/databases/libmemcached/files/patch-tests__replication.cc b/databases/libmemcached/files/patch-tests__replication.cc new file mode 100644 index 000000000000..1017fede639e --- /dev/null +++ b/databases/libmemcached/files/patch-tests__replication.cc @@ -0,0 +1,15 @@ +--- tests/replication.cc.orig 2011-08-05 09:22:41.000000000 +0800 ++++ tests/replication.cc 2011-08-05 09:23:16.000000000 +0800 +@@ -249,10 +249,10 @@ test_return_t replication_delete_test(me + + // Make one copy + test_compare(MEMCACHED_SUCCESS, memcached_behavior_set(memc_replicated, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 1UL)); +- test_compare(1UL, memcached_behavior_get(memc_replicated, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS)); ++ test_compare(1UL, (unsigned long)memcached_behavior_get(memc_replicated, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS)); + + test_compare(MEMCACHED_SUCCESS, memcached_behavior_set(memc_not_replicate, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 0UL)); +- test_compare(0UL, memcached_behavior_get(memc_not_replicate, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS)); ++ test_compare(0UL, (unsigned long)memcached_behavior_get(memc_not_replicate, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS)); + + for (size_t x= 0; x < test_array_length(keys); ++x) + {