From 8b85f11b21222ef16cf3cf5aaeb8ac3aca97d4e3 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Thu, 17 Dec 2009 10:12:35 +0100 Subject: [PATCH] Fixed compilation with --with-debug --- libmemcached/memcached.c | 1 - libmemcached/string.c | 6 +++--- libmemcached/watchpoint.h | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/libmemcached/memcached.c b/libmemcached/memcached.c index 90d3a708..2fa4f42c 100644 --- a/libmemcached/memcached.c +++ b/libmemcached/memcached.c @@ -39,7 +39,6 @@ memcached_st *memcached_create(memcached_st *ptr) ptr->io_bytes_watermark= 65 * 1024; WATCHPOINT_ASSERT_INITIALIZED(&ptr->result); - WATCHPOINT_ASSERT_INITIALIZED(&ptr->hashkit); return ptr; } diff --git a/libmemcached/string.c b/libmemcached/string.c index 838ca416..846a3316 100644 --- a/libmemcached/string.c +++ b/libmemcached/string.c @@ -50,7 +50,7 @@ memcached_string_st *memcached_string_create(memcached_st *memc, memcached_strin /* Saving malloc calls :) */ if (string) { - WATCHPOINT_ASSERT(memc->options.is_safe && string->options.is_initialized == false); + WATCHPOINT_ASSERT(string->options.is_initialized == false); memset(string, 0, sizeof(memcached_string_st)); } @@ -82,7 +82,7 @@ memcached_string_st *memcached_string_create(memcached_st *memc, memcached_strin return string; } -memcached_return_t memcached_string_append_character(memcached_string_st *string, +memcached_return_t memcached_string_append_character(memcached_string_st *string, char character) { memcached_return_t rc; @@ -139,7 +139,7 @@ char *memcached_string_c_copy(memcached_string_st *string) memcached_return_t memcached_string_reset(memcached_string_st *string) { string->end= string->string; - + return MEMCACHED_SUCCESS; } diff --git a/libmemcached/watchpoint.h b/libmemcached/watchpoint.h index d8c593ec..a69d3916 100644 --- a/libmemcached/watchpoint.h +++ b/libmemcached/watchpoint.h @@ -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 @@ -17,16 +17,16 @@ #include -#define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); -#define WATCHPOINT_ERROR(A) fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); -#define WATCHPOINT_IFERROR(A) if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); -#define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); -#define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout); -#define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout); -#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout); -#define WATCHPOINT_ASSERT_PRINT(A,B,C) if(!(A)){fprintf(stderr, "\nWATCHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C));fprintf(stderr,"\n");fflush(stdout);}assert((A)); -#define WATCHPOINT_ASSERT(A) assert((A)); -#define WATCHPOINT_ASSERT_INITIALIZED(A) (memcached_is_initialized((A)); +#define WATCHPOINT do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); } while (0) +#define WATCHPOINT_ERROR(A) do {fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); } while (0) +#define WATCHPOINT_IFERROR(A) do { if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); } while (0) +#define WATCHPOINT_STRING(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); } while (0) +#define WATCHPOINT_STRING_LENGTH(A,B) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout); } while (0) +#define WATCHPOINT_NUMBER(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout); } while (0) +#define WATCHPOINT_ERRNO(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout); } while (0) +#define WATCHPOINT_ASSERT_PRINT(A,B,C) do { if(!(A)){fprintf(stderr, "\nWATCHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C));fprintf(stderr,"\n");fflush(stdout);}assert((A)); } while (0) +#define WATCHPOINT_ASSERT(A) assert((A)) +#define WATCHPOINT_ASSERT_INITIALIZED(A) assert(memcached_is_initialized((A))) #else -- 2.30.2