From 9dfc6c4518012a6a4e7d6b436a90ba520445631c Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 27 Jul 2011 20:16:07 +0000 Subject: [PATCH] ICU-8728 remove redundant U_RELEASE, use U_DEBUG instead X-SVN-Rev: 30431 --- icu4c/source/common/stringtriebuilder.cpp | 4 ++-- icu4c/source/common/uassert.h | 10 +++++----- icu4c/source/common/umutex.c | 2 +- icu4c/source/common/unicode/uconfig.h | 11 ----------- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/icu4c/source/common/stringtriebuilder.cpp b/icu4c/source/common/stringtriebuilder.cpp index 536ce9e6488..327661825d3 100644 --- a/icu4c/source/common/stringtriebuilder.cpp +++ b/icu4c/source/common/stringtriebuilder.cpp @@ -329,7 +329,7 @@ StringTrieBuilder::registerNode(Node *newNode, UErrorCode &errorCode) { } // If uhash_puti() returns a non-zero value from an equivalent, previously // registered node, then uhash_find() failed to find that and we will leak newNode. -#if !U_RELEASE +#if U_DEBUG int32_t oldValue= // Only in debug mode to avoid a compiler warning about unused oldValue. #endif uhash_puti(nodes, newNode, 1, &errorCode); @@ -358,7 +358,7 @@ StringTrieBuilder::registerFinalValue(int32_t value, UErrorCode &errorCode) { } // If uhash_puti() returns a non-zero value from an equivalent, previously // registered node, then uhash_find() failed to find that and we will leak newNode. -#if !U_RELEASE +#if U_DEBUG int32_t oldValue= // Only in debug mode to avoid a compiler warning about unused oldValue. #endif uhash_puti(nodes, newNode, 1, &errorCode); diff --git a/icu4c/source/common/uassert.h b/icu4c/source/common/uassert.h index 9b1a14168fb..9dc29b242b5 100644 --- a/icu4c/source/common/uassert.h +++ b/icu4c/source/common/uassert.h @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 2002-2003, International Business Machines +* Copyright (C) 2002-2011, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -21,11 +21,11 @@ #define U_ASSERT_H /* utypes.h is included to get the proper define for uint8_t */ #include "unicode/utypes.h" -#if U_RELEASE -#define U_ASSERT(exp) +#if U_DEBUG +# include +# define U_ASSERT(exp) assert(exp) #else -#include -#define U_ASSERT(exp) assert(exp) +# define U_ASSERT(exp) #endif #endif diff --git a/icu4c/source/common/umutex.c b/icu4c/source/common/umutex.c index 5be6eb95ef5..1c1d1d32be4 100644 --- a/icu4c/source/common/umutex.c +++ b/icu4c/source/common/umutex.c @@ -560,7 +560,7 @@ u_setAtomicIncDecFunctions(const void *context, UMtxAtomicFn *ip, UMtxAtomicFn * pDecFn = dp; gIncDecContext = context; -#if !U_RELEASE +#if U_DEBUG { int32_t testInt = 0; U_ASSERT(umtx_atomic_inc(&testInt) == 1); /* Sanity Check. Do the functions work at all? */ diff --git a/icu4c/source/common/unicode/uconfig.h b/icu4c/source/common/unicode/uconfig.h index 5da685e88cf..177747aadf2 100644 --- a/icu4c/source/common/unicode/uconfig.h +++ b/icu4c/source/common/unicode/uconfig.h @@ -69,21 +69,10 @@ * which disables assert(). */ # define U_DEBUG 1 -#elif defined(U_RELEASE) -# define U_DEBUG (!U_RELEASE) # else # define U_DEBUG 0 #endif -/** - * \def U_DEBUG - * Opposite of U_DEBUG. - * @internal - */ -#ifndef U_RELEASE -#define U_RELEASE (!U_DEBUG) -#endif - /** * Determines wheter to enable auto cleanup of libraries. * @internal -- 2.40.0