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

X-SVN-Rev: 20240
This commit is contained in:
George Rhoten 2006-09-03 17:08:23 +00:00
parent 0445548bae
commit b27729b208
18 changed files with 42 additions and 30 deletions

View File

@ -129,7 +129,7 @@ ICULanguageBreakFactory::~ICULanguageBreakFactory() {
U_NAMESPACE_END U_NAMESPACE_END
U_CDECL_BEGIN U_CDECL_BEGIN
static void U_CALLCONV _deleteEngine(void *obj) { static void U_CALLCONV _deleteEngine(void *obj) {
delete (const LanguageBreakEngine *) obj; delete (const U_NAMESPACE_QUALIFIER LanguageBreakEngine *) obj;
} }
U_CDECL_END U_CDECL_END
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN

View File

@ -238,8 +238,6 @@ BreakIterator::~BreakIterator()
//------------------------------------------- //-------------------------------------------
#if !UCONFIG_NO_SERVICE #if !UCONFIG_NO_SERVICE
static ICULocaleService* gService = NULL;
// ------------------------------------- // -------------------------------------
class ICUBreakIteratorFactory : public ICUResourceBundleFactory { class ICUBreakIteratorFactory : public ICUResourceBundleFactory {
@ -283,6 +281,8 @@ U_NAMESPACE_END
// defined in ucln_cmn.h // defined in ucln_cmn.h
static U_NAMESPACE_QUALIFIER ICULocaleService* gService = NULL;
/** /**
* Release all static memory held by breakiterator. * Release all static memory held by breakiterator.
*/ */

View File

@ -41,7 +41,7 @@
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
static Locale* availableLocaleList = NULL; static U_NAMESPACE_QUALIFIER Locale* availableLocaleList = NULL;
static int32_t availableLocaleListCount; static int32_t availableLocaleListCount;
typedef enum ELocalePos { typedef enum ELocalePos {
eENGLISH, eENGLISH,
@ -76,9 +76,9 @@ U_CFUNC int32_t locale_getKeywords(const char *localeID,
UBool valuesToo, UBool valuesToo,
UErrorCode *status); UErrorCode *status);
static Locale *gLocaleCache = NULL; static U_NAMESPACE_QUALIFIER Locale *gLocaleCache = NULL;
static const Locale *gDefaultLocale = NULL; static const U_NAMESPACE_QUALIFIER Locale *gDefaultLocale = NULL;
static UHashtable *gDefaultLocalesHashT = NULL; static UHashtable *gDefaultLocalesHashT = NULL;
U_CDECL_BEGIN U_CDECL_BEGIN
// //
@ -86,7 +86,7 @@ U_CDECL_BEGIN
// //
static void U_CALLCONV static void U_CALLCONV
deleteLocale(void *obj) { deleteLocale(void *obj) {
delete (Locale *) obj; delete (U_NAMESPACE_QUALIFIER Locale *) obj;
} }
static UBool U_CALLCONV locale_cleanup(void) static UBool U_CALLCONV locale_cleanup(void)
@ -115,14 +115,11 @@ static UBool U_CALLCONV locale_cleanup(void)
U_CDECL_END U_CDECL_END
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Locale)
// //
// locale_set_default_internal. // locale_set_default_internal.
// //
void locale_set_default_internal(const char *id) void locale_set_default_internal(const char *id)
{ {
U_NAMESPACE_USE
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
UBool canonicalize = FALSE; UBool canonicalize = FALSE;
@ -218,7 +215,6 @@ void locale_set_default_internal(const char *id)
} }
U_NAMESPACE_END U_NAMESPACE_END
/* sfb 07/21/99 */ /* sfb 07/21/99 */
U_CFUNC void U_CFUNC void
locale_set_default(const char *id) locale_set_default(const char *id)
@ -239,6 +235,8 @@ locale_get_default(void)
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Locale)
/*Character separating the posix id fields*/ /*Character separating the posix id fields*/
// '_' // '_'
// In the platform codepage. // In the platform codepage.

View File

@ -1,6 +1,6 @@
/** /**
******************************************************************************* *******************************************************************************
* Copyright (C) 2002-2005, International Business Machines Corporation and * * Copyright (C) 2002-2006, International Business Machines Corporation and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
******************************************************************************* *******************************************************************************
* *
@ -20,7 +20,7 @@
#include "umutex.h" #include "umutex.h"
// see LocaleUtility::getAvailableLocaleNames // see LocaleUtility::getAvailableLocaleNames
static Hashtable * LocaleUtility_cache = NULL; static U_NAMESPACE_QUALIFIER Hashtable * LocaleUtility_cache = NULL;
#define UNDERSCORE_CHAR ((UChar)0x005f) #define UNDERSCORE_CHAR ((UChar)0x005f)
#define AT_SIGN_CHAR ((UChar)64) #define AT_SIGN_CHAR ((UChar)64)

View File

@ -1,6 +1,6 @@
/* /*
********************************************************************** **********************************************************************
* Copyright (c) 2002-2005, International Business Machines * Copyright (c) 2002-2006, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
* Author: Alan Liu * Author: Alan Liu
@ -204,6 +204,7 @@ PropertyAliases::getPropertyValueEnum(EnumValue prop,
} }
U_NAMESPACE_END U_NAMESPACE_END
U_NAMESPACE_USE
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// UDataMemory structures // UDataMemory structures

View File

@ -1674,12 +1674,12 @@ int32_t RuleBasedBreakIterator::checkDictionary(int32_t startPos,
return (reverse ? startPos : endPos); return (reverse ? startPos : endPos);
} }
static UStack *gLanguageBreakFactories = NULL;
U_NAMESPACE_END U_NAMESPACE_END
// defined in ucln_cmn.h // defined in ucln_cmn.h
static U_NAMESPACE_QUALIFIER UStack *gLanguageBreakFactories = NULL;
/** /**
* Release all static memory held by breakiterator. * Release all static memory held by breakiterator.
*/ */
@ -1695,7 +1695,7 @@ U_CDECL_END
U_CDECL_BEGIN U_CDECL_BEGIN
static void U_CALLCONV _deleteFactory(void *obj) { static void U_CALLCONV _deleteFactory(void *obj) {
delete (LanguageBreakFactory *) obj; delete (U_NAMESPACE_QUALIFIER LanguageBreakFactory *) obj;
} }
U_CDECL_END U_CDECL_END
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN

View File

@ -1,6 +1,6 @@
/* /*
*************************************************************************** ***************************************************************************
* Copyright (C) 1999-2005 International Business Machines Corporation * * Copyright (C) 1999-2006 International Business Machines Corporation *
* and others. All rights reserved. * * and others. All rights reserved. *
*************************************************************************** ***************************************************************************
*/ */
@ -257,6 +257,7 @@ void RBBIDataWrapper::printData() {
U_NAMESPACE_END U_NAMESPACE_END
U_NAMESPACE_USE
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //

View File

@ -72,7 +72,7 @@ static const UChar kAny[] = {0x61, 0x6e, 0x79, 0x00}; // "any"
U_CDECL_BEGIN U_CDECL_BEGIN
static void U_CALLCONV RBBISetTable_deleter(void *p) { static void U_CALLCONV RBBISetTable_deleter(void *p) {
RBBISetTableEl *px = (RBBISetTableEl *)p; U_NAMESPACE_QUALIFIER RBBISetTableEl *px = (U_NAMESPACE_QUALIFIER RBBISetTableEl *)p;
delete px->key; delete px->key;
// Note: px->val is owned by the linked list "fSetsListHead" in scanner. // Note: px->val is owned by the linked list "fSetsListHead" in scanner.
// Don't delete the value nodes here. // Don't delete the value nodes here.

View File

@ -3,7 +3,7 @@
// //
/* /*
*************************************************************************** ***************************************************************************
* Copyright (C) 2002-2005 International Business Machines Corporation * * Copyright (C) 2002-2006 International Business Machines Corporation *
* and others. All rights reserved. * * and others. All rights reserved. *
*************************************************************************** ***************************************************************************
*/ */
@ -29,7 +29,7 @@
// //
U_CDECL_BEGIN U_CDECL_BEGIN
static void U_CALLCONV RBBISymbolTableEntry_deleter(void *p) { static void U_CALLCONV RBBISymbolTableEntry_deleter(void *p) {
RBBISymbolTableEntry *px = (RBBISymbolTableEntry *)p; U_NAMESPACE_QUALIFIER RBBISymbolTableEntry *px = (U_NAMESPACE_QUALIFIER RBBISymbolTableEntry *)p;
delete px; delete px;
} }
U_CDECL_END U_CDECL_END

View File

@ -876,6 +876,7 @@ static void walkHorizontal(const TernaryNode *node,
} }
U_NAMESPACE_END U_NAMESPACE_END
U_NAMESPACE_USE
U_CDECL_BEGIN U_CDECL_BEGIN
static int32_t U_CALLCONV static int32_t U_CALLCONV
_sortBuildNodes(const void * /*context*/, const void *voidl, const void *voidr) { _sortBuildNodes(const void * /*context*/, const void *voidl, const void *voidr) {

View File

@ -21,6 +21,8 @@
#include "unicode/uiter.h" #include "unicode/uiter.h"
#include "cstring.h" #include "cstring.h"
U_NAMESPACE_USE
#define IS_EVEN(n) (((n)&1)==0) #define IS_EVEN(n) (((n)&1)==0)
#define IS_POINTER_EVEN(p) IS_EVEN((size_t)p) #define IS_POINTER_EVEN(p) IS_EVEN((size_t)p)

View File

@ -1,6 +1,6 @@
/* /*
****************************************************************************** ******************************************************************************
* Copyright (C) 1999-2005, International Business Machines Corporation and * * Copyright (C) 1999-2006, International Business Machines Corporation and *
* others. All Rights Reserved. * * others. All Rights Reserved. *
****************************************************************************** ******************************************************************************
* *
@ -90,7 +90,7 @@ us_arrayCopy(const UChar *src, int32_t srcStart,
U_CDECL_BEGIN U_CDECL_BEGIN
static UChar U_CALLCONV static UChar U_CALLCONV
UnicodeString_charAt(int32_t offset, void *context) { UnicodeString_charAt(int32_t offset, void *context) {
return ((UnicodeString*) context)->charAt(offset); return ((U_NAMESPACE_QUALIFIER UnicodeString*) context)->charAt(offset);
} }
U_CDECL_END U_CDECL_END

View File

@ -78,6 +78,8 @@
*/ */
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
U_NAMESPACE_USE
/* /*
* This new implementation of the normalization code loads its data from * This new implementation of the normalization code loads its data from
* unorm.dat, which is generated with the gennorm tool. * unorm.dat, which is generated with the gennorm tool.

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. * Corporation and others. All Rights Reserved.
* *
******************************************************************************* *******************************************************************************
@ -29,6 +29,8 @@
#include "ucase.h" #include "ucase.h"
#include "cmemory.h" #include "cmemory.h"
U_NAMESPACE_USE
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
/* compare canonically equivalent ------------------------------------------- */ /* compare canonically equivalent ------------------------------------------- */

View File

@ -29,6 +29,8 @@
#include "unicode/ustring.h" #include "unicode/ustring.h"
#include "unicode/parsepos.h" #include "unicode/parsepos.h"
U_NAMESPACE_USE
U_CAPI USet* U_EXPORT2 U_CAPI USet* U_EXPORT2
uset_open(UChar32 start, UChar32 end) { uset_open(UChar32 start, UChar32 end) {
return (USet*) new UnicodeSet(start, end); return (USet*) new UnicodeSet(start, end);

View File

@ -1,7 +1,7 @@
/* /*
******************************************************************************* *******************************************************************************
* *
* Copyright (C) 2002-2005, International Business Machines * Copyright (C) 2002-2006, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
******************************************************************************* *******************************************************************************
@ -25,6 +25,8 @@
#include "unicode/ustring.h" #include "unicode/ustring.h"
#include "unicode/parsepos.h" #include "unicode/parsepos.h"
U_NAMESPACE_USE
U_CAPI USet* U_EXPORT2 U_CAPI USet* U_EXPORT2
uset_openPattern(const UChar* pattern, int32_t patternLength, uset_openPattern(const UChar* pattern, int32_t patternLength,
UErrorCode* ec) UErrorCode* ec)

View File

@ -1,6 +1,6 @@
/* /*
********************************************************************** **********************************************************************
* Copyright (c) 2002-2005, International Business Machines * Copyright (c) 2002-2006, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
********************************************************************** **********************************************************************
* Author: Alan Liu * Author: Alan Liu
@ -149,12 +149,12 @@ void UStringEnumeration::reset(UErrorCode& status) {
uenum_reset(uenum, &status); uenum_reset(uenum, &status);
} }
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UStringEnumeration/*, StringEnumeration*/) UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UStringEnumeration)
U_NAMESPACE_END U_NAMESPACE_END
// C wrapper --------------------------------------------------------------- *** // C wrapper --------------------------------------------------------------- ***
#define THIS(en) ((StringEnumeration*)(en->context)) #define THIS(en) ((U_NAMESPACE_QUALIFIER StringEnumeration*)(en->context))
U_CDECL_BEGIN U_CDECL_BEGIN
@ -231,7 +231,7 @@ U_CDECL_END
* delete it (regardless of error status). * delete it (regardless of error status).
*/ */
U_CAPI UEnumeration* U_EXPORT2 U_CAPI UEnumeration* U_EXPORT2
uenum_openStringEnumeration(StringEnumeration* adopted, UErrorCode* ec) { uenum_openStringEnumeration(U_NAMESPACE_QUALIFIER StringEnumeration* adopted, UErrorCode* ec) {
UEnumeration* result = NULL; UEnumeration* result = NULL;
if (U_SUCCESS(*ec) && adopted != NULL) { if (U_SUCCESS(*ec) && adopted != NULL) {
result = (UEnumeration*) uprv_malloc(sizeof(UEnumeration)); result = (UEnumeration*) uprv_malloc(sizeof(UEnumeration));

View File

@ -24,6 +24,7 @@
#include "cstring.h" #include "cstring.h"
#include "uassert.h" #include "uassert.h"
U_NAMESPACE_USE
#define I32_FLAG(bitIndex) ((int32_t)1<<(bitIndex)) #define I32_FLAG(bitIndex) ((int32_t)1<<(bitIndex))