Permalink
Browse files

Merge in trond.

  • Loading branch information...
2 parents 33e26a3 + 61a4bb0 commit ea7ce3a75159b4fd8bae38c1e1d3e9dd56c2e867 @BrianAker BrianAker committed Feb 22, 2011
View
@@ -43,10 +43,11 @@ static char *opt_username;
static char *opt_passwd;
/* Print the keys and counter how many were found */
-static memcached_return_t key_printer(const memcached_st *ptr __attribute__((unused)),
+static memcached_return_t key_printer(const memcached_st *ptr,
const char *key, size_t key_length,
- void *context __attribute__((unused)))
+ void *context)
{
+ (void)ptr;(void)context;
printf("%.*s\n", (uint32_t)key_length, key);
return MEMCACHED_SUCCESS;
View
@@ -71,9 +71,10 @@ static const char *lookup_help(memcached_options option)
void help_command(const char *command_name, const char *description,
const struct option *long_options,
- memcached_programs_help_st *options __attribute__((unused)))
+ memcached_programs_help_st *options)
{
unsigned int x;
+ (void)options;
printf("%s v%u.%u\n\n", command_name, 1U, 0U);
printf("\t%s\n\n", description);
View
@@ -79,7 +79,6 @@ AH_BOTTOM([
#define closesocket(a) close(a)
#define get_socket_errno() errno
#endif
-
#endif
])
@@ -287,8 +287,8 @@ static const char* comcode2str(uint8_t cmd)
/**
* Print out the command we are about to execute
*/
-static void pre_execute(const void *cookie __attribute__((unused)),
- protocol_binary_request_header *header __attribute__((unused)))
+static void pre_execute(const void *cookie,
+ protocol_binary_request_header *header)
{
if (verbose)
{
@@ -303,8 +303,8 @@ static void pre_execute(const void *cookie __attribute__((unused)),
/**
* Print out the command we just executed
*/
-static void post_execute(const void *cookie __attribute__((unused)),
- protocol_binary_request_header *header __attribute__((unused)))
+static void post_execute(const void *cookie,
+ protocol_binary_request_header *header)
{
if (verbose)
{
View
@@ -165,7 +165,8 @@ void update_cas(struct item* item)
item->cas= ++cas;
}
-void release_item(struct item* item __attribute__((unused)))
+void release_item(struct item* item)
{
+ (void)item;
/* EMPTY */
}
View
@@ -73,10 +73,11 @@ static const uint32_t crc32tab[256] = {
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
};
-uint32_t hashkit_crc32(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_crc32(const char *key, size_t key_length, void *context)
{
uint64_t x;
uint32_t crc= UINT32_MAX;
+ (void)context;
for (x= 0; x < key_length; x++)
crc= (crc >> 8) ^ crc32tab[(crc ^ (uint64_t)key[x]) & 0xff];
View
@@ -14,10 +14,11 @@ static uint64_t FNV_64_PRIME= UINT64_C(0x100000001b3);
static uint32_t FNV_32_INIT= 2166136261UL;
static uint32_t FNV_32_PRIME= 16777619;
-uint32_t hashkit_fnv1_64(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_fnv1_64(const char *key, size_t key_length, void *context)
{
/* Thanks to pierre@demartines.com for the pointer */
uint64_t hash= FNV_64_INIT;
+ (void)context;
for (size_t x= 0; x < key_length; x++)
{
@@ -28,9 +29,10 @@ uint32_t hashkit_fnv1_64(const char *key, size_t key_length, void *context __att
return (uint32_t)hash;
}
-uint32_t hashkit_fnv1a_64(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_fnv1a_64(const char *key, size_t key_length, void *context)
{
uint32_t hash= (uint32_t) FNV_64_INIT;
+ (void)context;
for (size_t x= 0; x < key_length; x++)
{
@@ -42,9 +44,10 @@ uint32_t hashkit_fnv1a_64(const char *key, size_t key_length, void *context __at
return hash;
}
-uint32_t hashkit_fnv1_32(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_fnv1_32(const char *key, size_t key_length, void *context)
{
uint32_t hash= FNV_32_INIT;
+ (void)context;
for (size_t x= 0; x < key_length; x++)
{
@@ -56,9 +59,10 @@ uint32_t hashkit_fnv1_32(const char *key, size_t key_length, void *context __att
return hash;
}
-uint32_t hashkit_fnv1a_32(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_fnv1a_32(const char *key, size_t key_length, void *context)
{
uint32_t hash= FNV_32_INIT;
+ (void)context;
for (size_t x= 0; x < key_length; x++)
{
View
@@ -56,10 +56,11 @@ use a bitmask. For example, if you need only 10 bits, do
In which case, the hash table should have hashsize(10) elements.
*/
-uint32_t hashkit_jenkins(const char *key, size_t length, void *context __attribute__((unused)))
+uint32_t hashkit_jenkins(const char *key, size_t length, void *context)
{
uint32_t a,b,c; /* internal state */
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
+ (void)context;
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + JENKINS_INITVAL;
@@ -82,7 +83,7 @@ uint32_t hashkit_jenkins(const char *key, size_t length, void *context __attribu
}
/*----------------------------- handle the last (probably partial) block */
- /*
+ /*
* "k[2]&0xffffff" actually reads beyond the end of the string, but
* then masks off the part it's not allowed to read. Because the
* string is aligned, the masked-off tail is in the same word as the
@@ -109,7 +110,7 @@ uint32_t hashkit_jenkins(const char *key, size_t length, void *context __attribu
default: return c;
}
- }
+ }
else if ((u.i & 0x1) == 0)
{
const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */
@@ -159,7 +160,7 @@ uint32_t hashkit_jenkins(const char *key, size_t length, void *context __attribu
default: return c;
}
- }
+ }
else
{ /* need to read the key one byte at a time */
#endif /* little endian */
View
@@ -1,5 +1,5 @@
/*
- This Library has been modified from its original form by
+ This Library has been modified from its original form by
Brian Aker (brian@tangent.org)
See below for original Copyright.
@@ -125,7 +125,7 @@ Rotation is separate from addition to prevent recomputation.
}
-/*
+/*
Just a simple method for getting the signature
result must be == 16
*/
@@ -352,9 +352,10 @@ unsigned int len)
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
-uint32_t hashkit_md5(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_md5(const char *key, size_t key_length, void *context)
{
unsigned char results[16];
+ (void)context;
md5_signature((unsigned char*)key, (unsigned int)key_length, results);
View
@@ -1,4 +1,4 @@
-/*
+/*
"Murmur" hash provided by Austin, tanjent@gmail.com
http://murmurhash.googlepages.com/
@@ -17,9 +17,9 @@
#include "common.h"
-uint32_t hashkit_murmur(const char *key, size_t length, void *context __attribute__((unused)))
+uint32_t hashkit_murmur(const char *key, size_t length, void *context)
{
- /*
+ /*
'm' and 'r' are mixing constants generated offline. They're not
really 'magic', they just happen to work well.
*/
@@ -36,16 +36,17 @@ uint32_t hashkit_murmur(const char *key, size_t length, void *context __attribut
// Mix 4 bytes at a time into the hash
const unsigned char * data= (const unsigned char *)key;
+ (void)context;
while(length >= 4)
{
unsigned int k = *(unsigned int *)data;
- k *= m;
- k ^= k >> r;
- k *= m;
+ k *= m;
+ k ^= k >> r;
+ k *= m;
- h *= m;
+ h *= m;
h ^= k;
data += 4;
@@ -63,9 +64,9 @@ uint32_t hashkit_murmur(const char *key, size_t length, void *context __attribut
default: break;
};
- /*
+ /*
Do a few final mixes of the hash to ensure the last few bytes are
- well-incorporated.
+ well-incorporated.
*/
h ^= h >> 13;
@@ -13,10 +13,11 @@
#include "common.h"
-uint32_t hashkit_one_at_a_time(const char *key, size_t key_length, void *context __attribute__((unused)))
+uint32_t hashkit_one_at_a_time(const char *key, size_t key_length, void *context)
{
const char *ptr= key;
uint32_t value= 0;
+ (void)context;
while (key_length--)
{
View
@@ -8,8 +8,9 @@
#include "common.h"
-const char *hashkit_strerror(hashkit_st *ptr __attribute__((unused)), hashkit_return_t rc)
+const char *hashkit_strerror(hashkit_st *ptr, hashkit_return_t rc)
{
+ (void)ptr;
switch (rc)
{
case HASHKIT_SUCCESS:
View
@@ -162,7 +162,8 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, char *key, char
strcmp("reclaimed", key) == 0))
{
WATCHPOINT_STRING(key);
- return MEMCACHED_UNKNOWN_STAT_KEY;
+ /* return MEMCACHED_UNKNOWN_STAT_KEY; */
+ return MEMCACHED_SUCCESS;
}
return MEMCACHED_SUCCESS;
View
@@ -310,8 +310,8 @@ memcached_return_t memcached_cas(memcached_st *ptr,
}
memcached_return_t memcached_set_by_key(memcached_st *ptr,
- const char *master_key __attribute__((unused)),
- size_t master_key_length __attribute__((unused)),
+ const char *master_key,
+ size_t master_key_length,
const char *key, size_t key_length,
const char *value, size_t value_length,
time_t expiration,
View
@@ -1,7 +1,8 @@
#include "common.h"
-const char *memcached_strerror(memcached_st *ptr __attribute__((unused)), memcached_return_t rc)
+const char *memcached_strerror(memcached_st *ptr, memcached_return_t rc)
{
+ (void)ptr;
switch (rc)
{
case MEMCACHED_SUCCESS:
@@ -22,12 +22,13 @@ struct local_context
bool truth;
};
-static memcached_return_t check_server_version(const memcached_st *ptr __attribute__((unused)),
+static memcached_return_t check_server_version(const memcached_st *ptr,
const memcached_server_st *instance,
void *context)
{
/* Do Nothing */
struct local_context *check= (struct local_context *)context;
+ (void)ptr;
if (instance->major_version != UINT8_MAX &&
instance->major_version >= check->major_version &&
@@ -42,7 +43,7 @@ static memcached_return_t check_server_version(const memcached_st *ptr __attribu
return MEMCACHED_FAILURE;
}
-bool libmemcached_util_version_check(memcached_st *memc,
+bool libmemcached_util_version_check(memcached_st *memc,
uint8_t major_version,
uint8_t minor_version,
uint8_t micro_version)
View
@@ -1,12 +1,12 @@
#include "common.h"
-struct context_st
+struct context_st
{
size_t length;
const char *buffer;
};
-static memcached_return_t _set_verbosity(const memcached_st *ptr __attribute__((unused)),
+static memcached_return_t _set_verbosity(const memcached_st *ptr,
const memcached_server_st *server,
void *context)
{
@@ -16,6 +16,7 @@ static memcached_return_t _set_verbosity(const memcached_st *ptr __attribute__((
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
struct context_st *execute= (struct context_st *)context;
+ (void)ptr;
memc_ptr= memcached_create(&local_memc);
@@ -46,7 +47,7 @@ memcached_return_t memcached_verbosity(memcached_st *ptr, uint32_t verbosity)
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
- send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
+ send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
"verbosity %u\r\n", verbosity);
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || send_length < 0)
return MEMCACHED_WRITE_FAILURE;
View
@@ -20,9 +20,9 @@ AC_DEFUN([PANDORA_64BIT],[
[isainfo_b=`${ISAINFO} -b`],
[isainfo_b="x"])
- AS_IF([test "$isainfo_b" != "x"],[
+ AS_IF([test "$isainfo_b" != "x" -a "$isainfo_b" != "32"],[
- isainfo_k=`${ISAINFO} -k`
+ isainfo_k=`${ISAINFO} -k`
DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
AS_IF([test "x$ac_enable_64bit" = "xyes"],[
@@ -32,7 +32,7 @@ AC_DEFUN([PANDORA_64BIT],[
])
AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
- dnl The user hasn't overridden the default libdir, so we'll
+ dnl The user hasn't overridden the default libdir, so we'll
dnl the dir suffix to match solaris 32/64-bit policy
libdir="${libdir}/${isainfo_k}"
])
Oops, something went wrong.

0 comments on commit ea7ce3a

Please sign in to comment.