diff --git a/icu4c/source/common/locavailable.cpp b/icu4c/source/common/locavailable.cpp index a04c20468c0..2bf19de07fb 100644 --- a/icu4c/source/common/locavailable.cpp +++ b/icu4c/source/common/locavailable.cpp @@ -33,7 +33,7 @@ U_NAMESPACE_BEGIN static icu::Locale* availableLocaleList = NULL; static int32_t availableLocaleListCount; -static UInitOnce gInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gInitOnce = U_INITONCE_INITIALIZER; U_NAMESPACE_END @@ -100,7 +100,7 @@ static const char _kIndexTag[] = "InstalledLocales"; static char** _installedLocales = NULL; static int32_t _installedLocalesCount = 0; -static UInitOnce _installedLocalesInitOnce; +static icu::UInitOnce _installedLocalesInitOnce; /* ### Get available **************************************************/ diff --git a/icu4c/source/common/normalizer2.cpp b/icu4c/source/common/normalizer2.cpp index 68936c0c7c7..ed82f2c07fc 100644 --- a/icu4c/source/common/normalizer2.cpp +++ b/icu4c/source/common/normalizer2.cpp @@ -458,10 +458,10 @@ static Norm2AllModes *nfkc_cfSingleton; static Normalizer2 *noopSingleton; static UHashtable *cache=NULL; -static UInitOnce nfcInitOnce = U_INITONCE_INITIALIZER; -static UInitOnce nfkcInitOnce = U_INITONCE_INITIALIZER; -static UInitOnce nfkc_cfInitOnce = U_INITONCE_INITIALIZER; -static UInitOnce noopInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce nfcInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce nfkcInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce nfkc_cfInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce noopInitOnce = U_INITONCE_INITIALIZER; // UInitOnce singleton initialization function static void U_CALLCONV initSingletons(const char *what, UErrorCode &errorCode) { diff --git a/icu4c/source/common/rbbi.cpp b/icu4c/source/common/rbbi.cpp index aa745c1c707..2f0d1ba99e5 100644 --- a/icu4c/source/common/rbbi.cpp +++ b/icu4c/source/common/rbbi.cpp @@ -1794,7 +1794,7 @@ U_NAMESPACE_END static icu::UStack *gLanguageBreakFactories = NULL; -static icu::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 e07ec6210e1..d34a1b48536 100644 --- a/icu4c/source/common/ucnv_bld.cpp +++ b/icu4c/source/common/ucnv_bld.cpp @@ -167,7 +167,7 @@ static UMutex cnvCacheMutex = U_MUTEX_INITIALIZER; /* Mutex for synchronizing c static const char **gAvailableConverters = NULL; static uint16_t gAvailableConverterCount = 0; -static UInitOnce gAvailableConvertersInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gAvailableConvertersInitOnce = U_INITONCE_INITIALIZER; #if !U_CHARSET_IS_UTF8 diff --git a/icu4c/source/common/ucnv_io.cpp b/icu4c/source/common/ucnv_io.cpp index 0ccb441698b..94812cfd51d 100644 --- a/icu4c/source/common/ucnv_io.cpp +++ b/icu4c/source/common/ucnv_io.cpp @@ -175,7 +175,7 @@ static const char DATA_NAME[] = "cnvalias"; static const char DATA_TYPE[] = "icu"; static UDataMemory *gAliasData=NULL; -static UInitOnce gAliasDataInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gAliasDataInitOnce = U_INITONCE_INITIALIZER; enum { tocLengthIndex=0, diff --git a/icu4c/source/common/udata.cpp b/icu4c/source/common/udata.cpp index 4971caf352f..f82b531c74d 100644 --- a/icu4c/source/common/udata.cpp +++ b/icu4c/source/common/udata.cpp @@ -107,7 +107,7 @@ static UDataMemory *gCommonICUDataArray[10] = { NULL }; static UBool gHaveTriedToLoadCommonData = FALSE; /* See extendICUData(). */ static UHashtable *gCommonDataCache = NULL; /* Global hash table of opened ICU data files. */ -static UInitOnce gCommonDataCacheInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCommonDataCacheInitOnce = U_INITONCE_INITIALIZER; static UDataFileAccess gDataFileAccess = UDATA_DEFAULT_ACCESS; diff --git a/icu4c/source/common/uinit.cpp b/icu4c/source/common/uinit.cpp index 9b745ab14d1..e97869b2db2 100644 --- a/icu4c/source/common/uinit.cpp +++ b/icu4c/source/common/uinit.cpp @@ -1,11 +1,9 @@ /* ****************************************************************************** -* * -* Copyright (C) 2001-2013, International Business Machines * -* Corporation and others. All Rights Reserved. * -* * +* Copyright (C) 2001-2013, International Business Machines +* Corporation and others. All Rights Reserved. ****************************************************************************** -* file name: uinit.c +* file name: uinit.cpp * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 diff --git a/icu4c/source/common/unames.cpp b/icu4c/source/common/unames.cpp index de74b4abaa2..6a3e81c561d 100644 --- a/icu4c/source/common/unames.cpp +++ b/icu4c/source/common/unames.cpp @@ -105,7 +105,7 @@ typedef struct { static UDataMemory *uCharNamesData=NULL; static UCharNames *uCharNames=NULL; -static UInitOnce gCharNamesInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCharNamesInitOnce = U_INITONCE_INITIALIZER; /* * Maximum length of character names (regular & 1.0). diff --git a/icu4c/source/common/uniset_props.cpp b/icu4c/source/common/uniset_props.cpp index 42468b57989..1296d089eaa 100644 --- a/icu4c/source/common/uniset_props.cpp +++ b/icu4c/source/common/uniset_props.cpp @@ -105,7 +105,7 @@ struct Inclusion { static Inclusion gInclusions[UPROPS_SRC_COUNT]; // cached getInclusions() static UnicodeSet *uni32Singleton; -static UInitOnce uni32InitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce uni32InitOnce = U_INITONCE_INITIALIZER; //---------------------------------------------------------------- // Inclusions list diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index 035799c56dd..8081646f5e8 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -44,7 +44,7 @@ TODO: This cache should probably be removed when the deprecated code is completely removed. */ static UHashtable *cache = NULL; -static UInitOnce gCacheInitOnce; +static icu::UInitOnce gCacheInitOnce; static UMutex resbMutex = U_MUTEX_INITIALIZER; diff --git a/icu4c/source/common/usprep.cpp b/icu4c/source/common/usprep.cpp index 722f6b25101..9e5d70c2668 100644 --- a/icu4c/source/common/usprep.cpp +++ b/icu4c/source/common/usprep.cpp @@ -42,7 +42,7 @@ U_CDECL_BEGIN Static cache for already opened StringPrep profiles */ static UHashtable *SHARED_DATA_HASHTABLE = NULL; -static UInitOnce gSharedDataInitOnce; +static icu::UInitOnce gSharedDataInitOnce; static UMutex usprepMutex = U_MUTEX_INITIALIZER; diff --git a/icu4c/source/i18n/buddhcal.cpp b/icu4c/source/i18n/buddhcal.cpp index a4fa7b66f1d..99f2bd4c21c 100644 --- a/icu4c/source/i18n/buddhcal.cpp +++ b/icu4c/source/i18n/buddhcal.cpp @@ -131,7 +131,7 @@ void BuddhistCalendar::timeToFields(UDate theTime, UBool quick, UErrorCode& stat */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gBCInitOnce; +static icu::UInitOnce gBCInitOnce; UBool BuddhistCalendar::haveDefaultCentury() const diff --git a/icu4c/source/i18n/chnsecal.cpp b/icu4c/source/i18n/chnsecal.cpp index 8ff04ac5213..893f9f6cacc 100644 --- a/icu4c/source/i18n/chnsecal.cpp +++ b/icu4c/source/i18n/chnsecal.cpp @@ -838,7 +838,7 @@ ChineseCalendar::inDaylightTime(UErrorCode& status) const static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInitOnce = U_INITONCE_INITIALIZER; UBool ChineseCalendar::haveDefaultCentury() const diff --git a/icu4c/source/i18n/coptccal.cpp b/icu4c/source/i18n/coptccal.cpp index 9b19e8adbf7..55195e9859a 100644 --- a/icu4c/source/i18n/coptccal.cpp +++ b/icu4c/source/i18n/coptccal.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 2003 - 2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 2003 - 2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* */ @@ -101,7 +101,7 @@ CopticCalendar::handleComputeFields(int32_t julianDay, UErrorCode &/*status*/) */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; static void U_CALLCONV initializeSystemDefaultCentury() { diff --git a/icu4c/source/i18n/decfmtst.cpp b/icu4c/source/i18n/decfmtst.cpp index 44872a7d659..d1ea6f4d4c4 100644 --- a/icu4c/source/i18n/decfmtst.cpp +++ b/icu4c/source/i18n/decfmtst.cpp @@ -184,7 +184,7 @@ void DecimalFormatStaticSets::cleanup() { // Be sure to clean up newly added fie } static DecimalFormatStaticSets *gStaticSets; -static UInitOnce gStaticSetsInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gStaticSetsInitOnce = U_INITONCE_INITIALIZER; //------------------------------------------------------------------------------ diff --git a/icu4c/source/i18n/ethpccal.cpp b/icu4c/source/i18n/ethpccal.cpp index dd386025c64..dc5bd691113 100644 --- a/icu4c/source/i18n/ethpccal.cpp +++ b/icu4c/source/i18n/ethpccal.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 2003 - 2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 2003 - 2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* */ @@ -141,7 +141,7 @@ EthiopicCalendar::handleGetLimit(UCalendarDateFields field, ELimitType limitType */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; static void U_CALLCONV initializeSystemDefaultCentury() { diff --git a/icu4c/source/i18n/gregocal.cpp b/icu4c/source/i18n/gregocal.cpp index 9e00b4266b9..1854ccc69e9 100644 --- a/icu4c/source/i18n/gregocal.cpp +++ b/icu4c/source/i18n/gregocal.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 1997-2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 1997-2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* * * File GREGOCAL.CPP @@ -1271,7 +1271,7 @@ GregorianCalendar::getType() const { */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; UBool GregorianCalendar::haveDefaultCentury() const diff --git a/icu4c/source/i18n/hebrwcal.cpp b/icu4c/source/i18n/hebrwcal.cpp index cdd76953830..aa16adf988b 100644 --- a/icu4c/source/i18n/hebrwcal.cpp +++ b/icu4c/source/i18n/hebrwcal.cpp @@ -675,7 +675,7 @@ HebrewCalendar::inDaylightTime(UErrorCode& status) const */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; UBool HebrewCalendar::haveDefaultCentury() const { diff --git a/icu4c/source/i18n/islamcal.cpp b/icu4c/source/i18n/islamcal.cpp index c610038c809..fec702799db 100644 --- a/icu4c/source/i18n/islamcal.cpp +++ b/icu4c/source/i18n/islamcal.cpp @@ -522,7 +522,7 @@ IslamicCalendar::inDaylightTime(UErrorCode& status) const */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; UBool IslamicCalendar::haveDefaultCentury() const diff --git a/icu4c/source/i18n/numfmt.cpp b/icu4c/source/i18n/numfmt.cpp index a89d16e9dc3..779b699d92f 100644 --- a/icu4c/source/i18n/numfmt.cpp +++ b/icu4c/source/i18n/numfmt.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 1997-2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 1997-2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* * * File NUMFMT.CPP diff --git a/icu4c/source/i18n/persncal.cpp b/icu4c/source/i18n/persncal.cpp index 60afeb4eb9e..bcc1411ea12 100644 --- a/icu4c/source/i18n/persncal.cpp +++ b/icu4c/source/i18n/persncal.cpp @@ -248,7 +248,7 @@ PersianCalendar::inDaylightTime(UErrorCode& status) const static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; UBool PersianCalendar::haveDefaultCentury() const { diff --git a/icu4c/source/i18n/taiwncal.cpp b/icu4c/source/i18n/taiwncal.cpp index 0b244fe3b36..5fa55d9ba77 100644 --- a/icu4c/source/i18n/taiwncal.cpp +++ b/icu4c/source/i18n/taiwncal.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* - * Copyright (C) 2003-2013, International Business Machines Corporation and * - * others. All Rights Reserved. * + * Copyright (C) 2003-2013, International Business Machines Corporation and + * others. All Rights Reserved. ******************************************************************************* * * File TAIWNCAL.CPP @@ -138,7 +138,7 @@ void TaiwanCalendar::timeToFields(UDate theTime, UBool quick, UErrorCode& status */ static UDate gSystemDefaultCenturyStart = DBL_MIN; static int32_t gSystemDefaultCenturyStartYear = -1; -static UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; +static icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER; UBool TaiwanCalendar::haveDefaultCentury() const { diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 5eb7da4d7e6..0e37d19b38b 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 1997-2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 1997-2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* * * File TIMEZONE.CPP diff --git a/icu4c/source/i18n/tzfmt.cpp b/icu4c/source/i18n/tzfmt.cpp index d4ac316481a..3b787627e33 100644 --- a/icu4c/source/i18n/tzfmt.cpp +++ b/icu4c/source/i18n/tzfmt.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 2011-2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 2011-2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* */ @@ -136,10 +136,10 @@ static const int32_t ALL_GENERIC_NAME_TYPES = UTZGNM_LOCATION | UTZGNM_LONG | UT // Time Zone ID/Short ID trie static TextTrieMap *gZoneIdTrie = NULL; -static UInitOnce gZoneIdTrieInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gZoneIdTrieInitOnce = U_INITONCE_INITIALIZER; static TextTrieMap *gShortZoneIdTrie = NULL; -static UInitOnce gShortZoneIdTrieInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gShortZoneIdTrieInitOnce = U_INITONCE_INITIALIZER; static UMutex gLock = U_MUTEX_INITIALIZER; diff --git a/icu4c/source/i18n/ucol_bld.cpp b/icu4c/source/i18n/ucol_bld.cpp index 8a2bf1c36b9..822ef8c6434 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 icu::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/ucol_res.cpp b/icu4c/source/i18n/ucol_res.cpp index 853de6e08aa..9136edaa378 100644 --- a/icu4c/source/i18n/ucol_res.cpp +++ b/icu4c/source/i18n/ucol_res.cpp @@ -55,7 +55,7 @@ static void ucol_setReorderCodesFromParser(UCollator *coll, UColTokenParser *par // static UCA. There is only one. Collators don't use it. // It is referenced only in ucol_initUCA and ucol_cleanup static UCollator* _staticUCA = NULL; -static UInitOnce gStaticUCAInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gStaticUCAInitOnce = U_INITONCE_INITIALIZER; // static pointer to udata memory. Inited in ucol_initUCA // used for cleanup in ucol_cleanup static UDataMemory* UCA_DATA_MEM = NULL; diff --git a/icu4c/source/i18n/zonemeta.cpp b/icu4c/source/i18n/zonemeta.cpp index 2d2e4c35dce..1d34af5a9b7 100644 --- a/icu4c/source/i18n/zonemeta.cpp +++ b/icu4c/source/i18n/zonemeta.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* -* Copyright (C) 2007-2013, International Business Machines Corporation and * -* others. All Rights Reserved. * +* Copyright (C) 2007-2013, International Business Machines Corporation and +* others. All Rights Reserved. ******************************************************************************* */ @@ -31,16 +31,16 @@ static UMutex gZoneMetaLock = U_MUTEX_INITIALIZER; // CLDR Canonical ID mapping table static UHashtable *gCanonicalIDCache = NULL; -static icu::UInitOnce gCanonicalIDCacheInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gCanonicalIDCacheInitOnce = U_INITONCE_INITIALIZER; // Metazone mapping table static UHashtable *gOlsonToMeta = NULL; -static icu::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 icu::UInitOnce gMetaZoneIDsInitOnce = U_INITONCE_INITIALIZER; +static icu::UInitOnce gMetaZoneIDsInitOnce = U_INITONCE_INITIALIZER; // Country info vectors static icu::UVector *gSingleZoneCountries = NULL;