mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-21148 Consistently use standard lowercase true/false everywhere.
This is the normal standard way in C, C++ as well as Java and there's no longer any reason for ICU to be different. The various internal macros providing custom boolean constants can all be deleted and code as well as documentation can be updated to use lowercase true/false everywhere.
This commit is contained in:
parent
00003dcbf2
commit
030fa1a479
679 changed files with 11113 additions and 11044 deletions
|
@ -350,10 +350,10 @@ UBool isWholeWord(BreakIterator& wordBrk,
|
|||
int32_t start,
|
||||
int32_t end) {
|
||||
if (s.isEmpty())
|
||||
return FALSE;
|
||||
return false;
|
||||
wordBrk.setText(s);
|
||||
if (!wordBrk.isBoundary(start))
|
||||
return FALSE;
|
||||
return false;
|
||||
return wordBrk.isBoundary(end);
|
||||
}
|
||||
```
|
||||
|
@ -367,10 +367,10 @@ UBool isWholeWord(UBreakIterator* wordBrk,
|
|||
int32_t start,
|
||||
int32_t end,
|
||||
UErrorCode* err) {
|
||||
UBool result = FALSE;
|
||||
UBool result = false;
|
||||
if (wordBrk == NULL || s == NULL) {
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
ubrk_setText(wordBrk, s, sLen, err);
|
||||
if (U_SUCCESS(*err)) {
|
||||
|
|
|
@ -53,7 +53,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
|||
UCollator *myCollator = 0;
|
||||
if (U_FAILURE(*status))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
u_uastrcpy(source, "This is a test.");
|
||||
u_uastrcpy(target, "THIS IS A TEST.");
|
||||
|
@ -63,7 +63,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
|||
/*Report the error with display name... */
|
||||
fprintf(stderr,
|
||||
"Failed to create the collator for : \"%s\"\n", dispName);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
result = ucol_strcoll(myCollator, source, u_strlen(source), target, u_strlen(target));
|
||||
/* result is 1, secondary differences only for ignorable space characters*/
|
||||
|
@ -71,7 +71,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with only secondary differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* To compare them with just primary differences */
|
||||
ucol_setStrength(myCollator, UCOL_PRIMARY);
|
||||
|
@ -81,7 +81,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with no differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Now, do the same comparison with keys */
|
||||
|
@ -93,10 +93,10 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with sort keys in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
ucol_close(myCollator);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -122,7 +122,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
|||
Collator *myCollator = 0;
|
||||
if (U_FAILURE(status))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
myCollator = Collator::createInstance(locale, status);
|
||||
if (U_FAILURE(status)){
|
||||
|
@ -130,7 +130,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
|||
/*Report the error with display name... */
|
||||
fprintf(stderr,
|
||||
"%s: Failed to create the collator for : \"%s\"\n", dispName);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
result = myCollator->compare(source, target);
|
||||
/* result is 1, secondary differences only for ignorable space characters*/
|
||||
|
@ -138,7 +138,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with only secondary differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* To compare them with just primary differences */
|
||||
myCollator->setStrength(Collator::PRIMARY);
|
||||
|
@ -148,7 +148,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"Comparing two strings with no differences in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* Now, do the same comparison with keys */
|
||||
myCollator->getCollationKey(source, sourceKey, status);
|
||||
|
@ -160,10 +160,10 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"%s: Comparing two strings with sort keys in C failed.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
delete myCollator;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -175,7 +175,7 @@ int main()
|
|||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
fprintf(stdout, "\n");
|
||||
if (collateWithLocaleInCPP(Locale("en", "US"), status) != TRUE)
|
||||
if (collateWithLocaleInCPP(Locale("en", "US"), status) != true)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Collate with locale in C++ failed.\n");
|
||||
|
@ -185,7 +185,7 @@ int main()
|
|||
}
|
||||
status = U_ZERO_ERROR;
|
||||
fprintf(stdout, "\n");
|
||||
if (collateWithLocaleInC("en_US", &status) != TRUE)
|
||||
if (collateWithLocaleInC("en_US", &status) != true)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: Collate with locale in C failed.\n");
|
||||
|
|
|
@ -350,7 +350,7 @@ UConverter* newCnv = ucnv_safeClone(oldCnv, 0, &bufferSize, &err)
|
|||
|
||||
3. In conversions to Unicode from Multi-byte encodings or conversions from
|
||||
Unicode involving surrogates, if (a) only a partial byte sequence is
|
||||
retrieved from the source buffer, (b) the "flush" parameter is set to "TRUE"
|
||||
retrieved from the source buffer, (b) the "flush" parameter is set to "true"
|
||||
and (c) the end of source is reached, then the callback is called with
|
||||
`U_TRUNCATED_CHAR_FOUND`.
|
||||
|
||||
|
@ -368,7 +368,7 @@ calling:
|
|||
direction.
|
||||
|
||||
The converters are reset implicitly when the conversion functions are called
|
||||
with the "flush" parameter set to "TRUE" and the source is consumed.
|
||||
with the "flush" parameter set to "true" and the source is consumed.
|
||||
|
||||
### Error
|
||||
|
||||
|
@ -774,12 +774,12 @@ can be used.
|
|||
In such a scenario, the inner write does not occur unless a buffer overflow
|
||||
occurs OR 'flush' is true. So, the 'write' and resetting of the target and
|
||||
targetLimit pointers would only happen
|
||||
`if (err == U_BUFFER_OVERFLOW_ERROR || flush == TRUE)`
|
||||
`if (err == U_BUFFER_OVERFLOW_ERROR || flush == true)`
|
||||
|
||||
The flush parameter on each conversion call should be set to FALSE, until the
|
||||
The flush parameter on each conversion call should be set to false, until the
|
||||
conversion call is called for the last time for the buffer. This is because the
|
||||
conversion is stateful. On the last conversion call, the flush parameter should
|
||||
be set to TRUE. More details are mentioned in the API reference in
|
||||
be set to true. More details are mentioned in the API reference in
|
||||
[ucnv.h](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucnv_8h.html) .
|
||||
|
||||
### 4. Pre-flighting
|
||||
|
|
|
@ -256,7 +256,7 @@ static char buffer[BUFFER_SIZE] = {....};
|
|||
int32_t inputLength = ... // length of the input text
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ucsdet_setText(csd, buffer, inputLength, &status);
|
||||
ucsdet_enableInputFilter(csd, TRUE);
|
||||
ucsdet_enableInputFilter(csd, true);
|
||||
ucm = ucsdet_detect(csd, &status);
|
||||
```
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ Unicode.
|
|||
references](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucnv_8h.html) .
|
||||
|
||||
7. For data exchange (rather than pure display), turn off fallback
|
||||
mappings: `ucnv_setFallback(cnv, FALSE)`;
|
||||
mappings: `ucnv_setFallback(cnv, false)`;
|
||||
|
||||
8. For some text formats, especially XML and HTML, it is possible to set an
|
||||
"escape callback" function that turns unmappable Unicode code points
|
||||
|
|
|
@ -460,6 +460,7 @@ Starting with ICU 68 (2020q4), we no longer define these in public header files
|
|||
(unless `U_DEFINE_FALSE_AND_TRUE`=1),
|
||||
in order to avoid name collisions with code outside ICU defining enum constants and similar
|
||||
with these names.
|
||||
Starting with ICU 72 (2022q4), we no longer use these anywhere in ICU.
|
||||
|
||||
Instead, the versions of the C and C++ standards we require now do define type `bool`
|
||||
and values `false` & `true`, and we and our users can use these values.
|
||||
|
|
|
@ -203,8 +203,8 @@ static std::condition_variable initCondition;
|
|||
// function on this thread, or wait for some other thread to complete the initialization.
|
||||
//
|
||||
// The actual call to the init function is made inline by template code
|
||||
// that knows the C++ types involved. This function returns TRUE if
|
||||
// the inline code needs to invoke the Init function, or FALSE if the initialization
|
||||
// that knows the C++ types involved. This function returns true if
|
||||
// the inline code needs to invoke the Init function, or false if the initialization
|
||||
// has completed on another thread.
|
||||
//
|
||||
// UInitOnce::fState values:
|
||||
|
@ -217,7 +217,7 @@ UBool umtx_initImplPreInit(UInitOnce &uio) {
|
|||
int32_t state = uio.fState;
|
||||
if (state == 0) {
|
||||
umtx_storeRelease(uio.fState, 1);
|
||||
return TRUE; // Caller will next call the init function.
|
||||
return true; // Caller will next call the init function.
|
||||
} else {
|
||||
while (uio.fState == 1) {
|
||||
// Another thread is currently running the initialization.
|
||||
|
@ -225,7 +225,7 @@ UBool umtx_initImplPreInit(UInitOnce &uio) {
|
|||
initCondition.wait(initLock);
|
||||
}
|
||||
U_ASSERT(uio.fState == 2);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -445,7 +445,7 @@ when it is constructed from a NULL `UChar *` pointer, then the UnicodeString
|
|||
object becomes "bogus". This can be tested with the isBogus() function. A
|
||||
UnicodeString can be put into the "bogus" state explicitly with the setToBogus()
|
||||
function. This is different from an empty string (although a "bogus" string also
|
||||
returns TRUE from isEmpty()) and may be used equivalently to NULL in `UChar *` C
|
||||
returns true from isEmpty()) and may be used equivalently to NULL in `UChar *` C
|
||||
APIs (or null references in Java, or NULL values in SQL). A string remains
|
||||
"bogus" until a non-bogus string value is assigned to it. For complete details
|
||||
of the behavior of "bogus" strings see the description of the setToBogus()
|
||||
|
|
|
@ -229,7 +229,7 @@ public:
|
|||
// unnormalized suffix as a read-only alias (does not copy characters)
|
||||
UnicodeString unnormalized=s.tempSubString(spanQCYes);
|
||||
// set the fcdString to the FCD prefix as a read-only alias
|
||||
fcdString.setTo(FALSE, s.getBuffer(), spanQCYes);
|
||||
fcdString.setTo(false, s.getBuffer(), spanQCYes);
|
||||
// automatic copy-on-write, and append the FCD'ed suffix
|
||||
fcd.normalizeSecondAndAppend(fcdString, unnormalized, errorCode);
|
||||
ps=&fcdString;
|
||||
|
|
|
@ -37,23 +37,23 @@ Appendable::appendString(const UChar *s, int32_t length) {
|
|||
UChar c;
|
||||
while((c=*s++)!=0) {
|
||||
if(!appendCodeUnit(c)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if(length>0) {
|
||||
const UChar *limit=s+length;
|
||||
do {
|
||||
if(!appendCodeUnit(*s++)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} while(s<limit);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool
|
||||
Appendable::reserveAppendCapacity(int32_t /*appendCapacity*/) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UChar *
|
||||
|
|
|
@ -309,9 +309,9 @@ BMPSet::contains(UChar32 c) const {
|
|||
// surrogate or supplementary code point
|
||||
return containsSlow(c, list4kStarts[0xd], list4kStarts[0x11]);
|
||||
} else {
|
||||
// Out-of-range code points get FALSE, consistent with long-standing
|
||||
// Out-of-range code points get false, consistent with long-standing
|
||||
// behavior of UnicodeSet::contains(c).
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -261,10 +261,10 @@ ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
|
|||
const UChar *extStart = u_memrchr(dictfname, 0x002e, dictnlength); // last dot
|
||||
if (extStart != NULL) {
|
||||
int32_t len = (int32_t)(extStart - dictfname);
|
||||
ext.appendInvariantChars(UnicodeString(FALSE, extStart + 1, dictnlength - len - 1), status);
|
||||
ext.appendInvariantChars(UnicodeString(false, extStart + 1, dictnlength - len - 1), status);
|
||||
dictnlength = len;
|
||||
}
|
||||
dictnbuf.appendInvariantChars(UnicodeString(FALSE, dictfname, dictnlength), status);
|
||||
dictnbuf.appendInvariantChars(UnicodeString(false, dictfname, dictnlength), status);
|
||||
ures_close(b);
|
||||
|
||||
UDataMemory *file = udata_open(U_ICUDATA_BRKITR, ext.data(), dictnbuf.data(), &status);
|
||||
|
|
|
@ -296,7 +296,7 @@ static UBool U_CALLCONV breakiterator_cleanup(void) {
|
|||
}
|
||||
gInitOnceBrkiter.reset();
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
U_CDECL_END
|
||||
U_NAMESPACE_BEGIN
|
||||
|
@ -347,7 +347,7 @@ BreakIterator::unregister(URegistryKey key, UErrorCode& status)
|
|||
}
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
|
|
|
@ -20,7 +20,7 @@ U_NAMESPACE_BEGIN
|
|||
UBool
|
||||
ByteSinkUtil::appendChange(int32_t length, const char16_t *s16, int32_t s16Length,
|
||||
ByteSink &sink, Edits *edits, UErrorCode &errorCode) {
|
||||
if (U_FAILURE(errorCode)) { return FALSE; }
|
||||
if (U_FAILURE(errorCode)) { return false; }
|
||||
char scratch[200];
|
||||
int32_t s8Length = 0;
|
||||
for (int32_t i = 0; i < s16Length;) {
|
||||
|
@ -44,7 +44,7 @@ ByteSinkUtil::appendChange(int32_t length, const char16_t *s16, int32_t s16Lengt
|
|||
}
|
||||
if (j > (INT32_MAX - s8Length)) {
|
||||
errorCode = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
sink.Append(buffer, j);
|
||||
s8Length += j;
|
||||
|
@ -52,17 +52,17 @@ ByteSinkUtil::appendChange(int32_t length, const char16_t *s16, int32_t s16Lengt
|
|||
if (edits != nullptr) {
|
||||
edits->addReplace(length, s8Length);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool
|
||||
ByteSinkUtil::appendChange(const uint8_t *s, const uint8_t *limit,
|
||||
const char16_t *s16, int32_t s16Length,
|
||||
ByteSink &sink, Edits *edits, UErrorCode &errorCode) {
|
||||
if (U_FAILURE(errorCode)) { return FALSE; }
|
||||
if (U_FAILURE(errorCode)) { return false; }
|
||||
if ((limit - s) > INT32_MAX) {
|
||||
errorCode = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return appendChange((int32_t)(limit - s), s16, s16Length, sink, edits, errorCode);
|
||||
}
|
||||
|
@ -109,16 +109,16 @@ UBool
|
|||
ByteSinkUtil::appendUnchanged(const uint8_t *s, const uint8_t *limit,
|
||||
ByteSink &sink, uint32_t options, Edits *edits,
|
||||
UErrorCode &errorCode) {
|
||||
if (U_FAILURE(errorCode)) { return FALSE; }
|
||||
if (U_FAILURE(errorCode)) { return false; }
|
||||
if ((limit - s) > INT32_MAX) {
|
||||
errorCode = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
int32_t length = (int32_t)(limit - s);
|
||||
if (length > 0) {
|
||||
appendNonEmptyUnchanged(s, length, sink, options, edits);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
CharStringByteSink::CharStringByteSink(CharString* dest) : dest_(*dest) {
|
||||
|
|
|
@ -30,14 +30,14 @@ void ByteSink::Flush() {}
|
|||
|
||||
CheckedArrayByteSink::CheckedArrayByteSink(char* outbuf, int32_t capacity)
|
||||
: outbuf_(outbuf), capacity_(capacity < 0 ? 0 : capacity),
|
||||
size_(0), appended_(0), overflowed_(FALSE) {
|
||||
size_(0), appended_(0), overflowed_(false) {
|
||||
}
|
||||
|
||||
CheckedArrayByteSink::~CheckedArrayByteSink() {}
|
||||
|
||||
CheckedArrayByteSink& CheckedArrayByteSink::Reset() {
|
||||
size_ = appended_ = 0;
|
||||
overflowed_ = FALSE;
|
||||
overflowed_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -48,14 +48,14 @@ void CheckedArrayByteSink::Append(const char* bytes, int32_t n) {
|
|||
if (n > (INT32_MAX - appended_)) {
|
||||
// TODO: Report as integer overflow, not merely buffer overflow.
|
||||
appended_ = INT32_MAX;
|
||||
overflowed_ = TRUE;
|
||||
overflowed_ = true;
|
||||
return;
|
||||
}
|
||||
appended_ += n;
|
||||
int32_t available = capacity_ - size_;
|
||||
if (n > available) {
|
||||
n = available;
|
||||
overflowed_ = TRUE;
|
||||
overflowed_ = true;
|
||||
}
|
||||
if (n > 0 && bytes != (outbuf_ + size_)) {
|
||||
uprv_memcpy(outbuf_ + size_, bytes, n);
|
||||
|
|
|
@ -337,13 +337,13 @@ BytesTrie::findUniqueValueFromBranch(const uint8_t *pos, int32_t length,
|
|||
}
|
||||
} else {
|
||||
uniqueValue=value;
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
}
|
||||
} else {
|
||||
if(!findUniqueValue(pos+value, haveUniqueValue, uniqueValue)) {
|
||||
return NULL;
|
||||
}
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
}
|
||||
} while(--length>1);
|
||||
return pos+1; // ignore the last comparison byte
|
||||
|
@ -359,9 +359,9 @@ BytesTrie::findUniqueValue(const uint8_t *pos, UBool haveUniqueValue, int32_t &u
|
|||
}
|
||||
pos=findUniqueValueFromBranch(pos, node+1, haveUniqueValue, uniqueValue);
|
||||
if(pos==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
} else if(node<kMinValueLead) {
|
||||
// linear-match node
|
||||
pos+=node-kMinLinearMatch+1; // Ignore the match bytes.
|
||||
|
@ -370,14 +370,14 @@ BytesTrie::findUniqueValue(const uint8_t *pos, UBool haveUniqueValue, int32_t &u
|
|||
int32_t value=readValue(pos, node>>1);
|
||||
if(haveUniqueValue) {
|
||||
if(value!=uniqueValue) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
uniqueValue=value;
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
}
|
||||
if(isFinal) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
pos=skipValue(pos, node);
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ BytesTrieBuilder::buildBytes(UStringTrieBuildOption buildOption, UErrorCode &err
|
|||
}
|
||||
uprv_sortArray(elements, elementsLength, (int32_t)sizeof(BytesTrieElement),
|
||||
compareElementStrings, strings,
|
||||
FALSE, // need not be a stable sort
|
||||
false, // need not be a stable sort
|
||||
&errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
|
@ -375,7 +375,7 @@ BytesTrieBuilder::createLinearMatchNode(int32_t i, int32_t byteIndex, int32_t le
|
|||
UBool
|
||||
BytesTrieBuilder::ensureCapacity(int32_t length) {
|
||||
if(bytes==NULL) {
|
||||
return FALSE; // previous memory allocation had failed
|
||||
return false; // previous memory allocation had failed
|
||||
}
|
||||
if(length>bytesCapacity) {
|
||||
int32_t newCapacity=bytesCapacity;
|
||||
|
@ -388,7 +388,7 @@ BytesTrieBuilder::ensureCapacity(int32_t length) {
|
|||
uprv_free(bytes);
|
||||
bytes=NULL;
|
||||
bytesCapacity=0;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
uprv_memcpy(newBytes+(newCapacity-bytesLength),
|
||||
bytes+(bytesCapacity-bytesLength), bytesLength);
|
||||
|
@ -396,7 +396,7 @@ BytesTrieBuilder::ensureCapacity(int32_t length) {
|
|||
bytes=newBytes;
|
||||
bytesCapacity=newCapacity;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
@ -463,7 +463,7 @@ int32_t
|
|||
BytesTrieBuilder::writeValueAndType(UBool hasValue, int32_t value, int32_t node) {
|
||||
int32_t offset=write(node);
|
||||
if(hasValue) {
|
||||
offset=writeValueAndFinal(value, FALSE);
|
||||
offset=writeValueAndFinal(value, false);
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
|
|
@ -101,12 +101,12 @@ BytesTrie::Iterator::hasNext() const { return pos_!=NULL || !stack_->isEmpty();
|
|||
UBool
|
||||
BytesTrie::Iterator::next(UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
const uint8_t *pos=pos_;
|
||||
if(pos==NULL) {
|
||||
if(stack_->isEmpty()) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Pop the state off the stack and continue with the next outbound edge of
|
||||
// the branch node.
|
||||
|
@ -119,7 +119,7 @@ BytesTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
if(length>1) {
|
||||
pos=branchNext(pos, length, errorCode);
|
||||
if(pos==NULL) {
|
||||
return TRUE; // Reached a final value.
|
||||
return true; // Reached a final value.
|
||||
}
|
||||
} else {
|
||||
str_->append((char)*pos++, errorCode);
|
||||
|
@ -141,7 +141,7 @@ BytesTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
} else {
|
||||
pos_=skipValue(pos, node);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if(maxLength_>0 && str_->length()==maxLength_) {
|
||||
return truncateAndStop();
|
||||
|
@ -152,7 +152,7 @@ BytesTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
}
|
||||
pos=branchNext(pos, node+1, errorCode);
|
||||
if(pos==NULL) {
|
||||
return TRUE; // Reached a final value.
|
||||
return true; // Reached a final value.
|
||||
}
|
||||
} else {
|
||||
// Linear-match node, append length bytes to str_.
|
||||
|
@ -177,7 +177,7 @@ UBool
|
|||
BytesTrie::Iterator::truncateAndStop() {
|
||||
pos_=NULL;
|
||||
value_=-1; // no real value for str
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Branch node, needs to take the first outbound edge and push state for the rest.
|
||||
|
|
|
@ -119,7 +119,7 @@ UnicodeString CanonicalIterator::getSource() {
|
|||
* Resets the iterator so that one can start again from the beginning.
|
||||
*/
|
||||
void CanonicalIterator::reset() {
|
||||
done = FALSE;
|
||||
done = false;
|
||||
for (int i = 0; i < current_length; ++i) {
|
||||
current[i] = 0;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ UnicodeString CanonicalIterator::next() {
|
|||
|
||||
for (i = current_length - 1; ; --i) {
|
||||
if (i < 0) {
|
||||
done = TRUE;
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
current[i]++;
|
||||
|
@ -176,7 +176,7 @@ void CanonicalIterator::setSource(const UnicodeString &newSource, UErrorCode &st
|
|||
if(U_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
done = FALSE;
|
||||
done = false;
|
||||
|
||||
cleanPieces();
|
||||
|
||||
|
@ -521,7 +521,7 @@ Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, con
|
|||
int32_t decompLen=decompString.length();
|
||||
|
||||
// See if it matches the start of segment (at segmentPos)
|
||||
UBool ok = FALSE;
|
||||
UBool ok = false;
|
||||
UChar32 cp;
|
||||
int32_t decompPos = 0;
|
||||
UChar32 decompCp;
|
||||
|
@ -537,7 +537,7 @@ Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, con
|
|||
|
||||
if (decompPos == decompLen) { // done, have all decomp characters!
|
||||
temp.append(segment+i, segLen-i);
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
break;
|
||||
}
|
||||
U16_NEXT(decomp, decompPos, decompLen, decompCp);
|
||||
|
|
|
@ -85,7 +85,7 @@ UBool U_CALLCONV characterproperties_cleanup() {
|
|||
ucptrie_close(reinterpret_cast<UCPTrie *>(maps[i]));
|
||||
maps[i] = nullptr;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void U_CALLCONV initInclusion(UPropertySource src, UErrorCode &errorCode) {
|
||||
|
|
|
@ -220,7 +220,7 @@ UBool CharString::ensureCapacity(int32_t capacity,
|
|||
int32_t desiredCapacityHint,
|
||||
UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if(capacity>buffer.getCapacity()) {
|
||||
if(desiredCapacityHint==0) {
|
||||
|
@ -230,10 +230,10 @@ UBool CharString::ensureCapacity(int32_t capacity,
|
|||
buffer.resize(capacity, len+1)==NULL
|
||||
) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
CharString &CharString::appendPathPart(StringPiece s, UErrorCode &errorCode) {
|
||||
|
|
|
@ -134,5 +134,5 @@ U_CFUNC UBool cmemory_cleanup(void) {
|
|||
pAlloc = NULL;
|
||||
pRealloc = NULL;
|
||||
pFree = NULL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
// Select the currently marked candidate, point after it in the text, and invalidate self
|
||||
int32_t acceptMarked( UText *text );
|
||||
|
||||
// Back up from the current candidate to the next shorter one; return TRUE if that exists
|
||||
// Back up from the current candidate to the next shorter one; return true if that exists
|
||||
// and point the text after it
|
||||
UBool backUp( UText *text );
|
||||
|
||||
|
@ -165,9 +165,9 @@ UBool
|
|||
PossibleWord::backUp( UText *text ) {
|
||||
if (current > 0) {
|
||||
utext_setNativeIndex(text, offset + cuLengths[--current]);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1146,7 +1146,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
|
|||
|
||||
// Input UText is in one contiguous UTF-16 chunk.
|
||||
// Use Read-only aliasing UnicodeString.
|
||||
inString.setTo(FALSE,
|
||||
inString.setTo(false,
|
||||
inText->chunkContents + rangeStart - inText->chunkNativeStart,
|
||||
rangeEnd - rangeStart);
|
||||
} else {
|
||||
|
|
|
@ -221,7 +221,7 @@ UBool Edits::growArray() {
|
|||
// Not U_BUFFER_OVERFLOW_ERROR because that could be confused on a string transform API
|
||||
// with a result-string-buffer overflow.
|
||||
errorCode_ = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if (capacity >= (INT32_MAX / 2)) {
|
||||
newCapacity = INT32_MAX;
|
||||
} else {
|
||||
|
@ -230,25 +230,25 @@ UBool Edits::growArray() {
|
|||
// Grow by at least 5 units so that a maximal change record will fit.
|
||||
if ((newCapacity - capacity) < 5) {
|
||||
errorCode_ = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
uint16_t *newArray = (uint16_t *)uprv_malloc((size_t)newCapacity * 2);
|
||||
if (newArray == NULL) {
|
||||
errorCode_ = U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
uprv_memcpy(newArray, array, (size_t)length * 2);
|
||||
releaseArray();
|
||||
array = newArray;
|
||||
capacity = newCapacity;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool Edits::copyErrorTo(UErrorCode &outErrorCode) const {
|
||||
if (U_FAILURE(outErrorCode)) { return TRUE; }
|
||||
if (U_SUCCESS(errorCode_)) { return FALSE; }
|
||||
if (U_FAILURE(outErrorCode)) { return true; }
|
||||
if (U_SUCCESS(errorCode_)) { return false; }
|
||||
outErrorCode = errorCode_;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
Edits &Edits::mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &errorCode) {
|
||||
|
@ -257,7 +257,7 @@ Edits &Edits::mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &error
|
|||
// Parallel iteration over both Edits.
|
||||
Iterator abIter = ab.getFineIterator();
|
||||
Iterator bcIter = bc.getFineIterator();
|
||||
UBool abHasNext = TRUE, bcHasNext = TRUE;
|
||||
UBool abHasNext = true, bcHasNext = true;
|
||||
// Copy iterator state into local variables, so that we can modify and subdivide spans.
|
||||
// ab old & new length, bc old & new length
|
||||
int32_t aLength = 0, ab_bLength = 0, bc_bLength = 0, cLength = 0;
|
||||
|
@ -400,7 +400,7 @@ Edits &Edits::mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &error
|
|||
Edits::Iterator::Iterator(const uint16_t *a, int32_t len, UBool oc, UBool crs) :
|
||||
array(a), index(0), length(len), remaining(0),
|
||||
onlyChanges_(oc), coarse(crs),
|
||||
dir(0), changed(FALSE), oldLength_(0), newLength_(0),
|
||||
dir(0), changed(false), oldLength_(0), newLength_(0),
|
||||
srcIndex(0), replIndex(0), destIndex(0) {}
|
||||
|
||||
int32_t Edits::Iterator::readLength(int32_t head) {
|
||||
|
@ -441,16 +441,16 @@ void Edits::Iterator::updatePreviousIndexes() {
|
|||
UBool Edits::Iterator::noNext() {
|
||||
// No change before or beyond the string.
|
||||
dir = 0;
|
||||
changed = FALSE;
|
||||
changed = false;
|
||||
oldLength_ = newLength_ = 0;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
||||
// Forward iteration: Update the string indexes to the limit of the current span,
|
||||
// and post-increment-read array units to assemble a new span.
|
||||
// Leaves the array index one after the last unit of that span.
|
||||
if (U_FAILURE(errorCode)) { return FALSE; }
|
||||
if (U_FAILURE(errorCode)) { return false; }
|
||||
// We have an errorCode in case we need to start guarding against integer overflows.
|
||||
// It is also convenient for caller loops if we bail out when an error was set elsewhere.
|
||||
if (dir > 0) {
|
||||
|
@ -464,7 +464,7 @@ UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
|||
// Stay on the current one of a sequence of compressed changes.
|
||||
++index; // next() rests on the index after the sequence unit.
|
||||
dir = 1;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
dir = 1;
|
||||
|
@ -473,7 +473,7 @@ UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
|||
// Fine-grained iterator: Continue a sequence of compressed changes.
|
||||
if (remaining > 1) {
|
||||
--remaining;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
remaining = 0;
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
|||
int32_t u = array[index++];
|
||||
if (u <= MAX_UNCHANGED) {
|
||||
// Combine adjacent unchanged ranges.
|
||||
changed = FALSE;
|
||||
changed = false;
|
||||
oldLength_ = u + 1;
|
||||
while (index < length && (u = array[index]) <= MAX_UNCHANGED) {
|
||||
++index;
|
||||
|
@ -498,10 +498,10 @@ UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
|||
// already fetched u > MAX_UNCHANGED at index
|
||||
++index;
|
||||
} else {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
changed = TRUE;
|
||||
changed = true;
|
||||
if (u <= MAX_SHORT_CHANGE) {
|
||||
int32_t oldLen = u >> 12;
|
||||
int32_t newLen = (u >> 9) & MAX_SHORT_CHANGE_NEW_LENGTH;
|
||||
|
@ -516,14 +516,14 @@ UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
|||
if (num > 1) {
|
||||
remaining = num; // This is the first of two or more changes.
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
U_ASSERT(u <= 0x7fff);
|
||||
oldLength_ = readLength((u >> 6) & 0x3f);
|
||||
newLength_ = readLength(u & 0x3f);
|
||||
if (!coarse) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Combine adjacent changes.
|
||||
|
@ -539,14 +539,14 @@ UBool Edits::Iterator::next(UBool onlyChanges, UErrorCode &errorCode) {
|
|||
newLength_ += readLength(u & 0x3f);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
||||
// Backward iteration: Pre-decrement-read array units to assemble a new span,
|
||||
// then update the string indexes to the start of that span.
|
||||
// Leaves the array index on the head unit of that span.
|
||||
if (U_FAILURE(errorCode)) { return FALSE; }
|
||||
if (U_FAILURE(errorCode)) { return false; }
|
||||
// We have an errorCode in case we need to start guarding against integer overflows.
|
||||
// It is also convenient for caller loops if we bail out when an error was set elsewhere.
|
||||
if (dir >= 0) {
|
||||
|
@ -559,7 +559,7 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
// Stay on the current one of a sequence of compressed changes.
|
||||
--index; // previous() rests on the sequence unit.
|
||||
dir = -1;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
updateNextIndexes();
|
||||
}
|
||||
|
@ -572,7 +572,7 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
if (remaining <= (u & SHORT_CHANGE_NUM_MASK)) {
|
||||
++remaining;
|
||||
updatePreviousIndexes();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
remaining = 0;
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
int32_t u = array[--index];
|
||||
if (u <= MAX_UNCHANGED) {
|
||||
// Combine adjacent unchanged ranges.
|
||||
changed = FALSE;
|
||||
changed = false;
|
||||
oldLength_ = u + 1;
|
||||
while (index > 0 && (u = array[index - 1]) <= MAX_UNCHANGED) {
|
||||
--index;
|
||||
|
@ -591,9 +591,9 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
newLength_ = oldLength_;
|
||||
// No need to handle onlyChanges as long as previous() is called only from findIndex().
|
||||
updatePreviousIndexes();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
changed = TRUE;
|
||||
changed = true;
|
||||
if (u <= MAX_SHORT_CHANGE) {
|
||||
int32_t oldLen = u >> 12;
|
||||
int32_t newLen = (u >> 9) & MAX_SHORT_CHANGE_NEW_LENGTH;
|
||||
|
@ -609,7 +609,7 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
remaining = 1; // This is the last of two or more changes.
|
||||
}
|
||||
updatePreviousIndexes();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (u <= 0x7fff) {
|
||||
|
@ -629,7 +629,7 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
}
|
||||
if (!coarse) {
|
||||
updatePreviousIndexes();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Combine adjacent changes.
|
||||
|
@ -648,7 +648,7 @@ UBool Edits::Iterator::previous(UErrorCode &errorCode) {
|
|||
}
|
||||
}
|
||||
updatePreviousIndexes();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t Edits::Iterator::findIndex(int32_t i, UBool findSource, UErrorCode &errorCode) {
|
||||
|
@ -705,7 +705,7 @@ int32_t Edits::Iterator::findIndex(int32_t i, UBool findSource, UErrorCode &erro
|
|||
// The index is in the current span.
|
||||
return 0;
|
||||
}
|
||||
while (next(FALSE, errorCode)) {
|
||||
while (next(false, errorCode)) {
|
||||
if (findSource) {
|
||||
spanStart = srcIndex;
|
||||
spanLength = oldLength_;
|
||||
|
@ -739,7 +739,7 @@ int32_t Edits::Iterator::findIndex(int32_t i, UBool findSource, UErrorCode &erro
|
|||
}
|
||||
|
||||
int32_t Edits::Iterator::destinationIndexFromSourceIndex(int32_t i, UErrorCode &errorCode) {
|
||||
int32_t where = findIndex(i, TRUE, errorCode);
|
||||
int32_t where = findIndex(i, true, errorCode);
|
||||
if (where < 0) {
|
||||
// Error or before the string.
|
||||
return 0;
|
||||
|
@ -758,7 +758,7 @@ int32_t Edits::Iterator::destinationIndexFromSourceIndex(int32_t i, UErrorCode &
|
|||
}
|
||||
|
||||
int32_t Edits::Iterator::sourceIndexFromDestinationIndex(int32_t i, UErrorCode &errorCode) {
|
||||
int32_t where = findIndex(i, FALSE, errorCode);
|
||||
int32_t where = findIndex(i, false, errorCode);
|
||||
if (where < 0) {
|
||||
// Error or before the string.
|
||||
return 0;
|
||||
|
|
|
@ -614,11 +614,11 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr
|
|||
i++) {
|
||||
const UnicodeString *abbr = fSet.getStringAt(i);
|
||||
if(abbr) {
|
||||
FB_TRACE("build",abbr,TRUE,i);
|
||||
FB_TRACE("build",abbr,true,i);
|
||||
ustrs[n] = *abbr; // copy by value
|
||||
FB_TRACE("ustrs[n]",&ustrs[n],TRUE,i);
|
||||
FB_TRACE("ustrs[n]",&ustrs[n],true,i);
|
||||
} else {
|
||||
FB_TRACE("build",abbr,FALSE,i);
|
||||
FB_TRACE("build",abbr,false,i);
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -629,37 +629,37 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr
|
|||
for(int i=0;i<subCount;i++) {
|
||||
int nn = ustrs[i].indexOf(kFULLSTOP); // TODO: non-'.' abbreviations
|
||||
if(nn>-1 && (nn+1)!=ustrs[i].length()) {
|
||||
FB_TRACE("partial",&ustrs[i],FALSE,i);
|
||||
FB_TRACE("partial",&ustrs[i],false,i);
|
||||
// is partial.
|
||||
// is it unique?
|
||||
int sameAs = -1;
|
||||
for(int j=0;j<subCount;j++) {
|
||||
if(j==i) continue;
|
||||
if(ustrs[i].compare(0,nn+1,ustrs[j],0,nn+1)==0) {
|
||||
FB_TRACE("prefix",&ustrs[j],FALSE,nn+1);
|
||||
FB_TRACE("prefix",&ustrs[j],false,nn+1);
|
||||
//UBool otherIsPartial = ((nn+1)!=ustrs[j].length()); // true if ustrs[j] doesn't end at nn
|
||||
if(partials[j]==0) { // hasn't been processed yet
|
||||
partials[j] = kSuppressInReverse | kAddToForward;
|
||||
FB_TRACE("suppressing",&ustrs[j],FALSE,j);
|
||||
FB_TRACE("suppressing",&ustrs[j],false,j);
|
||||
} else if(partials[j] & kSuppressInReverse) {
|
||||
sameAs = j; // the other entry is already in the reverse table.
|
||||
}
|
||||
}
|
||||
}
|
||||
FB_TRACE("for partial same-",&ustrs[i],FALSE,sameAs);
|
||||
FB_TRACE(" == partial #",&ustrs[i],FALSE,partials[i]);
|
||||
FB_TRACE("for partial same-",&ustrs[i],false,sameAs);
|
||||
FB_TRACE(" == partial #",&ustrs[i],false,partials[i]);
|
||||
UnicodeString prefix(ustrs[i], 0, nn+1);
|
||||
if(sameAs == -1 && partials[i] == 0) {
|
||||
// first one - add the prefix to the reverse table.
|
||||
prefix.reverse();
|
||||
builder->add(prefix, kPARTIAL, status);
|
||||
revCount++;
|
||||
FB_TRACE("Added partial",&prefix,FALSE, i);
|
||||
FB_TRACE(u_errorName(status),&ustrs[i],FALSE,i);
|
||||
FB_TRACE("Added partial",&prefix,false, i);
|
||||
FB_TRACE(u_errorName(status),&ustrs[i],false,i);
|
||||
partials[i] = kSuppressInReverse | kAddToForward;
|
||||
} else {
|
||||
FB_TRACE("NOT adding partial",&prefix,FALSE, i);
|
||||
FB_TRACE(u_errorName(status),&ustrs[i],FALSE,i);
|
||||
FB_TRACE("NOT adding partial",&prefix,false, i);
|
||||
FB_TRACE(u_errorName(status),&ustrs[i],false,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -668,9 +668,9 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr
|
|||
ustrs[i].reverse();
|
||||
builder->add(ustrs[i], kMATCH, status);
|
||||
revCount++;
|
||||
FB_TRACE(u_errorName(status), &ustrs[i], FALSE, i);
|
||||
FB_TRACE(u_errorName(status), &ustrs[i], false, i);
|
||||
} else {
|
||||
FB_TRACE("Adding fwd",&ustrs[i], FALSE, i);
|
||||
FB_TRACE("Adding fwd",&ustrs[i], false, i);
|
||||
|
||||
// an optimization would be to only add the portion after the '.'
|
||||
// for example, for "Ph.D." we store ".hP" in the reverse table. We could just store "D." in the forward,
|
||||
|
@ -682,12 +682,12 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr
|
|||
////if(debug2) u_printf("SUPPRESS- not Added(%d): /%S/ status=%s\n",partials[i], ustrs[i].getTerminatedBuffer(), u_errorName(status));
|
||||
}
|
||||
}
|
||||
FB_TRACE("AbbrCount",NULL,FALSE, subCount);
|
||||
FB_TRACE("AbbrCount",NULL,false, subCount);
|
||||
|
||||
if(revCount>0) {
|
||||
backwardsTrie.adoptInstead(builder->build(USTRINGTRIE_BUILD_FAST, status));
|
||||
if(U_FAILURE(status)) {
|
||||
FB_TRACE(u_errorName(status),NULL,FALSE, -1);
|
||||
FB_TRACE(u_errorName(status),NULL,false, -1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr
|
|||
if(fwdCount>0) {
|
||||
forwardsPartialTrie.adoptInstead(builder2->build(USTRINGTRIE_BUILD_FAST, status));
|
||||
if(U_FAILURE(status)) {
|
||||
FB_TRACE(u_errorName(status),NULL,FALSE, -1);
|
||||
FB_TRACE(u_errorName(status),NULL,false, -1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,14 +137,14 @@ UnicodeString &
|
|||
FilteredNormalizer2::normalizeSecondAndAppend(UnicodeString &first,
|
||||
const UnicodeString &second,
|
||||
UErrorCode &errorCode) const {
|
||||
return normalizeSecondAndAppend(first, second, TRUE, errorCode);
|
||||
return normalizeSecondAndAppend(first, second, true, errorCode);
|
||||
}
|
||||
|
||||
UnicodeString &
|
||||
FilteredNormalizer2::append(UnicodeString &first,
|
||||
const UnicodeString &second,
|
||||
UErrorCode &errorCode) const {
|
||||
return normalizeSecondAndAppend(first, second, FALSE, errorCode);
|
||||
return normalizeSecondAndAppend(first, second, false, errorCode);
|
||||
}
|
||||
|
||||
UnicodeString &
|
||||
|
@ -224,7 +224,7 @@ UBool
|
|||
FilteredNormalizer2::isNormalized(const UnicodeString &s, UErrorCode &errorCode) const {
|
||||
uprv_checkCanGetBuffer(s, errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
USetSpanCondition spanCondition=USET_SPAN_SIMPLE;
|
||||
for(int32_t prevSpanLimit=0; prevSpanLimit<s.length();) {
|
||||
|
@ -235,19 +235,19 @@ FilteredNormalizer2::isNormalized(const UnicodeString &s, UErrorCode &errorCode)
|
|||
if( !norm2.isNormalized(s.tempSubStringBetween(prevSpanLimit, spanLimit), errorCode) ||
|
||||
U_FAILURE(errorCode)
|
||||
) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
spanCondition=USET_SPAN_NOT_CONTAINED;
|
||||
}
|
||||
prevSpanLimit=spanLimit;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool
|
||||
FilteredNormalizer2::isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) const {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
const char *s = sp.data();
|
||||
int32_t length = sp.length();
|
||||
|
@ -259,14 +259,14 @@ FilteredNormalizer2::isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) con
|
|||
} else {
|
||||
if (!norm2.isNormalizedUTF8(StringPiece(s, spanLength), errorCode) ||
|
||||
U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
spanCondition = USET_SPAN_NOT_CONTAINED;
|
||||
}
|
||||
s += spanLength;
|
||||
length -= spanLength;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UNormalizationCheckResult
|
||||
|
|
|
@ -59,8 +59,8 @@ struct UPlugData {
|
|||
void *context; /**< user context data */
|
||||
char name[UPLUG_NAME_MAX]; /**< name of plugin */
|
||||
UPlugLevel level; /**< level of plugin */
|
||||
UBool awaitingLoad; /**< TRUE if the plugin is awaiting a load call */
|
||||
UBool dontUnload; /**< TRUE if plugin must stay resident (leak plugin and lib) */
|
||||
UBool awaitingLoad; /**< true if the plugin is awaiting a load call */
|
||||
UBool dontUnload; /**< true if plugin must stay resident (leak plugin and lib) */
|
||||
UErrorCode pluginStatus; /**< status code of plugin */
|
||||
};
|
||||
|
||||
|
@ -304,11 +304,11 @@ static void uplug_queryPlug(UPlugData *plug, UErrorCode *status) {
|
|||
if(U_SUCCESS(*status)) {
|
||||
if(plug->level == UPLUG_LEVEL_INVALID) {
|
||||
plug->pluginStatus = U_PLUGIN_DIDNT_SET_LEVEL;
|
||||
plug->awaitingLoad = FALSE;
|
||||
plug->awaitingLoad = false;
|
||||
}
|
||||
} else {
|
||||
plug->pluginStatus = U_INTERNAL_PROGRAM_ERROR;
|
||||
plug->awaitingLoad = FALSE;
|
||||
plug->awaitingLoad = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,7 +322,7 @@ static void uplug_loadPlug(UPlugData *plug, UErrorCode *status) {
|
|||
return;
|
||||
}
|
||||
uplug_callPlug(plug, UPLUG_REASON_LOAD, status);
|
||||
plug->awaitingLoad = FALSE;
|
||||
plug->awaitingLoad = false;
|
||||
if(!U_SUCCESS(*status)) {
|
||||
plug->pluginStatus = U_INTERNAL_PROGRAM_ERROR;
|
||||
}
|
||||
|
@ -347,8 +347,8 @@ static UPlugData *uplug_allocateEmptyPlug(UErrorCode *status)
|
|||
plug->structSize = sizeof(UPlugData);
|
||||
plug->name[0]=0;
|
||||
plug->level = UPLUG_LEVEL_UNKNOWN; /* initialize to null state */
|
||||
plug->awaitingLoad = TRUE;
|
||||
plug->dontUnload = FALSE;
|
||||
plug->awaitingLoad = true;
|
||||
plug->dontUnload = false;
|
||||
plug->pluginStatus = U_ZERO_ERROR;
|
||||
plug->libName[0] = 0;
|
||||
plug->config[0]=0;
|
||||
|
@ -403,9 +403,9 @@ static void uplug_deallocatePlug(UPlugData *plug, UErrorCode *status) {
|
|||
pluginCount = uplug_removeEntryAt(pluginList, pluginCount, sizeof(plug[0]), uplug_pluginNumber(plug));
|
||||
} else {
|
||||
/* not ok- leave as a message. */
|
||||
plug->awaitingLoad=FALSE;
|
||||
plug->awaitingLoad=false;
|
||||
plug->entrypoint=0;
|
||||
plug->dontUnload=TRUE;
|
||||
plug->dontUnload=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -558,8 +558,8 @@ uplug_initErrorPlug(const char *libName, const char *sym, const char *config, co
|
|||
if(U_FAILURE(*status)) return NULL;
|
||||
|
||||
plug->pluginStatus = loadStatus;
|
||||
plug->awaitingLoad = FALSE; /* Won't load. */
|
||||
plug->dontUnload = TRUE; /* cannot unload. */
|
||||
plug->awaitingLoad = false; /* Won't load. */
|
||||
plug->dontUnload = true; /* cannot unload. */
|
||||
|
||||
if(sym!=NULL) {
|
||||
uprv_strncpy(plug->sym, sym, UPLUG_NAME_MAX);
|
||||
|
@ -646,7 +646,7 @@ static UBool U_CALLCONV uplug_cleanup(void)
|
|||
}
|
||||
/* close other held libs? */
|
||||
gCurrentLevel = UPLUG_LEVEL_LOW;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if U_ENABLE_DYLOAD
|
||||
|
@ -678,7 +678,7 @@ static void uplug_loadWaitingPlugs(UErrorCode *status) {
|
|||
currentLevel = newLevel;
|
||||
}
|
||||
}
|
||||
pluginToLoad->awaitingLoad = FALSE;
|
||||
pluginToLoad->awaitingLoad = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -694,7 +694,7 @@ static void uplug_loadWaitingPlugs(UErrorCode *status) {
|
|||
} else {
|
||||
uplug_loadPlug(pluginToLoad, &subStatus);
|
||||
}
|
||||
pluginToLoad->awaitingLoad = FALSE;
|
||||
pluginToLoad->awaitingLoad = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,9 +67,9 @@ LoadedNormalizer2Impl::isAcceptable(void * /*context*/,
|
|||
) {
|
||||
// Normalizer2Impl *me=(Normalizer2Impl *)context;
|
||||
// uprv_memcpy(me->dataVersion, pInfo->dataVersion, 4);
|
||||
return TRUE;
|
||||
return true;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ static UBool U_CALLCONV uprv_loaded_normalizer2_cleanup() {
|
|||
|
||||
uhash_close(cache);
|
||||
cache=NULL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
U_CDECL_END
|
||||
|
|
|
@ -459,7 +459,7 @@ Locale LocaleBuilder::build(UErrorCode& errorCode)
|
|||
UBool LocaleBuilder::copyErrorTo(UErrorCode &outErrorCode) const {
|
||||
if (U_FAILURE(outErrorCode)) {
|
||||
// Do not overwrite the older error code
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
outErrorCode = status_;
|
||||
return U_FAILURE(outErrorCode);
|
||||
|
|
|
@ -60,7 +60,7 @@ LocaleMatcher::Result::Result(LocaleMatcher::Result &&src) U_NOEXCEPT :
|
|||
if (desiredIsOwned) {
|
||||
src.desiredLocale = nullptr;
|
||||
src.desiredIndex = -1;
|
||||
src.desiredIsOwned = FALSE;
|
||||
src.desiredIsOwned = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ LocaleMatcher::Result &LocaleMatcher::Result::operator=(LocaleMatcher::Result &&
|
|||
if (desiredIsOwned) {
|
||||
src.desiredLocale = nullptr;
|
||||
src.desiredIndex = -1;
|
||||
src.desiredIsOwned = FALSE;
|
||||
src.desiredIsOwned = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
@ -287,10 +287,10 @@ LocaleMatcher::Builder &LocaleMatcher::Builder::internalSetThresholdDistance(int
|
|||
#endif
|
||||
|
||||
UBool LocaleMatcher::Builder::copyErrorTo(UErrorCode &outErrorCode) const {
|
||||
if (U_FAILURE(outErrorCode)) { return TRUE; }
|
||||
if (U_SUCCESS(errorCode_)) { return FALSE; }
|
||||
if (U_FAILURE(outErrorCode)) { return true; }
|
||||
if (U_SUCCESS(errorCode_)) { return false; }
|
||||
outErrorCode = errorCode_;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
LocaleMatcher LocaleMatcher::Builder::build(UErrorCode &errorCode) const {
|
||||
|
@ -632,30 +632,30 @@ const Locale *LocaleMatcher::getBestMatchForListString(
|
|||
LocaleMatcher::Result LocaleMatcher::getBestMatchResult(
|
||||
const Locale &desiredLocale, UErrorCode &errorCode) const {
|
||||
if (U_FAILURE(errorCode)) {
|
||||
return Result(nullptr, defaultLocale, -1, -1, FALSE);
|
||||
return Result(nullptr, defaultLocale, -1, -1, false);
|
||||
}
|
||||
int32_t suppIndex = getBestSuppIndex(
|
||||
getMaximalLsrOrUnd(likelySubtags, desiredLocale, errorCode),
|
||||
nullptr, errorCode);
|
||||
if (U_FAILURE(errorCode) || suppIndex < 0) {
|
||||
return Result(nullptr, defaultLocale, -1, -1, FALSE);
|
||||
return Result(nullptr, defaultLocale, -1, -1, false);
|
||||
} else {
|
||||
return Result(&desiredLocale, supportedLocales[suppIndex], 0, suppIndex, FALSE);
|
||||
return Result(&desiredLocale, supportedLocales[suppIndex], 0, suppIndex, false);
|
||||
}
|
||||
}
|
||||
|
||||
LocaleMatcher::Result LocaleMatcher::getBestMatchResult(
|
||||
Locale::Iterator &desiredLocales, UErrorCode &errorCode) const {
|
||||
if (U_FAILURE(errorCode) || !desiredLocales.hasNext()) {
|
||||
return Result(nullptr, defaultLocale, -1, -1, FALSE);
|
||||
return Result(nullptr, defaultLocale, -1, -1, false);
|
||||
}
|
||||
LocaleLsrIterator lsrIter(likelySubtags, desiredLocales, ULOCMATCH_TEMPORARY_LOCALES);
|
||||
int32_t suppIndex = getBestSuppIndex(lsrIter.next(errorCode), &lsrIter, errorCode);
|
||||
if (U_FAILURE(errorCode) || suppIndex < 0) {
|
||||
return Result(nullptr, defaultLocale, -1, -1, FALSE);
|
||||
return Result(nullptr, defaultLocale, -1, -1, false);
|
||||
} else {
|
||||
return Result(lsrIter.orphanRemembered(), supportedLocales[suppIndex],
|
||||
lsrIter.getBestDesiredIndex(), suppIndex, TRUE);
|
||||
lsrIter.getBestDesiredIndex(), suppIndex, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ void LocalePriorityList::sort(UErrorCode &errorCode) {
|
|||
// The comparator forces a stable sort via the item index.
|
||||
if (U_FAILURE(errorCode) || getLength() <= 1 || !hasWeights) { return; }
|
||||
uprv_sortArray(list->array.getAlias(), listLength, sizeof(LocaleAndWeight),
|
||||
compareLocaleAndWeight, nullptr, FALSE, &errorCode);
|
||||
compareLocaleAndWeight, nullptr, false, &errorCode);
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
|
@ -54,7 +54,7 @@ static UBool U_CALLCONV locale_available_cleanup(void)
|
|||
availableLocaleListCount = 0;
|
||||
gInitOnceLocale.reset();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
U_CDECL_END
|
||||
|
@ -203,7 +203,7 @@ static UBool U_CALLCONV uloc_cleanup(void) {
|
|||
gAvailableLocaleCounts[i] = 0;
|
||||
}
|
||||
ginstalledLocalesInitOnce.reset();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Load Installed Locales. This function will be called exactly once
|
||||
|
|
|
@ -514,11 +514,11 @@ uloc_getDisplayName(const char *locale,
|
|||
UChar formatCloseParen = 0x0029; // )
|
||||
UChar formatReplaceCloseParen = 0x005D; // ]
|
||||
|
||||
UBool haveLang = TRUE; /* assume true, set false if we find we don't have
|
||||
UBool haveLang = true; /* assume true, set false if we find we don't have
|
||||
a lang component in the locale */
|
||||
UBool haveRest = TRUE; /* assume true, set false if we find we don't have
|
||||
UBool haveRest = true; /* assume true, set false if we find we don't have
|
||||
any other component in the locale */
|
||||
UBool retry = FALSE; /* set true if we need to retry, see below */
|
||||
UBool retry = false; /* set true if we need to retry, see below */
|
||||
|
||||
int32_t langi = 0; /* index of the language substitution (0 or 1), virtually always 0 */
|
||||
|
||||
|
@ -625,7 +625,7 @@ uloc_getDisplayName(const char *locale,
|
|||
}
|
||||
|
||||
for(int32_t subi=0,resti=0;subi<2;) { /* iterate through patterns 0 and 1*/
|
||||
UBool subdone = FALSE; /* set true when ready to move to next substitution */
|
||||
UBool subdone = false; /* set true when ready to move to next substitution */
|
||||
|
||||
/* prep p and cap for calls to get display components, pin cap to 0 since
|
||||
they complain if cap is negative */
|
||||
|
@ -643,10 +643,10 @@ uloc_getDisplayName(const char *locale,
|
|||
length+=langLen;
|
||||
haveLang=langLen>0;
|
||||
}
|
||||
subdone=TRUE;
|
||||
subdone=true;
|
||||
} else { /* {1} */
|
||||
if(!haveRest) {
|
||||
subdone=TRUE;
|
||||
subdone=true;
|
||||
} else {
|
||||
int32_t len; /* length of component (plus other stuff) we just fetched */
|
||||
switch(resti++) {
|
||||
|
@ -667,7 +667,7 @@ uloc_getDisplayName(const char *locale,
|
|||
const char* kw=uenum_next(kenum.getAlias(), &len, pErrorCode);
|
||||
if (kw == NULL) {
|
||||
len=0; /* mark that we didn't add a component */
|
||||
subdone=TRUE;
|
||||
subdone=true;
|
||||
} else {
|
||||
/* incorporating this behavior into the loop made it even more complex,
|
||||
so just special case it here */
|
||||
|
@ -772,7 +772,7 @@ uloc_getDisplayName(const char *locale,
|
|||
/* would have fit, but didn't because of pattern prefix. */
|
||||
sub0Pos=0; /* stops initial padding (and a second retry,
|
||||
so we won't end up here again) */
|
||||
retry=TRUE;
|
||||
retry=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ UBool U_CALLCONV cleanup() {
|
|||
delete gLocaleDistance;
|
||||
gLocaleDistance = nullptr;
|
||||
gInitOnce.reset();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -403,7 +403,7 @@ struct LocaleDisplayNamesImpl::CapitalizationContextSink : public ResourceSink {
|
|||
LocaleDisplayNamesImpl& parent;
|
||||
|
||||
CapitalizationContextSink(LocaleDisplayNamesImpl& _parent)
|
||||
: hasCapitalizationUsage(FALSE), parent(_parent) {}
|
||||
: hasCapitalizationUsage(false), parent(_parent) {}
|
||||
virtual ~CapitalizationContextSink();
|
||||
|
||||
virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/,
|
||||
|
@ -437,8 +437,8 @@ struct LocaleDisplayNamesImpl::CapitalizationContextSink : public ResourceSink {
|
|||
int32_t titlecaseInt = (parent.capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU) ? intVector[0] : intVector[1];
|
||||
if (titlecaseInt == 0) { continue; }
|
||||
|
||||
parent.fCapitalization[usageEnum] = TRUE;
|
||||
hasCapitalizationUsage = TRUE;
|
||||
parent.fCapitalization[usageEnum] = true;
|
||||
hasCapitalizationUsage = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -490,7 +490,7 @@ LocaleDisplayNamesImpl::initialize(void) {
|
|||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
// Only get the context data if we need it! This is a const object so we know now...
|
||||
// Also check whether we will need a break iterator (depends on the data)
|
||||
UBool needBrkIter = FALSE;
|
||||
UBool needBrkIter = false;
|
||||
if (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU || capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_STANDALONE) {
|
||||
LocalUResourceBundlePointer resource(ures_open(NULL, locale.getName(), &status));
|
||||
if (U_FAILURE(status)) { return; }
|
||||
|
@ -593,8 +593,8 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
ncat(buffer, ULOC_FULLNAME_CAPACITY, lang, "_", script, "_", country, (char *)0);
|
||||
localeIdName(buffer, resultName, false);
|
||||
if (!resultName.isBogus()) {
|
||||
hasScript = FALSE;
|
||||
hasCountry = FALSE;
|
||||
hasScript = false;
|
||||
hasCountry = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
ncat(buffer, ULOC_FULLNAME_CAPACITY, lang, "_", script, (char *)0);
|
||||
localeIdName(buffer, resultName, false);
|
||||
if (!resultName.isBogus()) {
|
||||
hasScript = FALSE;
|
||||
hasScript = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -610,11 +610,11 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
ncat(buffer, ULOC_FULLNAME_CAPACITY, lang, "_", country, (char*)0);
|
||||
localeIdName(buffer, resultName, false);
|
||||
if (!resultName.isBogus()) {
|
||||
hasCountry = FALSE;
|
||||
hasCountry = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (FALSE);
|
||||
} while (false);
|
||||
}
|
||||
if (resultName.isBogus() || resultName.isEmpty()) {
|
||||
localeIdName(lang, resultName, substitute == UDISPCTX_SUBSTITUTE);
|
||||
|
@ -629,7 +629,7 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if (hasScript) {
|
||||
UnicodeString script_str = scriptDisplayName(script, temp, TRUE);
|
||||
UnicodeString script_str = scriptDisplayName(script, temp, true);
|
||||
if (script_str.isBogus()) {
|
||||
result.setToBogus();
|
||||
return result;
|
||||
|
@ -637,7 +637,7 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
resultRemainder.append(script_str);
|
||||
}
|
||||
if (hasCountry) {
|
||||
UnicodeString region_str = regionDisplayName(country, temp, TRUE);
|
||||
UnicodeString region_str = regionDisplayName(country, temp, true);
|
||||
if (region_str.isBogus()) {
|
||||
result.setToBogus();
|
||||
return result;
|
||||
|
@ -645,7 +645,7 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
appendWithSep(resultRemainder, region_str);
|
||||
}
|
||||
if (hasVariant) {
|
||||
UnicodeString variant_str = variantDisplayName(variant, temp, TRUE);
|
||||
UnicodeString variant_str = variantDisplayName(variant, temp, true);
|
||||
if (variant_str.isBogus()) {
|
||||
result.setToBogus();
|
||||
return result;
|
||||
|
@ -666,10 +666,10 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
|
|||
if (U_FAILURE(status) || status == U_STRING_NOT_TERMINATED_WARNING) {
|
||||
return result;
|
||||
}
|
||||
keyDisplayName(key, temp, TRUE);
|
||||
keyDisplayName(key, temp, true);
|
||||
temp.findAndReplace(formatOpenParen, formatReplaceOpenParen);
|
||||
temp.findAndReplace(formatCloseParen, formatReplaceCloseParen);
|
||||
keyValueDisplayName(key, value, temp2, TRUE);
|
||||
keyValueDisplayName(key, value, temp2, true);
|
||||
temp2.findAndReplace(formatOpenParen, formatReplaceOpenParen);
|
||||
temp2.findAndReplace(formatCloseParen, formatReplaceCloseParen);
|
||||
if (temp2 != UnicodeString(value, -1, US_INV)) {
|
||||
|
@ -797,13 +797,13 @@ LocaleDisplayNamesImpl::scriptDisplayName(const char* script,
|
|||
UnicodeString&
|
||||
LocaleDisplayNamesImpl::scriptDisplayName(const char* script,
|
||||
UnicodeString& result) const {
|
||||
return scriptDisplayName(script, result, FALSE);
|
||||
return scriptDisplayName(script, result, false);
|
||||
}
|
||||
|
||||
UnicodeString&
|
||||
LocaleDisplayNamesImpl::scriptDisplayName(UScriptCode scriptCode,
|
||||
UnicodeString& result) const {
|
||||
return scriptDisplayName(uscript_getName(scriptCode), result, FALSE);
|
||||
return scriptDisplayName(uscript_getName(scriptCode), result, false);
|
||||
}
|
||||
|
||||
UnicodeString&
|
||||
|
@ -827,7 +827,7 @@ LocaleDisplayNamesImpl::regionDisplayName(const char* region,
|
|||
UnicodeString&
|
||||
LocaleDisplayNamesImpl::regionDisplayName(const char* region,
|
||||
UnicodeString& result) const {
|
||||
return regionDisplayName(region, result, FALSE);
|
||||
return regionDisplayName(region, result, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -847,7 +847,7 @@ LocaleDisplayNamesImpl::variantDisplayName(const char* variant,
|
|||
UnicodeString&
|
||||
LocaleDisplayNamesImpl::variantDisplayName(const char* variant,
|
||||
UnicodeString& result) const {
|
||||
return variantDisplayName(variant, result, FALSE);
|
||||
return variantDisplayName(variant, result, false);
|
||||
}
|
||||
|
||||
UnicodeString&
|
||||
|
@ -866,7 +866,7 @@ LocaleDisplayNamesImpl::keyDisplayName(const char* key,
|
|||
UnicodeString&
|
||||
LocaleDisplayNamesImpl::keyDisplayName(const char* key,
|
||||
UnicodeString& result) const {
|
||||
return keyDisplayName(key, result, FALSE);
|
||||
return keyDisplayName(key, result, false);
|
||||
}
|
||||
|
||||
UnicodeString&
|
||||
|
@ -908,7 +908,7 @@ UnicodeString&
|
|||
LocaleDisplayNamesImpl::keyValueDisplayName(const char* key,
|
||||
const char* value,
|
||||
UnicodeString& result) const {
|
||||
return keyValueDisplayName(key, value, result, FALSE);
|
||||
return keyValueDisplayName(key, value, result, false);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -128,7 +128,7 @@ static UBool U_CALLCONV locale_cleanup(void)
|
|||
gDefaultLocalesHashT = NULL;
|
||||
}
|
||||
gDefaultLocale = NULL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -171,7 +171,7 @@ Locale *locale_set_default_internal(const char *id, UErrorCode& status) {
|
|||
// Synchronize this entire function.
|
||||
Mutex lock(&gDefaultLocaleMutex);
|
||||
|
||||
UBool canonicalize = FALSE;
|
||||
UBool canonicalize = false;
|
||||
|
||||
// If given a NULL string for the locale id, grab the default
|
||||
// name from the system.
|
||||
|
@ -179,7 +179,7 @@ Locale *locale_set_default_internal(const char *id, UErrorCode& status) {
|
|||
// the current ICU default locale.)
|
||||
if (id == NULL) {
|
||||
id = uprv_getDefaultLocaleID(); // This function not thread safe? TODO: verify.
|
||||
canonicalize = TRUE; // always canonicalize host ID
|
||||
canonicalize = true; // always canonicalize host ID
|
||||
}
|
||||
|
||||
CharString localeNameBuf;
|
||||
|
@ -212,7 +212,7 @@ Locale *locale_set_default_internal(const char *id, UErrorCode& status) {
|
|||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return gDefaultLocale;
|
||||
}
|
||||
newDefault->init(localeNameBuf.data(), FALSE);
|
||||
newDefault->init(localeNameBuf.data(), false);
|
||||
uhash_put(gDefaultLocalesHashT, (char*) newDefault->getName(), newDefault, &status);
|
||||
if (U_FAILURE(status)) {
|
||||
return gDefaultLocale;
|
||||
|
@ -269,7 +269,7 @@ Locale::~Locale()
|
|||
Locale::Locale()
|
||||
: UObject(), fullName(fullNameBuffer), baseName(NULL)
|
||||
{
|
||||
init(NULL, FALSE);
|
||||
init(NULL, false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -292,7 +292,7 @@ Locale::Locale( const char * newLanguage,
|
|||
{
|
||||
if( (newLanguage==NULL) && (newCountry == NULL) && (newVariant == NULL) )
|
||||
{
|
||||
init(NULL, FALSE); /* shortcut */
|
||||
init(NULL, false); /* shortcut */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -397,7 +397,7 @@ Locale::Locale( const char * newLanguage,
|
|||
}
|
||||
// Parse it, because for example 'language' might really be a complete
|
||||
// string.
|
||||
init(togo.data(), FALSE);
|
||||
init(togo.data(), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ static const char* const KNOWN_CANONICALIZED[] = {
|
|||
static UBool U_CALLCONV cleanupKnownCanonicalized() {
|
||||
gKnownCanonicalizedInitOnce.reset();
|
||||
if (gKnownCanonicalized) { uhash_close(gKnownCanonicalized); }
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void U_CALLCONV loadKnownCanonicalized(UErrorCode &status) {
|
||||
|
@ -689,7 +689,7 @@ AliasData::cleanup()
|
|||
{
|
||||
gInitOnce.reset();
|
||||
delete gSingleton;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1817,7 +1817,7 @@ ulocimp_isCanonicalizedLocaleForTest(const char* localeName)
|
|||
/*This function initializes a Locale from a C locale ID*/
|
||||
Locale& Locale::init(const char* localeID, UBool canonicalize)
|
||||
{
|
||||
fIsBogus = FALSE;
|
||||
fIsBogus = false;
|
||||
/* Free our current storage */
|
||||
if ((baseName != fullName) && (baseName != fullNameBuffer)) {
|
||||
uprv_free(baseName);
|
||||
|
@ -2021,7 +2021,7 @@ Locale::setToBogus() {
|
|||
*language = 0;
|
||||
*script = 0;
|
||||
*country = 0;
|
||||
fIsBogus = TRUE;
|
||||
fIsBogus = true;
|
||||
variantBegin = 0;
|
||||
}
|
||||
|
||||
|
@ -2071,7 +2071,7 @@ Locale::addLikelySubtags(UErrorCode& status) {
|
|||
return;
|
||||
}
|
||||
|
||||
init(maximizedLocaleID.data(), /*canonicalize=*/FALSE);
|
||||
init(maximizedLocaleID.data(), /*canonicalize=*/false);
|
||||
if (isBogus()) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
@ -2093,7 +2093,7 @@ Locale::minimizeSubtags(UErrorCode& status) {
|
|||
return;
|
||||
}
|
||||
|
||||
init(minimizedLocaleID.data(), /*canonicalize=*/FALSE);
|
||||
init(minimizedLocaleID.data(), /*canonicalize=*/false);
|
||||
if (isBogus()) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
@ -2112,7 +2112,7 @@ Locale::canonicalize(UErrorCode& status) {
|
|||
if (U_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
init(uncanonicalized.data(), /*canonicalize=*/TRUE);
|
||||
init(uncanonicalized.data(), /*canonicalize=*/true);
|
||||
if (isBogus()) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
@ -2159,7 +2159,7 @@ Locale::forLanguageTag(StringPiece tag, UErrorCode& status)
|
|||
return result;
|
||||
}
|
||||
|
||||
result.init(localeID.data(), /*canonicalize=*/FALSE);
|
||||
result.init(localeID.data(), /*canonicalize=*/false);
|
||||
if (result.isBogus()) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
@ -2178,7 +2178,7 @@ Locale::toLanguageTag(ByteSink& sink, UErrorCode& status) const
|
|||
return;
|
||||
}
|
||||
|
||||
ulocimp_toLanguageTag(fullName, sink, /*strict=*/FALSE, &status);
|
||||
ulocimp_toLanguageTag(fullName, sink, /*strict=*/false, &status);
|
||||
}
|
||||
|
||||
Locale U_EXPORT2
|
||||
|
@ -2186,7 +2186,7 @@ Locale::createFromName (const char *name)
|
|||
{
|
||||
if (name) {
|
||||
Locale l("");
|
||||
l.init(name, FALSE);
|
||||
l.init(name, false);
|
||||
return l;
|
||||
}
|
||||
else {
|
||||
|
@ -2197,7 +2197,7 @@ Locale::createFromName (const char *name)
|
|||
Locale U_EXPORT2
|
||||
Locale::createCanonical(const char* name) {
|
||||
Locale loc("");
|
||||
loc.init(name, TRUE);
|
||||
loc.init(name, true);
|
||||
return loc;
|
||||
}
|
||||
|
||||
|
@ -2240,7 +2240,7 @@ const char* const* U_EXPORT2 Locale::getISOLanguages()
|
|||
// Set the locale's data based on a posix id.
|
||||
void Locale::setFromPOSIXID(const char *posixID)
|
||||
{
|
||||
init(posixID, TRUE);
|
||||
init(posixID, true);
|
||||
}
|
||||
|
||||
const Locale & U_EXPORT2
|
||||
|
@ -2530,7 +2530,7 @@ Locale::createKeywords(UErrorCode &status) const
|
|||
if(assignment > variantStart) {
|
||||
CharString keywords;
|
||||
CharStringByteSink sink(&keywords);
|
||||
ulocimp_getKeywords(variantStart+1, '@', sink, FALSE, &status);
|
||||
ulocimp_getKeywords(variantStart+1, '@', sink, false, &status);
|
||||
if (U_SUCCESS(status) && !keywords.isEmpty()) {
|
||||
result = new KeywordEnumeration(keywords.data(), keywords.length(), 0, status);
|
||||
if (!result) {
|
||||
|
@ -2559,7 +2559,7 @@ Locale::createUnicodeKeywords(UErrorCode &status) const
|
|||
if(assignment > variantStart) {
|
||||
CharString keywords;
|
||||
CharStringByteSink sink(&keywords);
|
||||
ulocimp_getKeywords(variantStart+1, '@', sink, FALSE, &status);
|
||||
ulocimp_getKeywords(variantStart+1, '@', sink, false, &status);
|
||||
if (U_SUCCESS(status) && !keywords.isEmpty()) {
|
||||
result = new UnicodeKeywordEnumeration(keywords.data(), keywords.length(), 0, status);
|
||||
if (!result) {
|
||||
|
|
|
@ -201,7 +201,7 @@ createTagStringWithAlternates(
|
|||
**/
|
||||
char tagBuffer[ULOC_FULLNAME_CAPACITY];
|
||||
int32_t tagLength = 0;
|
||||
UBool regionAppended = FALSE;
|
||||
UBool regionAppended = false;
|
||||
|
||||
if (langLength > 0) {
|
||||
appendTag(
|
||||
|
@ -209,7 +209,7 @@ createTagStringWithAlternates(
|
|||
langLength,
|
||||
tagBuffer,
|
||||
&tagLength,
|
||||
/*withSeparator=*/FALSE);
|
||||
/*withSeparator=*/false);
|
||||
}
|
||||
else if (alternateTags == NULL) {
|
||||
/*
|
||||
|
@ -246,7 +246,7 @@ createTagStringWithAlternates(
|
|||
alternateLangLength,
|
||||
tagBuffer,
|
||||
&tagLength,
|
||||
/*withSeparator=*/FALSE);
|
||||
/*withSeparator=*/false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ createTagStringWithAlternates(
|
|||
scriptLength,
|
||||
tagBuffer,
|
||||
&tagLength,
|
||||
/*withSeparator=*/TRUE);
|
||||
/*withSeparator=*/true);
|
||||
}
|
||||
else if (alternateTags != NULL) {
|
||||
/*
|
||||
|
@ -281,7 +281,7 @@ createTagStringWithAlternates(
|
|||
alternateScriptLength,
|
||||
tagBuffer,
|
||||
&tagLength,
|
||||
/*withSeparator=*/TRUE);
|
||||
/*withSeparator=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -291,9 +291,9 @@ createTagStringWithAlternates(
|
|||
regionLength,
|
||||
tagBuffer,
|
||||
&tagLength,
|
||||
/*withSeparator=*/TRUE);
|
||||
/*withSeparator=*/true);
|
||||
|
||||
regionAppended = TRUE;
|
||||
regionAppended = true;
|
||||
}
|
||||
else if (alternateTags != NULL) {
|
||||
/*
|
||||
|
@ -317,9 +317,9 @@ createTagStringWithAlternates(
|
|||
alternateRegionLength,
|
||||
tagBuffer,
|
||||
&tagLength,
|
||||
/*withSeparator=*/TRUE);
|
||||
/*withSeparator=*/true);
|
||||
|
||||
regionAppended = TRUE;
|
||||
regionAppended = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -622,7 +622,7 @@ createLikelySubtagsString(
|
|||
likelySubtags,
|
||||
sink,
|
||||
err);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -678,7 +678,7 @@ createLikelySubtagsString(
|
|||
likelySubtags,
|
||||
sink,
|
||||
err);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -734,7 +734,7 @@ createLikelySubtagsString(
|
|||
likelySubtags,
|
||||
sink,
|
||||
err);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -789,11 +789,11 @@ createLikelySubtagsString(
|
|||
likelySubtags,
|
||||
sink,
|
||||
err);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
error:
|
||||
|
||||
|
@ -801,7 +801,7 @@ error:
|
|||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#define CHECK_TRAILING_VARIANT_SIZE(trailing, trailingLength) UPRV_BLOCK_MACRO_BEGIN { \
|
||||
|
@ -836,7 +836,7 @@ _uloc_addLikelySubtags(const char* localeID,
|
|||
const char* trailing = "";
|
||||
int32_t trailingLength = 0;
|
||||
int32_t trailingIndex = 0;
|
||||
UBool success = FALSE;
|
||||
UBool success = false;
|
||||
|
||||
if(U_FAILURE(*err)) {
|
||||
goto error;
|
||||
|
@ -901,7 +901,7 @@ error:
|
|||
if (!U_FAILURE(*err)) {
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add likely subtags to the sink
|
||||
|
@ -925,7 +925,7 @@ _uloc_minimizeSubtags(const char* localeID,
|
|||
const char* trailing = "";
|
||||
int32_t trailingLength = 0;
|
||||
int32_t trailingIndex = 0;
|
||||
UBool successGetMax = FALSE;
|
||||
UBool successGetMax = false;
|
||||
|
||||
if(U_FAILURE(*err)) {
|
||||
goto error;
|
||||
|
@ -1248,7 +1248,7 @@ _ulocimp_addLikelySubtags(const char* localeID,
|
|||
if (U_SUCCESS(*status)) {
|
||||
return _uloc_addLikelySubtags(localeBuffer.getBuffer(), sink, status);
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1320,14 +1320,14 @@ uloc_isRightToLeft(const char *locale) {
|
|||
char lang[8];
|
||||
int32_t langLength = uloc_getLanguage(locale, lang, UPRV_LENGTHOF(lang), &errorCode);
|
||||
if (U_FAILURE(errorCode) || errorCode == U_STRING_NOT_TERMINATED_WARNING) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (langLength > 0) {
|
||||
const char* langPtr = uprv_strstr(LANG_DIR_STRING, lang);
|
||||
if (langPtr != NULL) {
|
||||
switch (langPtr[langLength]) {
|
||||
case '-': return FALSE;
|
||||
case '+': return TRUE;
|
||||
case '-': return false;
|
||||
case '+': return true;
|
||||
default: break; // partial match of a longer code
|
||||
}
|
||||
}
|
||||
|
@ -1340,12 +1340,12 @@ uloc_isRightToLeft(const char *locale) {
|
|||
ulocimp_addLikelySubtags(locale, sink, &errorCode);
|
||||
}
|
||||
if (U_FAILURE(errorCode) || errorCode == U_STRING_NOT_TERMINATED_WARNING) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
scriptLength = uloc_getScript(likely.data(), script, UPRV_LENGTHOF(script), &errorCode);
|
||||
if (U_FAILURE(errorCode) || errorCode == U_STRING_NOT_TERMINATED_WARNING ||
|
||||
scriptLength == 0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
UScriptCode scriptCode = (UScriptCode)u_getPropertyValueEnum(UCHAR_SCRIPT, script);
|
||||
|
@ -1392,7 +1392,7 @@ ulocimp_getRegionForSupplementalData(const char *localeID, UBool inferRegion,
|
|||
if (U_FAILURE(*status)) {
|
||||
rgLen = 0;
|
||||
} else if (rgLen == 0 && inferRegion) {
|
||||
// no unicode_region_subtag but inferRegion TRUE, try likely subtags
|
||||
// no unicode_region_subtag but inferRegion true, try likely subtags
|
||||
rgStatus = U_ZERO_ERROR;
|
||||
icu::CharString locBuf;
|
||||
{
|
||||
|
|
|
@ -233,7 +233,7 @@ private:
|
|||
return false;
|
||||
}
|
||||
for (int i = 0; i < length; ++i) {
|
||||
stringArray.getValue(i, value); // returns TRUE because i < length
|
||||
stringArray.getValue(i, value); // returns true because i < length
|
||||
rawIndexes[i] = strings.add(value.getUnicodeString(errorCode), errorCode);
|
||||
if (U_FAILURE(errorCode)) { return false; }
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ UBool U_CALLCONV cleanup() {
|
|||
delete gLikelySubtags;
|
||||
gLikelySubtags = nullptr;
|
||||
gInitOnce.reset();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -1053,7 +1053,7 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr
|
|||
{
|
||||
uint16_t langID;
|
||||
uint32_t localeIndex;
|
||||
UBool bLookup = TRUE;
|
||||
UBool bLookup = true;
|
||||
const char *pPosixID = NULL;
|
||||
|
||||
#if U_PLATFORM_HAS_WIN32_API && UCONFIG_USE_WINDOWS_LCID_MAPPING_API
|
||||
|
@ -1074,7 +1074,7 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr
|
|||
if (tmpLen > 1) {
|
||||
int32_t i = 0;
|
||||
// Only need to look up in table if have _, eg for de-de_phoneb type alternate sort.
|
||||
bLookup = FALSE;
|
||||
bLookup = false;
|
||||
for (i = 0; i < UPRV_LENGTHOF(locName); i++)
|
||||
{
|
||||
locName[i] = (char)(windowsLocaleName[i]);
|
||||
|
@ -1088,7 +1088,7 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr
|
|||
// TODO: Should these be mapped from _phoneb to @collation=phonebook, etc.?
|
||||
locName[i] = '\0';
|
||||
tmpLen = i;
|
||||
bLookup = TRUE;
|
||||
bLookup = true;
|
||||
break;
|
||||
}
|
||||
else if (windowsLocaleName[i] == L'-')
|
||||
|
@ -1201,7 +1201,7 @@ uprv_convertToLCIDPlatform(const char* localeID, UErrorCode* status)
|
|||
|
||||
char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {};
|
||||
// this will change it from de_DE@collation=phonebook to de-DE-u-co-phonebk form
|
||||
(void)uloc_toLanguageTag(mylocaleID, asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, status);
|
||||
(void)uloc_toLanguageTag(mylocaleID, asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), false, status);
|
||||
|
||||
if (U_SUCCESS(*status))
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ static UBool U_CALLCONV service_cleanup(void) {
|
|||
delete LocaleUtility_cache;
|
||||
LocaleUtility_cache = NULL;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -97,9 +97,9 @@ public:
|
|||
UBool ensureCapacityForOneMore(int32_t oldLength, UErrorCode &errorCode);
|
||||
UBool equals(const MessagePatternList<T, stackCapacity> &other, int32_t length) const {
|
||||
for(int32_t i=0; i<length; ++i) {
|
||||
if(a[i]!=other.a[i]) { return FALSE; }
|
||||
if(a[i]!=other.a[i]) { return false; }
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
MaybeStackArray<T, stackCapacity> a;
|
||||
|
@ -124,13 +124,13 @@ template<typename T, int32_t stackCapacity>
|
|||
UBool
|
||||
MessagePatternList<T, stackCapacity>::ensureCapacityForOneMore(int32_t oldLength, UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if(a.getCapacity()>oldLength || a.resize(2*oldLength, oldLength)!=NULL) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// MessagePatternList specializations -------------------------------------- ***
|
||||
|
@ -147,7 +147,7 @@ MessagePattern::MessagePattern(UErrorCode &errorCode)
|
|||
: aposMode(UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
hasArgNames(FALSE), hasArgNumbers(FALSE), needsAutoQuoting(FALSE) {
|
||||
hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
|
||||
init(errorCode);
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ MessagePattern::MessagePattern(UMessagePatternApostropheMode mode, UErrorCode &e
|
|||
: aposMode(mode),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
hasArgNames(FALSE), hasArgNumbers(FALSE), needsAutoQuoting(FALSE) {
|
||||
hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
|
||||
init(errorCode);
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ MessagePattern::MessagePattern(const UnicodeString &pattern, UParseError *parseE
|
|||
: aposMode(UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
hasArgNames(FALSE), hasArgNumbers(FALSE), needsAutoQuoting(FALSE) {
|
||||
hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
|
||||
if(init(errorCode)) {
|
||||
parse(pattern, parseError, errorCode);
|
||||
}
|
||||
|
@ -172,15 +172,15 @@ MessagePattern::MessagePattern(const UnicodeString &pattern, UParseError *parseE
|
|||
UBool
|
||||
MessagePattern::init(UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
partsList=new MessagePatternPartsList();
|
||||
if(partsList==NULL) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
parts=partsList->a.getAlias();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
MessagePattern::MessagePattern(const MessagePattern &other)
|
||||
|
@ -215,7 +215,7 @@ MessagePattern::operator=(const MessagePattern &other) {
|
|||
UBool
|
||||
MessagePattern::copyStorage(const MessagePattern &other, UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
parts=NULL;
|
||||
partsLength=0;
|
||||
|
@ -225,14 +225,14 @@ MessagePattern::copyStorage(const MessagePattern &other, UErrorCode &errorCode)
|
|||
partsList=new MessagePatternPartsList();
|
||||
if(partsList==NULL) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
parts=partsList->a.getAlias();
|
||||
}
|
||||
if(other.partsLength>0) {
|
||||
partsList->copyFrom(*other.partsList, other.partsLength, errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
parts=partsList->a.getAlias();
|
||||
partsLength=other.partsLength;
|
||||
|
@ -242,19 +242,19 @@ MessagePattern::copyStorage(const MessagePattern &other, UErrorCode &errorCode)
|
|||
numericValuesList=new MessagePatternDoubleList();
|
||||
if(numericValuesList==NULL) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
numericValues=numericValuesList->a.getAlias();
|
||||
}
|
||||
numericValuesList->copyFrom(
|
||||
*other.numericValuesList, other.numericValuesLength, errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
numericValues=numericValuesList->a.getAlias();
|
||||
numericValuesLength=other.numericValuesLength;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
MessagePattern::~MessagePattern() {
|
||||
|
@ -303,8 +303,8 @@ void
|
|||
MessagePattern::clear() {
|
||||
// Mostly the same as preParse().
|
||||
msg.remove();
|
||||
hasArgNames=hasArgNumbers=FALSE;
|
||||
needsAutoQuoting=FALSE;
|
||||
hasArgNames=hasArgNumbers=false;
|
||||
needsAutoQuoting=false;
|
||||
partsLength=0;
|
||||
numericValuesLength=0;
|
||||
}
|
||||
|
@ -414,8 +414,8 @@ MessagePattern::preParse(const UnicodeString &pattern, UParseError *parseError,
|
|||
parseError->postContext[0]=0;
|
||||
}
|
||||
msg=pattern;
|
||||
hasArgNames=hasArgNumbers=FALSE;
|
||||
needsAutoQuoting=FALSE;
|
||||
hasArgNames=hasArgNumbers=false;
|
||||
needsAutoQuoting=false;
|
||||
partsLength=0;
|
||||
numericValuesLength=0;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength,
|
|||
// Add a Part for auto-quoting.
|
||||
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
|
||||
u_apos, errorCode); // value=char to be inserted
|
||||
needsAutoQuoting=TRUE;
|
||||
needsAutoQuoting=true;
|
||||
} else {
|
||||
c=msg.charAt(index);
|
||||
if(c==u_apos) {
|
||||
|
@ -491,7 +491,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength,
|
|||
// Add a Part for auto-quoting.
|
||||
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
|
||||
u_apos, errorCode); // value=char to be inserted
|
||||
needsAutoQuoting=TRUE;
|
||||
needsAutoQuoting=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength,
|
|||
// Add a Part for auto-quoting.
|
||||
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
|
||||
u_apos, errorCode); // value=char to be inserted
|
||||
needsAutoQuoting=TRUE;
|
||||
needsAutoQuoting=true;
|
||||
}
|
||||
}
|
||||
} else if(UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE(parentType) && c==u_pound) {
|
||||
|
@ -560,7 +560,7 @@ MessagePattern::parseArg(int32_t index, int32_t argStartLength, int32_t nestingL
|
|||
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0;
|
||||
}
|
||||
hasArgNumbers=TRUE;
|
||||
hasArgNumbers=true;
|
||||
addPart(UMSGPAT_PART_TYPE_ARG_NUMBER, nameIndex, length, number, errorCode);
|
||||
} else if(number==UMSGPAT_ARG_NAME_NOT_NUMBER) {
|
||||
int32_t length=index-nameIndex;
|
||||
|
@ -569,7 +569,7 @@ MessagePattern::parseArg(int32_t index, int32_t argStartLength, int32_t nestingL
|
|||
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0;
|
||||
}
|
||||
hasArgNames=TRUE;
|
||||
hasArgNames=true;
|
||||
addPart(UMSGPAT_PART_TYPE_ARG_NAME, nameIndex, length, 0, errorCode);
|
||||
} else { // number<-1 (ARG_NAME_NOT_VALID)
|
||||
setParseError(parseError, nameIndex); // Bad argument syntax.
|
||||
|
@ -727,7 +727,7 @@ MessagePattern::parseChoiceStyle(int32_t index, int32_t nestingLevel,
|
|||
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0;
|
||||
}
|
||||
parseDouble(numberIndex, index, TRUE, parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
|
||||
parseDouble(numberIndex, index, true, parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -774,8 +774,8 @@ MessagePattern::parsePluralOrSelectStyle(UMessagePatternArgType argType,
|
|||
return 0;
|
||||
}
|
||||
int32_t start=index;
|
||||
UBool isEmpty=TRUE;
|
||||
UBool hasOther=FALSE;
|
||||
UBool isEmpty=true;
|
||||
UBool hasOther=false;
|
||||
for(;;) {
|
||||
// First, collect the selector looking for a small set of terminators.
|
||||
// It would be a little faster to consider the syntax of each possible
|
||||
|
@ -811,7 +811,7 @@ MessagePattern::parsePluralOrSelectStyle(UMessagePatternArgType argType,
|
|||
return 0;
|
||||
}
|
||||
addPart(UMSGPAT_PART_TYPE_ARG_SELECTOR, selectorIndex, length, 0, errorCode);
|
||||
parseDouble(selectorIndex+1, index, FALSE,
|
||||
parseDouble(selectorIndex+1, index, false,
|
||||
parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
|
||||
} else {
|
||||
index=skipIdentifier(index);
|
||||
|
@ -845,12 +845,12 @@ MessagePattern::parsePluralOrSelectStyle(UMessagePatternArgType argType,
|
|||
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0;
|
||||
}
|
||||
parseDouble(valueIndex, index, FALSE,
|
||||
parseDouble(valueIndex, index, false,
|
||||
parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return 0;
|
||||
}
|
||||
isEmpty=FALSE;
|
||||
isEmpty=false;
|
||||
continue; // no message fragment after the offset
|
||||
} else {
|
||||
// normal selector word
|
||||
|
@ -861,7 +861,7 @@ MessagePattern::parsePluralOrSelectStyle(UMessagePatternArgType argType,
|
|||
}
|
||||
addPart(UMSGPAT_PART_TYPE_ARG_SELECTOR, selectorIndex, length, 0, errorCode);
|
||||
if(0==msg.compare(selectorIndex, length, kOther, 0, 5)) {
|
||||
hasOther=TRUE;
|
||||
hasOther=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -880,7 +880,7 @@ MessagePattern::parsePluralOrSelectStyle(UMessagePatternArgType argType,
|
|||
if(U_FAILURE(errorCode)) {
|
||||
return 0;
|
||||
}
|
||||
isEmpty=FALSE;
|
||||
isEmpty=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -901,11 +901,11 @@ MessagePattern::parseArgNumber(const UnicodeString &s, int32_t start, int32_t li
|
|||
return 0;
|
||||
} else {
|
||||
number=0;
|
||||
badNumber=TRUE; // leading zero
|
||||
badNumber=true; // leading zero
|
||||
}
|
||||
} else if(0x31<=c && c<=0x39) {
|
||||
number=c-0x30;
|
||||
badNumber=FALSE;
|
||||
badNumber=false;
|
||||
} else {
|
||||
return UMSGPAT_ARG_NAME_NOT_NUMBER;
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ MessagePattern::parseArgNumber(const UnicodeString &s, int32_t start, int32_t li
|
|||
c=s.charAt(start++);
|
||||
if(0x30<=c && c<=0x39) {
|
||||
if(number>=INT32_MAX/10) {
|
||||
badNumber=TRUE; // overflow
|
||||
badNumber=true; // overflow
|
||||
}
|
||||
number=number*10+(c-0x30);
|
||||
} else {
|
||||
|
|
|
@ -62,7 +62,7 @@ Normalizer2::normalizeUTF8(uint32_t /*options*/, StringPiece src, ByteSink &sink
|
|||
|
||||
UBool
|
||||
Normalizer2::getRawDecomposition(UChar32, UnicodeString &) const {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
UChar32
|
||||
|
@ -142,7 +142,7 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
}
|
||||
virtual UBool
|
||||
getDecomposition(UChar32, UnicodeString &) const U_OVERRIDE {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// No need to U_OVERRIDE the default getRawDecomposition().
|
||||
virtual UBool
|
||||
|
@ -161,9 +161,9 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
spanQuickCheckYes(const UnicodeString &s, UErrorCode &) const U_OVERRIDE {
|
||||
return s.length();
|
||||
}
|
||||
virtual UBool hasBoundaryBefore(UChar32) const U_OVERRIDE { return TRUE; }
|
||||
virtual UBool hasBoundaryAfter(UChar32) const U_OVERRIDE { return TRUE; }
|
||||
virtual UBool isInert(UChar32) const U_OVERRIDE { return TRUE; }
|
||||
virtual UBool hasBoundaryBefore(UChar32) const U_OVERRIDE { return true; }
|
||||
virtual UBool hasBoundaryAfter(UChar32) const U_OVERRIDE { return true; }
|
||||
virtual UBool isInert(UChar32) const U_OVERRIDE { return true; }
|
||||
};
|
||||
|
||||
NoopNormalizer2::~NoopNormalizer2() {}
|
||||
|
@ -299,7 +299,7 @@ static UBool U_CALLCONV uprv_normalizer2_cleanup() {
|
|||
nfcSingleton = NULL;
|
||||
nfcInitOnce.reset();
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
U_CDECL_END
|
||||
|
@ -423,7 +423,7 @@ unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
|
|||
return normalizeSecondAndAppend(norm2,
|
||||
first, firstLength, firstCapacity,
|
||||
second, secondLength,
|
||||
TRUE, pErrorCode);
|
||||
true, pErrorCode);
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
|
@ -434,7 +434,7 @@ unorm2_append(const UNormalizer2 *norm2,
|
|||
return normalizeSecondAndAppend(norm2,
|
||||
first, firstLength, firstCapacity,
|
||||
second, secondLength,
|
||||
FALSE, pErrorCode);
|
||||
false, pErrorCode);
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
|
|
|
@ -185,7 +185,7 @@ UBool ReorderingBuffer::init(int32_t destCapacity, UErrorCode &errorCode) {
|
|||
if(start==NULL) {
|
||||
// getBuffer() already did str.setToBogus()
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
limit=start+length;
|
||||
remainingCapacity=str.getCapacity()-length;
|
||||
|
@ -201,7 +201,7 @@ UBool ReorderingBuffer::init(int32_t destCapacity, UErrorCode &errorCode) {
|
|||
}
|
||||
reorderStart=codePointLimit;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool ReorderingBuffer::equals(const UChar *otherStart, const UChar *otherLimit) const {
|
||||
|
@ -217,7 +217,7 @@ UBool ReorderingBuffer::equals(const uint8_t *otherStart, const uint8_t *otherLi
|
|||
int32_t otherLength = (int32_t)(otherLimit - otherStart);
|
||||
// For equal strings, UTF-8 is at least as long as UTF-16, and at most three times as long.
|
||||
if (otherLength < length || (otherLength / 3) > length) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Compare valid strings from between normalization boundaries.
|
||||
// (Invalid sequences are normalization-inert.)
|
||||
|
@ -225,21 +225,21 @@ UBool ReorderingBuffer::equals(const uint8_t *otherStart, const uint8_t *otherLi
|
|||
if (i >= length) {
|
||||
return j >= otherLength;
|
||||
} else if (j >= otherLength) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Not at the end of either string yet.
|
||||
UChar32 c, other;
|
||||
U16_NEXT_UNSAFE(start, i, c);
|
||||
U8_NEXT_UNSAFE(otherStart, j, other);
|
||||
if (c != other) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UBool ReorderingBuffer::appendSupplementary(UChar32 c, uint8_t cc, UErrorCode &errorCode) {
|
||||
if(remainingCapacity<2 && !resize(2, errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if(lastCC<=cc || cc==0) {
|
||||
limit[0]=U16_LEAD(c);
|
||||
|
@ -253,17 +253,17 @@ UBool ReorderingBuffer::appendSupplementary(UChar32 c, uint8_t cc, UErrorCode &e
|
|||
insert(c, cc);
|
||||
}
|
||||
remainingCapacity-=2;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool ReorderingBuffer::append(const UChar *s, int32_t length, UBool isNFD,
|
||||
uint8_t leadCC, uint8_t trailCC,
|
||||
UErrorCode &errorCode) {
|
||||
if(length==0) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if(remainingCapacity<length && !resize(length, errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
remainingCapacity-=length;
|
||||
if(lastCC<=leadCC || leadCC==0) {
|
||||
|
@ -294,13 +294,13 @@ UBool ReorderingBuffer::append(const UChar *s, int32_t length, UBool isNFD,
|
|||
append(c, leadCC, errorCode);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool ReorderingBuffer::appendZeroCC(UChar32 c, UErrorCode &errorCode) {
|
||||
int32_t cpLength=U16_LENGTH(c);
|
||||
if(remainingCapacity<cpLength && !resize(cpLength, errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
remainingCapacity-=cpLength;
|
||||
if(cpLength==1) {
|
||||
|
@ -312,23 +312,23 @@ UBool ReorderingBuffer::appendZeroCC(UChar32 c, UErrorCode &errorCode) {
|
|||
}
|
||||
lastCC=0;
|
||||
reorderStart=limit;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool ReorderingBuffer::appendZeroCC(const UChar *s, const UChar *sLimit, UErrorCode &errorCode) {
|
||||
if(s==sLimit) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
int32_t length=(int32_t)(sLimit-s);
|
||||
if(remainingCapacity<length && !resize(length, errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
u_memcpy(limit, s, length);
|
||||
limit+=length;
|
||||
remainingCapacity-=length;
|
||||
lastCC=0;
|
||||
reorderStart=limit;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReorderingBuffer::remove() {
|
||||
|
@ -365,12 +365,12 @@ UBool ReorderingBuffer::resize(int32_t appendLength, UErrorCode &errorCode) {
|
|||
if(start==NULL) {
|
||||
// getBuffer() already did str.setToBogus()
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
reorderStart=start+reorderStartIndex;
|
||||
limit=start+length;
|
||||
remainingCapacity=str.getCapacity()-length;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReorderingBuffer::skipPrevious() {
|
||||
|
@ -728,7 +728,7 @@ UBool Normalizer2Impl::decompose(UChar32 c, uint16_t norm16,
|
|||
} else {
|
||||
leadCC=0;
|
||||
}
|
||||
return buffer.append((const UChar *)mapping+1, length, TRUE, leadCC, trailCC, errorCode);
|
||||
return buffer.append((const UChar *)mapping+1, length, true, leadCC, trailCC, errorCode);
|
||||
}
|
||||
|
||||
// Dual functionality:
|
||||
|
@ -820,11 +820,11 @@ Normalizer2Impl::decomposeUTF8(uint32_t options,
|
|||
if (U_FAILURE(errorCode)) {
|
||||
break;
|
||||
}
|
||||
decomposeShort(prevBoundary, src, STOP_AT_LIMIT, FALSE /* onlyContiguous */,
|
||||
decomposeShort(prevBoundary, src, STOP_AT_LIMIT, false /* onlyContiguous */,
|
||||
buffer, errorCode);
|
||||
// Decompose until the next boundary.
|
||||
if (buffer.getLastCC() > 1) {
|
||||
src = decomposeShort(src, limit, STOP_AT_DECOMP_BOUNDARY, FALSE /* onlyContiguous */,
|
||||
src = decomposeShort(src, limit, STOP_AT_DECOMP_BOUNDARY, false /* onlyContiguous */,
|
||||
buffer, errorCode);
|
||||
}
|
||||
if (U_FAILURE(errorCode)) {
|
||||
|
@ -931,7 +931,7 @@ Normalizer2Impl::decomposeShort(const uint8_t *src, const uint8_t *limit,
|
|||
if (leadCC == 0 && stopAt == STOP_AT_DECOMP_BOUNDARY) {
|
||||
return prevSrc;
|
||||
}
|
||||
if (!buffer.append((const char16_t *)mapping+1, length, TRUE, leadCC, trailCC, errorCode)) {
|
||||
if (!buffer.append((const char16_t *)mapping+1, length, true, leadCC, trailCC, errorCode)) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -1052,7 +1052,7 @@ void Normalizer2Impl::decomposeAndAppend(const UChar *src, const UChar *limit,
|
|||
limit=u_strchr(p, 0);
|
||||
}
|
||||
|
||||
if (buffer.append(src, (int32_t)(p - src), FALSE, firstCC, prevCC, errorCode)) {
|
||||
if (buffer.append(src, (int32_t)(p - src), false, firstCC, prevCC, errorCode)) {
|
||||
buffer.appendZeroCC(p, limit, errorCode);
|
||||
}
|
||||
}
|
||||
|
@ -1064,7 +1064,7 @@ UBool Normalizer2Impl::hasDecompBoundaryBefore(UChar32 c) const {
|
|||
|
||||
UBool Normalizer2Impl::norm16HasDecompBoundaryBefore(uint16_t norm16) const {
|
||||
if (norm16 < minNoNoCompNoMaybeCC) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (norm16 >= limitNoNo) {
|
||||
return norm16 <= MIN_NORMAL_MAYBE_YES || norm16 == JAMO_VT;
|
||||
|
@ -1072,23 +1072,23 @@ UBool Normalizer2Impl::norm16HasDecompBoundaryBefore(uint16_t norm16) const {
|
|||
// c decomposes, get everything from the variable-length extra data
|
||||
const uint16_t *mapping=getMapping(norm16);
|
||||
uint16_t firstUnit=*mapping;
|
||||
// TRUE if leadCC==0 (hasFCDBoundaryBefore())
|
||||
// true if leadCC==0 (hasFCDBoundaryBefore())
|
||||
return (firstUnit&MAPPING_HAS_CCC_LCCC_WORD)==0 || (*(mapping-1)&0xff00)==0;
|
||||
}
|
||||
|
||||
UBool Normalizer2Impl::hasDecompBoundaryAfter(UChar32 c) const {
|
||||
if (c < minDecompNoCP) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (c <= 0xffff && !singleLeadMightHaveNonZeroFCD16(c)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return norm16HasDecompBoundaryAfter(getNorm16(c));
|
||||
}
|
||||
|
||||
UBool Normalizer2Impl::norm16HasDecompBoundaryAfter(uint16_t norm16) const {
|
||||
if(norm16 <= minYesNo || isHangulLVT(norm16)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (norm16 >= limitNoNo) {
|
||||
if (isMaybeOrNonZeroCC(norm16)) {
|
||||
|
@ -1103,13 +1103,13 @@ UBool Normalizer2Impl::norm16HasDecompBoundaryAfter(uint16_t norm16) const {
|
|||
// decomp after-boundary: same as hasFCDBoundaryAfter(),
|
||||
// fcd16<=1 || trailCC==0
|
||||
if(firstUnit>0x1ff) {
|
||||
return FALSE; // trailCC>1
|
||||
return false; // trailCC>1
|
||||
}
|
||||
if(firstUnit<=0xff) {
|
||||
return TRUE; // trailCC==0
|
||||
return true; // trailCC==0
|
||||
}
|
||||
// if(trailCC==1) test leadCC==0, same as checking for before-boundary
|
||||
// TRUE if leadCC==0 (hasFCDBoundaryBefore())
|
||||
// true if leadCC==0 (hasFCDBoundaryBefore())
|
||||
return (firstUnit&MAPPING_HAS_CCC_LCCC_WORD)==0 || (*(mapping-1)&0xff00)==0;
|
||||
}
|
||||
|
||||
|
@ -1235,7 +1235,7 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
|
|||
// and are only initialized now to avoid compiler warnings.
|
||||
compositionsList=NULL; // used as indicator for whether we have a forward-combining starter
|
||||
starter=NULL;
|
||||
starterIsSupplementary=FALSE;
|
||||
starterIsSupplementary=false;
|
||||
prevCC=0;
|
||||
|
||||
for(;;) {
|
||||
|
@ -1301,7 +1301,7 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
|
|||
*starter=(UChar)composite;
|
||||
// The composite is shorter than the starter,
|
||||
// move the intermediate characters forward one.
|
||||
starterIsSupplementary=FALSE;
|
||||
starterIsSupplementary=false;
|
||||
q=starter+1;
|
||||
r=q+1;
|
||||
while(r<pRemove) {
|
||||
|
@ -1312,7 +1312,7 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
|
|||
} else if(U_IS_SUPPLEMENTARY(composite)) {
|
||||
// The composite is longer than the starter,
|
||||
// move the intermediate characters back one.
|
||||
starterIsSupplementary=TRUE;
|
||||
starterIsSupplementary=true;
|
||||
++starter; // temporarily increment for the loop boundary
|
||||
q=pRemove;
|
||||
r=++pRemove;
|
||||
|
@ -1366,10 +1366,10 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
|
|||
if((compositionsList=getCompositionsListForDecompYes(norm16))!=NULL) {
|
||||
// It may combine with something, prepare for it.
|
||||
if(U_IS_BMP(c)) {
|
||||
starterIsSupplementary=FALSE;
|
||||
starterIsSupplementary=false;
|
||||
starter=p-1;
|
||||
} else {
|
||||
starterIsSupplementary=TRUE;
|
||||
starterIsSupplementary=true;
|
||||
starter=p-2;
|
||||
}
|
||||
}
|
||||
|
@ -1447,7 +1447,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
doCompose ? &buffer : NULL,
|
||||
errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
limit=u_strchr(src, 0);
|
||||
if (prevBoundary != src) {
|
||||
|
@ -1471,7 +1471,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
if (prevBoundary != limit && doCompose) {
|
||||
buffer.appendZeroCC(prevBoundary, limit, errorCode);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if( (c=*src)<minNoMaybeCP ||
|
||||
isCompYesAndZeroCC(norm16=UCPTRIE_FAST_BMP_GET(normTrie, UCPTRIE_16, c))
|
||||
|
@ -1503,7 +1503,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
// Medium-fast path: Handle cases that do not require full decomposition and recomposition.
|
||||
if (!isMaybeOrNonZeroCC(norm16)) { // minNoNo <= norm16 < minMaybeYes
|
||||
if (!doCompose) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Fast path for mapping a character that is immediately surrounded by boundaries.
|
||||
// In this case, we need not decompose around the current character.
|
||||
|
@ -1559,7 +1559,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
UChar l = (UChar)(prev-Hangul::JAMO_L_BASE);
|
||||
if(l<Hangul::JAMO_L_COUNT) {
|
||||
if (!doCompose) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
int32_t t;
|
||||
if (src != limit &&
|
||||
|
@ -1599,7 +1599,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
// The current character is a Jamo Trailing consonant,
|
||||
// compose with previous Hangul LV that does not contain a Jamo T.
|
||||
if (!doCompose) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
UChar32 syllable = prev + c - Hangul::JAMO_T_BASE;
|
||||
--prevSrc; // Replace the Hangul LV as well.
|
||||
|
@ -1622,7 +1622,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
if (onlyContiguous /* FCC */ && getPreviousTrailCC(prevBoundary, prevSrc) > cc) {
|
||||
// Fails FCD test, need to decompose and contiguously recompose.
|
||||
if (!doCompose) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// If !onlyContiguous (not FCC), then we ignore the tccc of
|
||||
|
@ -1634,7 +1634,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
if (doCompose) {
|
||||
buffer.appendZeroCC(prevBoundary, limit, errorCode);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
uint8_t prevCC = cc;
|
||||
nextSrc = src;
|
||||
|
@ -1643,7 +1643,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
cc = getCCFromNormalYesOrMaybe(n16);
|
||||
if (prevCC > cc) {
|
||||
if (!doCompose) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1678,28 +1678,28 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
|
|||
}
|
||||
int32_t recomposeStartIndex=buffer.length();
|
||||
// We know there is not a boundary here.
|
||||
decomposeShort(prevSrc, src, FALSE /* !stopAtCompBoundary */, onlyContiguous,
|
||||
decomposeShort(prevSrc, src, false /* !stopAtCompBoundary */, onlyContiguous,
|
||||
buffer, errorCode);
|
||||
// Decompose until the next boundary.
|
||||
src = decomposeShort(src, limit, TRUE /* stopAtCompBoundary */, onlyContiguous,
|
||||
src = decomposeShort(src, limit, true /* stopAtCompBoundary */, onlyContiguous,
|
||||
buffer, errorCode);
|
||||
if (U_FAILURE(errorCode)) {
|
||||
break;
|
||||
}
|
||||
if ((src - prevSrc) > INT32_MAX) { // guard before buffer.equals()
|
||||
errorCode = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
recompose(buffer, recomposeStartIndex, onlyContiguous);
|
||||
if(!doCompose) {
|
||||
if(!buffer.equals(prevSrc, src)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
buffer.remove();
|
||||
}
|
||||
prevBoundary=src;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Very similar to compose(): Make the same changes in both places if relevant.
|
||||
|
@ -1846,7 +1846,7 @@ void Normalizer2Impl::composeAndAppend(const UChar *src, const UChar *limit,
|
|||
middle.append(src, (int32_t)(firstStarterInSrc-src));
|
||||
const UChar *middleStart=middle.getBuffer();
|
||||
compose(middleStart, middleStart+middle.length(), onlyContiguous,
|
||||
TRUE, buffer, errorCode);
|
||||
true, buffer, errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1854,7 +1854,7 @@ void Normalizer2Impl::composeAndAppend(const UChar *src, const UChar *limit,
|
|||
}
|
||||
}
|
||||
if(doCompose) {
|
||||
compose(src, limit, onlyContiguous, TRUE, buffer, errorCode);
|
||||
compose(src, limit, onlyContiguous, true, buffer, errorCode);
|
||||
} else {
|
||||
if(limit==NULL) { // appendZeroCC() needs limit!=NULL
|
||||
limit=u_strchr(src, 0);
|
||||
|
@ -1883,7 +1883,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
ByteSinkUtil::appendUnchanged(prevBoundary, limit,
|
||||
*sink, options, edits, errorCode);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (*src < minNoMaybeLead) {
|
||||
++src;
|
||||
|
@ -1904,7 +1904,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
// Medium-fast path: Handle cases that do not require full decomposition and recomposition.
|
||||
if (!isMaybeOrNonZeroCC(norm16)) { // minNoNo <= norm16 < minMaybeYes
|
||||
if (sink == nullptr) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Fast path for mapping a character that is immediately surrounded by boundaries.
|
||||
// In this case, we need not decompose around the current character.
|
||||
|
@ -1972,7 +1972,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
UChar32 l = prev - Hangul::JAMO_L_BASE;
|
||||
if ((uint32_t)l < Hangul::JAMO_L_COUNT) {
|
||||
if (sink == nullptr) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
int32_t t = getJamoTMinusBase(src, limit);
|
||||
if (t >= 0) {
|
||||
|
@ -2008,7 +2008,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
// The current character is a Jamo Trailing consonant,
|
||||
// compose with previous Hangul LV that does not contain a Jamo T.
|
||||
if (sink == nullptr) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
UChar32 syllable = prev + getJamoTMinusBase(prevSrc, src);
|
||||
prevSrc -= 3; // Replace the Hangul LV as well.
|
||||
|
@ -2031,7 +2031,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
if (onlyContiguous /* FCC */ && getPreviousTrailCC(prevBoundary, prevSrc) > cc) {
|
||||
// Fails FCD test, need to decompose and contiguously recompose.
|
||||
if (sink == nullptr) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// If !onlyContiguous (not FCC), then we ignore the tccc of
|
||||
|
@ -2044,7 +2044,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
ByteSinkUtil::appendUnchanged(prevBoundary, limit,
|
||||
*sink, options, edits, errorCode);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
uint8_t prevCC = cc;
|
||||
nextSrc = src;
|
||||
|
@ -2053,7 +2053,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
cc = getCCFromNormalYesOrMaybe(n16);
|
||||
if (prevCC > cc) {
|
||||
if (sink == nullptr) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2098,12 +2098,12 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
}
|
||||
if ((src - prevSrc) > INT32_MAX) { // guard before buffer.equals()
|
||||
errorCode = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
recompose(buffer, 0, onlyContiguous);
|
||||
if (!buffer.equals(prevSrc, src)) {
|
||||
if (sink == nullptr) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (prevBoundary != prevSrc &&
|
||||
!ByteSinkUtil::appendUnchanged(prevBoundary, prevSrc,
|
||||
|
@ -2117,12 +2117,12 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
|
|||
prevBoundary = src;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UBool Normalizer2Impl::hasCompBoundaryBefore(const UChar *src, const UChar *limit) const {
|
||||
if (src == limit || *src < minCompNoMaybeCP) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
UChar32 c;
|
||||
uint16_t norm16;
|
||||
|
@ -2132,7 +2132,7 @@ UBool Normalizer2Impl::hasCompBoundaryBefore(const UChar *src, const UChar *limi
|
|||
|
||||
UBool Normalizer2Impl::hasCompBoundaryBefore(const uint8_t *src, const uint8_t *limit) const {
|
||||
if (src == limit) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
uint16_t norm16;
|
||||
UCPTRIE_FAST_U8_NEXT(normTrie, UCPTRIE_16, src, limit, norm16);
|
||||
|
@ -2142,7 +2142,7 @@ UBool Normalizer2Impl::hasCompBoundaryBefore(const uint8_t *src, const uint8_t *
|
|||
UBool Normalizer2Impl::hasCompBoundaryAfter(const UChar *start, const UChar *p,
|
||||
UBool onlyContiguous) const {
|
||||
if (start == p) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
UChar32 c;
|
||||
uint16_t norm16;
|
||||
|
@ -2153,7 +2153,7 @@ UBool Normalizer2Impl::hasCompBoundaryAfter(const UChar *start, const UChar *p,
|
|||
UBool Normalizer2Impl::hasCompBoundaryAfter(const uint8_t *start, const uint8_t *p,
|
||||
UBool onlyContiguous) const {
|
||||
if (start == p) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
uint16_t norm16;
|
||||
UCPTRIE_FAST_U8_PREV(normTrie, UCPTRIE_16, start, p, norm16);
|
||||
|
@ -2399,7 +2399,7 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit,
|
|||
* The source text does not fulfill the conditions for FCD.
|
||||
* Decompose and reorder a limited piece of the text.
|
||||
*/
|
||||
decomposeShort(prevBoundary, src, FALSE, FALSE, *buffer, errorCode);
|
||||
decomposeShort(prevBoundary, src, false, false, *buffer, errorCode);
|
||||
if (U_FAILURE(errorCode)) {
|
||||
break;
|
||||
}
|
||||
|
@ -2665,7 +2665,7 @@ UBool Normalizer2Impl::isCanonSegmentStarter(UChar32 c) const {
|
|||
UBool Normalizer2Impl::getCanonStartSet(UChar32 c, UnicodeSet &set) const {
|
||||
int32_t canonValue=getCanonValue(c)&~CANON_NOT_SEGMENT_STARTER;
|
||||
if(canonValue==0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
set.clear();
|
||||
int32_t value=canonValue&CANON_VALUE_MASK;
|
||||
|
@ -2684,7 +2684,7 @@ UBool Normalizer2Impl::getCanonStartSet(UChar32 c, UnicodeSet &set) const {
|
|||
addComposites(getCompositionsList(norm16), set);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
|
@ -205,7 +205,7 @@ Normalizer::isNormalized(const UnicodeString& source,
|
|||
return n2->isNormalized(source, status);
|
||||
}
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -483,7 +483,7 @@ Normalizer::nextNormalize() {
|
|||
currentIndex=nextIndex;
|
||||
text->setIndex(nextIndex);
|
||||
if(!text->hasNext()) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Skip at least one character so we make progress.
|
||||
UnicodeString segment(text->next32PostInc());
|
||||
|
@ -507,7 +507,7 @@ Normalizer::previousNormalize() {
|
|||
nextIndex=currentIndex;
|
||||
text->setIndex(currentIndex);
|
||||
if(!text->hasPrevious()) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
UnicodeString segment;
|
||||
while(text->hasPrevious()) {
|
||||
|
|
|
@ -118,49 +118,49 @@ static const uint32_t syntaxOrWhiteSpace2000[]={
|
|||
UBool
|
||||
PatternProps::isSyntax(UChar32 c) {
|
||||
if(c<0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if(c<=0xff) {
|
||||
return (UBool)(latin1[c]>>1)&1;
|
||||
} else if(c<0x2010) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if(c<=0x3030) {
|
||||
uint32_t bits=syntax2000[index2000[(c-0x2000)>>5]];
|
||||
return (UBool)((bits>>(c&0x1f))&1);
|
||||
} else if(0xfd3e<=c && c<=0xfe46) {
|
||||
return c<=0xfd3f || 0xfe45<=c;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
PatternProps::isSyntaxOrWhiteSpace(UChar32 c) {
|
||||
if(c<0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if(c<=0xff) {
|
||||
return (UBool)(latin1[c]&1);
|
||||
} else if(c<0x200e) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if(c<=0x3030) {
|
||||
uint32_t bits=syntaxOrWhiteSpace2000[index2000[(c-0x2000)>>5]];
|
||||
return (UBool)((bits>>(c&0x1f))&1);
|
||||
} else if(0xfd3e<=c && c<=0xfe46) {
|
||||
return c<=0xfd3f || 0xfe45<=c;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
PatternProps::isWhiteSpace(UChar32 c) {
|
||||
if(c<0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if(c<=0xff) {
|
||||
return (UBool)(latin1[c]>>2)&1;
|
||||
} else if(0x200e<=c && c<=0x2029) {
|
||||
return c<=0x200f || 0x2028<=c;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,15 +207,15 @@ PatternProps::trimWhiteSpace(const UChar *s, int32_t &length) {
|
|||
UBool
|
||||
PatternProps::isIdentifier(const UChar *s, int32_t length) {
|
||||
if(length<=0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
const UChar *limit=s+length;
|
||||
do {
|
||||
if(isSyntaxOrWhiteSpace(*s++)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} while(s<limit);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
const UChar *
|
||||
|
|
|
@ -218,7 +218,7 @@ const char *PropNameData::getName(const char *nameGroup, int32_t nameIndex) {
|
|||
|
||||
UBool PropNameData::containsName(BytesTrie &trie, const char *name) {
|
||||
if(name==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
UStringTrieResult result=USTRINGTRIE_NO_VALUE;
|
||||
char c;
|
||||
|
@ -229,7 +229,7 @@ UBool PropNameData::containsName(BytesTrie &trie, const char *name) {
|
|||
continue;
|
||||
}
|
||||
if(!USTRINGTRIE_HAS_NEXT(result)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
result=trie.next((uint8_t)c);
|
||||
}
|
||||
|
|
|
@ -351,7 +351,7 @@ upvec_compact(UPropsVectors *pv, UPVecCompactHandler *handler, void *context, UE
|
|||
}
|
||||
|
||||
/* Set the flag now: Sorting and compacting destroys the builder data structure. */
|
||||
pv->isCompacted=TRUE;
|
||||
pv->isCompacted=true;
|
||||
|
||||
rows=pv->rows;
|
||||
columns=pv->columns;
|
||||
|
@ -360,7 +360,7 @@ upvec_compact(UPropsVectors *pv, UPVecCompactHandler *handler, void *context, UE
|
|||
|
||||
/* sort the properties vectors to find unique vector values */
|
||||
uprv_sortArray(pv->v, rows, columns*4,
|
||||
upvec_compareRows, pv, FALSE, pErrorCode);
|
||||
upvec_compareRows, pv, false, pErrorCode);
|
||||
if(U_FAILURE(*pErrorCode)) {
|
||||
return;
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ upvec_compactToUTrie2Handler(void *context,
|
|||
(void)columns;
|
||||
UPVecToUTrie2Context *toUTrie2=(UPVecToUTrie2Context *)context;
|
||||
if(start<UPVEC_FIRST_SPECIAL_CP) {
|
||||
utrie2_setRange32(toUTrie2->trie, start, end, (uint32_t)rowIndex, TRUE, pErrorCode);
|
||||
utrie2_setRange32(toUTrie2->trie, start, end, (uint32_t)rowIndex, true, pErrorCode);
|
||||
} else {
|
||||
switch(start) {
|
||||
case UPVEC_INITIAL_VALUE_CP:
|
||||
|
|
|
@ -573,7 +573,7 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
|
|||
/* Case of last character determines uppercase flag: */
|
||||
caseFlags[codeUnitIndex]=IS_BASIC_UPPERCASE(src[in-1]);
|
||||
if(cpLength==2) {
|
||||
caseFlags[codeUnitIndex+1]=FALSE;
|
||||
caseFlags[codeUnitIndex+1]=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ u_signBit(double d) {
|
|||
*/
|
||||
UDate fakeClock_t0 = 0; /** Time to start the clock from **/
|
||||
UDate fakeClock_dt = 0; /** Offset (fake time - real time) **/
|
||||
UBool fakeClock_set = FALSE; /** True if fake clock has spun up **/
|
||||
UBool fakeClock_set = false; /** True if fake clock has spun up **/
|
||||
|
||||
static UDate getUTCtime_real() {
|
||||
struct timeval posixTime;
|
||||
|
@ -269,7 +269,7 @@ static UDate getUTCtime_fake() {
|
|||
fprintf(stderr,"U_DEBUG_FAKETIME was set at compile time, but U_FAKETIME_START was not set.\n"
|
||||
"Set U_FAKETIME_START to the number of milliseconds since 1/1/1970 to set the ICU clock.\n");
|
||||
}
|
||||
fakeClock_set = TRUE;
|
||||
fakeClock_set = true;
|
||||
}
|
||||
umtx_unlock(&fakeClockMutex);
|
||||
|
||||
|
@ -905,7 +905,7 @@ static UBool compareBinaryFiles(const char* defaultTZFileName, const char* TZFil
|
|||
int32_t sizeFileRead;
|
||||
int32_t sizeFileToRead;
|
||||
char bufferFile[MAX_READ_SIZE];
|
||||
UBool result = TRUE;
|
||||
UBool result = true;
|
||||
|
||||
if (tzInfo->defaultTZFilePtr == NULL) {
|
||||
tzInfo->defaultTZFilePtr = fopen(defaultTZFileName, "r");
|
||||
|
@ -925,7 +925,7 @@ static UBool compareBinaryFiles(const char* defaultTZFileName, const char* TZFil
|
|||
sizeFileLeft = sizeFile;
|
||||
|
||||
if (sizeFile != tzInfo->defaultTZFileSize) {
|
||||
result = FALSE;
|
||||
result = false;
|
||||
} else {
|
||||
/* Store the data from the files in separate buffers and
|
||||
* compare each byte to determine equality.
|
||||
|
@ -942,7 +942,7 @@ static UBool compareBinaryFiles(const char* defaultTZFileName, const char* TZFil
|
|||
|
||||
sizeFileRead = fread(bufferFile, 1, sizeFileToRead, file);
|
||||
if (memcmp(tzInfo->defaultTZBuffer + tzInfo->defaultTZPosition, bufferFile, sizeFileRead) != 0) {
|
||||
result = FALSE;
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
sizeFileLeft -= sizeFileRead;
|
||||
|
@ -950,7 +950,7 @@ static UBool compareBinaryFiles(const char* defaultTZFileName, const char* TZFil
|
|||
}
|
||||
}
|
||||
} else {
|
||||
result = FALSE;
|
||||
result = false;
|
||||
}
|
||||
|
||||
if (file != NULL) {
|
||||
|
@ -1189,7 +1189,7 @@ uprv_tzname(int n)
|
|||
tzInfo->defaultTZBuffer = NULL;
|
||||
tzInfo->defaultTZFileSize = 0;
|
||||
tzInfo->defaultTZFilePtr = NULL;
|
||||
tzInfo->defaultTZstatus = FALSE;
|
||||
tzInfo->defaultTZstatus = false;
|
||||
tzInfo->defaultTZPosition = 0;
|
||||
|
||||
gTimeZoneBufferPtr = searchForTZFile(TZZONEINFO, tzInfo);
|
||||
|
@ -1295,7 +1295,7 @@ static UBool U_CALLCONV putil_cleanup(void)
|
|||
gCorrectedPOSIXLocaleHeapAllocated = false;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1344,16 +1344,16 @@ U_CAPI UBool U_EXPORT2
|
|||
uprv_pathIsAbsolute(const char *path)
|
||||
{
|
||||
if(!path || !*path) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(*path == U_FILE_SEP_CHAR) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
|
||||
if(*path == U_FILE_ALT_SEP_CHAR) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1361,11 +1361,11 @@ uprv_pathIsAbsolute(const char *path)
|
|||
if( (((path[0] >= 'A') && (path[0] <= 'Z')) ||
|
||||
((path[0] >= 'a') && (path[0] <= 'z'))) &&
|
||||
path[1] == ':' ) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Backup setting of ICU_DATA_DIR_PREFIX_ENV_VAR
|
||||
|
@ -1402,12 +1402,12 @@ static BOOL U_CALLCONV getIcuDataDirectoryUnderWindowsDirectory(char* directoryB
|
|||
if ((windowsPathUtf8Len + UPRV_LENGTHOF(ICU_DATA_DIR_WINDOWS)) < bufferLength) {
|
||||
uprv_strcpy(directoryBuffer, windowsPathUtf8);
|
||||
uprv_strcat(directoryBuffer, ICU_DATA_DIR_WINDOWS);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "uvectr32.h"
|
||||
|
||||
#ifdef RBBI_DEBUG
|
||||
static UBool gTrace = FALSE;
|
||||
static UBool gTrace = false;
|
||||
#endif
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
@ -267,7 +267,7 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) {
|
|||
}
|
||||
// TODO: clone fLanguageBreakEngines from "that"
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
utext_clone(&fText, &that.fText, FALSE, TRUE, &status);
|
||||
utext_clone(&fText, &that.fText, false, true, &status);
|
||||
|
||||
if (fCharIter != &fSCharIter) {
|
||||
delete fCharIter;
|
||||
|
@ -354,13 +354,13 @@ void RuleBasedBreakIterator::init(UErrorCode &status) {
|
|||
}
|
||||
|
||||
#ifdef RBBI_DEBUG
|
||||
static UBool debugInitDone = FALSE;
|
||||
if (debugInitDone == FALSE) {
|
||||
static UBool debugInitDone = false;
|
||||
if (debugInitDone == false) {
|
||||
char *debugEnv = getenv("U_RBBIDEBUG");
|
||||
if (debugEnv && uprv_strstr(debugEnv, "trace")) {
|
||||
gTrace = TRUE;
|
||||
gTrace = true;
|
||||
}
|
||||
debugInitDone = TRUE;
|
||||
debugInitDone = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ void RuleBasedBreakIterator::setText(UText *ut, UErrorCode &status) {
|
|||
}
|
||||
fBreakCache->reset();
|
||||
fDictionaryCache->reset();
|
||||
utext_clone(&fText, ut, FALSE, TRUE, &status);
|
||||
utext_clone(&fText, ut, false, true, &status);
|
||||
|
||||
// Set up a dummy CharacterIterator to be returned if anyone
|
||||
// calls getText(). With input from UText, there is no reasonable
|
||||
|
@ -460,7 +460,7 @@ void RuleBasedBreakIterator::setText(UText *ut, UErrorCode &status) {
|
|||
|
||||
|
||||
UText *RuleBasedBreakIterator::getUText(UText *fillIn, UErrorCode &status) const {
|
||||
UText *result = utext_clone(fillIn, &fText, FALSE, TRUE, &status);
|
||||
UText *result = utext_clone(fillIn, &fText, false, true, &status);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ RuleBasedBreakIterator &RuleBasedBreakIterator::refreshInputText(UText *input, U
|
|||
}
|
||||
int64_t pos = utext_getNativeIndex(&fText);
|
||||
// Shallow read-only clone of the new UText into the existing input UText
|
||||
utext_clone(&fText, input, FALSE, TRUE, &status);
|
||||
utext_clone(&fText, input, false, true, &status);
|
||||
if (U_FAILURE(status)) {
|
||||
return *this;
|
||||
}
|
||||
|
@ -696,7 +696,7 @@ UBool RuleBasedBreakIterator::isBoundary(int32_t offset) {
|
|||
// out-of-range indexes are never boundary positions
|
||||
if (offset < 0) {
|
||||
first(); // For side effects on current position, tag values.
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Adjust offset to be on a code point boundary and not beyond the end of the text.
|
||||
|
@ -713,9 +713,9 @@ UBool RuleBasedBreakIterator::isBoundary(int32_t offset) {
|
|||
}
|
||||
|
||||
if (result && adjustedOffset < offset && utext_char32At(&fText, offset) == U_SENTINEL) {
|
||||
// Original offset is beyond the end of the text. Return FALSE, it's not a boundary,
|
||||
// Original offset is beyond the end of the text. Return false, it's not a boundary,
|
||||
// but the iteration position remains set to the end of the text, which is a boundary.
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (!result) {
|
||||
// Not on a boundary. isBoundary() must leave iterator on the following boundary.
|
||||
|
@ -838,7 +838,7 @@ int32_t RuleBasedBreakIterator::handleNext() {
|
|||
result = initialPosition;
|
||||
c = UTEXT_NEXT32(&fText);
|
||||
if (c==U_SENTINEL) {
|
||||
fDone = TRUE;
|
||||
fDone = true;
|
||||
return UBRK_DONE;
|
||||
}
|
||||
|
||||
|
@ -1167,7 +1167,7 @@ UBool U_CALLCONV rbbi_cleanup(void) {
|
|||
gEmptyString = nullptr;
|
||||
gLanguageBreakFactoriesInitOnce.reset();
|
||||
gRBBIInitOnce.reset();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
U_CDECL_END
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ void RuleBasedBreakIterator::DictionaryCache::reset() {
|
|||
UBool RuleBasedBreakIterator::DictionaryCache::following(int32_t fromPos, int32_t *result, int32_t *statusIndex) {
|
||||
if (fromPos >= fLimit || fromPos < fStart) {
|
||||
fPositionInCache = -1;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sequential iteration, move from previous boundary to the following
|
||||
|
@ -55,13 +55,13 @@ UBool RuleBasedBreakIterator::DictionaryCache::following(int32_t fromPos, int32_
|
|||
++fPositionInCache;
|
||||
if (fPositionInCache >= fBreaks.size()) {
|
||||
fPositionInCache = -1;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
r = fBreaks.elementAti(fPositionInCache);
|
||||
U_ASSERT(r > fromPos);
|
||||
*result = r;
|
||||
*statusIndex = fOtherRuleStatusIndex;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Random indexing. Linear search for the boundary following the given position.
|
||||
|
@ -71,7 +71,7 @@ UBool RuleBasedBreakIterator::DictionaryCache::following(int32_t fromPos, int32_
|
|||
if (r > fromPos) {
|
||||
*result = r;
|
||||
*statusIndex = fOtherRuleStatusIndex;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
UPRV_UNREACHABLE_EXIT;
|
||||
|
@ -81,7 +81,7 @@ UBool RuleBasedBreakIterator::DictionaryCache::following(int32_t fromPos, int32_
|
|||
UBool RuleBasedBreakIterator::DictionaryCache::preceding(int32_t fromPos, int32_t *result, int32_t *statusIndex) {
|
||||
if (fromPos <= fStart || fromPos > fLimit) {
|
||||
fPositionInCache = -1;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fromPos == fLimit) {
|
||||
|
@ -98,12 +98,12 @@ UBool RuleBasedBreakIterator::DictionaryCache::preceding(int32_t fromPos, int32_
|
|||
U_ASSERT(r < fromPos);
|
||||
*result = r;
|
||||
*statusIndex = ( r== fStart) ? fFirstRuleStatusIndex : fOtherRuleStatusIndex;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (fPositionInCache == 0) {
|
||||
fPositionInCache = -1;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (fPositionInCache = fBreaks.size()-1; fPositionInCache >= 0; --fPositionInCache) {
|
||||
|
@ -111,7 +111,7 @@ UBool RuleBasedBreakIterator::DictionaryCache::preceding(int32_t fromPos, int32_
|
|||
if (r < fromPos) {
|
||||
*result = r;
|
||||
*statusIndex = ( r == fStart) ? fFirstRuleStatusIndex : fOtherRuleStatusIndex;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
UPRV_UNREACHABLE_EXIT;
|
||||
|
@ -227,7 +227,7 @@ void RuleBasedBreakIterator::BreakCache::reset(int32_t pos, int32_t ruleStatus)
|
|||
int32_t RuleBasedBreakIterator::BreakCache::current() {
|
||||
fBI->fPosition = fTextIdx;
|
||||
fBI->fRuleStatusIndex = fStatuses[fBufIdx];
|
||||
fBI->fDone = FALSE;
|
||||
fBI->fDone = false;
|
||||
return fTextIdx;
|
||||
}
|
||||
|
||||
|
@ -302,18 +302,18 @@ void RuleBasedBreakIterator::BreakCache::previous(UErrorCode &status) {
|
|||
|
||||
UBool RuleBasedBreakIterator::BreakCache::seek(int32_t pos) {
|
||||
if (pos < fBoundaries[fStartBufIdx] || pos > fBoundaries[fEndBufIdx]) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (pos == fBoundaries[fStartBufIdx]) {
|
||||
// Common case: seek(0), from BreakIterator::first()
|
||||
fBufIdx = fStartBufIdx;
|
||||
fTextIdx = fBoundaries[fBufIdx];
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (pos == fBoundaries[fEndBufIdx]) {
|
||||
fBufIdx = fEndBufIdx;
|
||||
fTextIdx = fBoundaries[fBufIdx];
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t min = fStartBufIdx;
|
||||
|
@ -331,13 +331,13 @@ UBool RuleBasedBreakIterator::BreakCache::seek(int32_t pos) {
|
|||
fBufIdx = modChunkSize(max - 1);
|
||||
fTextIdx = fBoundaries[fBufIdx];
|
||||
U_ASSERT(fTextIdx <= pos);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
UBool RuleBasedBreakIterator::BreakCache::populateNear(int32_t position, UErrorCode &status) {
|
||||
if (U_FAILURE(status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
U_ASSERT(position < fBoundaries[fStartBufIdx] || position > fBoundaries[fEndBufIdx]);
|
||||
|
||||
|
@ -476,13 +476,13 @@ UBool RuleBasedBreakIterator::BreakCache::populateFollowing() {
|
|||
|
||||
if (fBI->fDictionaryCache->following(fromPosition, &pos, &ruleStatusIdx)) {
|
||||
addFollowing(pos, ruleStatusIdx, UpdateCachePosition);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
fBI->fPosition = fromPosition;
|
||||
pos = fBI->handleNext();
|
||||
if (pos == UBRK_DONE) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
ruleStatusIdx = fBI->fRuleStatusIndex;
|
||||
|
@ -492,7 +492,7 @@ UBool RuleBasedBreakIterator::BreakCache::populateFollowing() {
|
|||
fBI->fDictionaryCache->populateDictionary(fromPosition, pos, fromRuleStatusIdx, ruleStatusIdx);
|
||||
if (fBI->fDictionaryCache->following(fromPosition, &pos, &ruleStatusIdx)) {
|
||||
addFollowing(pos, ruleStatusIdx, UpdateCachePosition);
|
||||
return TRUE;
|
||||
return true;
|
||||
// TODO: may want to move a sizable chunk of dictionary cache to break cache at this point.
|
||||
// But be careful with interactions with populateNear().
|
||||
}
|
||||
|
@ -515,18 +515,18 @@ UBool RuleBasedBreakIterator::BreakCache::populateFollowing() {
|
|||
addFollowing(pos, fBI->fRuleStatusIndex, RetainCachePosition);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
UBool RuleBasedBreakIterator::BreakCache::populatePreceding(UErrorCode &status) {
|
||||
if (U_FAILURE(status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t fromPosition = fBoundaries[fStartBufIdx];
|
||||
if (fromPosition == 0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t position = 0;
|
||||
|
@ -534,7 +534,7 @@ UBool RuleBasedBreakIterator::BreakCache::populatePreceding(UErrorCode &status)
|
|||
|
||||
if (fBI->fDictionaryCache->preceding(fromPosition, &position, &positionStatusIdx)) {
|
||||
addPreceding(position, positionStatusIdx, UpdateCachePosition);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t backupPosition = fromPosition;
|
||||
|
@ -588,7 +588,7 @@ UBool RuleBasedBreakIterator::BreakCache::populatePreceding(UErrorCode &status)
|
|||
break;
|
||||
}
|
||||
|
||||
UBool segmentHandledByDictionary = FALSE;
|
||||
UBool segmentHandledByDictionary = false;
|
||||
if (fBI->fDictionaryCharCount != 0) {
|
||||
// Segment from the rules includes dictionary characters.
|
||||
// Subdivide it, with subdivided results going into the dictionary cache.
|
||||
|
@ -615,12 +615,12 @@ UBool RuleBasedBreakIterator::BreakCache::populatePreceding(UErrorCode &status)
|
|||
} while (position < fromPosition);
|
||||
|
||||
// Move boundaries from the side buffer to the main circular buffer.
|
||||
UBool success = FALSE;
|
||||
UBool success = false;
|
||||
if (!fSideBuffer.isEmpty()) {
|
||||
positionStatusIdx = fSideBuffer.popi();
|
||||
position = fSideBuffer.popi();
|
||||
addPreceding(position, positionStatusIdx, UpdateCachePosition);
|
||||
success = TRUE;
|
||||
success = true;
|
||||
}
|
||||
|
||||
while (!fSideBuffer.isEmpty()) {
|
||||
|
|
|
@ -111,9 +111,9 @@ line_loop: while (<>) {
|
|||
#
|
||||
# do the 'n' flag
|
||||
#
|
||||
$state_flag[$num_states] = $javaOutput? "false" : "FALSE";
|
||||
$state_flag[$num_states] = "false";
|
||||
if ($fields[0] eq "n") {
|
||||
$state_flag[$num_states] = $javaOutput? "true": "TRUE";
|
||||
$state_flag[$num_states] = "true";
|
||||
shift @fields;
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,7 @@ else
|
|||
# emit the state transition table
|
||||
#
|
||||
print "static const struct RBBIRuleTableEl gRuleParseStateTable[] = {\n";
|
||||
print " {doNOP, 0, 0, 0, TRUE}\n"; # State 0 is a dummy. Real states start with index = 1.
|
||||
print " {doNOP, 0, 0, 0, true}\n"; # State 0 is a dummy. Real states start with index = 1.
|
||||
for ($state=1; $state < $num_states; $state++) {
|
||||
print " , {$state_func_name[$state],";
|
||||
if ($state_literal_chars[$state] ne "") {
|
||||
|
|
|
@ -38,7 +38,7 @@ RBBIDataWrapper::RBBIDataWrapper(const RBBIDataHeader *data, UErrorCode &status)
|
|||
RBBIDataWrapper::RBBIDataWrapper(const RBBIDataHeader *data, enum EDontAdopt, UErrorCode &status) {
|
||||
init0();
|
||||
init(data, status);
|
||||
fDontFreeData = TRUE;
|
||||
fDontFreeData = true;
|
||||
}
|
||||
|
||||
RBBIDataWrapper::RBBIDataWrapper(UDataMemory* udm, UErrorCode &status) {
|
||||
|
@ -86,7 +86,7 @@ void RBBIDataWrapper::init0() {
|
|||
fTrie = NULL;
|
||||
fUDataMem = NULL;
|
||||
fRefCount = 0;
|
||||
fDontFreeData = TRUE;
|
||||
fDontFreeData = true;
|
||||
}
|
||||
|
||||
void RBBIDataWrapper::init(const RBBIDataHeader *data, UErrorCode &status) {
|
||||
|
@ -102,7 +102,7 @@ void RBBIDataWrapper::init(const RBBIDataHeader *data, UErrorCode &status) {
|
|||
// that is no longer supported. At that time fFormatVersion was
|
||||
// an int32_t field, rather than an array of 4 bytes.
|
||||
|
||||
fDontFreeData = FALSE;
|
||||
fDontFreeData = false;
|
||||
if (data->fFTableLen != 0) {
|
||||
fForwardTable = (RBBIStateTable *)((char *)data + fHeader->fFTable);
|
||||
}
|
||||
|
|
|
@ -58,10 +58,10 @@ RBBINode::RBBINode(NodeType t) : UMemory() {
|
|||
fInputSet = NULL;
|
||||
fFirstPos = 0;
|
||||
fLastPos = 0;
|
||||
fNullable = FALSE;
|
||||
fLookAheadEnd = FALSE;
|
||||
fRuleRoot = FALSE;
|
||||
fChainIn = FALSE;
|
||||
fNullable = false;
|
||||
fLookAheadEnd = false;
|
||||
fRuleRoot = false;
|
||||
fChainIn = false;
|
||||
fVal = 0;
|
||||
fPrecedence = precZero;
|
||||
|
||||
|
@ -92,7 +92,7 @@ RBBINode::RBBINode(const RBBINode &other) : UMemory(other) {
|
|||
fLastPos = other.fLastPos;
|
||||
fNullable = other.fNullable;
|
||||
fVal = other.fVal;
|
||||
fRuleRoot = FALSE;
|
||||
fRuleRoot = false;
|
||||
fChainIn = other.fChainIn;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
fFirstPosSet = new UVector(status); // TODO - get a real status from somewhere
|
||||
|
@ -355,11 +355,11 @@ void RBBINode::printTree(const RBBINode *node, UBool printHeading) {
|
|||
// Unconditionally dump children of all other node types.
|
||||
if (node->fType != varRef) {
|
||||
if (node->fLeftChild != NULL) {
|
||||
printTree(node->fLeftChild, FALSE);
|
||||
printTree(node->fLeftChild, false);
|
||||
}
|
||||
|
||||
if (node->fRightChild != NULL) {
|
||||
printTree(node->fRightChild, FALSE);
|
||||
printTree(node->fRightChild, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,9 +65,9 @@ RBBIRuleBuilder::RBBIRuleBuilder(const UnicodeString &rules,
|
|||
fDefaultTree = &fForwardTree;
|
||||
fForwardTable = NULL;
|
||||
fRuleStatusVals = NULL;
|
||||
fChainRules = FALSE;
|
||||
fLBCMNoChain = FALSE;
|
||||
fLookAheadHardBreak = FALSE;
|
||||
fChainRules = false;
|
||||
fLBCMNoChain = false;
|
||||
fLookAheadHardBreak = false;
|
||||
fUSetNodes = NULL;
|
||||
fRuleStatusVals = NULL;
|
||||
fScanner = NULL;
|
||||
|
|
|
@ -79,110 +79,110 @@ struct RBBIRuleTableEl {
|
|||
};
|
||||
|
||||
static const struct RBBIRuleTableEl gRuleParseStateTable[] = {
|
||||
{doNOP, 0, 0, 0, TRUE}
|
||||
, {doExprStart, 254, 29, 9, FALSE} // 1 start
|
||||
, {doNOP, 132, 1,0, TRUE} // 2
|
||||
, {doNoChain, 94 /* ^ */, 12, 9, TRUE} // 3
|
||||
, {doExprStart, 36 /* $ */, 88, 98, FALSE} // 4
|
||||
, {doNOP, 33 /* ! */, 19,0, TRUE} // 5
|
||||
, {doNOP, 59 /* ; */, 1,0, TRUE} // 6
|
||||
, {doNOP, 252, 0,0, FALSE} // 7
|
||||
, {doExprStart, 255, 29, 9, FALSE} // 8
|
||||
, {doEndOfRule, 59 /* ; */, 1,0, TRUE} // 9 break-rule-end
|
||||
, {doNOP, 132, 9,0, TRUE} // 10
|
||||
, {doRuleError, 255, 103,0, FALSE} // 11
|
||||
, {doExprStart, 254, 29,0, FALSE} // 12 start-after-caret
|
||||
, {doNOP, 132, 12,0, TRUE} // 13
|
||||
, {doRuleError, 94 /* ^ */, 103,0, FALSE} // 14
|
||||
, {doExprStart, 36 /* $ */, 88, 37, FALSE} // 15
|
||||
, {doRuleError, 59 /* ; */, 103,0, FALSE} // 16
|
||||
, {doRuleError, 252, 103,0, FALSE} // 17
|
||||
, {doExprStart, 255, 29,0, FALSE} // 18
|
||||
, {doNOP, 33 /* ! */, 21,0, TRUE} // 19 rev-option
|
||||
, {doReverseDir, 255, 28, 9, FALSE} // 20
|
||||
, {doOptionStart, 130, 23,0, TRUE} // 21 option-scan1
|
||||
, {doRuleError, 255, 103,0, FALSE} // 22
|
||||
, {doNOP, 129, 23,0, TRUE} // 23 option-scan2
|
||||
, {doOptionEnd, 255, 25,0, FALSE} // 24
|
||||
, {doNOP, 59 /* ; */, 1,0, TRUE} // 25 option-scan3
|
||||
, {doNOP, 132, 25,0, TRUE} // 26
|
||||
, {doRuleError, 255, 103,0, FALSE} // 27
|
||||
, {doExprStart, 255, 29, 9, FALSE} // 28 reverse-rule
|
||||
, {doRuleChar, 254, 38,0, TRUE} // 29 term
|
||||
, {doNOP, 132, 29,0, TRUE} // 30
|
||||
, {doRuleChar, 131, 38,0, TRUE} // 31
|
||||
, {doNOP, 91 /* [ */, 94, 38, FALSE} // 32
|
||||
, {doLParen, 40 /* ( */, 29, 38, TRUE} // 33
|
||||
, {doNOP, 36 /* $ */, 88, 37, FALSE} // 34
|
||||
, {doDotAny, 46 /* . */, 38,0, TRUE} // 35
|
||||
, {doRuleError, 255, 103,0, FALSE} // 36
|
||||
, {doCheckVarDef, 255, 38,0, FALSE} // 37 term-var-ref
|
||||
, {doNOP, 132, 38,0, TRUE} // 38 expr-mod
|
||||
, {doUnaryOpStar, 42 /* * */, 43,0, TRUE} // 39
|
||||
, {doUnaryOpPlus, 43 /* + */, 43,0, TRUE} // 40
|
||||
, {doUnaryOpQuestion, 63 /* ? */, 43,0, TRUE} // 41
|
||||
, {doNOP, 255, 43,0, FALSE} // 42
|
||||
, {doExprCatOperator, 254, 29,0, FALSE} // 43 expr-cont
|
||||
, {doNOP, 132, 43,0, TRUE} // 44
|
||||
, {doExprCatOperator, 131, 29,0, FALSE} // 45
|
||||
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 46
|
||||
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 47
|
||||
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 48
|
||||
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 49
|
||||
, {doExprCatOperator, 47 /* / */, 55,0, FALSE} // 50
|
||||
, {doExprCatOperator, 123 /* { */, 67,0, TRUE} // 51
|
||||
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 52
|
||||
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 53
|
||||
, {doExprFinished, 255, 255,0, FALSE} // 54
|
||||
, {doSlash, 47 /* / */, 57,0, TRUE} // 55 look-ahead
|
||||
, {doNOP, 255, 103,0, FALSE} // 56
|
||||
, {doExprCatOperator, 254, 29,0, FALSE} // 57 expr-cont-no-slash
|
||||
, {doNOP, 132, 43,0, TRUE} // 58
|
||||
, {doExprCatOperator, 131, 29,0, FALSE} // 59
|
||||
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 60
|
||||
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 61
|
||||
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 62
|
||||
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 63
|
||||
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 64
|
||||
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 65
|
||||
, {doExprFinished, 255, 255,0, FALSE} // 66
|
||||
, {doNOP, 132, 67,0, TRUE} // 67 tag-open
|
||||
, {doStartTagValue, 128, 70,0, FALSE} // 68
|
||||
, {doTagExpectedError, 255, 103,0, FALSE} // 69
|
||||
, {doNOP, 132, 74,0, TRUE} // 70 tag-value
|
||||
, {doNOP, 125 /* } */, 74,0, FALSE} // 71
|
||||
, {doTagDigit, 128, 70,0, TRUE} // 72
|
||||
, {doTagExpectedError, 255, 103,0, FALSE} // 73
|
||||
, {doNOP, 132, 74,0, TRUE} // 74 tag-close
|
||||
, {doTagValue, 125 /* } */, 77,0, TRUE} // 75
|
||||
, {doTagExpectedError, 255, 103,0, FALSE} // 76
|
||||
, {doExprCatOperator, 254, 29,0, FALSE} // 77 expr-cont-no-tag
|
||||
, {doNOP, 132, 77,0, TRUE} // 78
|
||||
, {doExprCatOperator, 131, 29,0, FALSE} // 79
|
||||
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 80
|
||||
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 81
|
||||
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 82
|
||||
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 83
|
||||
, {doExprCatOperator, 47 /* / */, 55,0, FALSE} // 84
|
||||
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 85
|
||||
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 86
|
||||
, {doExprFinished, 255, 255,0, FALSE} // 87
|
||||
, {doStartVariableName, 36 /* $ */, 90,0, TRUE} // 88 scan-var-name
|
||||
, {doNOP, 255, 103,0, FALSE} // 89
|
||||
, {doNOP, 130, 92,0, TRUE} // 90 scan-var-start
|
||||
, {doVariableNameExpectedErr, 255, 103,0, FALSE} // 91
|
||||
, {doNOP, 129, 92,0, TRUE} // 92 scan-var-body
|
||||
, {doEndVariableName, 255, 255,0, FALSE} // 93
|
||||
, {doScanUnicodeSet, 91 /* [ */, 255,0, TRUE} // 94 scan-unicode-set
|
||||
, {doScanUnicodeSet, 112 /* p */, 255,0, TRUE} // 95
|
||||
, {doScanUnicodeSet, 80 /* P */, 255,0, TRUE} // 96
|
||||
, {doNOP, 255, 103,0, FALSE} // 97
|
||||
, {doNOP, 132, 98,0, TRUE} // 98 assign-or-rule
|
||||
, {doStartAssign, 61 /* = */, 29, 101, TRUE} // 99
|
||||
, {doNOP, 255, 37, 9, FALSE} // 100
|
||||
, {doEndAssign, 59 /* ; */, 1,0, TRUE} // 101 assign-end
|
||||
, {doRuleErrorAssignExpr, 255, 103,0, FALSE} // 102
|
||||
, {doExit, 255, 103,0, TRUE} // 103 errorDeath
|
||||
{doNOP, 0, 0, 0, true}
|
||||
, {doExprStart, 254, 29, 9, false} // 1 start
|
||||
, {doNOP, 132, 1,0, true} // 2
|
||||
, {doNoChain, 94 /* ^ */, 12, 9, true} // 3
|
||||
, {doExprStart, 36 /* $ */, 88, 98, false} // 4
|
||||
, {doNOP, 33 /* ! */, 19,0, true} // 5
|
||||
, {doNOP, 59 /* ; */, 1,0, true} // 6
|
||||
, {doNOP, 252, 0,0, false} // 7
|
||||
, {doExprStart, 255, 29, 9, false} // 8
|
||||
, {doEndOfRule, 59 /* ; */, 1,0, true} // 9 break-rule-end
|
||||
, {doNOP, 132, 9,0, true} // 10
|
||||
, {doRuleError, 255, 103,0, false} // 11
|
||||
, {doExprStart, 254, 29,0, false} // 12 start-after-caret
|
||||
, {doNOP, 132, 12,0, true} // 13
|
||||
, {doRuleError, 94 /* ^ */, 103,0, false} // 14
|
||||
, {doExprStart, 36 /* $ */, 88, 37, false} // 15
|
||||
, {doRuleError, 59 /* ; */, 103,0, false} // 16
|
||||
, {doRuleError, 252, 103,0, false} // 17
|
||||
, {doExprStart, 255, 29,0, false} // 18
|
||||
, {doNOP, 33 /* ! */, 21,0, true} // 19 rev-option
|
||||
, {doReverseDir, 255, 28, 9, false} // 20
|
||||
, {doOptionStart, 130, 23,0, true} // 21 option-scan1
|
||||
, {doRuleError, 255, 103,0, false} // 22
|
||||
, {doNOP, 129, 23,0, true} // 23 option-scan2
|
||||
, {doOptionEnd, 255, 25,0, false} // 24
|
||||
, {doNOP, 59 /* ; */, 1,0, true} // 25 option-scan3
|
||||
, {doNOP, 132, 25,0, true} // 26
|
||||
, {doRuleError, 255, 103,0, false} // 27
|
||||
, {doExprStart, 255, 29, 9, false} // 28 reverse-rule
|
||||
, {doRuleChar, 254, 38,0, true} // 29 term
|
||||
, {doNOP, 132, 29,0, true} // 30
|
||||
, {doRuleChar, 131, 38,0, true} // 31
|
||||
, {doNOP, 91 /* [ */, 94, 38, false} // 32
|
||||
, {doLParen, 40 /* ( */, 29, 38, true} // 33
|
||||
, {doNOP, 36 /* $ */, 88, 37, false} // 34
|
||||
, {doDotAny, 46 /* . */, 38,0, true} // 35
|
||||
, {doRuleError, 255, 103,0, false} // 36
|
||||
, {doCheckVarDef, 255, 38,0, false} // 37 term-var-ref
|
||||
, {doNOP, 132, 38,0, true} // 38 expr-mod
|
||||
, {doUnaryOpStar, 42 /* * */, 43,0, true} // 39
|
||||
, {doUnaryOpPlus, 43 /* + */, 43,0, true} // 40
|
||||
, {doUnaryOpQuestion, 63 /* ? */, 43,0, true} // 41
|
||||
, {doNOP, 255, 43,0, false} // 42
|
||||
, {doExprCatOperator, 254, 29,0, false} // 43 expr-cont
|
||||
, {doNOP, 132, 43,0, true} // 44
|
||||
, {doExprCatOperator, 131, 29,0, false} // 45
|
||||
, {doExprCatOperator, 91 /* [ */, 29,0, false} // 46
|
||||
, {doExprCatOperator, 40 /* ( */, 29,0, false} // 47
|
||||
, {doExprCatOperator, 36 /* $ */, 29,0, false} // 48
|
||||
, {doExprCatOperator, 46 /* . */, 29,0, false} // 49
|
||||
, {doExprCatOperator, 47 /* / */, 55,0, false} // 50
|
||||
, {doExprCatOperator, 123 /* { */, 67,0, true} // 51
|
||||
, {doExprOrOperator, 124 /* | */, 29,0, true} // 52
|
||||
, {doExprRParen, 41 /* ) */, 255,0, true} // 53
|
||||
, {doExprFinished, 255, 255,0, false} // 54
|
||||
, {doSlash, 47 /* / */, 57,0, true} // 55 look-ahead
|
||||
, {doNOP, 255, 103,0, false} // 56
|
||||
, {doExprCatOperator, 254, 29,0, false} // 57 expr-cont-no-slash
|
||||
, {doNOP, 132, 43,0, true} // 58
|
||||
, {doExprCatOperator, 131, 29,0, false} // 59
|
||||
, {doExprCatOperator, 91 /* [ */, 29,0, false} // 60
|
||||
, {doExprCatOperator, 40 /* ( */, 29,0, false} // 61
|
||||
, {doExprCatOperator, 36 /* $ */, 29,0, false} // 62
|
||||
, {doExprCatOperator, 46 /* . */, 29,0, false} // 63
|
||||
, {doExprOrOperator, 124 /* | */, 29,0, true} // 64
|
||||
, {doExprRParen, 41 /* ) */, 255,0, true} // 65
|
||||
, {doExprFinished, 255, 255,0, false} // 66
|
||||
, {doNOP, 132, 67,0, true} // 67 tag-open
|
||||
, {doStartTagValue, 128, 70,0, false} // 68
|
||||
, {doTagExpectedError, 255, 103,0, false} // 69
|
||||
, {doNOP, 132, 74,0, true} // 70 tag-value
|
||||
, {doNOP, 125 /* } */, 74,0, false} // 71
|
||||
, {doTagDigit, 128, 70,0, true} // 72
|
||||
, {doTagExpectedError, 255, 103,0, false} // 73
|
||||
, {doNOP, 132, 74,0, true} // 74 tag-close
|
||||
, {doTagValue, 125 /* } */, 77,0, true} // 75
|
||||
, {doTagExpectedError, 255, 103,0, false} // 76
|
||||
, {doExprCatOperator, 254, 29,0, false} // 77 expr-cont-no-tag
|
||||
, {doNOP, 132, 77,0, true} // 78
|
||||
, {doExprCatOperator, 131, 29,0, false} // 79
|
||||
, {doExprCatOperator, 91 /* [ */, 29,0, false} // 80
|
||||
, {doExprCatOperator, 40 /* ( */, 29,0, false} // 81
|
||||
, {doExprCatOperator, 36 /* $ */, 29,0, false} // 82
|
||||
, {doExprCatOperator, 46 /* . */, 29,0, false} // 83
|
||||
, {doExprCatOperator, 47 /* / */, 55,0, false} // 84
|
||||
, {doExprOrOperator, 124 /* | */, 29,0, true} // 85
|
||||
, {doExprRParen, 41 /* ) */, 255,0, true} // 86
|
||||
, {doExprFinished, 255, 255,0, false} // 87
|
||||
, {doStartVariableName, 36 /* $ */, 90,0, true} // 88 scan-var-name
|
||||
, {doNOP, 255, 103,0, false} // 89
|
||||
, {doNOP, 130, 92,0, true} // 90 scan-var-start
|
||||
, {doVariableNameExpectedErr, 255, 103,0, false} // 91
|
||||
, {doNOP, 129, 92,0, true} // 92 scan-var-body
|
||||
, {doEndVariableName, 255, 255,0, false} // 93
|
||||
, {doScanUnicodeSet, 91 /* [ */, 255,0, true} // 94 scan-unicode-set
|
||||
, {doScanUnicodeSet, 112 /* p */, 255,0, true} // 95
|
||||
, {doScanUnicodeSet, 80 /* P */, 255,0, true} // 96
|
||||
, {doNOP, 255, 103,0, false} // 97
|
||||
, {doNOP, 132, 98,0, true} // 98 assign-or-rule
|
||||
, {doStartAssign, 61 /* = */, 29, 101, true} // 99
|
||||
, {doNOP, 255, 37, 9, false} // 100
|
||||
, {doEndAssign, 59 /* ; */, 1,0, true} // 101 assign-end
|
||||
, {doRuleErrorAssignExpr, 255, 103,0, false} // 102
|
||||
, {doExit, 255, 103,0, true} // 103 errorDeath
|
||||
};
|
||||
#ifdef RBBI_DEBUG
|
||||
static const char * const RBBIRuleStateNames[] = { 0,
|
||||
|
|
|
@ -92,7 +92,7 @@ RBBIRuleScanner::RBBIRuleScanner(RBBIRuleBuilder *rb)
|
|||
fRB = rb;
|
||||
fScanIndex = 0;
|
||||
fNextIndex = 0;
|
||||
fQuoteMode = FALSE;
|
||||
fQuoteMode = false;
|
||||
fLineNum = 1;
|
||||
fCharNum = 0;
|
||||
fLastChar = 0;
|
||||
|
@ -103,9 +103,9 @@ RBBIRuleScanner::RBBIRuleScanner(RBBIRuleBuilder *rb)
|
|||
fNodeStack[0] = NULL;
|
||||
fNodeStackPtr = 0;
|
||||
|
||||
fReverseRule = FALSE;
|
||||
fLookAheadRule = FALSE;
|
||||
fNoChainInRule = FALSE;
|
||||
fReverseRule = false;
|
||||
fLookAheadRule = false;
|
||||
fNoChainInRule = false;
|
||||
|
||||
fSymbolTable = NULL;
|
||||
fSetTable = NULL;
|
||||
|
@ -201,7 +201,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
{
|
||||
RBBINode *n = NULL;
|
||||
|
||||
UBool returnVal = TRUE;
|
||||
UBool returnVal = true;
|
||||
|
||||
switch (action) {
|
||||
|
||||
|
@ -213,7 +213,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
|
||||
case doNoChain:
|
||||
// Scanned a '^' while on the rule start state.
|
||||
fNoChainInRule = TRUE;
|
||||
fNoChainInRule = true;
|
||||
break;
|
||||
|
||||
|
||||
|
@ -345,7 +345,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
catNode->fRightChild = endNode;
|
||||
fNodeStack[fNodeStackPtr] = catNode;
|
||||
endNode->fVal = fRuleNum;
|
||||
endNode->fLookAheadEnd = TRUE;
|
||||
endNode->fLookAheadEnd = true;
|
||||
thisRule = catNode;
|
||||
|
||||
// TODO: Disable chaining out of look-ahead (hard break) rules.
|
||||
|
@ -354,13 +354,13 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
}
|
||||
|
||||
// Mark this node as being the root of a rule.
|
||||
thisRule->fRuleRoot = TRUE;
|
||||
thisRule->fRuleRoot = true;
|
||||
|
||||
// Flag if chaining into this rule is wanted.
|
||||
//
|
||||
if (fRB->fChainRules && // If rule chaining is enabled globally via !!chain
|
||||
!fNoChainInRule) { // and no '^' chain-in inhibit was on this rule
|
||||
thisRule->fChainIn = TRUE;
|
||||
thisRule->fChainIn = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -398,9 +398,9 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
// Just move its parse tree from the stack to *destRules.
|
||||
*destRules = fNodeStack[fNodeStackPtr];
|
||||
}
|
||||
fReverseRule = FALSE; // in preparation for the next rule.
|
||||
fLookAheadRule = FALSE;
|
||||
fNoChainInRule = FALSE;
|
||||
fReverseRule = false; // in preparation for the next rule.
|
||||
fLookAheadRule = false;
|
||||
fNoChainInRule = false;
|
||||
fNodeStackPtr = 0;
|
||||
}
|
||||
break;
|
||||
|
@ -408,7 +408,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
|
||||
case doRuleError:
|
||||
error(U_BRK_RULE_SYNTAX);
|
||||
returnVal = FALSE;
|
||||
returnVal = false;
|
||||
break;
|
||||
|
||||
|
||||
|
@ -484,7 +484,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
if (U_FAILURE(*fRB->fStatus)) {
|
||||
break;
|
||||
}
|
||||
findSetFor(UnicodeString(TRUE, kAny, 3), n);
|
||||
findSetFor(UnicodeString(true, kAny, 3), n);
|
||||
n->fFirstPos = fScanIndex;
|
||||
n->fLastPos = fNextIndex;
|
||||
fRB->fRules.extractBetween(n->fFirstPos, n->fLastPos, n->fText);
|
||||
|
@ -501,7 +501,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
n->fFirstPos = fScanIndex;
|
||||
n->fLastPos = fNextIndex;
|
||||
fRB->fRules.extractBetween(n->fFirstPos, n->fLastPos, n->fText);
|
||||
fLookAheadRule = TRUE;
|
||||
fLookAheadRule = true;
|
||||
break;
|
||||
|
||||
|
||||
|
@ -534,7 +534,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
|
||||
case doTagExpectedError:
|
||||
error(U_BRK_MALFORMED_RULE_TAG);
|
||||
returnVal = FALSE;
|
||||
returnVal = false;
|
||||
break;
|
||||
|
||||
case doOptionStart:
|
||||
|
@ -546,9 +546,9 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
{
|
||||
UnicodeString opt(fRB->fRules, fOptionStart, fScanIndex-fOptionStart);
|
||||
if (opt == UNICODE_STRING("chain", 5)) {
|
||||
fRB->fChainRules = TRUE;
|
||||
fRB->fChainRules = true;
|
||||
} else if (opt == UNICODE_STRING("LBCMNoChain", 11)) {
|
||||
fRB->fLBCMNoChain = TRUE;
|
||||
fRB->fLBCMNoChain = true;
|
||||
} else if (opt == UNICODE_STRING("forward", 7)) {
|
||||
fRB->fDefaultTree = &fRB->fForwardTree;
|
||||
} else if (opt == UNICODE_STRING("reverse", 7)) {
|
||||
|
@ -558,7 +558,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
} else if (opt == UNICODE_STRING("safe_reverse", 12)) {
|
||||
fRB->fDefaultTree = &fRB->fSafeRevTree;
|
||||
} else if (opt == UNICODE_STRING("lookAheadHardBreak", 18)) {
|
||||
fRB->fLookAheadHardBreak = TRUE;
|
||||
fRB->fLookAheadHardBreak = true;
|
||||
} else if (opt == UNICODE_STRING("quoted_literals_only", 20)) {
|
||||
fRuleSets[kRuleSet_rule_char-128].clear();
|
||||
} else if (opt == UNICODE_STRING("unquoted_literals", 17)) {
|
||||
|
@ -570,7 +570,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
break;
|
||||
|
||||
case doReverseDir:
|
||||
fReverseRule = TRUE;
|
||||
fReverseRule = true;
|
||||
break;
|
||||
|
||||
case doStartVariableName:
|
||||
|
@ -600,7 +600,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
n = fNodeStack[fNodeStackPtr];
|
||||
if (n->fLeftChild == NULL) {
|
||||
error(U_BRK_UNDEFINED_VARIABLE);
|
||||
returnVal = FALSE;
|
||||
returnVal = false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -609,11 +609,11 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
|
||||
case doRuleErrorAssignExpr:
|
||||
error(U_BRK_ASSIGN_ERROR);
|
||||
returnVal = FALSE;
|
||||
returnVal = false;
|
||||
break;
|
||||
|
||||
case doExit:
|
||||
returnVal = FALSE;
|
||||
returnVal = false;
|
||||
break;
|
||||
|
||||
case doScanUnicodeSet:
|
||||
|
@ -622,7 +622,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
|||
|
||||
default:
|
||||
error(U_BRK_INTERNAL_ERROR);
|
||||
returnVal = FALSE;
|
||||
returnVal = false;
|
||||
break;
|
||||
}
|
||||
return returnVal && U_SUCCESS(*fRB->fStatus);
|
||||
|
@ -872,7 +872,7 @@ UChar32 RBBIRuleScanner::nextCharLL() {
|
|||
fCharNum=0;
|
||||
if (fQuoteMode) {
|
||||
error(U_BRK_NEW_LINE_IN_QUOTED_STRING);
|
||||
fQuoteMode = FALSE;
|
||||
fQuoteMode = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -901,7 +901,7 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
|
|||
|
||||
fScanIndex = fNextIndex;
|
||||
c.fChar = nextCharLL();
|
||||
c.fEscaped = FALSE;
|
||||
c.fEscaped = false;
|
||||
|
||||
//
|
||||
// check for '' sequence.
|
||||
|
@ -910,7 +910,7 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
|
|||
if (c.fChar == chApos) {
|
||||
if (fRB->fRules.char32At(fNextIndex) == chApos) {
|
||||
c.fChar = nextCharLL(); // get nextChar officially so character counts
|
||||
c.fEscaped = TRUE; // stay correct.
|
||||
c.fEscaped = true; // stay correct.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -918,18 +918,18 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
|
|||
// Toggle quoting mode.
|
||||
// Return either '(' or ')', because quotes cause a grouping of the quoted text.
|
||||
fQuoteMode = !fQuoteMode;
|
||||
if (fQuoteMode == TRUE) {
|
||||
if (fQuoteMode == true) {
|
||||
c.fChar = chLParen;
|
||||
} else {
|
||||
c.fChar = chRParen;
|
||||
}
|
||||
c.fEscaped = FALSE; // The paren that we return is not escaped.
|
||||
c.fEscaped = false; // The paren that we return is not escaped.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (fQuoteMode) {
|
||||
c.fEscaped = TRUE;
|
||||
c.fEscaped = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -963,7 +963,7 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
|
|||
// Use UnicodeString::unescapeAt() to handle them.
|
||||
//
|
||||
if (c.fChar == chBackSlash) {
|
||||
c.fEscaped = TRUE;
|
||||
c.fEscaped = true;
|
||||
int32_t startX = fNextIndex;
|
||||
c.fChar = fRB->fRules.unescapeAt(fNextIndex);
|
||||
if (fNextIndex == startX) {
|
||||
|
@ -1032,7 +1032,7 @@ void RBBIRuleScanner::parse() {
|
|||
#ifdef RBBI_DEBUG
|
||||
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "scan")) { RBBIDebugPrintf("."); fflush(stdout);}
|
||||
#endif
|
||||
if (tableEl->fCharClass < 127 && fC.fEscaped == FALSE && tableEl->fCharClass == fC.fChar) {
|
||||
if (tableEl->fCharClass < 127 && fC.fEscaped == false && tableEl->fCharClass == fC.fChar) {
|
||||
// Table row specified an individual character, not a set, and
|
||||
// the input character is not escaped, and
|
||||
// the input character matched it.
|
||||
|
@ -1057,7 +1057,7 @@ void RBBIRuleScanner::parse() {
|
|||
}
|
||||
|
||||
if (tableEl->fCharClass >= 128 && tableEl->fCharClass < 240 && // Table specs a char class &&
|
||||
fC.fEscaped == FALSE && // char is not escaped &&
|
||||
fC.fEscaped == false && // char is not escaped &&
|
||||
fC.fChar != (UChar32)-1) { // char is not EOF
|
||||
U_ASSERT((tableEl->fCharClass-128) < UPRV_LENGTHOF(fRuleSets));
|
||||
if (fRuleSets[tableEl->fCharClass-128].contains(fC.fChar)) {
|
||||
|
@ -1076,7 +1076,7 @@ void RBBIRuleScanner::parse() {
|
|||
// We've found the row of the state table that matches the current input
|
||||
// character from the rules string.
|
||||
// Perform any action specified by this row in the state table.
|
||||
if (doParseActions((int32_t)tableEl->fAction) == FALSE) {
|
||||
if (doParseActions((int32_t)tableEl->fAction) == false) {
|
||||
// Break out of the state machine loop if the
|
||||
// the action signalled some kind of error, or
|
||||
// the action was to exit, occurs on normal end-of-rules-input.
|
||||
|
@ -1133,13 +1133,13 @@ void RBBIRuleScanner::parse() {
|
|||
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "symbols")) {fSymbolTable->rbbiSymtablePrint();}
|
||||
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "ptree")) {
|
||||
RBBIDebugPrintf("Completed Forward Rules Parse Tree...\n");
|
||||
RBBINode::printTree(fRB->fForwardTree, TRUE);
|
||||
RBBINode::printTree(fRB->fForwardTree, true);
|
||||
RBBIDebugPrintf("\nCompleted Reverse Rules Parse Tree...\n");
|
||||
RBBINode::printTree(fRB->fReverseTree, TRUE);
|
||||
RBBINode::printTree(fRB->fReverseTree, true);
|
||||
RBBIDebugPrintf("\nCompleted Safe Point Forward Rules Parse Tree...\n");
|
||||
RBBINode::printTree(fRB->fSafeFwdTree, TRUE);
|
||||
RBBINode::printTree(fRB->fSafeFwdTree, true);
|
||||
RBBIDebugPrintf("\nCompleted Safe Point Reverse Rules Parse Tree...\n");
|
||||
RBBINode::printTree(fRB->fSafeRevTree, TRUE);
|
||||
RBBINode::printTree(fRB->fSafeRevTree, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1154,7 +1154,7 @@ void RBBIRuleScanner::parse() {
|
|||
void RBBIRuleScanner::printNodeStack(const char *title) {
|
||||
int i;
|
||||
RBBIDebugPrintf("%s. Dumping node stack...\n", title);
|
||||
for (i=fNodeStackPtr; i>0; i--) {RBBINode::printTree(fNodeStack[i], TRUE);}
|
||||
for (i=fNodeStackPtr; i>0; i--) {RBBINode::printTree(fNodeStack[i], true);}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ void RBBISetBuilder::buildRanges() {
|
|||
}
|
||||
if (inputSet->contains(bofString)) {
|
||||
addValToSet(usetNode, 2);
|
||||
fSawBOF = TRUE;
|
||||
fSawBOF = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,7 @@ void RBBISetBuilder::printSets() {
|
|||
RBBI_DEBUG_printUnicodeString(usetNode->fText);
|
||||
RBBIDebugPrintf("\n");
|
||||
if (usetNode->fLeftChild != NULL) {
|
||||
RBBINode::printTree(usetNode->fLeftChild, TRUE);
|
||||
RBBINode::printTree(usetNode->fLeftChild, true);
|
||||
}
|
||||
}
|
||||
RBBIDebugPrintf("\n");
|
||||
|
|
|
@ -254,8 +254,8 @@ void RBBISymbolTable::rbbiSymtablePrint() const {
|
|||
}
|
||||
RBBISymbolTableEntry *s = (RBBISymbolTableEntry *)e->value.pointer;
|
||||
RBBIDebugPrintf("%s\n", CStr(s->key)());
|
||||
RBBINode::printTree(s->val, TRUE);
|
||||
RBBINode::printTree(s->val->fLeftChild, FALSE);
|
||||
RBBINode::printTree(s->val, true);
|
||||
RBBINode::printTree(s->val->fLeftChild, false);
|
||||
RBBIDebugPrintf("\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ void RBBITableBuilder::buildForwardTable() {
|
|||
#ifdef RBBI_DEBUG
|
||||
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "ftree")) {
|
||||
RBBIDebugPuts("\nParse tree after flattening variable references.");
|
||||
RBBINode::printTree(fTree, TRUE);
|
||||
RBBINode::printTree(fTree, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -143,7 +143,7 @@ void RBBITableBuilder::buildForwardTable() {
|
|||
#ifdef RBBI_DEBUG
|
||||
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "stree")) {
|
||||
RBBIDebugPuts("\nParse tree after flattening Unicode Set references.");
|
||||
RBBINode::printTree(fTree, TRUE);
|
||||
RBBINode::printTree(fTree, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -209,14 +209,14 @@ void RBBITableBuilder::calcNullable(RBBINode *n) {
|
|||
if (n->fType == RBBINode::setRef ||
|
||||
n->fType == RBBINode::endMark ) {
|
||||
// These are non-empty leaf node types.
|
||||
n->fNullable = FALSE;
|
||||
n->fNullable = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (n->fType == RBBINode::lookAhead || n->fType == RBBINode::tag) {
|
||||
// Lookahead marker node. It's a leaf, so no recursion on children.
|
||||
// It's nullable because it does not match any literal text from the input stream.
|
||||
n->fNullable = TRUE;
|
||||
n->fNullable = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -234,10 +234,10 @@ void RBBITableBuilder::calcNullable(RBBINode *n) {
|
|||
n->fNullable = n->fLeftChild->fNullable && n->fRightChild->fNullable;
|
||||
}
|
||||
else if (n->fType == RBBINode::opStar || n->fType == RBBINode::opQuestion) {
|
||||
n->fNullable = TRUE;
|
||||
n->fNullable = true;
|
||||
}
|
||||
else {
|
||||
n->fNullable = FALSE;
|
||||
n->fNullable = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -618,7 +618,7 @@ void RBBITableBuilder::buildStateTable() {
|
|||
for (tx=1; tx<fDStates->size(); tx++) {
|
||||
RBBIStateDescriptor *temp;
|
||||
temp = (RBBIStateDescriptor *)fDStates->elementAt(tx);
|
||||
if (temp->fMarked == FALSE) {
|
||||
if (temp->fMarked == false) {
|
||||
T = temp;
|
||||
break;
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ void RBBITableBuilder::buildStateTable() {
|
|||
}
|
||||
|
||||
// mark T;
|
||||
T->fMarked = TRUE;
|
||||
T->fMarked = true;
|
||||
|
||||
// for each input symbol a do begin
|
||||
int32_t a;
|
||||
|
@ -655,7 +655,7 @@ void RBBITableBuilder::buildStateTable() {
|
|||
|
||||
// if U is not empty and not in DStates then
|
||||
int32_t ux = 0;
|
||||
UBool UinDstates = FALSE;
|
||||
UBool UinDstates = false;
|
||||
if (U != NULL) {
|
||||
U_ASSERT(U->size() > 0);
|
||||
int ix;
|
||||
|
@ -666,7 +666,7 @@ void RBBITableBuilder::buildStateTable() {
|
|||
delete U;
|
||||
U = temp2->fPositions;
|
||||
ux = ix;
|
||||
UinDstates = TRUE;
|
||||
UinDstates = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1131,7 +1131,7 @@ void RBBITableBuilder::printPosSets(RBBINode *n) {
|
|||
printf("\n");
|
||||
RBBINode::printNodeHeader();
|
||||
RBBINode::printNode(n);
|
||||
RBBIDebugPrintf(" Nullable: %s\n", n->fNullable?"TRUE":"FALSE");
|
||||
RBBIDebugPrintf(" Nullable: %s\n", n->fNullable?"true":"false");
|
||||
|
||||
RBBIDebugPrintf(" firstpos: ");
|
||||
printSet(n->fFirstPosSet);
|
||||
|
@ -1773,7 +1773,7 @@ void RBBITableBuilder::printRuleStatusTable() {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
RBBIStateDescriptor::RBBIStateDescriptor(int lastInputSymbol, UErrorCode *fStatus) {
|
||||
fMarked = FALSE;
|
||||
fMarked = false;
|
||||
fAccepting = 0;
|
||||
fLookAhead = 0;
|
||||
fTagsIdx = 0;
|
||||
|
|
|
@ -254,7 +254,7 @@ ResourceBundle::clone() const {
|
|||
UnicodeString ResourceBundle::getString(UErrorCode& status) const {
|
||||
int32_t len = 0;
|
||||
const UChar *r = ures_getString(fResource, &len, &status);
|
||||
return UnicodeString(TRUE, r, len);
|
||||
return UnicodeString(true, r, len);
|
||||
}
|
||||
|
||||
const uint8_t *ResourceBundle::getBinary(int32_t& len, UErrorCode& status) const {
|
||||
|
@ -312,13 +312,13 @@ ResourceBundle ResourceBundle::getNext(UErrorCode& status) {
|
|||
UnicodeString ResourceBundle::getNextString(UErrorCode& status) {
|
||||
int32_t len = 0;
|
||||
const UChar* r = ures_getNextString(fResource, &len, 0, &status);
|
||||
return UnicodeString(TRUE, r, len);
|
||||
return UnicodeString(true, r, len);
|
||||
}
|
||||
|
||||
UnicodeString ResourceBundle::getNextString(const char ** key, UErrorCode& status) {
|
||||
int32_t len = 0;
|
||||
const UChar* r = ures_getNextString(fResource, &len, key, &status);
|
||||
return UnicodeString(TRUE, r, len);
|
||||
return UnicodeString(true, r, len);
|
||||
}
|
||||
|
||||
ResourceBundle ResourceBundle::get(int32_t indexR, UErrorCode& status) const {
|
||||
|
@ -336,7 +336,7 @@ ResourceBundle ResourceBundle::get(int32_t indexR, UErrorCode& status) const {
|
|||
UnicodeString ResourceBundle::getStringEx(int32_t indexS, UErrorCode& status) const {
|
||||
int32_t len = 0;
|
||||
const UChar* r = ures_getStringByIndex(fResource, indexS, &len, &status);
|
||||
return UnicodeString(TRUE, r, len);
|
||||
return UnicodeString(true, r, len);
|
||||
}
|
||||
|
||||
ResourceBundle ResourceBundle::get(const char* key, UErrorCode& status) const {
|
||||
|
@ -364,7 +364,7 @@ ResourceBundle ResourceBundle::getWithFallback(const char* key, UErrorCode& stat
|
|||
UnicodeString ResourceBundle::getStringEx(const char* key, UErrorCode& status) const {
|
||||
int32_t len = 0;
|
||||
const UChar* r = ures_getStringByKey(fResource, key, &len, &status);
|
||||
return UnicodeString(TRUE, r, len);
|
||||
return UnicodeString(true, r, len);
|
||||
}
|
||||
|
||||
const char*
|
||||
|
|
|
@ -39,7 +39,7 @@ UChar32 RuleCharacterIterator::next(int32_t options, UBool& isEscaped, UErrorCod
|
|||
if (U_FAILURE(ec)) return DONE;
|
||||
|
||||
UChar32 c = DONE;
|
||||
isEscaped = FALSE;
|
||||
isEscaped = false;
|
||||
|
||||
for (;;) {
|
||||
c = _current();
|
||||
|
@ -75,7 +75,7 @@ UChar32 RuleCharacterIterator::next(int32_t options, UBool& isEscaped, UErrorCod
|
|||
int32_t offset = 0;
|
||||
c = lookahead(tempEscape, MAX_U_NOTATION_LEN).unescapeAt(offset);
|
||||
jumpahead(offset);
|
||||
isEscaped = TRUE;
|
||||
isEscaped = true;
|
||||
if (c < 0) {
|
||||
ec = U_MALFORMED_UNICODE_ESCAPE;
|
||||
return DONE;
|
||||
|
|
|
@ -64,7 +64,7 @@ ICUServiceKey::currentDescriptor(UnicodeString& result) const
|
|||
UBool
|
||||
ICUServiceKey::fallback()
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
UBool
|
||||
|
@ -249,7 +249,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Return TRUE if there is at least one reference to this and the
|
||||
* Return true if there is at least one reference to this and the
|
||||
* resource has not been released.
|
||||
*/
|
||||
UBool isShared() const {
|
||||
|
@ -454,11 +454,11 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
|
|||
|
||||
UnicodeString currentDescriptor;
|
||||
LocalPointer<UVector> cacheDescriptorList;
|
||||
UBool putInCache = FALSE;
|
||||
UBool putInCache = false;
|
||||
|
||||
int32_t startIndex = 0;
|
||||
int32_t limit = factories->size();
|
||||
UBool cacheResult = TRUE;
|
||||
UBool cacheResult = true;
|
||||
|
||||
if (factory != NULL) {
|
||||
for (int32_t i = 0; i < limit; ++i) {
|
||||
|
@ -472,7 +472,7 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
|
|||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
cacheResult = FALSE;
|
||||
cacheResult = false;
|
||||
}
|
||||
|
||||
do {
|
||||
|
@ -486,7 +486,7 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
|
|||
// first test of cache failed, so we'll have to update
|
||||
// the cache if we eventually succeed-- that is, if we're
|
||||
// going to update the cache at all.
|
||||
putInCache = TRUE;
|
||||
putInCache = true;
|
||||
|
||||
int32_t index = startIndex;
|
||||
while (index < limit) {
|
||||
|
@ -796,7 +796,7 @@ ICUService::getDisplayNames(UVector& result,
|
|||
URegistryKey
|
||||
ICUService::registerInstance(UObject* objToAdopt, const UnicodeString& id, UErrorCode& status)
|
||||
{
|
||||
return registerInstance(objToAdopt, id, TRUE, status);
|
||||
return registerInstance(objToAdopt, id, true, status);
|
||||
}
|
||||
|
||||
URegistryKey
|
||||
|
@ -864,13 +864,13 @@ UBool
|
|||
ICUService::unregister(URegistryKey rkey, UErrorCode& status)
|
||||
{
|
||||
ICUServiceFactory *factory = (ICUServiceFactory*)rkey;
|
||||
UBool result = FALSE;
|
||||
UBool result = false;
|
||||
if (factory != NULL && factories != NULL) {
|
||||
Mutex mutex(&lock);
|
||||
|
||||
if (factories->removeElement(factory)) {
|
||||
clearCaches();
|
||||
result = TRUE;
|
||||
result = true;
|
||||
} else {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
delete factory;
|
||||
|
|
|
@ -126,24 +126,24 @@ LocaleKey::fallback() {
|
|||
int x = _currentID.lastIndexOf(UNDERSCORE_CHAR);
|
||||
if (x != -1) {
|
||||
_currentID.remove(x); // truncate current or fallback, whichever we're pointing to
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!_fallbackID.isBogus()) {
|
||||
_currentID = _fallbackID;
|
||||
_fallbackID.setToBogus();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_currentID.length() > 0) {
|
||||
_currentID.remove(0); // completely truncate
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
_currentID.setToBogus();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
UBool
|
||||
|
|
|
@ -65,7 +65,7 @@ LocaleKeyFactory::handlesKey(const ICUServiceKey& key, UErrorCode& status) const
|
|||
key.currentID(id);
|
||||
return supported->get(id) != NULL;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -215,11 +215,11 @@ public:
|
|||
UBool upToDate(UErrorCode& status) const {
|
||||
if (U_SUCCESS(status)) {
|
||||
if (_timestamp == _service->getTimestamp()) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
status = U_ENUM_OUT_OF_SYNC_ERROR;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual int32_t count(UErrorCode& status) const override {
|
||||
|
|
|
@ -65,7 +65,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
|
|||
int32_t min, int32_t max,
|
||||
UErrorCode &errorCode) {
|
||||
if (U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Parse consistent with MessagePattern, but
|
||||
// - support only simple numbered arguments
|
||||
|
@ -76,7 +76,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
|
|||
compiledPattern.setTo((UChar)0);
|
||||
int32_t textLength = 0;
|
||||
int32_t maxArg = -1;
|
||||
UBool inQuote = FALSE;
|
||||
UBool inQuote = false;
|
||||
for (int32_t i = 0; i < patternLength;) {
|
||||
UChar c = patternBuffer[i++];
|
||||
if (c == APOS) {
|
||||
|
@ -85,12 +85,12 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
|
|||
++i;
|
||||
} else if (inQuote) {
|
||||
// skip the quote-ending apostrophe
|
||||
inQuote = FALSE;
|
||||
inQuote = false;
|
||||
continue;
|
||||
} else if (c == OPEN_BRACE || c == CLOSE_BRACE) {
|
||||
// Skip the quote-starting apostrophe, find the end of the quoted literal text.
|
||||
++i;
|
||||
inQuote = TRUE;
|
||||
inQuote = true;
|
||||
} else {
|
||||
// The apostrophe is part of literal text.
|
||||
c = APOS;
|
||||
|
@ -123,7 +123,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
|
|||
}
|
||||
if (argNumber < 0 || c != CLOSE_BRACE) {
|
||||
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (argNumber > maxArg) {
|
||||
|
@ -149,10 +149,10 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
|
|||
int32_t argCount = maxArg + 1;
|
||||
if (argCount < min || max < argCount) {
|
||||
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
compiledPattern.setCharAt(0, (UChar)argCount);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
UnicodeString& SimpleFormatter::format(
|
||||
|
@ -192,7 +192,7 @@ UnicodeString& SimpleFormatter::formatAndAppend(
|
|||
return appendTo;
|
||||
}
|
||||
return format(compiledPattern.getBuffer(), compiledPattern.length(), values,
|
||||
appendTo, NULL, TRUE,
|
||||
appendTo, NULL, true,
|
||||
offsets, offsetsLength, errorCode);
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ UnicodeString &SimpleFormatter::formatAndReplace(
|
|||
result.remove();
|
||||
}
|
||||
return format(cp, cpLength, values,
|
||||
result, &resultCopy, FALSE,
|
||||
result, &resultCopy, false,
|
||||
offsets, offsetsLength, errorCode);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ alignas(UnicodeSet)
|
|||
char gEmptyUnicodeSet[sizeof(UnicodeSet)];
|
||||
|
||||
// Whether the gEmptyUnicodeSet is initialized and ready to use.
|
||||
UBool gEmptyUnicodeSetInitialized = FALSE;
|
||||
UBool gEmptyUnicodeSetInitialized = false;
|
||||
|
||||
inline UnicodeSet* getImpl(Key key) {
|
||||
UnicodeSet* candidate = gUnicodeSets[key];
|
||||
|
@ -118,7 +118,7 @@ class ParseDataSink : public ResourceSink {
|
|||
} else {
|
||||
// Unknown class of parse lenients
|
||||
// TODO(ICU-20428): Make ICU automatically accept new classes?
|
||||
U_ASSERT(FALSE);
|
||||
U_ASSERT(false);
|
||||
}
|
||||
if (U_FAILURE(status)) { return; }
|
||||
}
|
||||
|
@ -134,14 +134,14 @@ icu::UInitOnce gNumberParseUniSetsInitOnce {};
|
|||
UBool U_CALLCONV cleanupNumberParseUniSets() {
|
||||
if (gEmptyUnicodeSetInitialized) {
|
||||
reinterpret_cast<UnicodeSet*>(gEmptyUnicodeSet)->~UnicodeSet();
|
||||
gEmptyUnicodeSetInitialized = FALSE;
|
||||
gEmptyUnicodeSetInitialized = false;
|
||||
}
|
||||
for (int32_t i = 0; i < UNISETS_KEY_COUNT; i++) {
|
||||
delete gUnicodeSets[i];
|
||||
gUnicodeSets[i] = nullptr;
|
||||
}
|
||||
gNumberParseUniSetsInitOnce.reset();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void U_CALLCONV initNumberParseUniSets(UErrorCode& status) {
|
||||
|
@ -150,7 +150,7 @@ void U_CALLCONV initNumberParseUniSets(UErrorCode& status) {
|
|||
// Initialize the empty instance for well-defined fallback behavior
|
||||
new(gEmptyUnicodeSet) UnicodeSet();
|
||||
reinterpret_cast<UnicodeSet*>(gEmptyUnicodeSet)->freeze();
|
||||
gEmptyUnicodeSetInitialized = TRUE;
|
||||
gEmptyUnicodeSetInitialized = true;
|
||||
|
||||
// These sets were decided after discussion with icu-design@. See tickets #13084 and #13309.
|
||||
// Zs+TAB is "horizontal whitespace" according to UTS #18 (blank property).
|
||||
|
|
|
@ -85,16 +85,16 @@ StringTrieBuilder::build(UStringTrieBuildOption buildOption, int32_t elementsLen
|
|||
// have a common prefix of length unitIndex.
|
||||
int32_t
|
||||
StringTrieBuilder::writeNode(int32_t start, int32_t limit, int32_t unitIndex) {
|
||||
UBool hasValue=FALSE;
|
||||
UBool hasValue=false;
|
||||
int32_t value=0;
|
||||
int32_t type;
|
||||
if(unitIndex==getElementStringLength(start)) {
|
||||
// An intermediate or final value.
|
||||
value=getElementValue(start++);
|
||||
if(start==limit) {
|
||||
return writeValueAndFinal(value, TRUE); // final-value node
|
||||
return writeValueAndFinal(value, true); // final-value node
|
||||
}
|
||||
hasValue=TRUE;
|
||||
hasValue=true;
|
||||
}
|
||||
// Now all [start..limit[ strings are longer than unitIndex.
|
||||
int32_t minUnit=getElementUnit(start, unitIndex);
|
||||
|
@ -209,7 +209,7 @@ StringTrieBuilder::makeNode(int32_t start, int32_t limit, int32_t unitIndex, UEr
|
|||
if(U_FAILURE(errorCode)) {
|
||||
return NULL;
|
||||
}
|
||||
UBool hasValue=FALSE;
|
||||
UBool hasValue=false;
|
||||
int32_t value=0;
|
||||
if(unitIndex==getElementStringLength(start)) {
|
||||
// An intermediate or final value.
|
||||
|
@ -217,7 +217,7 @@ StringTrieBuilder::makeNode(int32_t start, int32_t limit, int32_t unitIndex, UEr
|
|||
if(start==limit) {
|
||||
return registerFinalValue(value, errorCode);
|
||||
}
|
||||
hasValue=TRUE;
|
||||
hasValue=true;
|
||||
}
|
||||
Node *node;
|
||||
// Now all [start..limit[ strings are longer than unitIndex.
|
||||
|
@ -410,7 +410,7 @@ StringTrieBuilder::FinalValueNode::operator==(const Node &other) const {
|
|||
|
||||
void
|
||||
StringTrieBuilder::FinalValueNode::write(StringTrieBuilder &builder) {
|
||||
offset=builder.writeValueAndFinal(value, TRUE);
|
||||
offset=builder.writeValueAndFinal(value, true);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -448,7 +448,7 @@ StringTrieBuilder::IntermediateValueNode::markRightEdgesFirst(int32_t edgeNumber
|
|||
void
|
||||
StringTrieBuilder::IntermediateValueNode::write(StringTrieBuilder &builder) {
|
||||
next->write(builder);
|
||||
offset=builder.writeValueAndFinal(value, FALSE);
|
||||
offset=builder.writeValueAndFinal(value, false);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -526,7 +526,7 @@ StringTrieBuilder::ListBranchNode::write(StringTrieBuilder &builder) {
|
|||
// not jump for it at all.
|
||||
unitNumber=length-1;
|
||||
if(rightEdge==NULL) {
|
||||
builder.writeValueAndFinal(values[unitNumber], TRUE);
|
||||
builder.writeValueAndFinal(values[unitNumber], true);
|
||||
} else {
|
||||
rightEdge->write(builder);
|
||||
}
|
||||
|
@ -538,12 +538,12 @@ StringTrieBuilder::ListBranchNode::write(StringTrieBuilder &builder) {
|
|||
if(equal[unitNumber]==NULL) {
|
||||
// Write the final value for the one string ending with this unit.
|
||||
value=values[unitNumber];
|
||||
isFinal=TRUE;
|
||||
isFinal=true;
|
||||
} else {
|
||||
// Write the delta to the start position of the sub-node.
|
||||
U_ASSERT(equal[unitNumber]->getOffset()>0);
|
||||
value=offset-equal[unitNumber]->getOffset();
|
||||
isFinal=FALSE;
|
||||
isFinal=false;
|
||||
}
|
||||
builder.writeValueAndFinal(value, isFinal);
|
||||
offset=builder.write(units[unitNumber]);
|
||||
|
|
|
@ -75,7 +75,7 @@ U_CAPI int32_t U_EXPORT2
|
|||
uprv_stableBinarySearch(char *array, int32_t limit, void *item, int32_t itemSize,
|
||||
UComparator *cmp, const void *context) {
|
||||
int32_t start=0;
|
||||
UBool found=FALSE;
|
||||
UBool found=false;
|
||||
|
||||
/* Binary search until we get down to a tiny sub-array. */
|
||||
while((limit-start)>=MIN_QSORT) {
|
||||
|
@ -90,10 +90,10 @@ uprv_stableBinarySearch(char *array, int32_t limit, void *item, int32_t itemSize
|
|||
* However, if there are many equal items, then it should be
|
||||
* faster to continue with the binary search.
|
||||
* It seems likely that we either have all unique items
|
||||
* (where found will never become TRUE in the insertion sort)
|
||||
* (where found will never become true in the insertion sort)
|
||||
* or potentially many duplicates.
|
||||
*/
|
||||
found=TRUE;
|
||||
found=true;
|
||||
start=i+1;
|
||||
} else if(diff<0) {
|
||||
limit=i;
|
||||
|
@ -106,7 +106,7 @@ uprv_stableBinarySearch(char *array, int32_t limit, void *item, int32_t itemSize
|
|||
while(start<limit) {
|
||||
int32_t diff=cmp(context, item, array+start*itemSize);
|
||||
if(diff==0) {
|
||||
found=TRUE;
|
||||
found=true;
|
||||
} else if(diff<0) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* reset the object, all pointers NULL, all flags FALSE, all sizes 0 */
|
||||
/* reset the object, all pointers NULL, all flags false, all sizes 0 */
|
||||
uprv_memset(pBiDi, 0, sizeof(UBiDi));
|
||||
|
||||
/* allocate memory for arrays as requested */
|
||||
|
@ -160,7 +160,7 @@ ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode)
|
|||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
} else {
|
||||
pBiDi->mayAllocateText=TRUE;
|
||||
pBiDi->mayAllocateText=true;
|
||||
}
|
||||
|
||||
if(maxRunCount>0) {
|
||||
|
@ -171,7 +171,7 @@ ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode)
|
|||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
} else {
|
||||
pBiDi->mayAllocateRuns=TRUE;
|
||||
pBiDi->mayAllocateRuns=true;
|
||||
}
|
||||
|
||||
if(U_SUCCESS(*pErrorCode)) {
|
||||
|
@ -184,7 +184,7 @@ ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode)
|
|||
|
||||
/*
|
||||
* We are allowed to allocate memory if memory==NULL or
|
||||
* mayAllocate==TRUE for each array that we need.
|
||||
* mayAllocate==true for each array that we need.
|
||||
* We also try to grow memory as needed if we
|
||||
* allocate it.
|
||||
*
|
||||
|
@ -203,18 +203,18 @@ ubidi_getMemory(BidiMemoryForAllocation *bidiMem, int32_t *pSize, UBool mayAlloc
|
|||
/* we need to allocate memory */
|
||||
if(mayAllocate && (*pMemory=uprv_malloc(sizeNeeded))!=NULL) {
|
||||
*pSize=sizeNeeded;
|
||||
return TRUE;
|
||||
return true;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if(sizeNeeded<=*pSize) {
|
||||
/* there is already enough memory */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if(!mayAllocate) {
|
||||
/* not enough memory, and we must not allocate */
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
/* we try to grow */
|
||||
void *memory;
|
||||
|
@ -225,10 +225,10 @@ ubidi_getMemory(BidiMemoryForAllocation *bidiMem, int32_t *pSize, UBool mayAlloc
|
|||
if((memory=uprv_realloc(*pMemory, sizeNeeded))!=NULL) {
|
||||
*pMemory=memory;
|
||||
*pSize=sizeNeeded;
|
||||
return TRUE;
|
||||
return true;
|
||||
} else {
|
||||
/* we failed to grow */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ ubidi_isInverse(UBiDi *pBiDi) {
|
|||
if(pBiDi!=NULL) {
|
||||
return pBiDi->isInverse;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,17 +403,17 @@ checkParaCount(UBiDi *pBiDi) {
|
|||
int32_t count=pBiDi->paraCount;
|
||||
if(pBiDi->paras==pBiDi->simpleParas) {
|
||||
if(count<=SIMPLE_PARAS_COUNT)
|
||||
return TRUE;
|
||||
return true;
|
||||
if(!getInitialParasMemory(pBiDi, SIMPLE_PARAS_COUNT * 2))
|
||||
return FALSE;
|
||||
return false;
|
||||
pBiDi->paras=pBiDi->parasMemory;
|
||||
uprv_memcpy(pBiDi->parasMemory, pBiDi->simpleParas, SIMPLE_PARAS_COUNT * sizeof(Para));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if(!getInitialParasMemory(pBiDi, count * 2))
|
||||
return FALSE;
|
||||
return false;
|
||||
pBiDi->paras=pBiDi->parasMemory;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -579,8 +579,8 @@ getDirProps(UBiDi *pBiDi) {
|
|||
}
|
||||
if(i<originalLength) { /* B not last char in text */
|
||||
pBiDi->paraCount++;
|
||||
if(checkParaCount(pBiDi)==FALSE) /* not enough memory for a new para entry */
|
||||
return FALSE;
|
||||
if(checkParaCount(pBiDi)==false) /* not enough memory for a new para entry */
|
||||
return false;
|
||||
if(isDefaultLevel) {
|
||||
pBiDi->paras[pBiDi->paraCount-1].level=defaultParaLevel;
|
||||
state=SEEKING_STRONG_FOR_PARA;
|
||||
|
@ -636,7 +636,7 @@ getDirProps(UBiDi *pBiDi) {
|
|||
}
|
||||
pBiDi->flags=flags;
|
||||
pBiDi->lastArabicPos=lastArabicPos;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* determine the paragraph level at position index */
|
||||
|
@ -743,14 +743,14 @@ bracketProcessPDI(BracketData *bd) {
|
|||
}
|
||||
|
||||
/* newly found opening bracket: create an openings entry */
|
||||
static UBool /* return TRUE if success */
|
||||
static UBool /* return true if success */
|
||||
bracketAddOpening(BracketData *bd, UChar match, int32_t position) {
|
||||
IsoRun *pLastIsoRun=&bd->isoRuns[bd->isoRunLast];
|
||||
Opening *pOpening;
|
||||
if(pLastIsoRun->limit>=bd->openingsCount) { /* no available new entry */
|
||||
UBiDi *pBiDi=bd->pBiDi;
|
||||
if(!getInitialOpeningsMemory(pBiDi, pLastIsoRun->limit * 2))
|
||||
return FALSE;
|
||||
return false;
|
||||
if(bd->openings==bd->simpleOpenings)
|
||||
uprv_memcpy(pBiDi->openingsMemory, bd->simpleOpenings,
|
||||
SIMPLE_OPENINGS_COUNT * sizeof(Opening));
|
||||
|
@ -764,7 +764,7 @@ bracketAddOpening(BracketData *bd, UChar match, int32_t position) {
|
|||
pOpening->contextPos=pLastIsoRun->contextPos;
|
||||
pOpening->flags=0;
|
||||
pLastIsoRun->limit++;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* change N0c1 to N0c2 when a preceding bracket is assigned the embedding level */
|
||||
|
@ -804,7 +804,7 @@ bracketProcessClosing(BracketData *bd, int32_t openIdx, int32_t position) {
|
|||
DirProp newProp;
|
||||
pOpening=&bd->openings[openIdx];
|
||||
direction=(UBiDiDirection)(pLastIsoRun->level&1);
|
||||
stable=TRUE; /* assume stable until proved otherwise */
|
||||
stable=true; /* assume stable until proved otherwise */
|
||||
|
||||
/* The stable flag is set when brackets are paired and their
|
||||
level is resolved and cannot be changed by what will be
|
||||
|
@ -873,7 +873,7 @@ bracketProcessClosing(BracketData *bd, int32_t openIdx, int32_t position) {
|
|||
}
|
||||
|
||||
/* handle strong characters, digits and candidates for closing brackets */
|
||||
static UBool /* return TRUE if success */
|
||||
static UBool /* return true if success */
|
||||
bracketProcessChar(BracketData *bd, int32_t position) {
|
||||
IsoRun *pLastIsoRun=&bd->isoRuns[bd->isoRunLast];
|
||||
DirProp *dirProps, dirProp, newProp;
|
||||
|
@ -912,7 +912,7 @@ bracketProcessChar(BracketData *bd, int32_t position) {
|
|||
}
|
||||
/* matching brackets are not overridden by LRO/RLO */
|
||||
bd->pBiDi->levels[bd->openings[idx].position]&=~UBIDI_LEVEL_OVERRIDE;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/* We get here only if the ON character is not a matching closing
|
||||
bracket or it is a case of N0d */
|
||||
|
@ -927,14 +927,14 @@ bracketProcessChar(BracketData *bd, int32_t position) {
|
|||
create an opening entry for each synonym */
|
||||
if(match==0x232A) { /* RIGHT-POINTING ANGLE BRACKET */
|
||||
if(!bracketAddOpening(bd, 0x3009, position))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else if(match==0x3009) { /* RIGHT ANGLE BRACKET */
|
||||
if(!bracketAddOpening(bd, 0x232A, position))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if(!bracketAddOpening(bd, match, position))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
level=bd->pBiDi->levels[position];
|
||||
|
@ -998,7 +998,7 @@ bracketProcessChar(BracketData *bd, int32_t position) {
|
|||
if(position>bd->openings[i].position)
|
||||
bd->openings[i].flags|=flag;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* perform (X1)..(X9) ------------------------------------------------------- */
|
||||
|
@ -2432,11 +2432,11 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
|
|||
* than the original text. But we don't want the levels memory to be
|
||||
* reallocated shorter than the original length, since we need to restore
|
||||
* the levels as after the first call to ubidi_setpara() before returning.
|
||||
* We will force mayAllocateText to FALSE before the second call to
|
||||
* We will force mayAllocateText to false before the second call to
|
||||
* ubidi_setpara(), and will restore it afterwards.
|
||||
*/
|
||||
saveMayAllocateText=pBiDi->mayAllocateText;
|
||||
pBiDi->mayAllocateText=FALSE;
|
||||
pBiDi->mayAllocateText=false;
|
||||
ubidi_setPara(pBiDi, visualText, visualLength, paraLevel, NULL, pErrorCode);
|
||||
pBiDi->mayAllocateText=saveMayAllocateText;
|
||||
ubidi_getRuns(pBiDi, pErrorCode);
|
||||
|
@ -2866,7 +2866,7 @@ ubidi_isOrderParagraphsLTR(UBiDi *pBiDi) {
|
|||
if(pBiDi!=NULL) {
|
||||
return pBiDi->orderParagraphsLTR;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32
|
|||
/* add the start code point to the USet */
|
||||
const USetAdder *sa=(const USetAdder *)context;
|
||||
sa->add(sa->set, start);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
U_CFUNC void
|
||||
|
|
|
@ -942,7 +942,7 @@ static const UBiDiProps ubidi_props_singleton={
|
|||
0x0,
|
||||
0x110000,
|
||||
0x32dc,
|
||||
NULL, 0, FALSE, FALSE, 0, NULL
|
||||
NULL, 0, false, false, 0, NULL
|
||||
},
|
||||
{ 2,2,0,0 }
|
||||
};
|
||||
|
|
|
@ -101,7 +101,7 @@ setTrailingWSStart(UBiDi *pBiDi) {
|
|||
are already set to paragraph level.
|
||||
Setting trailingWSStart to pBidi->length will avoid changing the
|
||||
level of B chars from 0 to paraLevel in ubidi_getLevels when
|
||||
orderParagraphsLTR==TRUE.
|
||||
orderParagraphsLTR==true.
|
||||
*/
|
||||
if(dirProps[start-1]==B) {
|
||||
pBiDi->trailingWSStart=start; /* currently == pBiDi->length */
|
||||
|
@ -535,7 +535,7 @@ static int32_t getRunFromLogicalIndex(UBiDi *pBiDi, int32_t logicalIndex) {
|
|||
|
||||
/*
|
||||
* Compute the runs array from the levels array.
|
||||
* After ubidi_getRuns() returns TRUE, runCount is guaranteed to be >0
|
||||
* After ubidi_getRuns() returns true, runCount is guaranteed to be >0
|
||||
* and the runs are reordered.
|
||||
* Odd-level runs have visualStart on their visual right edge and
|
||||
* they progress visually to the left.
|
||||
|
@ -551,7 +551,7 @@ ubidi_getRuns(UBiDi *pBiDi, UErrorCode*) {
|
|||
* includes the case of length==0 (handled in setPara)..
|
||||
*/
|
||||
if (pBiDi->runCount>=0) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(pBiDi->direction!=UBIDI_MIXED) {
|
||||
|
@ -608,7 +608,7 @@ ubidi_getRuns(UBiDi *pBiDi, UErrorCode*) {
|
|||
if(getRunsMemory(pBiDi, runCount)) {
|
||||
runs=pBiDi->runsMemory;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* set the runs */
|
||||
|
@ -703,7 +703,7 @@ ubidi_getRuns(UBiDi *pBiDi, UErrorCode*) {
|
|||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static UBool
|
||||
|
@ -714,7 +714,7 @@ prepareReorder(const UBiDiLevel *levels, int32_t length,
|
|||
UBiDiLevel level, minLevel, maxLevel;
|
||||
|
||||
if(levels==NULL || length<=0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* determine minLevel and maxLevel */
|
||||
|
@ -723,7 +723,7 @@ prepareReorder(const UBiDiLevel *levels, int32_t length,
|
|||
for(start=length; start>0;) {
|
||||
level=levels[--start];
|
||||
if(level>UBIDI_MAX_EXPLICIT_LEVEL+1) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if(level<minLevel) {
|
||||
minLevel=level;
|
||||
|
@ -741,7 +741,7 @@ prepareReorder(const UBiDiLevel *levels, int32_t length,
|
|||
indexMap[start]=start;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* reorder a line based on a levels array (L2) ------------------------------ */
|
||||
|
|
|
@ -130,7 +130,7 @@ action_resolve(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
{
|
||||
ubidi_setPara(pTransform->pBidi, pTransform->src, pTransform->srcLength,
|
||||
pTransform->pActiveScheme->baseLevel, NULL, pErrorCode);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,7 +150,7 @@ action_reorder(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
|
||||
*pTransform->pDestLength = pTransform->srcLength;
|
||||
pTransform->reorderingOptions = UBIDI_REORDER_DEFAULT;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -166,9 +166,9 @@ static UBool
|
|||
action_setInverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
||||
{
|
||||
(void)pErrorCode;
|
||||
ubidi_setInverse(pTransform->pBidi, TRUE);
|
||||
ubidi_setInverse(pTransform->pBidi, true);
|
||||
ubidi_setReorderingMode(pTransform->pBidi, UBIDI_REORDER_INVERSE_LIKE_DIRECT);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,7 +186,7 @@ action_setRunsOnly(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
{
|
||||
(void)pErrorCode;
|
||||
ubidi_setReorderingMode(pTransform->pBidi, UBIDI_REORDER_RUNS_ONLY);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -205,7 +205,7 @@ action_reverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
pTransform->dest, pTransform->destSize,
|
||||
UBIDI_REORDER_DEFAULT, pErrorCode);
|
||||
*pTransform->pDestLength = pTransform->srcLength;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,7 +274,7 @@ static UBool
|
|||
action_shapeArabic(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
||||
{
|
||||
if ((pTransform->letters | pTransform->digits) == 0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (pTransform->pActiveScheme->lettersDir == pTransform->pActiveScheme->digitsDir) {
|
||||
doShape(pTransform, pTransform->letters | pTransform->digits | pTransform->pActiveScheme->lettersDir,
|
||||
|
@ -288,7 +288,7 @@ action_shapeArabic(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
pErrorCode);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -306,11 +306,11 @@ action_mirror(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
UChar32 c;
|
||||
uint32_t i = 0, j = 0;
|
||||
if (0 == (pTransform->reorderingOptions & UBIDI_DO_MIRRORING)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (pTransform->destSize < pTransform->srcLength) {
|
||||
*pErrorCode = U_BUFFER_OVERFLOW_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
UBool isOdd = ubidi_getLevelAt(pTransform->pBidi, i) & 1;
|
||||
|
@ -320,7 +320,7 @@ action_mirror(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
|
|||
|
||||
*pTransform->pDestLength = pTransform->srcLength;
|
||||
pTransform->reorderingOptions = UBIDI_REORDER_DEFAULT;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -444,7 +444,7 @@ ubiditransform_transform(UBiDiTransform *pBiDiTransform,
|
|||
UErrorCode *pErrorCode)
|
||||
{
|
||||
uint32_t destLength = 0;
|
||||
UBool textChanged = FALSE;
|
||||
UBool textChanged = false;
|
||||
const UBiDiTransform *pOrigTransform = pBiDiTransform;
|
||||
const UBiDiAction *action = NULL;
|
||||
|
||||
|
@ -503,10 +503,10 @@ ubiditransform_transform(UBiDiTransform *pBiDiTransform,
|
|||
updateSrc(pBiDiTransform, pBiDiTransform->dest, *pBiDiTransform->pDestLength,
|
||||
*pBiDiTransform->pDestLength, pErrorCode);
|
||||
}
|
||||
textChanged = TRUE;
|
||||
textChanged = true;
|
||||
}
|
||||
}
|
||||
ubidi_setInverse(pBiDiTransform->pBidi, FALSE);
|
||||
ubidi_setInverse(pBiDiTransform->pBidi, false);
|
||||
|
||||
if (!textChanged && U_SUCCESS(*pErrorCode)) {
|
||||
/* Text was not changed - just copy src to dest */
|
||||
|
|
|
@ -40,7 +40,7 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 /*end*/, ui
|
|||
/* add the start code point to the USet */
|
||||
const USetAdder *sa=(const USetAdder *)context;
|
||||
sa->add(sa->set, start);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
U_CFUNC void U_EXPORT2
|
||||
|
@ -354,7 +354,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
|
|||
int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth;
|
||||
|
||||
if(ucase_props_singleton.unfold==NULL || s==NULL) {
|
||||
return FALSE; /* no reverse case folding data, or no string */
|
||||
return false; /* no reverse case folding data, or no string */
|
||||
}
|
||||
if(length<=1) {
|
||||
/* the string is too short to find any match */
|
||||
|
@ -364,7 +364,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
|
|||
* but this does not make much practical difference because
|
||||
* a single supplementary code point would just not be found
|
||||
*/
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
const uint16_t *unfold=ucase_props_singleton.unfold;
|
||||
|
@ -375,7 +375,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
|
|||
|
||||
if(length>unfoldStringWidth) {
|
||||
/* the string is too long to find any match */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* do a binary search for the string */
|
||||
|
@ -395,7 +395,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
|
|||
sa->add(sa->set, c);
|
||||
ucase_addCaseClosure(c, sa);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
} else if(result<0) {
|
||||
limit=i;
|
||||
} else /* result>0 */ {
|
||||
|
@ -403,7 +403,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
|
|||
}
|
||||
}
|
||||
|
||||
return FALSE; /* string not found */
|
||||
return false; /* string not found */
|
||||
}
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
@ -431,7 +431,7 @@ FullCaseFoldingIterator::next(UnicodeString &full) {
|
|||
// Set "full" to the NUL-terminated string in the first unfold column.
|
||||
int32_t length=unfoldStringWidth;
|
||||
while(length>0 && p[length-1]==0) { --length; }
|
||||
full.setTo(FALSE, p, length);
|
||||
full.setTo(false, p, length);
|
||||
// Return the code point.
|
||||
UChar32 c;
|
||||
U16_NEXT_UNSAFE(p, rowCpIndex, c);
|
||||
|
@ -905,7 +905,7 @@ isFollowedByCasedLetter(UCaseContextIterator *iter, void *context, int8_t dir) {
|
|||
UChar32 c;
|
||||
|
||||
if(iter==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(/* dir!=0 sets direction */; (c=iter(context, dir))>=0; dir=0) {
|
||||
|
@ -913,13 +913,13 @@ isFollowedByCasedLetter(UCaseContextIterator *iter, void *context, int8_t dir) {
|
|||
if(type&4) {
|
||||
/* case-ignorable, continue with the loop */
|
||||
} else if(type!=UCASE_NONE) {
|
||||
return TRUE; /* followed by cased letter */
|
||||
return true; /* followed by cased letter */
|
||||
} else {
|
||||
return FALSE; /* uncased and not case-ignorable */
|
||||
return false; /* uncased and not case-ignorable */
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; /* not followed by cased letter */
|
||||
return false; /* not followed by cased letter */
|
||||
}
|
||||
|
||||
/* Is preceded by Soft_Dotted character with no intervening cc=230 ? */
|
||||
|
@ -930,19 +930,19 @@ isPrecededBySoftDotted(UCaseContextIterator *iter, void *context) {
|
|||
int8_t dir;
|
||||
|
||||
if(iter==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(dir=-1; (c=iter(context, dir))>=0; dir=0) {
|
||||
dotType=getDotType(c);
|
||||
if(dotType==UCASE_SOFT_DOTTED) {
|
||||
return TRUE; /* preceded by TYPE_i */
|
||||
return true; /* preceded by TYPE_i */
|
||||
} else if(dotType!=UCASE_OTHER_ACCENT) {
|
||||
return FALSE; /* preceded by different base character (not TYPE_i), or intervening cc==230 */
|
||||
return false; /* preceded by different base character (not TYPE_i), or intervening cc==230 */
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; /* not preceded by TYPE_i */
|
||||
return false; /* not preceded by TYPE_i */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -987,20 +987,20 @@ isPrecededBy_I(UCaseContextIterator *iter, void *context) {
|
|||
int8_t dir;
|
||||
|
||||
if(iter==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(dir=-1; (c=iter(context, dir))>=0; dir=0) {
|
||||
if(c==0x49) {
|
||||
return TRUE; /* preceded by I */
|
||||
return true; /* preceded by I */
|
||||
}
|
||||
dotType=getDotType(c);
|
||||
if(dotType!=UCASE_OTHER_ACCENT) {
|
||||
return FALSE; /* preceded by different base character (not I), or intervening cc==230 */
|
||||
return false; /* preceded by different base character (not I), or intervening cc==230 */
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; /* not preceded by I */
|
||||
return false; /* not preceded by I */
|
||||
}
|
||||
|
||||
/* Is followed by one or more cc==230 ? */
|
||||
|
@ -1011,19 +1011,19 @@ isFollowedByMoreAbove(UCaseContextIterator *iter, void *context) {
|
|||
int8_t dir;
|
||||
|
||||
if(iter==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(dir=1; (c=iter(context, dir))>=0; dir=0) {
|
||||
dotType=getDotType(c);
|
||||
if(dotType==UCASE_ABOVE) {
|
||||
return TRUE; /* at least one cc==230 following */
|
||||
return true; /* at least one cc==230 following */
|
||||
} else if(dotType!=UCASE_OTHER_ACCENT) {
|
||||
return FALSE; /* next base character, no more cc==230 following */
|
||||
return false; /* next base character, no more cc==230 following */
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; /* no more cc==230 following */
|
||||
return false; /* no more cc==230 following */
|
||||
}
|
||||
|
||||
/* Is followed by a dot above (without cc==230 in between) ? */
|
||||
|
@ -1034,20 +1034,20 @@ isFollowedByDotAbove(UCaseContextIterator *iter, void *context) {
|
|||
int8_t dir;
|
||||
|
||||
if(iter==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(dir=1; (c=iter(context, dir))>=0; dir=0) {
|
||||
if(c==0x307) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
dotType=getDotType(c);
|
||||
if(dotType!=UCASE_OTHER_ACCENT) {
|
||||
return FALSE; /* next base character or cc==230 in between */
|
||||
return false; /* next base character or cc==230 in between */
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; /* no dot above following */
|
||||
return false; /* no dot above following */
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
|
@ -1317,7 +1317,7 @@ ucase_toFullUpper(UChar32 c,
|
|||
UCaseContextIterator *iter, void *context,
|
||||
const UChar **pString,
|
||||
int32_t caseLocale) {
|
||||
return toUpperOrTitle(c, iter, context, pString, caseLocale, TRUE);
|
||||
return toUpperOrTitle(c, iter, context, pString, caseLocale, true);
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
|
@ -1325,7 +1325,7 @@ ucase_toFullTitle(UChar32 c,
|
|||
UCaseContextIterator *iter, void *context,
|
||||
const UChar **pString,
|
||||
int32_t caseLocale) {
|
||||
return toUpperOrTitle(c, iter, context, pString, caseLocale, FALSE);
|
||||
return toUpperOrTitle(c, iter, context, pString, caseLocale, false);
|
||||
}
|
||||
|
||||
/* case folding ------------------------------------------------------------- */
|
||||
|
@ -1601,6 +1601,6 @@ ucase_hasBinaryProperty(UChar32 c, UProperty which) {
|
|||
ucase_toFullUpper(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0 ||
|
||||
ucase_toFullTitle(c, NULL, NULL, &resultString, UCASE_LOC_ROOT)>=0);
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -990,7 +990,7 @@ static const UCaseProps ucase_props_singleton={
|
|||
0x0,
|
||||
0xe0800,
|
||||
0x3358,
|
||||
NULL, 0, FALSE, FALSE, 0, NULL
|
||||
NULL, 0, false, false, 0, NULL
|
||||
},
|
||||
{ 4,0,0,0 }
|
||||
};
|
||||
|
|
|
@ -157,7 +157,7 @@ appendResult(int32_t cpLength, int32_t result, const UChar *s,
|
|||
ByteSinkUtil::appendCodePoint(cpLength, result, sink, edits);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// See unicode/utf8.h U8_APPEND_UNSAFE().
|
||||
|
@ -525,14 +525,14 @@ ucasemap_internalUTF8ToTitle(
|
|||
csc.p=(void *)src;
|
||||
csc.limit=srcLength;
|
||||
int32_t prev=0;
|
||||
UBool isFirstIndex=TRUE;
|
||||
UBool isFirstIndex=true;
|
||||
|
||||
/* titlecasing loop */
|
||||
while(prev<srcLength) {
|
||||
/* find next index where to titlecase */
|
||||
int32_t index;
|
||||
if(isFirstIndex) {
|
||||
isFirstIndex=FALSE;
|
||||
isFirstIndex=false;
|
||||
index=iter->first();
|
||||
} else {
|
||||
index=iter->next();
|
||||
|
@ -643,12 +643,12 @@ UBool isFollowedByCasedLetter(const uint8_t *s, int32_t i, int32_t length) {
|
|||
if ((type & UCASE_IGNORABLE) != 0) {
|
||||
// Case-ignorable, continue with the loop.
|
||||
} else if (type != UCASE_NONE) {
|
||||
return TRUE; // Followed by cased letter.
|
||||
return true; // Followed by cased letter.
|
||||
} else {
|
||||
return FALSE; // Uncased and not case-ignorable.
|
||||
return false; // Uncased and not case-ignorable.
|
||||
}
|
||||
}
|
||||
return FALSE; // Not followed by cased letter.
|
||||
return false; // Not followed by cased letter.
|
||||
}
|
||||
|
||||
// Keep this consistent with the UTF-16 version in ustrcase.cpp and the Java version in CaseMap.java.
|
||||
|
@ -707,7 +707,7 @@ void toUpper(uint32_t options,
|
|||
nextState |= AFTER_VOWEL_WITH_ACCENT;
|
||||
}
|
||||
// Map according to Greek rules.
|
||||
UBool addTonos = FALSE;
|
||||
UBool addTonos = false;
|
||||
if (upper == 0x397 &&
|
||||
(data & HAS_ACCENT) != 0 &&
|
||||
numYpogegrammeni == 0 &&
|
||||
|
@ -718,7 +718,7 @@ void toUpper(uint32_t options,
|
|||
if (i == nextIndex) {
|
||||
upper = 0x389; // Preserve the precomposed form.
|
||||
} else {
|
||||
addTonos = TRUE;
|
||||
addTonos = true;
|
||||
}
|
||||
} else if ((data & HAS_DIALYTIKA) != 0) {
|
||||
// Preserve a vowel with dialytika in precomposed form if it exists.
|
||||
|
@ -733,7 +733,7 @@ void toUpper(uint32_t options,
|
|||
|
||||
UBool change;
|
||||
if (edits == nullptr && (options & U_OMIT_UNCHANGED_TEXT) == 0) {
|
||||
change = TRUE; // common, simple usage
|
||||
change = true; // common, simple usage
|
||||
} else {
|
||||
// Find out first whether we are changing the text.
|
||||
U_ASSERT(0x370 <= upper && upper <= 0x3ff); // 2-byte UTF-8, main Greek block
|
||||
|
|
|
@ -126,7 +126,7 @@ u_isxdigit(UChar32 c) {
|
|||
(c<=0x66 && c>=0x41 && (c<=0x46 || c>=0x61)) ||
|
||||
(c>=0xff21 && c<=0xff46 && (c<=0xff26 || c>=0xff41))
|
||||
) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
GET_PROPS(c, props);
|
||||
|
@ -249,7 +249,7 @@ U_CAPI UBool U_EXPORT2
|
|||
u_isprint(UChar32 c) {
|
||||
uint32_t props;
|
||||
GET_PROPS(c, props);
|
||||
/* comparing ==0 returns FALSE for the categories mentioned */
|
||||
/* comparing ==0 returns false for the categories mentioned */
|
||||
return (UBool)((CAT_MASK(props)&U_GC_C_MASK)==0);
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ U_CAPI UBool U_EXPORT2
|
|||
u_isgraph(UChar32 c) {
|
||||
uint32_t props;
|
||||
GET_PROPS(c, props);
|
||||
/* comparing ==0 returns FALSE for the categories mentioned */
|
||||
/* comparing ==0 returns false for the categories mentioned */
|
||||
return (UBool)((CAT_MASK(props)&
|
||||
(U_GC_CC_MASK|U_GC_CF_MASK|U_GC_CS_MASK|U_GC_CN_MASK|U_GC_Z_MASK))
|
||||
==0);
|
||||
|
@ -291,7 +291,7 @@ u_isgraphPOSIX(UChar32 c) {
|
|||
uint32_t props;
|
||||
GET_PROPS(c, props);
|
||||
/* \p{space}\p{gc=Control} == \p{gc=Z}\p{Control} */
|
||||
/* comparing ==0 returns FALSE for the categories mentioned */
|
||||
/* comparing ==0 returns false for the categories mentioned */
|
||||
return (UBool)((CAT_MASK(props)&
|
||||
(U_GC_CC_MASK|U_GC_CS_MASK|U_GC_CN_MASK|U_GC_Z_MASK))
|
||||
==0);
|
||||
|
@ -591,7 +591,7 @@ uscript_hasScript(UChar32 c, UScriptCode sc) {
|
|||
uint32_t sc32=sc;
|
||||
if(sc32>0x7fff) {
|
||||
/* Guard against bogus input that would make us go past the Script_Extensions terminator. */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
while(sc32>*scx) {
|
||||
++scx;
|
||||
|
@ -654,7 +654,7 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32
|
|||
sa->add(sa->set, start);
|
||||
(void)end;
|
||||
(void)value;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#define USET_ADD_CP_AND_NEXT(sa, cp) sa->add(sa->set, cp); sa->add(sa->set, cp+1)
|
||||
|
|
|
@ -1465,7 +1465,7 @@ static const UTrie2 propsTrie={
|
|||
0x0,
|
||||
0x110000,
|
||||
0x59e4,
|
||||
NULL, 0, FALSE, FALSE, 0, NULL
|
||||
NULL, 0, false, false, 0, NULL
|
||||
};
|
||||
|
||||
static const uint16_t propsVectorsTrie_index[32692]={
|
||||
|
@ -3527,7 +3527,7 @@ static const UTrie2 propsVectorsTrie={
|
|||
0x0,
|
||||
0x110000,
|
||||
0x7fb0,
|
||||
NULL, 0, FALSE, FALSE, 0, NULL
|
||||
NULL, 0, false, false, 0, NULL
|
||||
};
|
||||
|
||||
static const uint32_t propsVectors[7230]={
|
||||
|
|
|
@ -308,13 +308,13 @@ UCharsTrie::findUniqueValueFromBranch(const UChar *pos, int32_t length,
|
|||
}
|
||||
} else {
|
||||
uniqueValue=value;
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
}
|
||||
} else {
|
||||
if(!findUniqueValue(pos+value, haveUniqueValue, uniqueValue)) {
|
||||
return NULL;
|
||||
}
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
}
|
||||
} while(--length>1);
|
||||
return pos+1; // ignore the last comparison unit
|
||||
|
@ -330,9 +330,9 @@ UCharsTrie::findUniqueValue(const UChar *pos, UBool haveUniqueValue, int32_t &un
|
|||
}
|
||||
pos=findUniqueValueFromBranch(pos, node+1, haveUniqueValue, uniqueValue);
|
||||
if(pos==NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
node=*pos++;
|
||||
} else if(node<kMinValueLead) {
|
||||
// linear-match node
|
||||
|
@ -348,14 +348,14 @@ UCharsTrie::findUniqueValue(const UChar *pos, UBool haveUniqueValue, int32_t &un
|
|||
}
|
||||
if(haveUniqueValue) {
|
||||
if(value!=uniqueValue) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
uniqueValue=value;
|
||||
haveUniqueValue=TRUE;
|
||||
haveUniqueValue=true;
|
||||
}
|
||||
if(isFinal) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
pos=skipNodeValue(pos, node);
|
||||
node&=kNodeTypeMask;
|
||||
|
|
|
@ -163,7 +163,7 @@ UCharsTrieBuilder::buildUnicodeString(UStringTrieBuildOption buildOption, Unicod
|
|||
UErrorCode &errorCode) {
|
||||
buildUChars(buildOption, errorCode);
|
||||
if(U_SUCCESS(errorCode)) {
|
||||
result.setTo(FALSE, uchars+(ucharsCapacity-ucharsLength), ucharsLength);
|
||||
result.setTo(false, uchars+(ucharsCapacity-ucharsLength), ucharsLength);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ UCharsTrieBuilder::buildUChars(UStringTrieBuildOption buildOption, UErrorCode &e
|
|||
}
|
||||
uprv_sortArray(elements, elementsLength, (int32_t)sizeof(UCharsTrieElement),
|
||||
compareElementStrings, &strings,
|
||||
FALSE, // need not be a stable sort
|
||||
false, // need not be a stable sort
|
||||
&errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
|
@ -322,7 +322,7 @@ UCharsTrieBuilder::createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t l
|
|||
UBool
|
||||
UCharsTrieBuilder::ensureCapacity(int32_t length) {
|
||||
if(uchars==NULL) {
|
||||
return FALSE; // previous memory allocation had failed
|
||||
return false; // previous memory allocation had failed
|
||||
}
|
||||
if(length>ucharsCapacity) {
|
||||
int32_t newCapacity=ucharsCapacity;
|
||||
|
@ -335,7 +335,7 @@ UCharsTrieBuilder::ensureCapacity(int32_t length) {
|
|||
uprv_free(uchars);
|
||||
uchars=NULL;
|
||||
ucharsCapacity=0;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
u_memcpy(newUChars+(newCapacity-ucharsLength),
|
||||
uchars+(ucharsCapacity-ucharsLength), ucharsLength);
|
||||
|
@ -343,7 +343,7 @@ UCharsTrieBuilder::ensureCapacity(int32_t length) {
|
|||
uchars=newUChars;
|
||||
ucharsCapacity=newCapacity;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
|
|
@ -26,7 +26,7 @@ UCharsTrie::Iterator::Iterator(ConstChar16Ptr trieUChars, int32_t maxStringLengt
|
|||
: uchars_(trieUChars),
|
||||
pos_(uchars_), initialPos_(uchars_),
|
||||
remainingMatchLength_(-1), initialRemainingMatchLength_(-1),
|
||||
skipValue_(FALSE),
|
||||
skipValue_(false),
|
||||
maxLength_(maxStringLength), value_(0), stack_(NULL) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
|
@ -48,7 +48,7 @@ UCharsTrie::Iterator::Iterator(const UCharsTrie &trie, int32_t maxStringLength,
|
|||
: uchars_(trie.uchars_), pos_(trie.pos_), initialPos_(trie.pos_),
|
||||
remainingMatchLength_(trie.remainingMatchLength_),
|
||||
initialRemainingMatchLength_(trie.remainingMatchLength_),
|
||||
skipValue_(FALSE),
|
||||
skipValue_(false),
|
||||
maxLength_(maxStringLength), value_(0), stack_(NULL) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
|
@ -82,7 +82,7 @@ UCharsTrie::Iterator &
|
|||
UCharsTrie::Iterator::reset() {
|
||||
pos_=initialPos_;
|
||||
remainingMatchLength_=initialRemainingMatchLength_;
|
||||
skipValue_=FALSE;
|
||||
skipValue_=false;
|
||||
int32_t length=remainingMatchLength_+1; // Remaining match length.
|
||||
if(maxLength_>0 && length>maxLength_) {
|
||||
length=maxLength_;
|
||||
|
@ -100,12 +100,12 @@ UCharsTrie::Iterator::hasNext() const { return pos_!=NULL || !stack_->isEmpty();
|
|||
UBool
|
||||
UCharsTrie::Iterator::next(UErrorCode &errorCode) {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
const UChar *pos=pos_;
|
||||
if(pos==NULL) {
|
||||
if(stack_->isEmpty()) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Pop the state off the stack and continue with the next outbound edge of
|
||||
// the branch node.
|
||||
|
@ -118,7 +118,7 @@ UCharsTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
if(length>1) {
|
||||
pos=branchNext(pos, length, errorCode);
|
||||
if(pos==NULL) {
|
||||
return TRUE; // Reached a final value.
|
||||
return true; // Reached a final value.
|
||||
}
|
||||
} else {
|
||||
str_.append(*pos++);
|
||||
|
@ -135,7 +135,7 @@ UCharsTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
if(skipValue_) {
|
||||
pos=skipNodeValue(pos, node);
|
||||
node&=kNodeTypeMask;
|
||||
skipValue_=FALSE;
|
||||
skipValue_=false;
|
||||
} else {
|
||||
// Deliver value for the string so far.
|
||||
UBool isFinal=(UBool)(node>>15);
|
||||
|
@ -152,9 +152,9 @@ UCharsTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
// next time.
|
||||
// Instead, keep pos_ on the node lead unit itself.
|
||||
pos_=pos-1;
|
||||
skipValue_=TRUE;
|
||||
skipValue_=true;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(maxLength_>0 && str_.length()==maxLength_) {
|
||||
|
@ -166,7 +166,7 @@ UCharsTrie::Iterator::next(UErrorCode &errorCode) {
|
|||
}
|
||||
pos=branchNext(pos, node+1, errorCode);
|
||||
if(pos==NULL) {
|
||||
return TRUE; // Reached a final value.
|
||||
return true; // Reached a final value.
|
||||
}
|
||||
} else {
|
||||
// Linear-match node, append length units to str_.
|
||||
|
|
|
@ -171,7 +171,7 @@ UCharCharacterIterator::nextPostInc() {
|
|||
|
||||
UBool
|
||||
UCharCharacterIterator::hasNext() {
|
||||
return (UBool)(pos < end ? TRUE : FALSE);
|
||||
return (UBool)(pos < end ? true : false);
|
||||
}
|
||||
|
||||
UChar
|
||||
|
@ -185,7 +185,7 @@ UCharCharacterIterator::previous() {
|
|||
|
||||
UBool
|
||||
UCharCharacterIterator::hasPrevious() {
|
||||
return (UBool)(pos > begin ? TRUE : FALSE);
|
||||
return (UBool)(pos > begin ? true : false);
|
||||
}
|
||||
|
||||
UChar32
|
||||
|
|
|
@ -120,5 +120,5 @@ U_CFUNC UBool ucln_lib_cleanup(void) {
|
|||
#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
|
||||
ucln_unRegisterAutomaticCleanup();
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U
|
|||
UErrorCode cbErr;
|
||||
UConverterToUnicodeArgs toUArgs = {
|
||||
sizeof(UConverterToUnicodeArgs),
|
||||
TRUE,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -173,7 +173,7 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U
|
|||
};
|
||||
UConverterFromUnicodeArgs fromUArgs = {
|
||||
sizeof(UConverterFromUnicodeArgs),
|
||||
TRUE,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -269,7 +269,7 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U
|
|||
|
||||
/* Copy initial state */
|
||||
uprv_memcpy(localConverter, cnv, sizeof(UConverter));
|
||||
localConverter->isCopyLocal = localConverter->isExtraLocal = FALSE;
|
||||
localConverter->isCopyLocal = localConverter->isExtraLocal = false;
|
||||
|
||||
/* copy the substitution string */
|
||||
if (cnv->subChars == (uint8_t *)cnv->subUChars) {
|
||||
|
@ -306,7 +306,7 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U
|
|||
|
||||
if(localConverter == (UConverter*)stackBuffer) {
|
||||
/* we're using user provided data - set to not destroy */
|
||||
localConverter->isCopyLocal = TRUE;
|
||||
localConverter->isCopyLocal = true;
|
||||
}
|
||||
|
||||
/* allow callback functions to handle any memory allocation */
|
||||
|
@ -352,7 +352,7 @@ ucnv_close (UConverter * converter)
|
|||
if (converter->fromCharErrorBehaviour != UCNV_TO_U_DEFAULT_CALLBACK) {
|
||||
UConverterToUnicodeArgs toUArgs = {
|
||||
sizeof(UConverterToUnicodeArgs),
|
||||
TRUE,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -368,7 +368,7 @@ ucnv_close (UConverter * converter)
|
|||
if (converter->fromUCharErrorBehaviour != UCNV_FROM_U_DEFAULT_CALLBACK) {
|
||||
UConverterFromUnicodeArgs fromUArgs = {
|
||||
sizeof(UConverterFromUnicodeArgs),
|
||||
TRUE,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -580,7 +580,7 @@ static void _reset(UConverter *converter, UConverterResetChoice choice,
|
|||
if(choice<=UCNV_RESET_TO_UNICODE && converter->fromCharErrorBehaviour != UCNV_TO_U_DEFAULT_CALLBACK) {
|
||||
UConverterToUnicodeArgs toUArgs = {
|
||||
sizeof(UConverterToUnicodeArgs),
|
||||
TRUE,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -595,7 +595,7 @@ static void _reset(UConverter *converter, UConverterResetChoice choice,
|
|||
if(choice!=UCNV_RESET_TO_UNICODE && converter->fromUCharErrorBehaviour != UCNV_FROM_U_DEFAULT_CALLBACK) {
|
||||
UConverterFromUnicodeArgs fromUArgs = {
|
||||
sizeof(UConverterFromUnicodeArgs),
|
||||
TRUE,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -634,19 +634,19 @@ static void _reset(UConverter *converter, UConverterResetChoice choice,
|
|||
U_CAPI void U_EXPORT2
|
||||
ucnv_reset(UConverter *converter)
|
||||
{
|
||||
_reset(converter, UCNV_RESET_BOTH, TRUE);
|
||||
_reset(converter, UCNV_RESET_BOTH, true);
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_resetToUnicode(UConverter *converter)
|
||||
{
|
||||
_reset(converter, UCNV_RESET_TO_UNICODE, TRUE);
|
||||
_reset(converter, UCNV_RESET_TO_UNICODE, true);
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_resetFromUnicode(UConverter *converter)
|
||||
{
|
||||
_reset(converter, UCNV_RESET_FROM_UNICODE, TRUE);
|
||||
_reset(converter, UCNV_RESET_FROM_UNICODE, true);
|
||||
}
|
||||
|
||||
U_CAPI int8_t U_EXPORT2
|
||||
|
@ -871,7 +871,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
|
||||
/* avoid compiler warnings - not otherwise necessary, and the values do not matter */
|
||||
realSourceLimit=NULL;
|
||||
realFlush=FALSE;
|
||||
realFlush=false;
|
||||
realSourceIndex=0;
|
||||
} else {
|
||||
/*
|
||||
|
@ -887,7 +887,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR);
|
||||
pArgs->source=replay;
|
||||
pArgs->sourceLimit=replay-cnv->preFromULength;
|
||||
pArgs->flush=FALSE;
|
||||
pArgs->flush=false;
|
||||
sourceIndex=-1;
|
||||
|
||||
cnv->preFromULength=0;
|
||||
|
@ -923,11 +923,11 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
cnv->fromUChar32==0);
|
||||
} else {
|
||||
/* handle error from ucnv_convertEx() */
|
||||
converterSawEndOfInput=FALSE;
|
||||
converterSawEndOfInput=false;
|
||||
}
|
||||
|
||||
/* no callback called yet for this iteration */
|
||||
calledCallback=FALSE;
|
||||
calledCallback=false;
|
||||
|
||||
/* no sourceIndex adjustment for conversion, only for callback output */
|
||||
errorInputLength=0;
|
||||
|
@ -976,7 +976,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR);
|
||||
pArgs->source=replay;
|
||||
pArgs->sourceLimit=replay-cnv->preFromULength;
|
||||
pArgs->flush=FALSE;
|
||||
pArgs->flush=false;
|
||||
if((sourceIndex+=cnv->preFromULength)<0) {
|
||||
sourceIndex=-1;
|
||||
}
|
||||
|
@ -1017,7 +1017,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
|
||||
/* inject an error and continue with callback handling */
|
||||
*err=U_TRUNCATED_CHAR_FOUND;
|
||||
calledCallback=FALSE; /* new error condition */
|
||||
calledCallback=false; /* new error condition */
|
||||
} else {
|
||||
/* input consumed */
|
||||
if(pArgs->flush) {
|
||||
|
@ -1033,7 +1033,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
}
|
||||
|
||||
/* reset the converter without calling the callback function */
|
||||
_reset(cnv, UCNV_RESET_FROM_UNICODE, FALSE);
|
||||
_reset(cnv, UCNV_RESET_FROM_UNICODE, false);
|
||||
}
|
||||
|
||||
/* done successfully */
|
||||
|
@ -1110,7 +1110,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
* that a callback was called;
|
||||
* if the callback did not resolve the error, then we return
|
||||
*/
|
||||
calledCallback=TRUE;
|
||||
calledCallback=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
/*
|
||||
* Output the fromUnicode overflow buffer.
|
||||
* Call this function if(cnv->charErrorBufferLength>0).
|
||||
* @return TRUE if overflow
|
||||
* @return true if overflow
|
||||
*/
|
||||
static UBool
|
||||
ucnv_outputOverflowFromUnicode(UConverter *cnv,
|
||||
|
@ -1154,7 +1154,7 @@ ucnv_outputOverflowFromUnicode(UConverter *cnv,
|
|||
*pOffsets=offsets;
|
||||
}
|
||||
*err=U_BUFFER_OVERFLOW_ERROR;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* copy the overflow contents to the target */
|
||||
|
@ -1170,7 +1170,7 @@ ucnv_outputOverflowFromUnicode(UConverter *cnv,
|
|||
if(offsets!=NULL) {
|
||||
*pOffsets=offsets;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
|
@ -1316,7 +1316,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
|
||||
/* avoid compiler warnings - not otherwise necessary, and the values do not matter */
|
||||
realSourceLimit=NULL;
|
||||
realFlush=FALSE;
|
||||
realFlush=false;
|
||||
realSourceIndex=0;
|
||||
} else {
|
||||
/*
|
||||
|
@ -1332,7 +1332,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
|
||||
pArgs->source=replay;
|
||||
pArgs->sourceLimit=replay-cnv->preToULength;
|
||||
pArgs->flush=FALSE;
|
||||
pArgs->flush=false;
|
||||
sourceIndex=-1;
|
||||
|
||||
cnv->preToULength=0;
|
||||
|
@ -1368,11 +1368,11 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
cnv->toULength==0);
|
||||
} else {
|
||||
/* handle error from getNextUChar() or ucnv_convertEx() */
|
||||
converterSawEndOfInput=FALSE;
|
||||
converterSawEndOfInput=false;
|
||||
}
|
||||
|
||||
/* no callback called yet for this iteration */
|
||||
calledCallback=FALSE;
|
||||
calledCallback=false;
|
||||
|
||||
/* no sourceIndex adjustment for conversion, only for callback output */
|
||||
errorInputLength=0;
|
||||
|
@ -1421,7 +1421,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
|
||||
pArgs->source=replay;
|
||||
pArgs->sourceLimit=replay-cnv->preToULength;
|
||||
pArgs->flush=FALSE;
|
||||
pArgs->flush=false;
|
||||
if((sourceIndex+=cnv->preToULength)<0) {
|
||||
sourceIndex=-1;
|
||||
}
|
||||
|
@ -1462,7 +1462,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
|
||||
/* inject an error and continue with callback handling */
|
||||
*err=U_TRUNCATED_CHAR_FOUND;
|
||||
calledCallback=FALSE; /* new error condition */
|
||||
calledCallback=false; /* new error condition */
|
||||
} else {
|
||||
/* input consumed */
|
||||
if(pArgs->flush) {
|
||||
|
@ -1478,7 +1478,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
}
|
||||
|
||||
/* reset the converter without calling the callback function */
|
||||
_reset(cnv, UCNV_RESET_TO_UNICODE, FALSE);
|
||||
_reset(cnv, UCNV_RESET_TO_UNICODE, false);
|
||||
}
|
||||
|
||||
/* done successfully */
|
||||
|
@ -1556,7 +1556,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
* that a callback was called;
|
||||
* if the callback did not resolve the error, then we return
|
||||
*/
|
||||
calledCallback=TRUE;
|
||||
calledCallback=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1564,7 +1564,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
|
|||
/*
|
||||
* Output the toUnicode overflow buffer.
|
||||
* Call this function if(cnv->UCharErrorBufferLength>0).
|
||||
* @return TRUE if overflow
|
||||
* @return true if overflow
|
||||
*/
|
||||
static UBool
|
||||
ucnv_outputOverflowToUnicode(UConverter *cnv,
|
||||
|
@ -1600,7 +1600,7 @@ ucnv_outputOverflowToUnicode(UConverter *cnv,
|
|||
*pOffsets=offsets;
|
||||
}
|
||||
*err=U_BUFFER_OVERFLOW_ERROR;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* copy the overflow contents to the target */
|
||||
|
@ -1616,7 +1616,7 @@ ucnv_outputOverflowToUnicode(UConverter *cnv,
|
|||
if(offsets!=NULL) {
|
||||
*pOffsets=offsets;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
|
@ -1754,7 +1754,7 @@ ucnv_fromUChars(UConverter *cnv,
|
|||
destLimit=dest+destCapacity;
|
||||
|
||||
/* perform the conversion */
|
||||
ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
|
||||
ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, true, pErrorCode);
|
||||
destLength=(int32_t)(dest-originalDest);
|
||||
|
||||
/* if an overflow occurs, then get the preflighting length */
|
||||
|
@ -1765,7 +1765,7 @@ ucnv_fromUChars(UConverter *cnv,
|
|||
do {
|
||||
dest=buffer;
|
||||
*pErrorCode=U_ZERO_ERROR;
|
||||
ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
|
||||
ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, true, pErrorCode);
|
||||
destLength+=(int32_t)(dest-buffer);
|
||||
} while(*pErrorCode==U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
|
@ -1810,7 +1810,7 @@ ucnv_toUChars(UConverter *cnv,
|
|||
destLimit=dest+destCapacity;
|
||||
|
||||
/* perform the conversion */
|
||||
ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
|
||||
ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, true, pErrorCode);
|
||||
destLength=(int32_t)(dest-originalDest);
|
||||
|
||||
/* if an overflow occurs, then get the preflighting length */
|
||||
|
@ -1822,7 +1822,7 @@ ucnv_toUChars(UConverter *cnv,
|
|||
do {
|
||||
dest=buffer;
|
||||
*pErrorCode=U_ZERO_ERROR;
|
||||
ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
|
||||
ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, true, pErrorCode);
|
||||
destLength+=(int32_t)(dest-buffer);
|
||||
}
|
||||
while(*pErrorCode==U_BUFFER_OVERFLOW_ERROR);
|
||||
|
@ -1907,15 +1907,15 @@ ucnv_getNextUChar(UConverter *cnv,
|
|||
}
|
||||
|
||||
/*
|
||||
* flush==TRUE is implied for ucnv_getNextUChar()
|
||||
* flush==true is implied for ucnv_getNextUChar()
|
||||
*
|
||||
* do not simply return even if s==sourceLimit because the converter may
|
||||
* not have seen flush==TRUE before
|
||||
* not have seen flush==true before
|
||||
*/
|
||||
|
||||
/* prepare the converter arguments */
|
||||
args.converter=cnv;
|
||||
args.flush=TRUE;
|
||||
args.flush=true;
|
||||
args.offsets=NULL;
|
||||
args.source=s;
|
||||
args.sourceLimit=sourceLimit;
|
||||
|
@ -1937,7 +1937,7 @@ ucnv_getNextUChar(UConverter *cnv,
|
|||
*source=s=args.source;
|
||||
if(*err==U_INDEX_OUTOFBOUNDS_ERROR) {
|
||||
/* reset the converter without calling the callback function */
|
||||
_reset(cnv, UCNV_RESET_TO_UNICODE, FALSE);
|
||||
_reset(cnv, UCNV_RESET_TO_UNICODE, false);
|
||||
return 0xffff; /* no output */
|
||||
} else if(U_SUCCESS(*err) && c>=0) {
|
||||
return c;
|
||||
|
@ -2176,7 +2176,7 @@ ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
|
|||
|
||||
/* prepare the converter arguments */
|
||||
fromUArgs.converter=targetCnv;
|
||||
fromUArgs.flush=FALSE;
|
||||
fromUArgs.flush=false;
|
||||
fromUArgs.offsets=NULL;
|
||||
fromUArgs.target=*target;
|
||||
fromUArgs.targetLimit=targetLimit;
|
||||
|
@ -2331,8 +2331,8 @@ ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
|
|||
/* input consumed */
|
||||
if(flush) {
|
||||
/* reset the converters without calling the callback functions */
|
||||
_reset(sourceCnv, UCNV_RESET_TO_UNICODE, FALSE);
|
||||
_reset(targetCnv, UCNV_RESET_FROM_UNICODE, FALSE);
|
||||
_reset(sourceCnv, UCNV_RESET_TO_UNICODE, false);
|
||||
_reset(targetCnv, UCNV_RESET_FROM_UNICODE, false);
|
||||
}
|
||||
|
||||
/* done successfully */
|
||||
|
@ -2372,7 +2372,7 @@ ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
|
|||
sourceCnv->preToULength>=0 &&
|
||||
sourceCnv->UCharErrorBufferLength==0
|
||||
) {
|
||||
fromUArgs.flush=TRUE;
|
||||
fromUArgs.flush=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2436,8 +2436,8 @@ ucnv_internalConvert(UConverter *outConverter, UConverter *inConverter,
|
|||
&myTarget, targetLimit,
|
||||
&source, sourceLimit,
|
||||
pivotBuffer, &pivot, &pivot2, pivotBuffer+CHUNK_SIZE,
|
||||
FALSE,
|
||||
TRUE,
|
||||
false,
|
||||
true,
|
||||
pErrorCode);
|
||||
targetLength=(int32_t)(myTarget-target);
|
||||
}
|
||||
|
@ -2459,8 +2459,8 @@ ucnv_internalConvert(UConverter *outConverter, UConverter *inConverter,
|
|||
&myTarget, targetLimit,
|
||||
&source, sourceLimit,
|
||||
pivotBuffer, &pivot, &pivot2, pivotBuffer+CHUNK_SIZE,
|
||||
FALSE,
|
||||
TRUE,
|
||||
false,
|
||||
true,
|
||||
pErrorCode);
|
||||
targetLength+=(int32_t)(myTarget-targetBuffer);
|
||||
} while(*pErrorCode==U_BUFFER_OVERFLOW_ERROR);
|
||||
|
@ -2585,7 +2585,7 @@ ucnv_toAlgorithmic(UConverterType algorithmicType,
|
|||
char *target, int32_t targetCapacity,
|
||||
const char *source, int32_t sourceLength,
|
||||
UErrorCode *pErrorCode) {
|
||||
return ucnv_convertAlgorithmic(TRUE, algorithmicType, cnv,
|
||||
return ucnv_convertAlgorithmic(true, algorithmicType, cnv,
|
||||
target, targetCapacity,
|
||||
source, sourceLength,
|
||||
pErrorCode);
|
||||
|
@ -2597,7 +2597,7 @@ ucnv_fromAlgorithmic(UConverter *cnv,
|
|||
char *target, int32_t targetCapacity,
|
||||
const char *source, int32_t sourceLength,
|
||||
UErrorCode *pErrorCode) {
|
||||
return ucnv_convertAlgorithmic(FALSE, algorithmicType, cnv,
|
||||
return ucnv_convertAlgorithmic(false, algorithmicType, cnv,
|
||||
target, targetCapacity,
|
||||
source, sourceLength,
|
||||
pErrorCode);
|
||||
|
@ -2885,12 +2885,12 @@ ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status){
|
|||
U_CAPI UBool U_EXPORT2
|
||||
ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status){
|
||||
if (U_FAILURE(*status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cnv == NULL) {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (ucnv_getType(cnv)) {
|
||||
|
@ -2900,9 +2900,9 @@ ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status){
|
|||
case UCNV_UTF32_LittleEndian:
|
||||
case UCNV_UTF32:
|
||||
case UCNV_US_ASCII:
|
||||
return TRUE;
|
||||
return true;
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -491,7 +491,7 @@ _ISO2022Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){
|
|||
|
||||
uprv_memset(myConverterData, 0, sizeof(UConverterDataISO2022));
|
||||
myConverterData->currentType = ASCII1;
|
||||
cnv->fromUnicodeStatus =FALSE;
|
||||
cnv->fromUnicodeStatus =false;
|
||||
if(pArgs->locale){
|
||||
uprv_strncpy(myLocale, pArgs->locale, sizeof(myLocale)-1);
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ _ISO2022Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){
|
|||
#endif // !UCONFIG_ONLY_HTML_CONVERSION
|
||||
else{
|
||||
#ifdef U_ENABLE_GENERIC_ISO_2022
|
||||
myConverterData->isFirstBuffer = TRUE;
|
||||
myConverterData->isFirstBuffer = true;
|
||||
|
||||
/* append the UTF-8 escape sequence */
|
||||
cnv->charErrorBufferLength = 3;
|
||||
|
@ -682,7 +682,7 @@ _ISO2022Reset(UConverter *converter, UConverterResetChoice choice) {
|
|||
if(choice<=UCNV_RESET_TO_UNICODE) {
|
||||
uprv_memset(&myConverterData->toU2022State, 0, sizeof(ISO2022State));
|
||||
myConverterData->key = 0;
|
||||
myConverterData->isEmptySegment = FALSE;
|
||||
myConverterData->isEmptySegment = false;
|
||||
}
|
||||
if(choice!=UCNV_RESET_TO_UNICODE) {
|
||||
uprv_memset(&myConverterData->fromU2022State, 0, sizeof(ISO2022State));
|
||||
|
@ -690,7 +690,7 @@ _ISO2022Reset(UConverter *converter, UConverterResetChoice choice) {
|
|||
#ifdef U_ENABLE_GENERIC_ISO_2022
|
||||
if(myConverterData->locale[0] == 0){
|
||||
if(choice<=UCNV_RESET_TO_UNICODE) {
|
||||
myConverterData->isFirstBuffer = TRUE;
|
||||
myConverterData->isFirstBuffer = true;
|
||||
myConverterData->key = 0;
|
||||
if (converter->mode == UCNV_SO){
|
||||
ucnv_close (myConverterData->currentConverter);
|
||||
|
@ -1285,7 +1285,7 @@ T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverterToUnicodeArgs* args,
|
|||
}
|
||||
|
||||
/* convert to before the ESC or until the end of the buffer */
|
||||
myData->isFirstBuffer=FALSE;
|
||||
myData->isFirstBuffer=false;
|
||||
sourceStart = args->source;
|
||||
myTargetStart = args->target;
|
||||
args->converter = myData->currentConverter;
|
||||
|
@ -1848,7 +1848,7 @@ getTrail:
|
|||
len = 1;
|
||||
cs = cs0;
|
||||
g = 0;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
break;
|
||||
case JISX208:
|
||||
|
@ -1864,7 +1864,7 @@ getTrail:
|
|||
len = len2;
|
||||
cs = cs0;
|
||||
g = 0;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
} else if(len == 0 && useFallback &&
|
||||
(uint32_t)(sourceChar - HWKANA_START) <= (HWKANA_END - HWKANA_START)) {
|
||||
|
@ -1872,7 +1872,7 @@ getTrail:
|
|||
len = -2;
|
||||
cs = cs0;
|
||||
g = 0;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
break;
|
||||
case ISO8859_7:
|
||||
|
@ -1886,7 +1886,7 @@ getTrail:
|
|||
len = len2;
|
||||
cs = cs0;
|
||||
g = 2;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1911,7 +1911,7 @@ getTrail:
|
|||
len = len2;
|
||||
cs = cs0;
|
||||
g = 0;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2121,7 +2121,7 @@ UConverter_toUnicode_ISO_2022_JP_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
continue;
|
||||
} else {
|
||||
/* only JIS7 uses SI/SO, not ISO-2022-JP-x */
|
||||
myData->isEmptySegment = FALSE; /* reset this, we have a different error */
|
||||
myData->isEmptySegment = false; /* reset this, we have a different error */
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2133,7 +2133,7 @@ UConverter_toUnicode_ISO_2022_JP_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
continue;
|
||||
} else {
|
||||
/* only JIS7 uses SI/SO, not ISO-2022-JP-x */
|
||||
myData->isEmptySegment = FALSE; /* reset this, we have a different error */
|
||||
myData->isEmptySegment = false; /* reset this, we have a different error */
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2159,12 +2159,12 @@ escape:
|
|||
if(U_FAILURE(*err)){
|
||||
args->target = myTarget;
|
||||
args->source = mySource;
|
||||
myData->isEmptySegment = FALSE; /* Reset to avoid future spurious errors */
|
||||
myData->isEmptySegment = false; /* Reset to avoid future spurious errors */
|
||||
return;
|
||||
}
|
||||
/* If we successfully completed an escape sequence, we begin a new segment, empty so far */
|
||||
if(myData->key==0) {
|
||||
myData->isEmptySegment = TRUE;
|
||||
myData->isEmptySegment = true;
|
||||
}
|
||||
continue;
|
||||
|
||||
|
@ -2181,7 +2181,7 @@ escape:
|
|||
U_FALLTHROUGH;
|
||||
default:
|
||||
/* convert one or two bytes */
|
||||
myData->isEmptySegment = FALSE;
|
||||
myData->isEmptySegment = false;
|
||||
cs = (StateEnum)pToU2022State->cs[pToU2022State->g];
|
||||
if( (uint8_t)(mySourceChar - 0xa1) <= (0xdf - 0xa1) && myData->version==4 &&
|
||||
!IS_JP_DBCS(cs)
|
||||
|
@ -2262,7 +2262,7 @@ getTrailByte:
|
|||
tempBuf[0] = (char)(tmpSourceChar >> 8);
|
||||
tempBuf[1] = (char)(tmpSourceChar);
|
||||
}
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->myConverterArray[cs], tempBuf, 2, FALSE);
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->myConverterArray[cs], tempBuf, 2, false);
|
||||
} else if (!(trailIsOk || IS_2022_CONTROL(trailByte))) {
|
||||
/* report a pair of illegal bytes if the second byte is not a DBCS starter */
|
||||
++mySource;
|
||||
|
@ -2534,7 +2534,7 @@ getTrail:
|
|||
int32_t sourceIndex;
|
||||
|
||||
/* we are switching to ASCII */
|
||||
isTargetByteDBCS=FALSE;
|
||||
isTargetByteDBCS=false;
|
||||
|
||||
/* get the source index of the last input character */
|
||||
/*
|
||||
|
@ -2712,7 +2712,7 @@ UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
if(mySourceChar==UCNV_SI){
|
||||
myData->toU2022State.g = 0;
|
||||
if (myData->isEmptySegment) {
|
||||
myData->isEmptySegment = FALSE; /* we are handling it, reset to avoid future spurious errors */
|
||||
myData->isEmptySegment = false; /* we are handling it, reset to avoid future spurious errors */
|
||||
*err = U_ILLEGAL_ESCAPE_SEQUENCE;
|
||||
args->converter->toUCallbackReason = UCNV_IRREGULAR;
|
||||
args->converter->toUBytes[0] = (uint8_t)mySourceChar;
|
||||
|
@ -2725,13 +2725,13 @@ UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
continue;
|
||||
}else if(mySourceChar==UCNV_SO){
|
||||
myData->toU2022State.g = 1;
|
||||
myData->isEmptySegment = TRUE; /* Begin a new segment, empty so far */
|
||||
myData->isEmptySegment = true; /* Begin a new segment, empty so far */
|
||||
/*consume the source */
|
||||
continue;
|
||||
}else if(mySourceChar==ESC_2022){
|
||||
mySource--;
|
||||
escape:
|
||||
myData->isEmptySegment = FALSE; /* Any invalid ESC sequences will be detected separately, so just reset this */
|
||||
myData->isEmptySegment = false; /* Any invalid ESC sequences will be detected separately, so just reset this */
|
||||
changeState_2022(args->converter,&(mySource),
|
||||
mySourceLimit, ISO_2022_KR, err);
|
||||
if(U_FAILURE(*err)){
|
||||
|
@ -2742,7 +2742,7 @@ escape:
|
|||
continue;
|
||||
}
|
||||
|
||||
myData->isEmptySegment = FALSE; /* Any invalid char errors will be detected separately, so just reset this */
|
||||
myData->isEmptySegment = false; /* Any invalid char errors will be detected separately, so just reset this */
|
||||
if(myData->toU2022State.g == 1) {
|
||||
if(mySource < mySourceLimit) {
|
||||
int leadIsOk, trailIsOk;
|
||||
|
@ -3092,7 +3092,7 @@ getTrail:
|
|||
len = 2;
|
||||
} else {
|
||||
len = -2;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
if(cs == CNS_11643_1) {
|
||||
g = 1;
|
||||
|
@ -3119,7 +3119,7 @@ getTrail:
|
|||
len = len2;
|
||||
cs = cs0;
|
||||
g = 1;
|
||||
useFallback = FALSE;
|
||||
useFallback = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3301,7 +3301,7 @@ UConverter_toUnicode_ISO_2022_CN_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
case UCNV_SI:
|
||||
pToU2022State->g=0;
|
||||
if (myData->isEmptySegment) {
|
||||
myData->isEmptySegment = FALSE; /* we are handling it, reset to avoid future spurious errors */
|
||||
myData->isEmptySegment = false; /* we are handling it, reset to avoid future spurious errors */
|
||||
*err = U_ILLEGAL_ESCAPE_SEQUENCE;
|
||||
args->converter->toUCallbackReason = UCNV_IRREGULAR;
|
||||
args->converter->toUBytes[0] = static_cast<uint8_t>(mySourceChar);
|
||||
|
@ -3315,11 +3315,11 @@ UConverter_toUnicode_ISO_2022_CN_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
case UCNV_SO:
|
||||
if(pToU2022State->cs[1] != 0) {
|
||||
pToU2022State->g=1;
|
||||
myData->isEmptySegment = TRUE; /* Begin a new segment, empty so far */
|
||||
myData->isEmptySegment = true; /* Begin a new segment, empty so far */
|
||||
continue;
|
||||
} else {
|
||||
/* illegal to have SO before a matching designator */
|
||||
myData->isEmptySegment = FALSE; /* Handling a different error, reset this to avoid future spurious errs */
|
||||
myData->isEmptySegment = false; /* Handling a different error, reset this to avoid future spurious errs */
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3345,7 +3345,7 @@ escape:
|
|||
if(U_FAILURE(*err)){
|
||||
args->target = myTarget;
|
||||
args->source = mySource;
|
||||
myData->isEmptySegment = FALSE; /* Reset to avoid future spurious errors */
|
||||
myData->isEmptySegment = false; /* Reset to avoid future spurious errors */
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
|
@ -3358,7 +3358,7 @@ escape:
|
|||
U_FALLTHROUGH;
|
||||
default:
|
||||
/* convert one or two bytes */
|
||||
myData->isEmptySegment = FALSE;
|
||||
myData->isEmptySegment = false;
|
||||
if(pToU2022State->g != 0) {
|
||||
if(mySource < mySourceLimit) {
|
||||
UConverterSharedData *cnv;
|
||||
|
@ -3397,7 +3397,7 @@ getTrailByte:
|
|||
tempBuf[1] = (char) trailByte;
|
||||
tempBufLen = 2;
|
||||
}
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(cnv, tempBuf, tempBufLen, FALSE);
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(cnv, tempBuf, tempBufLen, false);
|
||||
mySourceChar = (mySourceChar << 8) | trailByte;
|
||||
} else if (!(trailIsOk || IS_2022_CONTROL(trailByte))) {
|
||||
/* report a pair of illegal bytes if the second byte is not a DBCS starter */
|
||||
|
@ -3609,7 +3609,7 @@ _ISO_2022_SafeClone(
|
|||
|
||||
uprv_memcpy(&localClone->mydata, cnvData, sizeof(UConverterDataISO2022));
|
||||
localClone->cnv.extraInfo = &localClone->mydata; /* set pointer to extra data */
|
||||
localClone->cnv.isExtraLocal = TRUE;
|
||||
localClone->cnv.isExtraLocal = true;
|
||||
|
||||
/* share the subconverters */
|
||||
|
||||
|
@ -3808,8 +3808,8 @@ static const UConverterStaticData _ISO2022StaticData={
|
|||
3, /* max 3 bytes per UChar from UTF-8 (4 bytes from surrogate _pair_) */
|
||||
{ 0x1a, 0, 0, 0 },
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -3853,8 +3853,8 @@ static const UConverterStaticData _ISO2022JPStaticData={
|
|||
6, /* max 6 bytes per UChar: 4-byte escape sequence + DBCS */
|
||||
{ 0x1a, 0, 0, 0 },
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -3904,8 +3904,8 @@ static const UConverterStaticData _ISO2022KRStaticData={
|
|||
8, /* max 8 bytes per UChar */
|
||||
{ 0x1a, 0, 0, 0 },
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -3955,8 +3955,8 @@ static const UConverterStaticData _ISO2022CNStaticData={
|
|||
8, /* max 8 bytes per UChar: 4-byte CNS designator + 2 bytes for SS2/SS3 + DBCS */
|
||||
{ 0x1a, 0, 0, 0 },
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -254,7 +254,7 @@ static UBool U_CALLCONV ucnv_cleanup(void) {
|
|||
#if !U_CHARSET_IS_UTF8
|
||||
gDefaultConverterName = NULL;
|
||||
gDefaultConverterNameBuffer[0] = 0;
|
||||
gDefaultConverterContainsOption = FALSE;
|
||||
gDefaultConverterContainsOption = false;
|
||||
gDefaultAlgorithmicSharedData = NULL;
|
||||
#endif
|
||||
|
||||
|
@ -318,7 +318,7 @@ ucnv_data_unFlattenClone(UConverterLoadArgs *pArgs, UDataMemory *pData, UErrorCo
|
|||
|
||||
data->staticData = source;
|
||||
|
||||
data->sharedDataCached = FALSE;
|
||||
data->sharedDataCached = false;
|
||||
|
||||
/* fill in fields from the loaded data */
|
||||
data->dataMemory = (void*)pData; /* for future use */
|
||||
|
@ -462,7 +462,7 @@ ucnv_shareConverterData(UConverterSharedData * data)
|
|||
*/
|
||||
|
||||
/* Mark it shared */
|
||||
data->sharedDataCached = TRUE;
|
||||
data->sharedDataCached = true;
|
||||
|
||||
uhash_put(SHARED_DATA_HASHTABLE,
|
||||
(void*) data->staticData->name, /* Okay to cast away const as long as
|
||||
|
@ -502,11 +502,11 @@ ucnv_getSharedConverterData(const char *name)
|
|||
*/
|
||||
/* Deletes (frees) the Shared data it's passed. first it checks the referenceCounter to
|
||||
* see if anyone is using it, if not it frees all the memory stemming from sharedConverterData and
|
||||
* returns TRUE,
|
||||
* otherwise returns FALSE
|
||||
* returns true,
|
||||
* otherwise returns false
|
||||
* @param sharedConverterData The shared data
|
||||
* @return if not it frees all the memory stemming from sharedConverterData and
|
||||
* returns TRUE, otherwise returns FALSE
|
||||
* returns true, otherwise returns false
|
||||
*/
|
||||
static UBool
|
||||
ucnv_deleteSharedConverterData(UConverterSharedData * deadSharedData)
|
||||
|
@ -515,8 +515,8 @@ ucnv_deleteSharedConverterData(UConverterSharedData * deadSharedData)
|
|||
UTRACE_DATA2(UTRACE_OPEN_CLOSE, "unload converter %s shared data %p", deadSharedData->staticData->name, deadSharedData);
|
||||
|
||||
if (deadSharedData->referenceCounter > 0) {
|
||||
UTRACE_EXIT_VALUE((int32_t)FALSE);
|
||||
return FALSE;
|
||||
UTRACE_EXIT_VALUE((int32_t)false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (deadSharedData->impl->unload != NULL) {
|
||||
|
@ -531,8 +531,8 @@ ucnv_deleteSharedConverterData(UConverterSharedData * deadSharedData)
|
|||
|
||||
uprv_free(deadSharedData);
|
||||
|
||||
UTRACE_EXIT_VALUE((int32_t)TRUE);
|
||||
return TRUE;
|
||||
UTRACE_EXIT_VALUE((int32_t)true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -589,7 +589,7 @@ ucnv_unload(UConverterSharedData *sharedData) {
|
|||
sharedData->referenceCounter--;
|
||||
}
|
||||
|
||||
if((sharedData->referenceCounter <= 0)&&(sharedData->sharedDataCached == FALSE)) {
|
||||
if((sharedData->referenceCounter <= 0)&&(sharedData->sharedDataCached == false)) {
|
||||
ucnv_deleteSharedConverterData(sharedData);
|
||||
}
|
||||
}
|
||||
|
@ -703,10 +703,10 @@ parseConverterOptions(const char *inName,
|
|||
|
||||
/*Logic determines if the converter is Algorithmic AND/OR cached
|
||||
*depending on that:
|
||||
* -we either go to get data from disk and cache it (Data=TRUE, Cached=False)
|
||||
* -Get it from a Hashtable (Data=X, Cached=TRUE)
|
||||
* -Call dataConverter initializer (Data=TRUE, Cached=TRUE)
|
||||
* -Call AlgorithmicConverter initializer (Data=FALSE, Cached=TRUE)
|
||||
* -we either go to get data from disk and cache it (Data=true, Cached=false)
|
||||
* -Get it from a Hashtable (Data=X, Cached=true)
|
||||
* -Call dataConverter initializer (Data=true, Cached=true)
|
||||
* -Call AlgorithmicConverter initializer (Data=false, Cached=true)
|
||||
*/
|
||||
U_CFUNC UConverterSharedData *
|
||||
ucnv_loadSharedData(const char *converterName,
|
||||
|
@ -717,8 +717,8 @@ ucnv_loadSharedData(const char *converterName,
|
|||
UConverterLoadArgs stackArgs;
|
||||
UConverterSharedData *mySharedConverterData = NULL;
|
||||
UErrorCode internalErrorCode = U_ZERO_ERROR;
|
||||
UBool mayContainOption = TRUE;
|
||||
UBool checkForAlgorithmic = TRUE;
|
||||
UBool mayContainOption = true;
|
||||
UBool checkForAlgorithmic = true;
|
||||
|
||||
if (U_FAILURE (*err)) {
|
||||
return NULL;
|
||||
|
@ -762,7 +762,7 @@ ucnv_loadSharedData(const char *converterName,
|
|||
return NULL;
|
||||
}
|
||||
mySharedConverterData = (UConverterSharedData *)gDefaultAlgorithmicSharedData;
|
||||
checkForAlgorithmic = FALSE;
|
||||
checkForAlgorithmic = false;
|
||||
mayContainOption = gDefaultConverterContainsOption;
|
||||
/* the default converter name is already canonical */
|
||||
#endif
|
||||
|
@ -866,7 +866,7 @@ ucnv_canCreateConverter(const char *converterName, UErrorCode *err) {
|
|||
if(U_SUCCESS(*err)) {
|
||||
UTRACE_DATA1(UTRACE_OPEN_CLOSE, "test if can open converter %s", converterName);
|
||||
|
||||
stackArgs.onlyTestIsLoadable=TRUE;
|
||||
stackArgs.onlyTestIsLoadable=true;
|
||||
mySharedConverterData = ucnv_loadSharedData(converterName, &stackPieces, &stackArgs, err);
|
||||
ucnv_createConverterFromSharedData(
|
||||
&myUConverter, mySharedConverterData,
|
||||
|
@ -989,15 +989,15 @@ ucnv_createConverterFromSharedData(UConverter *myUConverter,
|
|||
ucnv_unloadSharedDataIfReady(mySharedConverterData);
|
||||
return NULL;
|
||||
}
|
||||
isCopyLocal = FALSE;
|
||||
isCopyLocal = false;
|
||||
} else {
|
||||
isCopyLocal = TRUE;
|
||||
isCopyLocal = true;
|
||||
}
|
||||
|
||||
/* initialize the converter */
|
||||
uprv_memset(myUConverter, 0, sizeof(UConverter));
|
||||
myUConverter->isCopyLocal = isCopyLocal;
|
||||
/*myUConverter->isExtraLocal = FALSE;*/ /* Set by the memset call */
|
||||
/*myUConverter->isExtraLocal = false;*/ /* Set by the memset call */
|
||||
myUConverter->sharedData = mySharedConverterData;
|
||||
myUConverter->options = pArgs->options;
|
||||
if(!pArgs->onlyTestIsLoadable) {
|
||||
|
@ -1083,7 +1083,7 @@ ucnv_flushCache ()
|
|||
UCNV_DEBUG_LOG("del",mySharedData->staticData->name,mySharedData);
|
||||
|
||||
uhash_removeElement(SHARED_DATA_HASHTABLE, e);
|
||||
mySharedData->sharedDataCached = FALSE;
|
||||
mySharedData->sharedDataCached = false;
|
||||
ucnv_deleteSharedConverterData (mySharedData);
|
||||
} else {
|
||||
++remaining;
|
||||
|
@ -1342,7 +1342,7 @@ ucnv_swap(const UDataSwapper *ds,
|
|||
_MBCSHeader *outMBCSHeader;
|
||||
_MBCSHeader mbcsHeader;
|
||||
uint32_t mbcsHeaderLength;
|
||||
UBool noFromU=FALSE;
|
||||
UBool noFromU=false;
|
||||
|
||||
uint8_t outputType;
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ ucnv_cbFromUWriteUChars(UConverterFromUnicodeArgs *args,
|
|||
source,
|
||||
sourceLimit,
|
||||
NULL, /* no offsets */
|
||||
FALSE, /* no flush */
|
||||
false, /* no flush */
|
||||
err);
|
||||
|
||||
if(args->offsets)
|
||||
|
@ -141,7 +141,7 @@ ucnv_cbFromUWriteUChars(UConverterFromUnicodeArgs *args,
|
|||
source,
|
||||
sourceLimit,
|
||||
NULL,
|
||||
FALSE,
|
||||
false,
|
||||
&err2);
|
||||
|
||||
/* We can go ahead and overwrite the length here. We know just how
|
||||
|
|
|
@ -225,23 +225,23 @@ static COMPOUND_TEXT_CONVERTERS getState(int codepoint) {
|
|||
|
||||
static COMPOUND_TEXT_CONVERTERS findStateFromEscSeq(const char* source, const char* sourceLimit, const uint8_t* toUBytesBuffer, int32_t toUBytesBufferLength, UErrorCode *err) {
|
||||
COMPOUND_TEXT_CONVERTERS state = INVALID;
|
||||
UBool matchFound = FALSE;
|
||||
UBool matchFound = false;
|
||||
int32_t i, n, offset = toUBytesBufferLength;
|
||||
|
||||
for (i = 0; i < NUM_OF_CONVERTERS; i++) {
|
||||
matchFound = TRUE;
|
||||
matchFound = true;
|
||||
for (n = 0; escSeqCompoundText[i][n] != 0; n++) {
|
||||
if (n < toUBytesBufferLength) {
|
||||
if (toUBytesBuffer[n] != escSeqCompoundText[i][n]) {
|
||||
matchFound = FALSE;
|
||||
matchFound = false;
|
||||
break;
|
||||
}
|
||||
} else if ((source + (n - offset)) >= sourceLimit) {
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
matchFound = FALSE;
|
||||
matchFound = false;
|
||||
break;
|
||||
} else if (*(source + (n - offset)) != escSeqCompoundText[i][n]) {
|
||||
matchFound = FALSE;
|
||||
matchFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -634,8 +634,8 @@ static const UConverterStaticData _CompoundTextStaticData = {
|
|||
6,
|
||||
{ 0xef, 0, 0, 0 },
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -108,7 +108,7 @@ ucnv_extFindToU(const uint32_t *toUSection, int32_t length, uint8_t byte) {
|
|||
}
|
||||
|
||||
/*
|
||||
* TRUE if not an SI/SO stateful converter,
|
||||
* true if not an SI/SO stateful converter,
|
||||
* or if the match length fits with the current converter state
|
||||
*/
|
||||
#define UCNV_EXT_TO_U_VERIFY_SISO_MATCH(sisoState, match) \
|
||||
|
@ -154,7 +154,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
|
|||
srcLength=1;
|
||||
}
|
||||
}
|
||||
flush=TRUE;
|
||||
flush=true;
|
||||
}
|
||||
|
||||
/* we must not remember fallback matches when not using fallbacks */
|
||||
|
@ -302,7 +302,7 @@ ucnv_extInitialMatchToU(UConverter *cnv, const int32_t *cx,
|
|||
target, targetLimit,
|
||||
offsets, srcIndex,
|
||||
pErrorCode);
|
||||
return TRUE;
|
||||
return true;
|
||||
} else if(match<0) {
|
||||
/* save state for partial match */
|
||||
const char *s;
|
||||
|
@ -323,9 +323,9 @@ ucnv_extInitialMatchToU(UConverter *cnv, const int32_t *cx,
|
|||
}
|
||||
*src=s; /* same as *src=srcLimit; because we reached the end of input */
|
||||
cnv->preToULength=(int8_t)match;
|
||||
return TRUE;
|
||||
return true;
|
||||
} else /* match==0 no match */ {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ ucnv_extSimpleMatchToU(const int32_t *cx,
|
|||
source, length,
|
||||
NULL, 0,
|
||||
&value,
|
||||
useFallback, TRUE);
|
||||
useFallback, true);
|
||||
if(match==length) {
|
||||
/* write result for simple, single-character conversion */
|
||||
if(UCNV_EXT_TO_U_IS_CODE_POINT(value)) {
|
||||
|
@ -358,7 +358,7 @@ ucnv_extSimpleMatchToU(const int32_t *cx,
|
|||
* - match>0 && value points to string: simple conversion cannot handle multiple code points
|
||||
* - match>0 && match!=length: not all input consumed, forbidden for this function
|
||||
* - match==0: no match found in the first place
|
||||
* - match<0: partial match, not supported for simple conversion (and flush==TRUE)
|
||||
* - match<0: partial match, not supported for simple conversion (and flush==true)
|
||||
*/
|
||||
return 0xfffe;
|
||||
}
|
||||
|
@ -516,13 +516,13 @@ ucnv_extFindFromU(const UChar *fromUSection, int32_t length, UChar u) {
|
|||
* @param srcLength length of src, >=0
|
||||
* @param pMatchValue [out] output result value for the match from the data structure
|
||||
* @param useFallback "use fallback" flag, usually from cnv->useFallback
|
||||
* @param flush TRUE if the end of the input stream is reached
|
||||
* @param flush true if the end of the input stream is reached
|
||||
* @return >1: matched, return value=total match length (number of input units matched)
|
||||
* 1: matched, no mapping but request for <subchar1>
|
||||
* (only for the first code point)
|
||||
* 0: no match
|
||||
* <0: partial match, return value=negative total match length
|
||||
* (partial matches are never returned for flush==TRUE)
|
||||
* (partial matches are never returned for flush==true)
|
||||
* (partial matches are never returned as being longer than UCNV_EXT_MAX_UCHARS)
|
||||
* the matchLength is 2 if only firstCP matched, and >2 if firstCP and
|
||||
* further code units matched
|
||||
|
@ -778,7 +778,7 @@ ucnv_extInitialMatchFromU(UConverter *cnv, const int32_t *cx,
|
|||
target, targetLimit,
|
||||
offsets, srcIndex,
|
||||
pErrorCode);
|
||||
return TRUE;
|
||||
return true;
|
||||
} else if(match<0) {
|
||||
/* save state for partial match */
|
||||
const UChar *s;
|
||||
|
@ -795,13 +795,13 @@ ucnv_extInitialMatchFromU(UConverter *cnv, const int32_t *cx,
|
|||
}
|
||||
*src=s; /* same as *src=srcLimit; because we reached the end of input */
|
||||
cnv->preFromULength=(int8_t)match;
|
||||
return TRUE;
|
||||
return true;
|
||||
} else if(match==1) {
|
||||
/* matched, no mapping but request for <subchar1> */
|
||||
cnv->useSubChar1=TRUE;
|
||||
return FALSE;
|
||||
cnv->useSubChar1=true;
|
||||
return false;
|
||||
} else /* match==0 no match */ {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -822,7 +822,7 @@ ucnv_extSimpleMatchFromU(const int32_t *cx,
|
|||
NULL, 0,
|
||||
NULL, 0,
|
||||
&value,
|
||||
useFallback, TRUE);
|
||||
useFallback, true);
|
||||
if(match>=2) {
|
||||
/* write result for simple, single-character conversion */
|
||||
int32_t length;
|
||||
|
@ -854,7 +854,7 @@ ucnv_extSimpleMatchFromU(const int32_t *cx,
|
|||
* - match>1 && resultLength>4: result too long for simple conversion
|
||||
* - match==1: no match found, <subchar1> preferred
|
||||
* - match==0: no match found in the first place
|
||||
* - match<0: partial match, not supported for simple conversion (and flush==TRUE)
|
||||
* - match<0: partial match, not supported for simple conversion (and flush==true)
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
@ -934,7 +934,7 @@ ucnv_extContinueMatchFromU(UConverter *cnv,
|
|||
|
||||
if(match==1) {
|
||||
/* matched, no mapping but request for <subchar1> */
|
||||
cnv->useSubChar1=TRUE;
|
||||
cnv->useSubChar1=true;
|
||||
}
|
||||
|
||||
/* move the first code point to the error field */
|
||||
|
@ -961,12 +961,12 @@ extSetUseMapping(UConverterUnicodeSet which, int32_t minLength, uint32_t value)
|
|||
// Do not add entries with reserved bits set.
|
||||
if(((value&(UCNV_EXT_FROM_U_ROUNDTRIP_FLAG|UCNV_EXT_FROM_U_RESERVED_MASK))!=
|
||||
UCNV_EXT_FROM_U_ROUNDTRIP_FLAG)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else /* UCNV_ROUNDTRIP_AND_FALLBACK_SET */ {
|
||||
// Do not add entries with reserved bits set.
|
||||
if((value&UCNV_EXT_FROM_U_RESERVED_MASK)!=0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Do not add <subchar1> entries or other (future?) pseudo-entries
|
||||
|
|
|
@ -226,7 +226,7 @@ static UBool U_CALLCONV ucnv_io_cleanup(void)
|
|||
|
||||
uprv_memset(&gMainTable, 0, sizeof(gMainTable));
|
||||
|
||||
return TRUE; /* Everything was cleaned up */
|
||||
return true; /* Everything was cleaned up */
|
||||
}
|
||||
|
||||
static void U_CALLCONV initAliasData(UErrorCode &errCode) {
|
||||
|
@ -319,7 +319,7 @@ static inline UBool
|
|||
isAlias(const char *alias, UErrorCode *pErrorCode) {
|
||||
if(alias==NULL) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return (UBool)(*alias!=0);
|
||||
}
|
||||
|
@ -388,13 +388,13 @@ ucnv_io_stripASCIIForCompare(char *dst, const char *name) {
|
|||
char *dstItr = dst;
|
||||
uint8_t type, nextType;
|
||||
char c1;
|
||||
UBool afterDigit = FALSE;
|
||||
UBool afterDigit = false;
|
||||
|
||||
while ((c1 = *name++) != 0) {
|
||||
type = GET_ASCII_TYPE(c1);
|
||||
switch (type) {
|
||||
case UIGNORE:
|
||||
afterDigit = FALSE;
|
||||
afterDigit = false;
|
||||
continue; /* ignore all but letters and digits */
|
||||
case ZERO:
|
||||
if (!afterDigit) {
|
||||
|
@ -405,11 +405,11 @@ ucnv_io_stripASCIIForCompare(char *dst, const char *name) {
|
|||
}
|
||||
break;
|
||||
case NONZERO:
|
||||
afterDigit = TRUE;
|
||||
afterDigit = true;
|
||||
break;
|
||||
default:
|
||||
c1 = (char)type; /* lowercased letter */
|
||||
afterDigit = FALSE;
|
||||
afterDigit = false;
|
||||
break;
|
||||
}
|
||||
*dstItr++ = c1;
|
||||
|
@ -423,13 +423,13 @@ ucnv_io_stripEBCDICForCompare(char *dst, const char *name) {
|
|||
char *dstItr = dst;
|
||||
uint8_t type, nextType;
|
||||
char c1;
|
||||
UBool afterDigit = FALSE;
|
||||
UBool afterDigit = false;
|
||||
|
||||
while ((c1 = *name++) != 0) {
|
||||
type = GET_EBCDIC_TYPE(c1);
|
||||
switch (type) {
|
||||
case UIGNORE:
|
||||
afterDigit = FALSE;
|
||||
afterDigit = false;
|
||||
continue; /* ignore all but letters and digits */
|
||||
case ZERO:
|
||||
if (!afterDigit) {
|
||||
|
@ -440,11 +440,11 @@ ucnv_io_stripEBCDICForCompare(char *dst, const char *name) {
|
|||
}
|
||||
break;
|
||||
case NONZERO:
|
||||
afterDigit = TRUE;
|
||||
afterDigit = true;
|
||||
break;
|
||||
default:
|
||||
c1 = (char)type; /* lowercased letter */
|
||||
afterDigit = FALSE;
|
||||
afterDigit = false;
|
||||
break;
|
||||
}
|
||||
*dstItr++ = c1;
|
||||
|
@ -479,14 +479,14 @@ ucnv_compareNames(const char *name1, const char *name2) {
|
|||
int rc;
|
||||
uint8_t type, nextType;
|
||||
char c1, c2;
|
||||
UBool afterDigit1 = FALSE, afterDigit2 = FALSE;
|
||||
UBool afterDigit1 = false, afterDigit2 = false;
|
||||
|
||||
for (;;) {
|
||||
while ((c1 = *name1++) != 0) {
|
||||
type = GET_CHAR_TYPE(c1);
|
||||
switch (type) {
|
||||
case UIGNORE:
|
||||
afterDigit1 = FALSE;
|
||||
afterDigit1 = false;
|
||||
continue; /* ignore all but letters and digits */
|
||||
case ZERO:
|
||||
if (!afterDigit1) {
|
||||
|
@ -497,11 +497,11 @@ ucnv_compareNames(const char *name1, const char *name2) {
|
|||
}
|
||||
break;
|
||||
case NONZERO:
|
||||
afterDigit1 = TRUE;
|
||||
afterDigit1 = true;
|
||||
break;
|
||||
default:
|
||||
c1 = (char)type; /* lowercased letter */
|
||||
afterDigit1 = FALSE;
|
||||
afterDigit1 = false;
|
||||
break;
|
||||
}
|
||||
break; /* deliver c1 */
|
||||
|
@ -510,7 +510,7 @@ ucnv_compareNames(const char *name1, const char *name2) {
|
|||
type = GET_CHAR_TYPE(c2);
|
||||
switch (type) {
|
||||
case UIGNORE:
|
||||
afterDigit2 = FALSE;
|
||||
afterDigit2 = false;
|
||||
continue; /* ignore all but letters and digits */
|
||||
case ZERO:
|
||||
if (!afterDigit2) {
|
||||
|
@ -521,11 +521,11 @@ ucnv_compareNames(const char *name1, const char *name2) {
|
|||
}
|
||||
break;
|
||||
case NONZERO:
|
||||
afterDigit2 = TRUE;
|
||||
afterDigit2 = true;
|
||||
break;
|
||||
default:
|
||||
c2 = (char)type; /* lowercased letter */
|
||||
afterDigit2 = FALSE;
|
||||
afterDigit2 = false;
|
||||
break;
|
||||
}
|
||||
break; /* deliver c2 */
|
||||
|
@ -628,11 +628,11 @@ isAliasInList(const char *alias, uint32_t listOffset) {
|
|||
if (currList[currAlias]
|
||||
&& ucnv_compareNames(alias, GET_STRING(currList[currAlias]))==0)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1288,7 +1288,7 @@ ucnv_swapAliases(const UDataSwapper *ds,
|
|||
|
||||
uprv_sortArray(tempTable.rows, (int32_t)count, sizeof(TempRow),
|
||||
io_compareRows, &tempTable,
|
||||
FALSE, pErrorCode);
|
||||
false, pErrorCode);
|
||||
|
||||
if(U_SUCCESS(*pErrorCode)) {
|
||||
/* copy/swap/permutate items */
|
||||
|
|
|
@ -610,7 +610,7 @@ static const UConverterStaticData _LMBCSStaticData##n={\
|
|||
sizeof(UConverterStaticData),\
|
||||
"LMBCS-" #n,\
|
||||
0, UCNV_IBM, UCNV_LMBCS_##n, 1, 3,\
|
||||
{ 0x3f, 0, 0, 0 },1,FALSE,FALSE,0,0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} \
|
||||
{ 0x3f, 0, 0, 0 },1,false,false,0,0,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} \
|
||||
};\
|
||||
const UConverterSharedData _LMBCSData##n= \
|
||||
UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_LMBCSStaticData##n, &_LMBCSImpl##n);
|
||||
|
@ -721,7 +721,7 @@ _LMBCSSafeClone(const UConverter *cnv,
|
|||
}
|
||||
|
||||
newLMBCS->cnv.extraInfo = &newLMBCS->lmbcs;
|
||||
newLMBCS->cnv.isExtraLocal = TRUE;
|
||||
newLMBCS->cnv.isExtraLocal = true;
|
||||
return &newLMBCS->cnv;
|
||||
}
|
||||
|
||||
|
@ -763,14 +763,14 @@ LMBCSConversionWorker (
|
|||
U_ASSERT(xcnv);
|
||||
U_ASSERT(group<ULMBCS_GRP_UNICODE);
|
||||
|
||||
bytesConverted = ucnv_MBCSFromUChar32(xcnv, *pUniChar, &value, FALSE);
|
||||
bytesConverted = ucnv_MBCSFromUChar32(xcnv, *pUniChar, &value, false);
|
||||
|
||||
/* get the first result byte */
|
||||
if(bytesConverted > 0) {
|
||||
firstByte = (ulmbcs_byte_t)(value >> ((bytesConverted - 1) * 8));
|
||||
} else {
|
||||
/* most common failure mode is an unassigned character */
|
||||
groups_tried[group] = TRUE;
|
||||
groups_tried[group] = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1191,11 +1191,11 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args,
|
|||
if (*args->source == group) {
|
||||
/* single byte */
|
||||
++args->source;
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source, 1, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source, 1, false);
|
||||
++args->source;
|
||||
} else {
|
||||
/* double byte */
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source, 2, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source, 2, false);
|
||||
args->source += 2;
|
||||
}
|
||||
}
|
||||
|
@ -1220,7 +1220,7 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args,
|
|||
/* Lookup value must include opt group */
|
||||
bytes[0] = group;
|
||||
bytes[1] = CurByte;
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, bytes, 2, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, bytes, 2, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1236,13 +1236,13 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args,
|
|||
CHECK_SOURCE_LIMIT(0);
|
||||
|
||||
/* let the MBCS conversion consume CurByte again */
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source - 1, 1, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source - 1, 1, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECK_SOURCE_LIMIT(1);
|
||||
/* let the MBCS conversion consume CurByte again */
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source - 1, 2, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source - 1, 2, false);
|
||||
++args->source;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -637,7 +637,7 @@ static const UConverterStaticData _UTF16BEStaticData={
|
|||
sizeof(UConverterStaticData),
|
||||
"UTF-16BE",
|
||||
1200, UCNV_IBM, UCNV_UTF16_BigEndian, 2, 2,
|
||||
{ 0xff, 0xfd, 0, 0 },2,FALSE,FALSE,
|
||||
{ 0xff, 0xfd, 0, 0 },2,false,false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -1239,7 +1239,7 @@ static const UConverterStaticData _UTF16LEStaticData={
|
|||
sizeof(UConverterStaticData),
|
||||
"UTF-16LE",
|
||||
1202, UCNV_IBM, UCNV_UTF16_LittleEndian, 2, 2,
|
||||
{ 0xfd, 0xff, 0, 0 },2,FALSE,FALSE,
|
||||
{ 0xfd, 0xff, 0, 0 },2,false,false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -1526,7 +1526,7 @@ static const UConverterStaticData _UTF16StaticData = {
|
|||
#else
|
||||
{ 0xfd, 0xff, 0, 0 }, 2,
|
||||
#endif
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -1567,7 +1567,7 @@ static const UConverterStaticData _UTF16v2StaticData = {
|
|||
1204, /* CCSID for BOM sensitive UTF-16 */
|
||||
UCNV_IBM, UCNV_UTF16, 2, 2,
|
||||
{ 0xff, 0xfd, 0, 0 }, 2,
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -494,7 +494,7 @@ static const UConverterStaticData _UTF32BEStaticData = {
|
|||
"UTF-32BE",
|
||||
1232,
|
||||
UCNV_IBM, UCNV_UTF32_BigEndian, 4, 4,
|
||||
{ 0, 0, 0xff, 0xfd }, 4, FALSE, FALSE,
|
||||
{ 0, 0, 0xff, 0xfd }, 4, false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -989,7 +989,7 @@ static const UConverterStaticData _UTF32LEStaticData = {
|
|||
"UTF-32LE",
|
||||
1234,
|
||||
UCNV_IBM, UCNV_UTF32_LittleEndian, 4, 4,
|
||||
{ 0xfd, 0xff, 0, 0 }, 4, FALSE, FALSE,
|
||||
{ 0xfd, 0xff, 0, 0 }, 4, false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -1110,7 +1110,7 @@ _UTF32ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
|||
/* some of the bytes are from a previous buffer, replay those first */
|
||||
pArgs->source=utf32BOM+(state&4); /* select the correct BOM */
|
||||
pArgs->sourceLimit=pArgs->source+((state&3)-count); /* replay previous bytes */
|
||||
pArgs->flush=FALSE; /* this sourceLimit is not the real source stream limit */
|
||||
pArgs->flush=false; /* this sourceLimit is not the real source stream limit */
|
||||
|
||||
/* no offsets: bytes from previous buffer, and not enough for output */
|
||||
T_UConverter_toUnicode_UTF32_BE(pArgs, pErrorCode);
|
||||
|
@ -1241,7 +1241,7 @@ static const UConverterStaticData _UTF32StaticData = {
|
|||
#else
|
||||
{ 0xfd, 0xff, 0, 0 }, 4,
|
||||
#endif
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -184,12 +184,12 @@ static void U_CALLCONV
|
|||
_UTF7Reset(UConverter *cnv, UConverterResetChoice choice) {
|
||||
if(choice<=UCNV_RESET_TO_UNICODE) {
|
||||
/* reset toUnicode */
|
||||
cnv->toUnicodeStatus=0x1000000; /* inDirectMode=TRUE */
|
||||
cnv->toUnicodeStatus=0x1000000; /* inDirectMode=true */
|
||||
cnv->toULength=0;
|
||||
}
|
||||
if(choice!=UCNV_RESET_TO_UNICODE) {
|
||||
/* reset fromUnicode */
|
||||
cnv->fromUnicodeStatus=(cnv->fromUnicodeStatus&0xf0000000)|0x1000000; /* keep version, inDirectMode=TRUE */
|
||||
cnv->fromUnicodeStatus=(cnv->fromUnicodeStatus&0xf0000000)|0x1000000; /* keep version, inDirectMode=true */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ directMode:
|
|||
} else /* PLUS */ {
|
||||
/* switch to Unicode mode */
|
||||
nextSourceIndex=++sourceIndex;
|
||||
inDirectMode=FALSE;
|
||||
inDirectMode=false;
|
||||
byteIndex=0;
|
||||
bits=0;
|
||||
base64Counter=-1;
|
||||
|
@ -329,7 +329,7 @@ unicodeMode:
|
|||
* It may be for example, a plus which we need to deal with in direct mode.
|
||||
* 2.2.2. Else if the current char is illegal, we might as well deal with it here.
|
||||
*/
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
if(base64Counter==-1) {
|
||||
/* illegal: + immediately followed by something other than base64 or minus sign */
|
||||
/* include the plus sign in the reported sequence, but not the subsequent char */
|
||||
|
@ -411,7 +411,7 @@ unicodeMode:
|
|||
}
|
||||
} else /*base64Value==-2*/ {
|
||||
/* minus sign terminates the base64 sequence */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
if(base64Counter==-1) {
|
||||
/* +- i.e. a minus immediately following a plus */
|
||||
*target++=PLUS;
|
||||
|
@ -541,7 +541,7 @@ directMode:
|
|||
if(offsets!=NULL) {
|
||||
*offsets++=sourceIndex;
|
||||
}
|
||||
inDirectMode=FALSE;
|
||||
inDirectMode=false;
|
||||
base64Counter=0;
|
||||
goto unicodeMode;
|
||||
}
|
||||
|
@ -558,7 +558,7 @@ unicodeMode:
|
|||
c=*source++;
|
||||
if(c<=127 && encodeDirectly[c]) {
|
||||
/* encode directly */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
|
||||
/* trick: back out this character to make this easier */
|
||||
--source;
|
||||
|
@ -719,7 +719,7 @@ unicodeMode:
|
|||
}
|
||||
}
|
||||
/* reset the state for the next conversion */
|
||||
cnv->fromUnicodeStatus=(cnv->fromUnicodeStatus&0xf0000000)|0x1000000; /* keep version, inDirectMode=TRUE */
|
||||
cnv->fromUnicodeStatus=(cnv->fromUnicodeStatus&0xf0000000)|0x1000000; /* keep version, inDirectMode=true */
|
||||
} else {
|
||||
/* set the converter state back into UConverter */
|
||||
cnv->fromUnicodeStatus=
|
||||
|
@ -778,7 +778,7 @@ static const UConverterStaticData _UTF7StaticData={
|
|||
UCNV_IBM, UCNV_UTF7,
|
||||
1, 4,
|
||||
{ 0x3f, 0, 0, 0 }, 1, /* the subchar is not used */
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -971,7 +971,7 @@ directMode:
|
|||
} else /* AMPERSAND */ {
|
||||
/* switch to Unicode mode */
|
||||
nextSourceIndex=++sourceIndex;
|
||||
inDirectMode=FALSE;
|
||||
inDirectMode=false;
|
||||
byteIndex=0;
|
||||
bits=0;
|
||||
base64Counter=-1;
|
||||
|
@ -1002,7 +1002,7 @@ unicodeMode:
|
|||
++nextSourceIndex;
|
||||
if(b>0x7e) {
|
||||
/* illegal - test other illegal US-ASCII values by base64Value==-3 */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
|
||||
break;
|
||||
} else if((base64Value=FROM_BASE64_IMAP(b))>=0) {
|
||||
|
@ -1024,7 +1024,7 @@ unicodeMode:
|
|||
c=(UChar)((bits<<4)|(base64Value>>2));
|
||||
if(isLegalIMAP(c)) {
|
||||
/* illegal */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
|
||||
goto endloop;
|
||||
}
|
||||
|
@ -1042,7 +1042,7 @@ unicodeMode:
|
|||
c=(UChar)((bits<<2)|(base64Value>>4));
|
||||
if(isLegalIMAP(c)) {
|
||||
/* illegal */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
|
||||
goto endloop;
|
||||
}
|
||||
|
@ -1060,7 +1060,7 @@ unicodeMode:
|
|||
c=(UChar)((bits<<6)|base64Value);
|
||||
if(isLegalIMAP(c)) {
|
||||
/* illegal */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
|
||||
goto endloop;
|
||||
}
|
||||
|
@ -1079,7 +1079,7 @@ unicodeMode:
|
|||
}
|
||||
} else if(base64Value==-2) {
|
||||
/* minus sign terminates the base64 sequence */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
if(base64Counter==-1) {
|
||||
/* &- i.e. a minus immediately following an ampersand */
|
||||
*target++=AMPERSAND;
|
||||
|
@ -1109,7 +1109,7 @@ unicodeMode:
|
|||
/* base64Value==-1 for characters that are illegal only in Unicode mode */
|
||||
/* base64Value==-3 for illegal characters */
|
||||
/* illegal */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
|
||||
break;
|
||||
}
|
||||
|
@ -1144,7 +1144,7 @@ endloop:
|
|||
}
|
||||
/* else if(base64Counter!=-1) byteIndex remains 0 because there is no particular byte sequence */
|
||||
|
||||
inDirectMode=TRUE; /* avoid looping */
|
||||
inDirectMode=true; /* avoid looping */
|
||||
*pErrorCode=U_TRUNCATED_CHAR_FOUND;
|
||||
}
|
||||
|
||||
|
@ -1240,7 +1240,7 @@ directMode:
|
|||
if(offsets!=NULL) {
|
||||
*offsets++=sourceIndex;
|
||||
}
|
||||
inDirectMode=FALSE;
|
||||
inDirectMode=false;
|
||||
base64Counter=0;
|
||||
goto unicodeMode;
|
||||
}
|
||||
|
@ -1257,7 +1257,7 @@ unicodeMode:
|
|||
c=*source++;
|
||||
if(isLegalIMAP(c)) {
|
||||
/* encode directly */
|
||||
inDirectMode=TRUE;
|
||||
inDirectMode=true;
|
||||
|
||||
/* trick: back out this character to make this easier */
|
||||
--source;
|
||||
|
@ -1431,7 +1431,7 @@ unicodeMode:
|
|||
}
|
||||
}
|
||||
/* reset the state for the next conversion */
|
||||
cnv->fromUnicodeStatus=(cnv->fromUnicodeStatus&0xf0000000)|0x1000000; /* keep version, inDirectMode=TRUE */
|
||||
cnv->fromUnicodeStatus=(cnv->fromUnicodeStatus&0xf0000000)|0x1000000; /* keep version, inDirectMode=true */
|
||||
} else {
|
||||
/* set the converter state back into UConverter */
|
||||
cnv->fromUnicodeStatus=
|
||||
|
@ -1479,7 +1479,7 @@ static const UConverterStaticData _IMAPStaticData={
|
|||
UCNV_IBM, UCNV_IMAP_MAILBOX,
|
||||
1, 4,
|
||||
{ 0x3f, 0, 0, 0 }, 1, /* the subchar is not used */
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -56,7 +56,7 @@ static const uint32_t offsetsFromUTF8[5] = {0,
|
|||
static UBool hasCESU8Data(const UConverter *cnv)
|
||||
{
|
||||
#if UCONFIG_ONLY_HTML_CONVERSION
|
||||
return FALSE;
|
||||
return false;
|
||||
#else
|
||||
return (UBool)(cnv->sharedData == &_CESU8Data);
|
||||
#endif
|
||||
|
@ -888,7 +888,7 @@ static const UConverterStaticData _UTF8StaticData={
|
|||
"UTF-8",
|
||||
1208, UCNV_IBM, UCNV_UTF8,
|
||||
1, 3, /* max 3 bytes per UChar from UTF-8 (4 bytes from surrogate _pair_) */
|
||||
{ 0xef, 0xbf, 0xbd, 0 },3,FALSE,FALSE,
|
||||
{ 0xef, 0xbf, 0xbd, 0 },3,false,false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
@ -931,7 +931,7 @@ static const UConverterStaticData _CESU8StaticData={
|
|||
"CESU-8",
|
||||
9400, /* CCSID for CESU-8 */
|
||||
UCNV_UNKNOWN, UCNV_CESU8, 1, 3,
|
||||
{ 0xef, 0xbf, 0xbd, 0 },3,FALSE,FALSE,
|
||||
{ 0xef, 0xbf, 0xbd, 0 },3,false,false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -195,7 +195,7 @@ bocu1TrailToByte[BOCU1_TRAIL_CONTROLS_COUNT]={
|
|||
* what we need here.
|
||||
* This macro adjust the results so that the modulo-value m is always >=0.
|
||||
*
|
||||
* For positive n, the if() condition is always FALSE.
|
||||
* For positive n, the if() condition is always false.
|
||||
*
|
||||
* @param n Number to be split into quotient and rest.
|
||||
* Will be modified to contain the quotient.
|
||||
|
@ -1401,7 +1401,7 @@ static const UConverterStaticData _Bocu1StaticData={
|
|||
UCNV_IBM, UCNV_BOCU1,
|
||||
1, 4, /* one UChar generates at least 1 byte and at most 4 bytes */
|
||||
{ 0x1a, 0, 0, 0 }, 1, /* BOCU-1 never needs to write a subchar */
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
|
||||
|
|
|
@ -111,18 +111,18 @@ _HZReset(UConverter *cnv, UConverterResetChoice choice){
|
|||
cnv->toUnicodeStatus = 0;
|
||||
cnv->mode=0;
|
||||
if(cnv->extraInfo != NULL){
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isStateDBCS = FALSE;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isEmptySegment = FALSE;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isStateDBCS = false;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isEmptySegment = false;
|
||||
}
|
||||
}
|
||||
if(choice!=UCNV_RESET_TO_UNICODE) {
|
||||
cnv->fromUnicodeStatus= 0;
|
||||
cnv->fromUChar32=0x0000;
|
||||
if(cnv->extraInfo != NULL){
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isEscapeAppended = FALSE;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isEscapeAppended = false;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->targetIndex = 0;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->sourceIndex = 0;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isTargetUCharDBCS = FALSE;
|
||||
((UConverterDataHZ*)cnv->extraInfo)->isTargetUCharDBCS = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,13 +189,13 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 2);
|
||||
}
|
||||
*(myTarget++)=(UChar)mySourceChar;
|
||||
myData->isEmptySegment = FALSE;
|
||||
myData->isEmptySegment = false;
|
||||
continue;
|
||||
case UCNV_OPEN_BRACE:
|
||||
case UCNV_CLOSE_BRACE:
|
||||
myData->isStateDBCS = (mySourceChar == UCNV_OPEN_BRACE);
|
||||
if (myData->isEmptySegment) {
|
||||
myData->isEmptySegment = FALSE; /* we are handling it, reset to avoid future spurious errors */
|
||||
myData->isEmptySegment = false; /* we are handling it, reset to avoid future spurious errors */
|
||||
*err = U_ILLEGAL_ESCAPE_SEQUENCE;
|
||||
args->converter->toUCallbackReason = UCNV_IRREGULAR;
|
||||
args->converter->toUBytes[0] = UCNV_TILDE;
|
||||
|
@ -205,7 +205,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
args->source = mySource;
|
||||
return;
|
||||
}
|
||||
myData->isEmptySegment = TRUE;
|
||||
myData->isEmptySegment = true;
|
||||
continue;
|
||||
default:
|
||||
/* if the first byte is equal to TILDE and the trail byte
|
||||
|
@ -217,7 +217,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
* - If any of the non-initial bytes could be the start of a character,
|
||||
* we stop the illegal sequence before the first one of those.
|
||||
*/
|
||||
myData->isEmptySegment = FALSE; /* different error here, reset this to avoid spurious future error */
|
||||
myData->isEmptySegment = false; /* different error here, reset this to avoid spurious future error */
|
||||
*err = U_ILLEGAL_ESCAPE_SEQUENCE;
|
||||
args->converter->toUBytes[0] = UCNV_TILDE;
|
||||
if( myData->isStateDBCS ?
|
||||
|
@ -244,7 +244,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
} else {
|
||||
/* add another bit to distinguish a 0 byte from not having seen a lead byte */
|
||||
args->converter->toUnicodeStatus = (uint32_t) (mySourceChar | 0x100);
|
||||
myData->isEmptySegment = FALSE; /* the segment has something, either valid or will produce a different error, so reset this */
|
||||
myData->isEmptySegment = false; /* the segment has something, either valid or will produce a different error, so reset this */
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -289,10 +289,10 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
|||
continue;
|
||||
} else if(mySourceChar <= 0x7f) {
|
||||
targetUniChar = (UChar)mySourceChar; /* ASCII */
|
||||
myData->isEmptySegment = FALSE; /* the segment has something valid */
|
||||
myData->isEmptySegment = false; /* the segment has something valid */
|
||||
} else {
|
||||
targetUniChar = 0xffff;
|
||||
myData->isEmptySegment = FALSE; /* different error here, reset this to avoid spurious future error */
|
||||
myData->isEmptySegment = false; /* different error here, reset this to avoid spurious future error */
|
||||
}
|
||||
}
|
||||
if(targetUniChar < 0xfffe){
|
||||
|
@ -396,13 +396,13 @@ UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
|
|||
len =ESC_LEN;
|
||||
escSeq = SB_ESCAPE;
|
||||
CONCAT_ESCAPE_MACRO(args, myTargetIndex, targetLength, escSeq,err,len,mySourceIndex);
|
||||
myConverterData->isEscapeAppended = TRUE;
|
||||
myConverterData->isEscapeAppended = true;
|
||||
}
|
||||
else{ /* Shifting from a single byte to double byte mode*/
|
||||
len =ESC_LEN;
|
||||
escSeq = DB_ESCAPE;
|
||||
CONCAT_ESCAPE_MACRO(args, myTargetIndex, targetLength, escSeq,err,len,mySourceIndex);
|
||||
myConverterData->isEscapeAppended = TRUE;
|
||||
myConverterData->isEscapeAppended = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ _HZ_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *e
|
|||
if( convData->isTargetUCharDBCS){
|
||||
*p++= UCNV_TILDE;
|
||||
*p++= UCNV_CLOSE_BRACE;
|
||||
convData->isTargetUCharDBCS=FALSE;
|
||||
convData->isTargetUCharDBCS=false;
|
||||
}
|
||||
*p++= (char)cnv->subChars[0];
|
||||
|
||||
|
@ -550,7 +550,7 @@ _HZ_SafeClone(const UConverter *cnv,
|
|||
|
||||
uprv_memcpy(&localClone->mydata, cnv->extraInfo, sizeof(UConverterDataHZ));
|
||||
localClone->cnv.extraInfo = &localClone->mydata;
|
||||
localClone->cnv.isExtraLocal = TRUE;
|
||||
localClone->cnv.isExtraLocal = true;
|
||||
|
||||
/* deep-clone the sub-converter */
|
||||
size = (int32_t)sizeof(UConverter);
|
||||
|
@ -611,8 +611,8 @@ static const UConverterStaticData _HZStaticData={
|
|||
4,
|
||||
{ 0x1a, 0, 0, 0 },
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, /* reserved */
|
||||
|
|
|
@ -172,7 +172,7 @@ static const uint8_t pnjMap[80] = {
|
|||
static UBool
|
||||
isPNJConsonant(UChar32 c) {
|
||||
if (c < 0xa00 || 0xa50 <= c) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
return (UBool)(pnjMap[c - 0xa00] & 1);
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ isPNJConsonant(UChar32 c) {
|
|||
static UBool
|
||||
isPNJBindiTippi(UChar32 c) {
|
||||
if (c < 0xa00 || 0xa50 <= c) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
return (UBool)(pnjMap[c - 0xa00] >> 1);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ _ISCIIOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode) {
|
|||
converterData->contextCharToUnicode=NO_CHAR_MARKER;
|
||||
cnv->toUnicodeStatus = missingCharMarker;
|
||||
converterData->contextCharFromUnicode=0x0000;
|
||||
converterData->resetToDefaultToUnicode=FALSE;
|
||||
converterData->resetToDefaultToUnicode=false;
|
||||
/* check if the version requested is supported */
|
||||
if ((pArgs->options & UCNV_OPTIONS_VERSION_MASK) < 9) {
|
||||
/* initialize state variables */
|
||||
|
@ -214,7 +214,7 @@ _ISCIIOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode) {
|
|||
= converterData->currentMaskToUnicode
|
||||
= converterData->defMaskToUnicode = lookupInitialData[pArgs->options & UCNV_OPTIONS_VERSION_MASK].maskEnum;
|
||||
|
||||
converterData->isFirstBuffer=TRUE;
|
||||
converterData->isFirstBuffer=true;
|
||||
(void)uprv_strcpy(converterData->name, ISCII_CNV_PREFIX);
|
||||
len = (int32_t)uprv_strlen(converterData->name);
|
||||
converterData->name[len]= (char)((pArgs->options & UCNV_OPTIONS_VERSION_MASK) + '0');
|
||||
|
@ -267,8 +267,8 @@ _ISCIIReset(UConverter *cnv, UConverterResetChoice choice) {
|
|||
data->contextCharFromUnicode=0x00;
|
||||
data->currentMaskFromUnicode=data->defMaskToUnicode;
|
||||
data->currentDeltaFromUnicode=data->defDeltaToUnicode;
|
||||
data->isFirstBuffer=TRUE;
|
||||
data->resetToDefaultToUnicode=FALSE;
|
||||
data->isFirstBuffer=true;
|
||||
data->resetToDefaultToUnicode=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -906,7 +906,7 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC(
|
|||
UConverterDataISCII *converterData;
|
||||
uint16_t newDelta=0;
|
||||
uint16_t range = 0;
|
||||
UBool deltaChanged = FALSE;
|
||||
UBool deltaChanged = false;
|
||||
|
||||
if ((args->converter == NULL) || (args->targetLimit < args->target) || (args->sourceLimit < args->source)) {
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
|
@ -986,8 +986,8 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC(
|
|||
if (newDelta!= converterData->currentDeltaFromUnicode || converterData->isFirstBuffer) {
|
||||
converterData->currentDeltaFromUnicode = newDelta;
|
||||
converterData->currentMaskFromUnicode = lookupInitialData[range].maskEnum;
|
||||
deltaChanged =TRUE;
|
||||
converterData->isFirstBuffer=FALSE;
|
||||
deltaChanged =true;
|
||||
converterData->isFirstBuffer=false;
|
||||
}
|
||||
|
||||
if (converterData->currentDeltaFromUnicode == PNJ_DELTA) {
|
||||
|
@ -1024,7 +1024,7 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC(
|
|||
temp =(uint16_t)(ATR<<8);
|
||||
temp += (uint16_t)((uint8_t) lookupInitialData[range].isciiLang);
|
||||
/* reset */
|
||||
deltaChanged=FALSE;
|
||||
deltaChanged=false;
|
||||
/* now append ATR and language code */
|
||||
WRITE_TO_TARGET_FROM_U(args,offsets,source,target,targetLimit,temp,err);
|
||||
if (U_FAILURE(*err)) {
|
||||
|
@ -1330,7 +1330,7 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
|
|||
break;
|
||||
case 0x0A:
|
||||
case 0x0D:
|
||||
data->resetToDefaultToUnicode = TRUE;
|
||||
data->resetToDefaultToUnicode = true;
|
||||
GET_MAPPING(sourceChar,targetUniChar,data)
|
||||
;
|
||||
*contextCharToUnicode = sourceChar;
|
||||
|
@ -1338,12 +1338,12 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
|
|||
|
||||
case ISCII_VOWEL_SIGN_E:
|
||||
i=1;
|
||||
found=FALSE;
|
||||
found=false;
|
||||
for (; i<vowelSignESpecialCases[0][0]; i++) {
|
||||
U_ASSERT(i<UPRV_LENGTHOF(vowelSignESpecialCases));
|
||||
if (vowelSignESpecialCases[i][0]==(uint8_t)*contextCharToUnicode) {
|
||||
targetUniChar=vowelSignESpecialCases[i][1];
|
||||
found=TRUE;
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1397,12 +1397,12 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
|
|||
} else {
|
||||
/* try to handle <CHAR> + ISCII_NUKTA special mappings */
|
||||
i=1;
|
||||
found =FALSE;
|
||||
found =false;
|
||||
for (; i<nuktaSpecialCases[0][0]; i++) {
|
||||
if (nuktaSpecialCases[i][0]==(uint8_t)
|
||||
*contextCharToUnicode) {
|
||||
targetUniChar=nuktaSpecialCases[i][1];
|
||||
found =TRUE;
|
||||
found =true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1472,10 +1472,10 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
|
|||
if (targetUniChar != missingCharMarker) {
|
||||
/* now save the targetUniChar for delayed write */
|
||||
*toUnicodeStatus = (UChar) targetUniChar;
|
||||
if (data->resetToDefaultToUnicode==TRUE) {
|
||||
if (data->resetToDefaultToUnicode==true) {
|
||||
data->currentDeltaToUnicode = data->defDeltaToUnicode;
|
||||
data->currentMaskToUnicode = data->defMaskToUnicode;
|
||||
data->resetToDefaultToUnicode=FALSE;
|
||||
data->resetToDefaultToUnicode=false;
|
||||
}
|
||||
} else {
|
||||
|
||||
|
@ -1550,7 +1550,7 @@ _ISCII_SafeClone(const UConverter *cnv,
|
|||
|
||||
uprv_memcpy(&localClone->mydata, cnv->extraInfo, sizeof(UConverterDataISCII));
|
||||
localClone->cnv.extraInfo = &localClone->mydata;
|
||||
localClone->cnv.isExtraLocal = TRUE;
|
||||
localClone->cnv.isExtraLocal = true;
|
||||
|
||||
return &localClone->cnv;
|
||||
}
|
||||
|
@ -1621,8 +1621,8 @@ static const UConverterStaticData _ISCIIStaticData={
|
|||
4,
|
||||
{ 0x1a, 0, 0, 0 },
|
||||
0x1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
false,
|
||||
false,
|
||||
0x0,
|
||||
0x0,
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, /* reserved */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue