From 4cc82b4180c4f9790eed99957142eeebbff9906e Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Mon, 4 Sep 2006 16:36:21 +0000 Subject: [PATCH] ICU-5304 Allow source code to work again without using U_NAMESPACE_USE X-SVN-Rev: 20242 --- icu4c/source/i18n/anytrans.cpp | 4 ++-- icu4c/source/i18n/calendar.cpp | 2 +- icu4c/source/i18n/casetrn.cpp | 4 +++- icu4c/source/i18n/coll.cpp | 4 ++-- icu4c/source/i18n/csdetect.cpp | 6 +++++- icu4c/source/i18n/hebrwcal.cpp | 2 +- icu4c/source/i18n/islamcal.cpp | 6 +++--- icu4c/source/i18n/msgfmt.cpp | 14 +++++++------- icu4c/source/i18n/rbt_pars.cpp | 2 ++ icu4c/source/i18n/sortkey.cpp | 2 +- icu4c/source/i18n/timezone.cpp | 8 ++++---- icu4c/source/i18n/translit.cpp | 3 ++- icu4c/source/i18n/ucsdet.cpp | 2 ++ 13 files changed, 35 insertions(+), 24 deletions(-) diff --git a/icu4c/source/i18n/anytrans.cpp b/icu4c/source/i18n/anytrans.cpp index bd76fe148a7..5b10caf1f93 100644 --- a/icu4c/source/i18n/anytrans.cpp +++ b/icu4c/source/i18n/anytrans.cpp @@ -1,6 +1,6 @@ /* ***************************************************************** -* Copyright (c) 2002-2005, International Business Machines Corporation +* Copyright (c) 2002-2006, International Business Machines Corporation * and others. All Rights Reserved. ***************************************************************** * Date Name Description @@ -39,7 +39,7 @@ U_CDECL_BEGIN */ static void U_CALLCONV _deleteTransliterator(void *obj) { - delete (Transliterator*) obj; + delete (U_NAMESPACE_QUALIFIER Transliterator*) obj; } U_CDECL_END diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index 6e537028833..8c55c1c22c9 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -44,7 +44,7 @@ #include "uresimp.h" #if !UCONFIG_NO_SERVICE -static ICULocaleService* gService = NULL; +static U_NAMESPACE_QUALIFIER ICULocaleService* gService = NULL; #endif // INTERNAL - for cleanup diff --git a/icu4c/source/i18n/casetrn.cpp b/icu4c/source/i18n/casetrn.cpp index 307f80e94d5..b8d7f7074f7 100644 --- a/icu4c/source/i18n/casetrn.cpp +++ b/icu4c/source/i18n/casetrn.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2001-2005, International Business Machines +* Copyright (C) 2001-2006, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -30,6 +30,8 @@ U_CFUNC UChar32 U_CALLCONV utrans_rep_caseContextIterator(void *context, int8_t dir) { + U_NAMESPACE_USE + UCaseContext *csc=(UCaseContext *)context; Replaceable *rep=(Replaceable *)csc->p; UChar32 c; diff --git a/icu4c/source/i18n/coll.cpp b/icu4c/source/i18n/coll.cpp index c96e259c4ed..8cac0e5ebb5 100644 --- a/icu4c/source/i18n/coll.cpp +++ b/icu4c/source/i18n/coll.cpp @@ -1,6 +1,6 @@ /* ****************************************************************************** -* Copyright (C) 1996-2005, International Business Machines Corporation and * +* Copyright (C) 1996-2006, International Business Machines Corporation and * * others. All Rights Reserved. * ****************************************************************************** */ @@ -54,7 +54,7 @@ U_NAMESPACE_BEGIN #if !UCONFIG_NO_SERVICE U_NAMESPACE_END -static ICULocaleService* gService = NULL; +static U_NAMESPACE_QUALIFIER ICULocaleService* gService = NULL; /** * Release all static memory held by collator. */ diff --git a/icu4c/source/i18n/csdetect.cpp b/icu4c/source/i18n/csdetect.cpp index 2d5681fe19e..3d31e748cd0 100644 --- a/icu4c/source/i18n/csdetect.cpp +++ b/icu4c/source/i18n/csdetect.cpp @@ -33,7 +33,7 @@ #define DELETE_ARRAY(array) uprv_free((void *) (array)) U_CDECL_BEGIN -static CharsetRecognizer **fCSRecognizers = NULL; +static U_NAMESPACE_QUALIFIER CharsetRecognizer **fCSRecognizers = NULL; static int32_t fCSRecognizers_size = 0; @@ -56,6 +56,8 @@ static UBool U_CALLCONV csdet_cleanup(void) static int32_t U_CALLCONV charsetMatchComparator(const void *context, const void *left, const void *right) { + U_NAMESPACE_USE + const CharsetMatch **csm_l = (const CharsetMatch **) left; const CharsetMatch **csm_r = (const CharsetMatch **) right; @@ -367,6 +369,8 @@ static const UEnumeration gCSDetEnumeration = { U_CAPI UEnumeration * U_EXPORT2 ucsdet_getAllDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status) { + U_NAMESPACE_USE + if(U_FAILURE(*status)) { return 0; } diff --git a/icu4c/source/i18n/hebrwcal.cpp b/icu4c/source/i18n/hebrwcal.cpp index 1814272b0ce..f2695754b0d 100644 --- a/icu4c/source/i18n/hebrwcal.cpp +++ b/icu4c/source/i18n/hebrwcal.cpp @@ -130,7 +130,7 @@ static const int32_t LEAP_MONTH_START[][3] = { { 383, 384, 385 }, // Elul }; -static CalendarCache *gCache = NULL; +static U_NAMESPACE_QUALIFIER CalendarCache *gCache = NULL; U_CDECL_BEGIN static UBool calendar_hebrew_cleanup(void) { diff --git a/icu4c/source/i18n/islamcal.cpp b/icu4c/source/i18n/islamcal.cpp index eda1cc3642e..6f311979a54 100644 --- a/icu4c/source/i18n/islamcal.cpp +++ b/icu4c/source/i18n/islamcal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2004, International Business Machines Corporation + * Copyright (C) 2003-2006, International Business Machines Corporation * and others. All Rights Reserved. ****************************************************************************** * @@ -51,8 +51,8 @@ static void debug_islamcal_msg(const char *pat, ...) // --- The cache -- // cache of months static UMTX astroLock = 0; // pod bay door lock -static CalendarCache *gMonthCache = NULL; -static CalendarAstronomer *gIslamicCalendarAstro = NULL; +static U_NAMESPACE_QUALIFIER CalendarCache *gMonthCache = NULL; +static U_NAMESPACE_QUALIFIER CalendarAstronomer *gIslamicCalendarAstro = NULL; U_CDECL_BEGIN static UBool calendar_islamic_cleanup(void) { diff --git a/icu4c/source/i18n/msgfmt.cpp b/icu4c/source/i18n/msgfmt.cpp index 4a6adec0fde..9eb7bcb303a 100644 --- a/icu4c/source/i18n/msgfmt.cpp +++ b/icu4c/source/i18n/msgfmt.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1997-2005, International Business Machines Corporation and * +* Copyright (C) 1997-2006, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * @@ -131,12 +131,12 @@ static const UChar * const DATE_STYLE_IDS[] = { NULL, }; -static const DateFormat::EStyle DATE_STYLES[] = { - DateFormat::kDefault, - DateFormat::kShort, - DateFormat::kMedium, - DateFormat::kLong, - DateFormat::kFull, +static const U_NAMESPACE_QUALIFIER DateFormat::EStyle DATE_STYLES[] = { + U_NAMESPACE_QUALIFIER DateFormat::kDefault, + U_NAMESPACE_QUALIFIER DateFormat::kShort, + U_NAMESPACE_QUALIFIER DateFormat::kMedium, + U_NAMESPACE_QUALIFIER DateFormat::kLong, + U_NAMESPACE_QUALIFIER DateFormat::kFull, }; static const int32_t DEFAULT_INITIAL_CAPACITY = 10; diff --git a/icu4c/source/i18n/rbt_pars.cpp b/icu4c/source/i18n/rbt_pars.cpp index f1c2cb97625..d5c324f2e85 100644 --- a/icu4c/source/i18n/rbt_pars.cpp +++ b/icu4c/source/i18n/rbt_pars.cpp @@ -1574,6 +1574,8 @@ U_NAMESPACE_END U_CAPI int32_t utrans_stripRules(const UChar *source, int32_t sourceLen, UChar *target, UErrorCode *status) { + U_NAMESPACE_USE + //const UChar *sourceStart = source; const UChar *targetStart = target; const UChar *sourceLimit = source+sourceLen; diff --git a/icu4c/source/i18n/sortkey.cpp b/icu4c/source/i18n/sortkey.cpp index f6c3cf5f330..ceca9d16506 100644 --- a/icu4c/source/i18n/sortkey.cpp +++ b/icu4c/source/i18n/sortkey.cpp @@ -396,7 +396,7 @@ U_CAPI int32_t U_EXPORT2 ucol_keyHashCode(const uint8_t *key, int32_t length) { - CollationKey newKey(key, length); + U_NAMESPACE_QUALIFIER CollationKey newKey(key, length); return newKey.hashCode(); } diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 54aad970f16..2952deb8e40 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -98,12 +98,12 @@ static const UChar CUSTOM_ID[] = 0x43, 0x75, 0x73, 0x74, 0x6F, 0x6D, 0x00 /* "Custom" */ }; -static UMTX LOCK; -static TimeZone* DEFAULT_ZONE = NULL; -static TimeZone* _GMT = NULL; // cf. TimeZone::GMT +static UMTX LOCK; +static U_NAMESPACE_QUALIFIER TimeZone* DEFAULT_ZONE = NULL; +static U_NAMESPACE_QUALIFIER TimeZone* _GMT = NULL; // cf. TimeZone::GMT #ifdef U_USE_TIMEZONE_OBSOLETE_2_8 -static UnicodeString* OLSON_IDS = 0; +static U_NAMESPACE_QUALIFIER UnicodeString* OLSON_IDS = 0; #endif U_CDECL_BEGIN diff --git a/icu4c/source/i18n/translit.cpp b/icu4c/source/i18n/translit.cpp index 8a990f40bcd..f6ac04c56ac 100644 --- a/icu4c/source/i18n/translit.cpp +++ b/icu4c/source/i18n/translit.cpp @@ -90,7 +90,7 @@ static UMTX registryMutex = 0; /** * System transliterator registry; non-null when initialized. */ -static TransliteratorRegistry* registry = 0; +static U_NAMESPACE_QUALIFIER TransliteratorRegistry* registry = 0; // Macro to check/initialize the registry. ONLY USE WITHIN // MUTEX. Avoids function call when registry is initialized. @@ -1569,6 +1569,7 @@ U_NAMESPACE_END * user, because RBTs hold pointers to common data objects. */ U_CFUNC UBool transliterator_cleanup(void) { + U_NAMESPACE_USE TransliteratorIDParser::cleanup(); if (registry) { delete registry; diff --git a/icu4c/source/i18n/ucsdet.cpp b/icu4c/source/i18n/ucsdet.cpp index 114f896f415..d18e55c0e44 100644 --- a/icu4c/source/i18n/ucsdet.cpp +++ b/icu4c/source/i18n/ucsdet.cpp @@ -14,6 +14,8 @@ #include "cmemory.h" +U_NAMESPACE_USE + #define ARRAY_SIZE(array) (sizeof array / sizeof array[0]) #define NEW_ARRAY(type,count) (type *) uprv_malloc((count) * sizeof(type))