ICU-5304 Allow source code to work again without using U_NAMESPACE_USE

X-SVN-Rev: 20242
This commit is contained in:
George Rhoten 2006-09-04 16:36:21 +00:00
parent 8b2c84620c
commit 4cc82b4180
13 changed files with 35 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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.
*/

View File

@ -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;
}

View File

@ -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) {

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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();
}

View File

@ -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

View File

@ -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;

View File

@ -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))