From: Trond Norbye Date: Mon, 4 Aug 2008 07:24:49 +0000 (+0200) Subject: Fixed: warning: missing braces around initializer X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=fa9671f1d156abd1aaa9b913f62fce14fe7f96e0;p=m6w6%2Flibmemcached Fixed: warning: missing braces around initializer --- diff --git a/libmemcached/memcached_auto.c b/libmemcached/memcached_auto.c index 449d4c4e..f67b6298 100644 --- a/libmemcached/memcached_auto.c +++ b/libmemcached/memcached_auto.c @@ -79,7 +79,7 @@ static memcached_return binary_incr_decr(memcached_st *ptr, uint8_t cmd, server_key= memcached_generate_hash(ptr, key, key_length); - protocol_binary_request_incr request= {0}; + protocol_binary_request_incr request= {.bytes= {0}}; request.message.header.request.magic= PROTOCOL_BINARY_REQ; request.message.header.request.opcode= cmd; diff --git a/libmemcached/memcached_delete.c b/libmemcached/memcached_delete.c index 5ec2fca3..3e1390fa 100644 --- a/libmemcached/memcached_delete.c +++ b/libmemcached/memcached_delete.c @@ -88,7 +88,7 @@ static inline memcached_return binary_delete(memcached_st *ptr, size_t key_length, int flush) { - protocol_binary_request_delete request= {0}; + protocol_binary_request_delete request= {.bytes= {0}}; request.message.header.request.magic= PROTOCOL_BINARY_REQ; request.message.header.request.opcode= PROTOCOL_BINARY_CMD_DELETE; diff --git a/libmemcached/memcached_flush.c b/libmemcached/memcached_flush.c index f722cc90..4e048d00 100644 --- a/libmemcached/memcached_flush.c +++ b/libmemcached/memcached_flush.c @@ -51,7 +51,7 @@ static memcached_return memcached_flush_binary(memcached_st *ptr, time_t expiration) { unsigned int x; - protocol_binary_request_flush request= {0}; + protocol_binary_request_flush request= {.bytes= {0}}; unlikely (ptr->number_of_hosts == 0) return MEMCACHED_NO_SERVERS; diff --git a/libmemcached/memcached_get.c b/libmemcached/memcached_get.c index a84ef4f2..a01beee6 100644 --- a/libmemcached/memcached_get.c +++ b/libmemcached/memcached_get.c @@ -274,7 +274,7 @@ static memcached_return binary_mget_by_key(memcached_st *ptr, continue; } - protocol_binary_request_getk request= {0}; + protocol_binary_request_getk request= {.bytes= {0}}; request.message.header.request.magic= PROTOCOL_BINARY_REQ; if (number_of_keys == 1) request.message.header.request.opcode= PROTOCOL_BINARY_CMD_GETK; @@ -302,7 +302,7 @@ static memcached_return binary_mget_by_key(memcached_st *ptr, /* * Send a noop command to flush the buffers */ - protocol_binary_request_noop request= {0}; + protocol_binary_request_noop request= {.bytes= {0}}; request.message.header.request.magic= PROTOCOL_BINARY_REQ; request.message.header.request.opcode= PROTOCOL_BINARY_CMD_NOOP; request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES; diff --git a/libmemcached/memcached_quit.c b/libmemcached/memcached_quit.c index a3d114b3..c30b1ccd 100644 --- a/libmemcached/memcached_quit.c +++ b/libmemcached/memcached_quit.c @@ -21,7 +21,7 @@ void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death) if (ptr->root->flags & MEM_BINARY_PROTOCOL) { - protocol_binary_request_quit request = {0}; + protocol_binary_request_quit request = {.bytes= {0}}; request.message.header.request.magic = PROTOCOL_BINARY_REQ; request.message.header.request.opcode = PROTOCOL_BINARY_CMD_QUIT; request.message.header.request.datatype = PROTOCOL_BINARY_RAW_BYTES; diff --git a/libmemcached/memcached_stats.c b/libmemcached/memcached_stats.c index f8cfdbda..1b5576e7 100644 --- a/libmemcached/memcached_stats.c +++ b/libmemcached/memcached_stats.c @@ -219,7 +219,7 @@ static memcached_return binary_stats_fetch(memcached_st *ptr, memcached_return rc; char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE]; - protocol_binary_request_stats request= {0}; + protocol_binary_request_stats request= {.bytes= {0}}; request.message.header.request.magic= PROTOCOL_BINARY_REQ; request.message.header.request.opcode= PROTOCOL_BINARY_CMD_STAT; request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES; diff --git a/libmemcached/memcached_storage.c b/libmemcached/memcached_storage.c index 326f6fe6..d42124d7 100644 --- a/libmemcached/memcached_storage.c +++ b/libmemcached/memcached_storage.c @@ -329,7 +329,7 @@ static memcached_return memcached_send_binary(memcached_server_st* server, uint64_t cas, memcached_storage_action verb) { - protocol_binary_request_set request= {0}; + protocol_binary_request_set request= {.bytes= {0}}; size_t send_length= sizeof(request.bytes); request.message.header.request.magic= PROTOCOL_BINARY_REQ; diff --git a/libmemcached/memcached_version.c b/libmemcached/memcached_version.c index 182ff14e..0a77529c 100644 --- a/libmemcached/memcached_version.c +++ b/libmemcached/memcached_version.c @@ -63,7 +63,7 @@ static inline memcached_return memcached_version_binary(memcached_st *ptr) { memcached_return rc; unsigned int x; - protocol_binary_request_version request= {0}; + protocol_binary_request_version request= { .bytes= {0}}; request.message.header.request.magic= PROTOCOL_BINARY_REQ; request.message.header.request.opcode= PROTOCOL_BINARY_CMD_VERSION; request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;