summaryrefslogtreecommitdiff
path: root/thirdparty/icu4c/i18n/uspoof_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/icu4c/i18n/uspoof_impl.cpp')
-rw-r--r--thirdparty/icu4c/i18n/uspoof_impl.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/thirdparty/icu4c/i18n/uspoof_impl.cpp b/thirdparty/icu4c/i18n/uspoof_impl.cpp
index b283d81321..e50344c469 100644
--- a/thirdparty/icu4c/i18n/uspoof_impl.cpp
+++ b/thirdparty/icu4c/i18n/uspoof_impl.cpp
@@ -320,10 +320,10 @@ URestrictionLevel SpoofImpl::getRestrictionLevel(const UnicodeString& input, UEr
// Section 5.2 step 2
// Java use a static UnicodeSet for this test. In C++, avoid the static variable
// and just do a simple for loop.
- UBool allASCII = TRUE;
+ UBool allASCII = true;
for (int32_t i=0, length=input.length(); i<length; i++) {
if (input.charAt(i) > 0x7f) {
- allASCII = FALSE;
+ allASCII = false;
break;
}
}
@@ -495,9 +495,9 @@ UBool SpoofData::validateDataVersion(UErrorCode &status) const {
fRawData->fFormatVersion[2] != 0 ||
fRawData->fFormatVersion[3] != 0) {
status = U_INVALID_FORMAT_ERROR;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
static UBool U_CALLCONV
@@ -518,9 +518,9 @@ spoofDataIsAcceptable(void *context,
if(version != NULL) {
uprv_memcpy(version, pInfo->dataVersion, 4);
}
- return TRUE;
+ return true;
} else {
- return FALSE;
+ return false;
}
}
@@ -538,7 +538,7 @@ spoofDataIsAcceptable(void *context,
// uspoof_cleanupDefaultData - Called during cleanup.
//
-static UInitOnce gSpoofInitDefaultOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gSpoofInitDefaultOnce {};
static SpoofData* gDefaultSpoofData;
static UBool U_CALLCONV
@@ -549,7 +549,7 @@ uspoof_cleanupDefaultData(void) {
gDefaultSpoofData = nullptr;
gSpoofInitDefaultOnce.reset();
}
- return TRUE;
+ return true;
}
static void U_CALLCONV uspoof_loadDefaultData(UErrorCode& status) {
@@ -655,7 +655,7 @@ SpoofData::SpoofData(UErrorCode &status) {
// Called by constructors to put things in a known initial state.
void SpoofData::reset() {
fRawData = NULL;
- fDataOwned = FALSE;
+ fDataOwned = false;
fUDM = NULL;
fMemLimit = 0;
fRefCount = 1;
@@ -945,7 +945,7 @@ uspoof_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *ou
uint32_t magic = ds->readUInt32(spoofDH->fMagic);
ds->writeUInt32((uint32_t *)&outputDH->fMagic, magic);
- if (outputDH->fFormatVersion != spoofDH->fFormatVersion) {
+ if (inBytes != outBytes) {
uprv_memcpy(outputDH->fFormatVersion, spoofDH->fFormatVersion, sizeof(spoofDH->fFormatVersion));
}
// swap starting at fLength