diff --git a/icu4c/source/common/brkiter.cpp b/icu4c/source/common/brkiter.cpp index 56a532d4a5..3b6c94dc61 100644 --- a/icu4c/source/common/brkiter.cpp +++ b/icu4c/source/common/brkiter.cpp @@ -266,12 +266,13 @@ ICUBreakIteratorService::~ICUBreakIteratorService() {} // ------------------------------------- +// defined in ucln_cmn.h U_NAMESPACE_END -// defined in ucln_cmn.h - +static icu::UInitOnce gInitOnce; static icu::ICULocaleService* gService = NULL; -static UInitOnce gInitOnce; + + /** * Release all static memory held by breakiterator. diff --git a/icu4c/source/common/locavailable.cpp b/icu4c/source/common/locavailable.cpp index 62cdf972cb..a04c20468c 100644 --- a/icu4c/source/common/locavailable.cpp +++ b/icu4c/source/common/locavailable.cpp @@ -29,10 +29,14 @@ // C++ API ----------------------------------------------------------------- *** +U_NAMESPACE_BEGIN + static icu::Locale* availableLocaleList = NULL; static int32_t availableLocaleListCount; static UInitOnce gInitOnce = U_INITONCE_INITIALIZER; +U_NAMESPACE_END + U_CDECL_BEGIN static UBool U_CALLCONV locale_available_cleanup(void) @@ -172,3 +176,4 @@ uloc_countAvailable() _load_installedLocales(); return _installedLocalesCount; } + diff --git a/icu4c/source/common/rbbi.cpp b/icu4c/source/common/rbbi.cpp index 8cc0ed2cbb..aa745c1c70 100644 --- a/icu4c/source/common/rbbi.cpp +++ b/icu4c/source/common/rbbi.cpp @@ -1788,12 +1788,13 @@ int32_t RuleBasedBreakIterator::checkDictionary(int32_t startPos, return (reverse ? startPos : endPos); } -U_NAMESPACE_END - // defined in ucln_cmn.h +U_NAMESPACE_END + + static icu::UStack *gLanguageBreakFactories = NULL; -static UInitOnce gLanguageBreakFactoriesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gLanguageBreakFactoriesInitOnce = U_INITONCE_INITIALIZER; /** * Release all static memory held by breakiterator. diff --git a/icu4c/source/common/ucnv_bld.cpp b/icu4c/source/common/ucnv_bld.cpp index 57d15e7c14..e07ec6210e 100644 --- a/icu4c/source/common/ucnv_bld.cpp +++ b/icu4c/source/common/ucnv_bld.cpp @@ -44,7 +44,7 @@ #include "ucln_cmn.h" #include "ustr_cnv.h" - +U_NAMESPACE_BEGIN #if 0 #include @@ -540,7 +540,7 @@ ucnv_deleteSharedConverterData(UConverterSharedData * deadSharedData) * Load a non-algorithmic converter. * If pkg==NULL, then this function must be called inside umtx_lock(&cnvCacheMutex). */ -UConverterSharedData * +U_CAPI UConverterSharedData * ucnv_load(UConverterLoadArgs *pArgs, UErrorCode *err) { UConverterSharedData *mySharedConverterData; @@ -890,7 +890,7 @@ ucnv_canCreateConverter(const char *converterName, UErrorCode *err) { return U_SUCCESS(*err); } -UConverter * +U_CAPI UConverter * ucnv_createAlgorithmicConverter(UConverter *myUConverter, UConverterType type, const char *locale, uint32_t options, @@ -1702,4 +1702,6 @@ ucnv_swap(const UDataSwapper *ds, #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ +U_NAMESPACE_END + #endif diff --git a/icu4c/source/common/ucnv_io.cpp b/icu4c/source/common/ucnv_io.cpp index 091a1b7c6c..0ccb441698 100644 --- a/icu4c/source/common/ucnv_io.cpp +++ b/icu4c/source/common/ucnv_io.cpp @@ -161,6 +161,8 @@ * */ +U_NAMESPACE_BEGIN + /** * Used by the UEnumeration API */ @@ -1336,6 +1338,9 @@ ucnv_swapAliases(const UDataSwapper *ds, #endif + +U_NAMESPACE_END + /* * Hey, Emacs, please set the following: * diff --git a/icu4c/source/common/uinit.cpp b/icu4c/source/common/uinit.cpp index d9af267062..9b745ab14d 100644 --- a/icu4c/source/common/uinit.cpp +++ b/icu4c/source/common/uinit.cpp @@ -24,6 +24,8 @@ #include "umutex.h" #include "utracimp.h" +U_NAMESPACE_BEGIN + static UInitOnce gICUInitOnce = U_INITONCE_INITIALIZER; static UBool U_CALLCONV uinit_cleanup() { @@ -64,3 +66,5 @@ u_init(UErrorCode *status) { umtx_initOnce(gICUInitOnce, &initData, *status); UTRACE_EXIT_STATUS(*status); } + +U_NAMESPACE_END diff --git a/icu4c/source/common/unames.cpp b/icu4c/source/common/unames.cpp index eafe70ccb8..de74b4abaa 100644 --- a/icu4c/source/common/unames.cpp +++ b/icu4c/source/common/unames.cpp @@ -29,6 +29,8 @@ #include "udataswp.h" #include "uprops.h" +U_NAMESPACE_BEGIN + /* prototypes ------------------------------------------------------------- */ #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) @@ -2084,6 +2086,8 @@ uchar_swapNames(const UDataSwapper *ds, return headerSize+(int32_t)offset; } +U_NAMESPACE_END + /* * Hey, Emacs, please set the following: * diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index e1915f6fc1..035799c56d 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -36,6 +36,7 @@ #include "putilimp.h" #include "uassert.h" +U_NAMESPACE_BEGIN /* Static cache for already opened resource bundles - mostly for keeping fallback info @@ -1119,6 +1120,7 @@ static UResourceBundle *init_resb_result(const ResourceData *rdata, Resource r, return resB; } +U_CAPI UResourceBundle *ures_copyResb(UResourceBundle *r, const UResourceBundle *original, UErrorCode *status) { UBool isStackObject; if(U_FAILURE(*status) || r == original) { @@ -2877,4 +2879,5 @@ ures_getVersionByKey(const UResourceBundle* res, const char *key, UVersionInfo v } } +U_NAMESPACE_END /* eof */ diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index 928223891e..c760932027 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -60,7 +60,7 @@ #if !UCONFIG_NO_SERVICE static icu::ICULocaleService* gService = NULL; -static UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; #endif // INTERNAL - for cleanup diff --git a/icu4c/source/i18n/chnsecal.cpp b/icu4c/source/i18n/chnsecal.cpp index c32b0611c6..8ff04ac521 100644 --- a/icu4c/source/i18n/chnsecal.cpp +++ b/icu4c/source/i18n/chnsecal.cpp @@ -54,7 +54,7 @@ static icu::CalendarAstronomer *gChineseCalendarAstro = NULL; static icu::CalendarCache *gChineseCalendarWinterSolsticeCache = NULL; static icu::CalendarCache *gChineseCalendarNewYearCache = NULL; static icu::TimeZone *gChineseCalendarZoneAstroCalc = NULL; -static UInitOnce gChineseCalendarZoneAstroCalcInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gChineseCalendarZoneAstroCalcInitOnce = U_INITONCE_INITIALIZER; /** * The start year of the Chinese calendar, the 61st year of the reign diff --git a/icu4c/source/i18n/coll.cpp b/icu4c/source/i18n/coll.cpp index c12f9d4e2c..d4224ba39e 100644 --- a/icu4c/source/i18n/coll.cpp +++ b/icu4c/source/i18n/coll.cpp @@ -58,8 +58,8 @@ static icu::Locale* availableLocaleList = NULL; static int32_t availableLocaleListCount; static icu::ICULocaleService* gService = NULL; -static UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; -static UInitOnce gAvailableLocaleListInitOnce; +static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gAvailableLocaleListInitOnce; /** * Release all static memory held by collator. diff --git a/icu4c/source/i18n/csdetect.cpp b/icu4c/source/i18n/csdetect.cpp index 415c85421d..c7f82b5525 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)) static icu::CharsetRecognizer **fCSRecognizers = NULL; -static UInitOnce gCSRecognizersInitOnce; +static icu::UInitOnce gCSRecognizersInitOnce; static int32_t fCSRecognizers_size = 0; U_CDECL_BEGIN diff --git a/icu4c/source/i18n/dangical.cpp b/icu4c/source/i18n/dangical.cpp index 94e1458b8d..410260e52b 100644 --- a/icu4c/source/i18n/dangical.cpp +++ b/icu4c/source/i18n/dangical.cpp @@ -22,7 +22,7 @@ // --- The cache -- static icu::TimeZone *gDangiCalendarZoneAstroCalc = NULL; -static UInitOnce gDangiCalendarInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gDangiCalendarInitOnce = U_INITONCE_INITIALIZER; /** * The start year of the Korean traditional calendar (Dan-gi) is the inaugural diff --git a/icu4c/source/i18n/gender.cpp b/icu4c/source/i18n/gender.cpp index 8e6e0d15bf..be116eda29 100644 --- a/icu4c/source/i18n/gender.cpp +++ b/icu4c/source/i18n/gender.cpp @@ -35,7 +35,7 @@ static const char* gNeutralStr = "neutral"; static const char* gMailTaintsStr = "maleTaints"; static const char* gMixedNeutralStr = "mixedNeutral"; static icu::GenderInfo* gObjs = NULL; -static UInitOnce gGenderInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gGenderInitOnce = U_INITONCE_INITIALIZER; enum GenderStyle { NEUTRAL, diff --git a/icu4c/source/i18n/numfmt.cpp b/icu4c/source/i18n/numfmt.cpp index 0e2aa64b2e..a89d16e9dc 100644 --- a/icu4c/source/i18n/numfmt.cpp +++ b/icu4c/source/i18n/numfmt.cpp @@ -140,11 +140,11 @@ static const char *gFormatKeys[UNUM_FORMAT_STYLE_COUNT] = { // Static hashtable cache of NumberingSystem objects used by NumberFormat static UHashtable * NumberingSystem_cache = NULL; static UMutex nscacheMutex = U_MUTEX_INITIALIZER; -static UInitOnce gNSCacheInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gNSCacheInitOnce = U_INITONCE_INITIALIZER; #if !UCONFIG_NO_SERVICE static icu::ICULocaleService* gService = NULL; -static UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER; #endif /** diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 0596a38e2c..5eb7da4d7e 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -111,14 +111,14 @@ static const int32_t GMT_ID_LENGTH = 3; static const int32_t UNKNOWN_ZONE_ID_LENGTH = 11; static icu::TimeZone* DEFAULT_ZONE = NULL; -static UInitOnce gDefaultZoneInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gDefaultZoneInitOnce = U_INITONCE_INITIALIZER; static icu::TimeZone* _GMT = NULL; static icu::TimeZone* _UNKNOWN_ZONE = NULL; -static UInitOnce gStaticZonesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gStaticZonesInitOnce = U_INITONCE_INITIALIZER; static char TZDATA_VERSION[16]; -static UInitOnce gTZDataVersionInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gTZDataVersionInitOnce = U_INITONCE_INITIALIZER; static int32_t* MAP_SYSTEM_ZONES = NULL; static int32_t* MAP_CANONICAL_SYSTEM_ZONES = NULL; @@ -128,9 +128,9 @@ static int32_t LEN_SYSTEM_ZONES = 0; static int32_t LEN_CANONICAL_SYSTEM_ZONES = 0; static int32_t LEN_CANONICAL_SYSTEM_LOCATION_ZONES = 0; -static UInitOnce gSystemZonesInitOnce = U_INITONCE_INITIALIZER; -static UInitOnce gCanonicalZonesInitOnce = U_INITONCE_INITIALIZER; -static UInitOnce gCanonicalLocationZonesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemZonesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCanonicalZonesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCanonicalLocationZonesInitOnce = U_INITONCE_INITIALIZER; U_CDECL_BEGIN static UBool U_CALLCONV timeZone_cleanup(void) diff --git a/icu4c/source/i18n/ucol_bld.cpp b/icu4c/source/i18n/ucol_bld.cpp index 22ca64055e..8a2bf1c36b 100644 --- a/icu4c/source/i18n/ucol_bld.cpp +++ b/icu4c/source/i18n/ucol_bld.cpp @@ -42,7 +42,7 @@ static const InverseUCATableHeader* _staticInvUCA = NULL; static UDataMemory* invUCA_DATA_MEM = NULL; -static UInitOnce gStaticInvUCAInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gStaticInvUCAInitOnce = U_INITONCE_INITIALIZER; U_CDECL_BEGIN static UBool U_CALLCONV diff --git a/icu4c/source/i18n/ucurr.cpp b/icu4c/source/i18n/ucurr.cpp index f019007f9f..d2b4b2fe70 100644 --- a/icu4c/source/i18n/ucurr.cpp +++ b/icu4c/source/i18n/ucurr.cpp @@ -113,11 +113,11 @@ static const UChar EUR_STR[] = {0x0045,0x0055,0x0052,0}; // ISO codes mapping table static const UHashtable* gIsoCodes = NULL; -static UInitOnce gIsoCodesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gIsoCodesInitOnce = U_INITONCE_INITIALIZER; // Currency symbol equivalances static const icu::Hashtable* gCurrSymbolsEquiv = NULL; -static UInitOnce gCurrSymbolsEquivInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCurrSymbolsEquivInitOnce = U_INITONCE_INITIALIZER; // EquivIterator iterates over all strings that are equivalent to a given // string, s. Note that EquivIterator will never yield s itself. diff --git a/icu4c/source/i18n/zonemeta.cpp b/icu4c/source/i18n/zonemeta.cpp index 3851ff1758..2d2e4c35dc 100644 --- a/icu4c/source/i18n/zonemeta.cpp +++ b/icu4c/source/i18n/zonemeta.cpp @@ -31,21 +31,21 @@ static UMutex gZoneMetaLock = U_MUTEX_INITIALIZER; // CLDR Canonical ID mapping table static UHashtable *gCanonicalIDCache = NULL; -static UInitOnce gCanonicalIDCacheInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCanonicalIDCacheInitOnce = U_INITONCE_INITIALIZER; // Metazone mapping table static UHashtable *gOlsonToMeta = NULL; -static UInitOnce gOlsonToMetaInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gOlsonToMetaInitOnce = U_INITONCE_INITIALIZER; // Available metazone IDs vector and table static icu::UVector *gMetaZoneIDs = NULL; static UHashtable *gMetaZoneIDTable = NULL; -static UInitOnce gMetaZoneIDsInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gMetaZoneIDsInitOnce = U_INITONCE_INITIALIZER; // Country info vectors static icu::UVector *gSingleZoneCountries = NULL; static icu::UVector *gMultiZonesCountries = NULL; -static UInitOnce gCountryInfoVectorsInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCountryInfoVectorsInitOnce = U_INITONCE_INITIALIZER; U_CDECL_BEGIN