From c63b3f26c9e8d0214d3e1c70fb761f7700d61d2d Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 13 Sep 2010 14:26:17 +0200 Subject: [PATCH] Refactor: rename __write_vector_st Symbol names with double underscores generate a compile warning on some platforms causing a build break. Renamed to libmemcached_io_vector_st. --- libmemcached/auto.c | 6 +++--- libmemcached/delete.c | 4 ++-- libmemcached/do.c | 6 +++--- libmemcached/do.h | 4 ++-- libmemcached/get.c | 24 ++++++++++++------------ libmemcached/io.c | 2 +- libmemcached/io.h | 4 ++-- libmemcached/sasl.c | 2 +- libmemcached/stats.c | 6 +++--- libmemcached/storage.c | 8 ++++---- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/libmemcached/auto.c b/libmemcached/auto.c index b73425f0..ce2d0261 100644 --- a/libmemcached/auto.c +++ b/libmemcached/auto.c @@ -60,7 +60,7 @@ static memcached_return_t text_incr_decr(memcached_st *ptr, { *value= 0; rc= MEMCACHED_PROTOCOL_ERROR; - } + } else if (! strncmp(buffer, "CLIENT_ERROR\r\n", 14)) { *value= 0; @@ -116,12 +116,12 @@ static memcached_return_t binary_incr_decr(memcached_st *ptr, uint8_t cmd, request.message.body.initial= htonll(initial); request.message.body.expiration= htonl((uint32_t) expiration); - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length, .buffer= key } - }; + }; memcached_return_t rc; if ((rc= memcached_vdo(instance, vector, 3, true)) != MEMCACHED_SUCCESS) diff --git a/libmemcached/delete.c b/libmemcached/delete.c index 70553d94..84a34271 100644 --- a/libmemcached/delete.c +++ b/libmemcached/delete.c @@ -175,12 +175,12 @@ static inline memcached_return_t binary_delete(memcached_st *ptr, memcached_io_write(instance, NULL, 0, true); } - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes}, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length, .buffer= key }, - }; + }; memcached_return_t rc= MEMCACHED_SUCCESS; diff --git a/libmemcached/do.c b/libmemcached/do.c index 1a274cd3..14824a64 100644 --- a/libmemcached/do.c +++ b/libmemcached/do.c @@ -5,13 +5,13 @@ * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. * - * Summary: + * Summary: * */ #include "common.h" -memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const void *command, +memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const void *command, size_t command_length, bool with_flush) { memcached_return_t rc; @@ -51,7 +51,7 @@ memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const vo } memcached_return_t memcached_vdo(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, size_t count, + const struct libmemcached_io_vector_st *vector, size_t count, bool with_flush) { memcached_return_t rc; diff --git a/libmemcached/do.h b/libmemcached/do.h index d6d018d9..2506ddf2 100644 --- a/libmemcached/do.h +++ b/libmemcached/do.h @@ -17,14 +17,14 @@ extern "C" { #endif LIBMEMCACHED_LOCAL -memcached_return_t memcached_do(memcached_server_write_instance_st ptr, +memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const void *commmand, size_t command_length, bool with_flush); LIBMEMCACHED_LOCAL memcached_return_t memcached_vdo(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, size_t count, + const struct libmemcached_io_vector_st *vector, size_t count, bool with_flush); #ifdef __cplusplus diff --git a/libmemcached/get.c b/libmemcached/get.c index 55457f7f..8d76507c 100644 --- a/libmemcached/get.c +++ b/libmemcached/get.c @@ -1,5 +1,5 @@ /* LibMemcached - * Copyright (C) 2006-2009 Brian Aker + * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See @@ -227,13 +227,13 @@ static memcached_return_t memcached_mget_by_key_real(memcached_st *ptr, instance= memcached_server_instance_fetch(ptr, server_key); - struct __write_vector_st vector[]= - { - { .length= get_command_length, .buffer= get_command }, - { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, - { .length= key_length[x], .buffer= keys[x] }, - { .length= 1, .buffer= " " } - }; + struct libmemcached_io_vector_st vector[]= + { + { .length= get_command_length, .buffer= get_command }, + { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, + { .length= key_length[x], .buffer= keys[x] }, + { .length= 1, .buffer= " " } + }; if (memcached_server_response_count(instance) == 0) @@ -399,12 +399,12 @@ static memcached_return_t simple_binary_mget(memcached_st *ptr, request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES; request.message.header.request.bodylen= htonl((uint32_t)( key_length[x] + ptr->prefix_key_length)); - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length[x], .buffer= keys[x] } - }; + }; if (memcached_io_writev(instance, vector, 3, flush) == -1) { @@ -533,12 +533,12 @@ static memcached_return_t replication_binary_mget(memcached_st *ptr, * that we might have processed some of the responses etc. For now, * just make sure we work _correctly_ */ - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length[x], .buffer= keys[x] } - }; + }; if (memcached_io_writev(instance, vector, 3, true) == -1) { diff --git a/libmemcached/io.c b/libmemcached/io.c index 9a20609b..6513492d 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -440,7 +440,7 @@ ssize_t memcached_io_write(memcached_server_write_instance_st ptr, } ssize_t memcached_io_writev(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, + const struct libmemcached_io_vector_st *vector, size_t number_of, bool with_flush) { ssize_t total= 0; diff --git a/libmemcached/io.h b/libmemcached/io.h index 30145823..9d5087e0 100644 --- a/libmemcached/io.h +++ b/libmemcached/io.h @@ -40,7 +40,7 @@ struct udp_datagram_header_st uint16_t reserved; }; -struct __write_vector_st +struct libmemcached_io_vector_st { size_t length; const void *buffer; @@ -48,7 +48,7 @@ struct __write_vector_st LIBMEMCACHED_LOCAL ssize_t memcached_io_writev(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, + const struct libmemcached_io_vector_st *vector, size_t number_of, bool with_flush); LIBMEMCACHED_LOCAL diff --git a/libmemcached/sasl.c b/libmemcached/sasl.c index bdec4272..ef52c7c3 100644 --- a/libmemcached/sasl.c +++ b/libmemcached/sasl.c @@ -141,7 +141,7 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s do { /* send the packet */ - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= keylen, .buffer= chosenmech }, diff --git a/libmemcached/stats.c b/libmemcached/stats.c index 731c1cc0..0c52d97a 100644 --- a/libmemcached/stats.c +++ b/libmemcached/stats.c @@ -258,11 +258,11 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, request.message.header.request.keylen= htons((uint16_t)len); request.message.header.request.bodylen= htonl((uint32_t) len); - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= len, .buffer= args } - }; + }; if (memcached_vdo(instance, vector, 2, true) != MEMCACHED_SUCCESS) { @@ -302,7 +302,7 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, WATCHPOINT_ASSERT(0); } } - + if (check && check->func) { size_t key_length= strlen(buffer); diff --git a/libmemcached/storage.c b/libmemcached/storage.c index dce5fec3..25aaba30 100644 --- a/libmemcached/storage.c +++ b/libmemcached/storage.c @@ -155,12 +155,12 @@ static inline memcached_return_t memcached_send(memcached_st *ptr, } else { - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= write_length, .buffer= buffer }, { .length= value_length, .buffer= value }, { .length= 2, .buffer= "\r\n" } - }; + }; if (ptr->flags.buffer_requests && verb == SET_OP) { @@ -492,13 +492,13 @@ static memcached_return_t memcached_send_binary(memcached_st *ptr, } } - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= send_length, .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length, .buffer= key }, { .length= value_length, .buffer= value } - }; + }; /* write the header */ memcached_return_t rc; -- 2.30.2