// Toggle quoting mode.
// Return either '(' or ')', because quotes cause a grouping of the quoted text.
fQuoteMode = !fQuoteMode;
- if (fQuoteMode == true) {
+ if (fQuoteMode) {
c.fChar = chLParen;
} else {
c.fChar = chRParen;
if (targetUniChar != missingCharMarker) {
/* now save the targetUniChar for delayed write */
*toUnicodeStatus = (UChar) targetUniChar;
- if (data->resetToDefaultToUnicode==true) {
+ if (data->resetToDefaultToUnicode) {
data->currentDeltaToUnicode = data->defDeltaToUnicode;
data->currentMaskToUnicode = data->defMaskToUnicode;
data->resetToDefaultToUnicode=false;
/* check for .dat files */
pathBasename = findBasename(pathBuffer.data());
- if(checkLastFour == true &&
+ if(checkLastFour &&
(pathLen>=4) &&
uprv_strncmp(pathBuffer.data() +(pathLen-4), suffix.data(), 4)==0 && /* suffix matches */
uprv_strncmp(findBasename(pathBuffer.data()), basename, basenameLen)==0 && /* base matches */
failPos = j;
}
}
- if(useSTD3ASCIIRules == true){
+ if(useSTD3ASCIIRules){
// verify 3a and 3b
// 3(a) Verify the absence of non-LDH ASCII code points; that is, the
// absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F.
remainingDestCapacity = 0;
}
- if(done == true){
+ if(done){
break;
}
remainingDestCapacity = 0;
}
- if(done == true){
+ if(done){
break;
}
res = res_getTableItemByKey(&resB->getResData(), resB->fRes, &t, &key);
if(res == RES_BOGUS) {
key = inKey;
- if(resB->fHasFallback == true) {
+ if(resB->fHasFallback) {
dataEntry = getFallbackData(resB, &key, &res, status);
if(U_SUCCESS(*status)) {
/* check if resB->fResPath gives the right name here */
if(res == RES_BOGUS) {
key = inKey;
- if(resB->fHasFallback == true) {
+ if(resB->fHasFallback) {
dataEntry = getFallbackData(resB, &key, &res, status);
if(U_SUCCESS(*status)) {
switch (RES_GET_TYPE(res)) {
key = (UStringPrepKey *) e->key.pointer;
if ((noRefCount== false && profile->refCount == 0) ||
- noRefCount== true) {
+ noRefCount) {
deletedNum++;
uhash_removeElement(SHARED_DATA_HASHTABLE, e);
}
}
}
- if(profile->checkBiDi == true){
+ if(profile->checkBiDi){
// satisfy 2
- if( leftToRight == true && rightToLeft == true){
+ if( leftToRight && rightToLeft){
*status = U_STRINGPREP_CHECK_BIDI_ERROR;
uprv_syntaxError(b2,(rtlPos>ltrPos) ? rtlPos : ltrPos, b2Len, parseError);
return 0;
}
//satisfy 3
- if( rightToLeft == true &&
+ if( rightToLeft &&
!((firstCharDir == U_RIGHT_TO_LEFT || firstCharDir == U_RIGHT_TO_LEFT_ARABIC) &&
(direction == U_RIGHT_TO_LEFT || direction == U_RIGHT_TO_LEFT_ARABIC))
){
trail = ut->chunkContents[ut->chunkOffset];
}
UBool r = ut->pFuncs->access(ut, nativePosition, false); // reverse iteration flag loads preceding chunk
- U_ASSERT(r==true);
+ U_ASSERT(r);
ut->chunkOffset = originalOffset;
if(!r) {
return U_SENTINEL;
switch(bestField) {
case UCAL_WEEK_OF_YEAR:
if(woy == 1) {
- if(jan1InPrevYear == true) {
+ if(jan1InPrevYear) {
// the first week of January is in the previous year
// therefore WOY1 is always solidly within yearWoy
return yearWoy;
// both beforeCurrency and afterCurrency were found in CLDR.
static const char* defaults[] = { "[:letter:]", "[:digit:]", " " };
if (!hasBeforeCurrency || !hasAfterCurrency) {
- for (UBool beforeCurrency = 0; beforeCurrency <= true; beforeCurrency++) {
- for (int32_t pattern = 0; pattern < UNUM_CURRENCY_SPACING_COUNT; pattern++) {
- dfs.setPatternForCurrencySpacing((UCurrencySpacing)pattern,
- beforeCurrency, UnicodeString(defaults[pattern], -1, US_INV));
- }
+ for (int32_t pattern = 0; pattern < UNUM_CURRENCY_SPACING_COUNT; pattern++) {
+ dfs.setPatternForCurrencySpacing((UCurrencySpacing)pattern,
+ false, UnicodeString(defaults[pattern], -1, US_INV));
+ }
+ for (int32_t pattern = 0; pattern < UNUM_CURRENCY_SPACING_COUNT; pattern++) {
+ dfs.setPatternForCurrencySpacing((UCurrencySpacing)pattern,
+ true, UnicodeString(defaults[pattern], -1, US_INV));
}
}
}
}
patternsOfOneSkeleton[index] = intervalPattern;
- if ( emptyHash == true ) {
+ if ( emptyHash ) {
fIntervalPatterns->put(skeleton, patternsOfOneSkeleton, status);
}
}
const UnicodeString* pattern2 = (UnicodeString*)val2.pointer;
UBool ret = true;
int8_t i;
- for ( i = 0; i < DateIntervalInfo::kMaxIntervalPatternIndex && ret == true; ++i ) {
+ for ( i = 0; i < DateIntervalInfo::kMaxIntervalPatternIndex && ret ; ++i ) {
ret = (pattern1[i] == pattern2[i]);
}
return ret;
// The following check handles portions of the cutover year BEFORE the
// cutover itself happens.
//if ((fIsGregorian==true) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */
- if ((fIsGregorian==true) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */
+ if ((fIsGregorian) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */
#if defined (U_DEBUG_CAL)
fprintf(stderr, "%s:%d: jd [invert] %d\n",
__FILE__, __LINE__, jd);
if (c.fChar == (UChar32)-1) {
break; // End of Input
}
- if (c.fChar == chPound && fEOLComments == true) {
+ if (c.fChar == chPound && fEOLComments) {
// Start of a comment. Consume the rest of it, until EOF or a new line
for (;;) {
c.fChar = nextCharLL();
{
switch (attribute) {
case USEARCH_OVERLAP :
- return (m_search_->isOverlap == true ? USEARCH_ON : USEARCH_OFF);
+ return (m_search_->isOverlap ? USEARCH_ON : USEARCH_OFF);
case USEARCH_CANONICAL_MATCH :
- return (m_search_->isCanonicalMatch == true ? USEARCH_ON :
- USEARCH_OFF);
+ return (m_search_->isCanonicalMatch ? USEARCH_ON : USEARCH_OFF);
case USEARCH_ELEMENT_COMPARISON :
{
int16_t value = m_search_->elementComparisonType;
int32_t matchindex = m_search_->matchedIndex;
int32_t matchlength = m_search_->matchedLength;
m_search_->reset = false;
- if (m_search_->isForwardSearching == true) {
+ if (m_search_->isForwardSearching) {
int32_t textlength = m_search_->textLength;
if (offset == textlength || matchindex == textlength ||
(matchindex != USEARCH_DONE &&
}
int32_t matchindex = m_search_->matchedIndex;
- if (m_search_->isForwardSearching == true) {
+ if (m_search_->isForwardSearching) {
// switching direction.
// if matchedIndex == USEARCH_DONE, it means that either a
// setOffset has been called or that next ran off the text
if (strsrch) {
switch (attribute) {
case USEARCH_OVERLAP :
- return (strsrch->search->isOverlap == true ? USEARCH_ON :
- USEARCH_OFF);
+ return (strsrch->search->isOverlap ? USEARCH_ON : USEARCH_OFF);
case USEARCH_CANONICAL_MATCH :
- return (strsrch->search->isCanonicalMatch == true ? USEARCH_ON :
- USEARCH_OFF);
+ return (strsrch->search->isCanonicalMatch ? USEARCH_ON : USEARCH_OFF);
case USEARCH_ELEMENT_COMPARISON :
{
int16_t value = strsrch->search->elementComparisonType;
}
int32_t matchedindex = search->matchedIndex;
- if (search->isForwardSearching == true) {
+ if (search->isForwardSearching) {
// switching direction.
// if matchedIndex == USEARCH_DONE, it means that either a
// setOffset has been called or that next ran off the text
//
void ConfusabledataBuilder::outputData(UErrorCode &status) {
- U_ASSERT(fSpoofImpl->fSpoofData->fDataOwned == true);
+ U_ASSERT(fSpoofImpl->fSpoofData->fDataOwned);
// The Key Table
// While copying the keys to the runtime array,
UBool isNotEOF;
/* skip all leading ws in the input */
- while( ((isNotEOF = ufile_getch(input, &c)) == true) && (c == pad || u_isWhitespace(c)) )
+ while( ((isNotEOF = ufile_getch(input, &c))==(UBool)true) && (c == pad || u_isWhitespace(c)) )
{
count++;
}
if (U_SUCCESS(localStatus)) {
/* skip all leading ws in the input */
- while( ((isNotEOF = ufile_getch(input, &c)) == true) && (count < symbolLen && c == plusSymbol[count]) )
+ while( ((isNotEOF = ufile_getch(input, &c))==(UBool)true) && (count < symbolLen && c == plusSymbol[count]) )
{
count++;
}
return -1;
while( (info->fWidth == -1 || count < info->fWidth)
- && ((isNotEOF = ufile_getch(input, &c)) == true)
+ && ((isNotEOF = ufile_getch(input, &c))==(UBool)true)
&& (!info->fIsString || (c != info->fPadChar && !u_isWhitespace(c))))
{
count = 0;
while( (info->fWidth == -1 || count < info->fWidth)
- && ((isNotEOF = ufile_getch(input, &c)) == true)
+ && ((isNotEOF = ufile_getch(input, &c))==(UBool)true)
&& (!info->fIsString || (c != info->fPadChar && !u_isWhitespace(c))))
{
/* grab characters one at a time and make sure they are in the scanset */
while(chLeft > 0) {
- if ( ((isNotEOF = ufile_getch32(input, &c)) == true) && uset_contains(scanset, c) ) {
+ if ( ((isNotEOF = ufile_getch32(input, &c))==(UBool)true) && uset_contains(scanset, c) ) {
readCharacter = true;
if (!info->fSkipArg) {
int32_t idx = 0;