Skip to content

Commit

Permalink
Remove compile warnings
Browse files Browse the repository at this point in the history
Change-Id: I753e512e7669620cbaa33674df8c1fb3d6879efd
Reviewed-on: http://review.couchbase.org/19291
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Matt Ingenthron <matt@couchbase.com>
  • Loading branch information
trondn authored and ingenthr committed Aug 8, 2012
1 parent 26bc5f6 commit b9b0c33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
30 changes: 16 additions & 14 deletions libmemc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -678,20 +678,22 @@ static int binary_store(struct Server *server,
} }


protocol_binary_request_set request = { protocol_binary_request_set request = {
.message.header.request = { .message = {
.magic = PROTOCOL_BINARY_REQ, .header.request = {
.opcode = opcode, .magic = PROTOCOL_BINARY_REQ,
.keylen = htons(keylen), .opcode = opcode,
.extlen = 8, .keylen = htons(keylen),
.datatype = 0, .extlen = 8,
.vbucket = htons(get_vbucket(item->key, keylen)), .datatype = 0,
.bodylen = htonl(keylen + item->size + 8), .vbucket = htons(get_vbucket(item->key, keylen)),
.opaque = 0, .bodylen = htonl(keylen + item->size + 8),
.cas = swap64(item->cas_id) .opaque = 0,
}, .cas = swap64(item->cas_id)
.message.body = { },
.flags = 0, .body = {
.expiration = htonl(item->exptime) .flags = 0,
.expiration = htonl(item->exptime)
}
} }
}; };


Expand Down
4 changes: 3 additions & 1 deletion main.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ static void get_callback(libcouchbase_t instance,
const void *bytes, size_t nbytes, const void *bytes, size_t nbytes,
uint32_t flags, uint64_t cas) uint32_t flags, uint64_t cas)
{ {
(void)instance;
(void)key; (void)key;
(void)nkey; (void)nkey;
(void)flags; (void)flags;
Expand Down Expand Up @@ -448,7 +449,7 @@ static inline bool memcached_get_wrapper(struct connection *connection,
libcouchbase_error_t e; libcouchbase_error_t e;
struct libcouchbase_callback cb; struct libcouchbase_callback cb;
char *keys[1]; char *keys[1];
keys[0] = key; keys[0] = (void*)key;
size_t nkeys[1]; size_t nkeys[1];
nkeys[0] = nkey; nkeys[0] = nkey;


Expand Down Expand Up @@ -903,6 +904,7 @@ static int get_server_rusage(const struct host *entry, struct rusage *rusage)


static void exit_handler(int signum) static void exit_handler(int signum)
{ {
(void)signum;
long end_time = (int)time(NULL); long end_time = (int)time(NULL);
long time_taken = end_time - start_time; long time_taken = end_time - start_time;
long ops_sec = ((float)gets_count + sets_count) / time_taken; long ops_sec = ((float)gets_count + sets_count) / time_taken;
Expand Down

0 comments on commit b9b0c33

Please sign in to comment.