mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-20220 ICU4C: Use anonymous namespace instead of 'static' keyword in uspoof.cpp
This commit is contained in:
parent
108ea4af94
commit
ebd15cf8bd
1 changed files with 11 additions and 3 deletions
|
@ -43,7 +43,9 @@ static UnicodeSet *gRecommendedSet = NULL;
|
|||
static const Normalizer2 *gNfdNormalizer = NULL;
|
||||
static UInitOnce gSpoofInitStaticsOnce = U_INITONCE_INITIALIZER;
|
||||
|
||||
static UBool U_CALLCONV
|
||||
namespace {
|
||||
|
||||
UBool U_CALLCONV
|
||||
uspoof_cleanup(void) {
|
||||
delete gInclusionSet;
|
||||
gInclusionSet = NULL;
|
||||
|
@ -54,7 +56,7 @@ uspoof_cleanup(void) {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void U_CALLCONV initializeStatics(UErrorCode &status) {
|
||||
void U_CALLCONV initializeStatics(UErrorCode &status) {
|
||||
static const char16_t *inclusionPat =
|
||||
u"['\\-.\\:\\u00B7\\u0375\\u058A\\u05F3\\u05F4\\u06FD\\u06FE\\u0F0B\\u200C"
|
||||
u"\\u200D\\u2010\\u2019\\u2027\\u30A0\\u30FB]";
|
||||
|
@ -149,6 +151,8 @@ static void U_CALLCONV initializeStatics(UErrorCode &status) {
|
|||
ucln_i18n_registerCleanup(UCLN_I18N_SPOOF, uspoof_cleanup);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
U_CFUNC void uspoof_internalInitStatics(UErrorCode *status) {
|
||||
umtx_initOnce(gSpoofInitStaticsOnce, &initializeStatics, *status);
|
||||
}
|
||||
|
@ -546,7 +550,9 @@ uspoof_checkUnicodeString(const USpoofChecker *sc,
|
|||
return uspoof_check2UnicodeString(sc, id, NULL, status);
|
||||
}
|
||||
|
||||
static int32_t checkImpl(const SpoofImpl* This, const UnicodeString& id, CheckResult* checkResult, UErrorCode* status) {
|
||||
namespace {
|
||||
|
||||
int32_t checkImpl(const SpoofImpl* This, const UnicodeString& id, CheckResult* checkResult, UErrorCode* status) {
|
||||
U_ASSERT(This != NULL);
|
||||
U_ASSERT(checkResult != NULL);
|
||||
checkResult->clear();
|
||||
|
@ -638,6 +644,8 @@ static int32_t checkImpl(const SpoofImpl* This, const UnicodeString& id, CheckRe
|
|||
return checkResult->toCombinedBitmask(This->fChecks);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uspoof_check2UnicodeString(const USpoofChecker *sc,
|
||||
const icu::UnicodeString &id,
|
||||
|
|
Loading…
Add table
Reference in a new issue