From 24a2ae8e311f1598bd06f3ae60999d80ae770d03 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Sun, 11 Nov 2007 23:07:28 -0800 Subject: [PATCH] Fixing increment and decrement to take a 64bit unsigned value. --- ChangeLog | 1 + configure.ac | 2 +- docs/memcached_auto.pod | 4 ++-- include/memcached.h | 4 ++-- lib/memcached_auto.c | 8 ++++---- tests/function.c | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a54023a..2b273ae5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * fix for when no servers are definied. * different buffers are now kept for different connections to speed up async efforts + * Modified increment/decrement functions to return uint64_t values 0.8 Mon Nov 5 10:40:41 PST 2007 * Adding support for CRC hash method diff --git a/configure.ac b/configure.ac index 2dd4a229..58fac5ba 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ MEMCACHED_API_VERSION=1.0 AC_SUBST(MEMCACHED_API_VERSION) #shared library versioning -MEMCACHED_LIBRARY_VERSION=1:0:0 +MEMCACHED_LIBRARY_VERSION=1:1:0 # | | | # +------+ | +---+ # | | | diff --git a/docs/memcached_auto.pod b/docs/memcached_auto.pod index ebf63caa..27332e93 100755 --- a/docs/memcached_auto.pod +++ b/docs/memcached_auto.pod @@ -14,13 +14,13 @@ C Client Library for memcached (libmemcached, -lmemcached) memcached_increment (memcached_st *ptr, char *key, size_t key_length, unsigned int offset, - unsigned int *value); + uint64_t *value); memcached_return memcached_decrement (memcached_st *ptr, char *key, size_t key_length, unsigned int offset, - unsigned int *value); + uint64_t *value); =head1 DESCRIPTION diff --git a/include/memcached.h b/include/memcached.h index a684a1ec..6bf1e0be 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -182,11 +182,11 @@ memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_lengt memcached_return memcached_increment(memcached_st *ptr, char *key, size_t key_length, unsigned int offset, - unsigned int *value); + uint64_t *value); memcached_return memcached_decrement(memcached_st *ptr, char *key, size_t key_length, unsigned int offset, - unsigned int *value); + uint64_t *value); void memcached_stat_free(memcached_st *, memcached_stat_st *); memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return *error); memcached_return memcached_stat_servername(memcached_stat_st *stat, char *args, diff --git a/lib/memcached_auto.c b/lib/memcached_auto.c index 25f9aaf9..ad91f75b 100644 --- a/lib/memcached_auto.c +++ b/lib/memcached_auto.c @@ -4,7 +4,7 @@ static memcached_return memcached_auto(memcached_st *ptr, char *verb, char *key, size_t key_length, unsigned int offset, - unsigned int *value) + uint64_t *value) { size_t send_length, sent_length; memcached_return rc; @@ -53,7 +53,7 @@ static memcached_return memcached_auto(memcached_st *ptr, } else { - *value= strtol(buffer, (char **)NULL, 10); + *value= (uint64_t)strtoll(buffer, (char **)NULL, 10); rc= MEMCACHED_SUCCESS; } @@ -63,7 +63,7 @@ static memcached_return memcached_auto(memcached_st *ptr, memcached_return memcached_increment(memcached_st *ptr, char *key, size_t key_length, unsigned int offset, - unsigned int *value) + uint64_t *value) { memcached_return rc; @@ -77,7 +77,7 @@ memcached_return memcached_increment(memcached_st *ptr, memcached_return memcached_decrement(memcached_st *ptr, char *key, size_t key_length, unsigned int offset, - unsigned int *value) + uint64_t *value) { memcached_return rc; diff --git a/tests/function.c b/tests/function.c index 6bac2d53..37f2c490 100644 --- a/tests/function.c +++ b/tests/function.c @@ -354,7 +354,7 @@ uint8_t stats_servername_test(memcached_st *memc) uint8_t increment_test(memcached_st *memc) { - unsigned int new_number; + uint64_t new_number; memcached_return rc; char *key= "number"; char *value= "0"; @@ -379,7 +379,7 @@ uint8_t increment_test(memcached_st *memc) uint8_t decrement_test(memcached_st *memc) { - unsigned int new_number; + uint64_t new_number; memcached_return rc; char *key= "number"; char *value= "3"; -- 2.30.2