diff options
Diffstat (limited to 'thirdparty/icu4c/common/uloc.cpp')
-rw-r--r-- | thirdparty/icu4c/common/uloc.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/thirdparty/icu4c/common/uloc.cpp b/thirdparty/icu4c/common/uloc.cpp index 99c6a0af39..1da2abc361 100644 --- a/thirdparty/icu4c/common/uloc.cpp +++ b/thirdparty/icu4c/common/uloc.cpp @@ -102,7 +102,7 @@ static const char * const LANGUAGES[] = { "asa", "ase", "ast", "av", "avk", "awa", "ay", "az", "ba", "bal", "ban", "bar", "bas", "bax", "bbc", "bbj", "be", "bej", "bem", "bew", "bez", "bfd", "bfq", "bg", - "bgn", "bho", "bi", "bik", "bin", "bjn", "bkm", "bla", + "bgc", "bgn", "bho", "bi", "bik", "bin", "bjn", "bkm", "bla", "bm", "bn", "bo", "bpy", "bqi", "br", "bra", "brh", "brx", "bs", "bss", "bua", "bug", "bum", "byn", "byv", "ca", "cad", "car", "cay", "cch", "ccp", "ce", "ceb", "cgg", @@ -219,7 +219,7 @@ static const char * const LANGUAGES_3[] = { "asa", "ase", "ast", "ava", "avk", "awa", "aym", "aze", "bak", "bal", "ban", "bar", "bas", "bax", "bbc", "bbj", "bel", "bej", "bem", "bew", "bez", "bfd", "bfq", "bul", - "bgn", "bho", "bis", "bik", "bin", "bjn", "bkm", "bla", + "bgc", "bgn", "bho", "bis", "bik", "bin", "bjn", "bkm", "bla", "bam", "ben", "bod", "bpy", "bqi", "bre", "bra", "brh", "brx", "bos", "bss", "bua", "bug", "bum", "byn", "byv", "cat", "cad", "car", "cay", "cch", "ccp", "che", "ceb", "cgg", @@ -502,20 +502,20 @@ static int32_t getShortestSubtagLength(const char *localeID) { int32_t length = localeIDLength; int32_t tmpLength = 0; int32_t i; - UBool reset = TRUE; + UBool reset = true; for (i = 0; i < localeIDLength; i++) { if (localeID[i] != '_' && localeID[i] != '-') { if (reset) { tmpLength = 0; - reset = FALSE; + reset = false; } tmpLength++; } else { if (tmpLength != 0 && tmpLength < length) { length = tmpLength; } - reset = TRUE; + reset = true; } } @@ -620,7 +620,7 @@ ulocimp_getKeywords(const char *localeID, if(prev == '@') { /* start of keyword definition */ /* we will grab pairs, trim spaces, lowercase keywords, sort and return */ do { - UBool duplicate = FALSE; + UBool duplicate = false; /* skip leading spaces */ while(*pos == ' ') { pos++; @@ -693,7 +693,7 @@ ulocimp_getKeywords(const char *localeID, /* If this is a duplicate keyword, then ignore it */ for (j=0; j<numKeywords; ++j) { if (uprv_strcmp(keywordList[j].keyword, keywordList[numKeywords].keyword) == 0) { - duplicate = TRUE; + duplicate = true; break; } } @@ -704,7 +704,7 @@ ulocimp_getKeywords(const char *localeID, /* now we have a list of keywords */ /* we need to sort it */ - uprv_sortArray(keywordList, numKeywords, sizeof(KeywordStruct), compareKeywordStructs, NULL, FALSE, status); + uprv_sortArray(keywordList, numKeywords, sizeof(KeywordStruct), compareKeywordStructs, NULL, false, status); /* Now construct the keyword part */ for(i = 0; i < numKeywords; i++) { @@ -881,7 +881,7 @@ uloc_setKeywordValue(const char* keywordName, char* startSearchHere = NULL; char* keywordStart = NULL; CharString updatedKeysAndValues; - UBool handledInputKeyAndValue = FALSE; + UBool handledInputKeyAndValue = false; char keyValuePrefix = '@'; if(U_FAILURE(*status)) { @@ -1020,7 +1020,7 @@ uloc_setKeywordValue(const char* keywordName, updatedKeysAndValues.append('=', *status); updatedKeysAndValues.append(keywordValueBuffer, keywordValueLen, *status); } /* else removing this entry, don't emit anything */ - handledInputKeyAndValue = TRUE; + handledInputKeyAndValue = true; } else { /* input keyword sorts earlier than current entry, add before current entry */ if (rc < 0 && keywordValueLen > 0 && !handledInputKeyAndValue) { @@ -1030,7 +1030,7 @@ uloc_setKeywordValue(const char* keywordName, updatedKeysAndValues.append(keywordNameBuffer, keywordNameLen, *status); updatedKeysAndValues.append('=', *status); updatedKeysAndValues.append(keywordValueBuffer, keywordValueLen, *status); - handledInputKeyAndValue = TRUE; + handledInputKeyAndValue = true; } /* copy the current entry */ updatedKeysAndValues.append(keyValuePrefix, *status); @@ -1046,7 +1046,7 @@ uloc_setKeywordValue(const char* keywordName, updatedKeysAndValues.append(keywordNameBuffer, keywordNameLen, *status); updatedKeysAndValues.append('=', *status); updatedKeysAndValues.append(keywordValueBuffer, keywordValueLen, *status); - handledInputKeyAndValue = TRUE; + handledInputKeyAndValue = true; } keywordStart = nextSeparator; } /* end loop searching */ @@ -1089,7 +1089,7 @@ uloc_setKeywordValue(const char* keywordName, #define _isPrefixLetter(a) ((a=='x')||(a=='X')||(a=='i')||(a=='I')) -/*returns TRUE if one of the special prefixes is here (s=string) +/*returns true if one of the special prefixes is here (s=string) 'x-' or 'i-' */ #define _isIDPrefix(s) (_isPrefixLetter(s[0])&&_isIDSeparator(s[1])) @@ -1270,7 +1270,7 @@ _getVariant(const char *localeID, char prev, ByteSink& sink, UBool needSeparator) { - UBool hasVariant = FALSE; + UBool hasVariant = false; /* get one or more variant tags and separate them with '_' */ if(_isIDSeparator(prev)) { @@ -1278,12 +1278,12 @@ _getVariant(const char *localeID, while(!_isTerminator(*localeID)) { if (needSeparator) { sink.Append("_", 1); - needSeparator = FALSE; + needSeparator = false; } char c = (char)uprv_toupper(*localeID); if (c == '-') c = '_'; sink.Append(&c, 1); - hasVariant = TRUE; + hasVariant = true; localeID++; } } @@ -1300,7 +1300,7 @@ _getVariant(const char *localeID, while(!_isTerminator(*localeID)) { if (needSeparator) { sink.Append("_", 1); - needSeparator = FALSE; + needSeparator = false; } char c = (char)uprv_toupper(*localeID); if (c == '-' || c == ',') c = '_'; @@ -1453,7 +1453,7 @@ uloc_openKeywords(const char* localeID, if((tmpLocaleID = locale_getKeywordsStart(tmpLocaleID)) != NULL) { CharString keywords; CharStringByteSink sink(&keywords); - ulocimp_getKeywords(tmpLocaleID+1, '@', sink, FALSE, status); + ulocimp_getKeywords(tmpLocaleID+1, '@', sink, false, status); if (U_FAILURE(*status)) { return NULL; } @@ -1573,7 +1573,7 @@ _canonicalize(const char* localeID, variantSize = -tag.length(); { CharStringByteSink s(&tag); - _getVariant(tmpLocaleID+1, *tmpLocaleID, s, FALSE); + _getVariant(tmpLocaleID+1, *tmpLocaleID, s, false); } variantSize += tag.length(); if (variantSize > 0) { @@ -1585,13 +1585,13 @@ _canonicalize(const char* localeID, /* Copy POSIX-style charset specifier, if any [mr.utf8] */ if (!OPTION_SET(options, _ULOC_CANONICALIZE) && *tmpLocaleID == '.') { - UBool done = FALSE; + UBool done = false; do { char c = *tmpLocaleID; switch (c) { case 0: case '@': - done = TRUE; + done = true; break; default: tag.append(c, *err); @@ -1664,7 +1664,7 @@ _canonicalize(const char* localeID, (!separatorIndicator || separatorIndicator > keywordAssign)) { sink.Append("@", 1); ++fieldCount; - ulocimp_getKeywords(tmpLocaleID+1, '@', sink, TRUE, err); + ulocimp_getKeywords(tmpLocaleID+1, '@', sink, true, err); } } } @@ -1847,7 +1847,7 @@ uloc_getVariant(const char* localeID, } CheckedArrayByteSink sink(variant, variantCapacity); - _getVariant(tmpLocaleID+1, *tmpLocaleID, sink, FALSE); + _getVariant(tmpLocaleID+1, *tmpLocaleID, sink, false); i = sink.NumberOfBytesAppended(); @@ -2158,11 +2158,11 @@ isWellFormedLegacyKey(const char* legacyKey) const char* p = legacyKey; while (*p) { if (!UPRV_ISALPHANUM(*p)) { - return FALSE; + return false; } p++; } - return TRUE; + return true; } static UBool @@ -2173,13 +2173,13 @@ isWellFormedLegacyType(const char* legacyType) while (*p) { if (*p == '_' || *p == '/' || *p == '-') { if (alphaNumLen == 0) { - return FALSE; + return false; } alphaNumLen = 0; } else if (UPRV_ISALPHANUM(*p)) { alphaNumLen++; } else { - return FALSE; + return false; } p++; } |