Skip to content

Commit a18df7b

Browse files
committed
ICU-21267 stop using FALSE & TRUE macros in most library-internal headers
1 parent e3123c8 commit a18df7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+243
-243
lines changed

icu4c/source/common/bmpset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class BMPSet : public UMemory {
101101
*/
102102
UBool latin1Contains[0x100];
103103

104-
/* TRUE if contains(U+FFFD). */
104+
/* true if contains(U+FFFD). */
105105
UBool containsFFFD;
106106

107107
/*

icu4c/source/common/brkeng.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class LanguageBreakEngine : public UMemory {
5454
* a particular kind of break.</p>
5555
*
5656
* @param c A character which begins a run that the engine might handle
57-
* @return TRUE if this engine handles the particular character and break
57+
* @return true if this engine handles the particular character and break
5858
* type.
5959
*/
6060
virtual UBool handles(UChar32 c) const = 0;
@@ -171,7 +171,7 @@ class UnhandledEngine : public LanguageBreakEngine {
171171
* a particular kind of break.</p>
172172
*
173173
* @param c A character which begins a run that the engine might handle
174-
* @return TRUE if this engine handles the particular character and break
174+
* @return true if this engine handles the particular character and break
175175
* type.
176176
*/
177177
virtual UBool handles(UChar32 c) const;

icu4c/source/common/bytesinkutil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class U_COMMON_API ByteSinkUtil {
4545
static UBool appendUnchanged(const uint8_t *s, int32_t length,
4646
ByteSink &sink, uint32_t options, Edits *edits,
4747
UErrorCode &errorCode) {
48-
if (U_FAILURE(errorCode)) { return FALSE; }
48+
if (U_FAILURE(errorCode)) { return false; }
4949
if (length > 0) { appendNonEmptyUnchanged(s, length, sink, options, edits); }
50-
return TRUE;
50+
return true;
5151
}
5252

5353
static UBool appendUnchanged(const uint8_t *s, const uint8_t *limit,

icu4c/source/common/dictbe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
5959
* a particular kind of break.</p>
6060
*
6161
* @param c A character which begins a run that the engine might handle
62-
* @return TRUE if this engine handles the particular character and break
62+
* @return true if this engine handles the particular character and break
6363
* type.
6464
*/
6565
virtual UBool handles(UChar32 c) const;

icu4c/source/common/messageimpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ U_NAMESPACE_BEGIN
3333
class U_COMMON_API MessageImpl {
3434
public:
3535
/**
36-
* @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
36+
* @return true if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
3737
*/
3838
static UBool jdkAposMode(const MessagePattern &msgPattern) {
3939
return msgPattern.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED;

icu4c/source/common/norm2allmodes.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ class Normalizer2WithImpl : public Normalizer2 {
6565
normalizeSecondAndAppend(UnicodeString &first,
6666
const UnicodeString &second,
6767
UErrorCode &errorCode) const {
68-
return normalizeSecondAndAppend(first, second, TRUE, errorCode);
68+
return normalizeSecondAndAppend(first, second, true, errorCode);
6969
}
7070
virtual UnicodeString &
7171
append(UnicodeString &first,
7272
const UnicodeString &second,
7373
UErrorCode &errorCode) const {
74-
return normalizeSecondAndAppend(first, second, FALSE, errorCode);
74+
return normalizeSecondAndAppend(first, second, false, errorCode);
7575
}
7676
UnicodeString &
7777
normalizeSecondAndAppend(UnicodeString &first,
@@ -112,29 +112,29 @@ class Normalizer2WithImpl : public Normalizer2 {
112112
int32_t length;
113113
const UChar *d=impl.getDecomposition(c, buffer, length);
114114
if(d==NULL) {
115-
return FALSE;
115+
return false;
116116
}
117117
if(d==buffer) {
118118
decomposition.setTo(buffer, length); // copy the string (Jamos from Hangul syllable c)
119119
} else {
120-
decomposition.setTo(FALSE, d, length); // read-only alias
120+
decomposition.setTo(false, d, length); // read-only alias
121121
}
122-
return TRUE;
122+
return true;
123123
}
124124
virtual UBool
125125
getRawDecomposition(UChar32 c, UnicodeString &decomposition) const {
126126
UChar buffer[30];
127127
int32_t length;
128128
const UChar *d=impl.getRawDecomposition(c, buffer, length);
129129
if(d==NULL) {
130-
return FALSE;
130+
return false;
131131
}
132132
if(d==buffer) {
133133
decomposition.setTo(buffer, length); // copy the string (algorithmic decomposition)
134134
} else {
135-
decomposition.setTo(FALSE, d, length); // read-only alias
135+
decomposition.setTo(false, d, length); // read-only alias
136136
}
137-
return TRUE;
137+
return true;
138138
}
139139
virtual UChar32
140140
composePair(UChar32 a, UChar32 b) const {
@@ -150,12 +150,12 @@ class Normalizer2WithImpl : public Normalizer2 {
150150
virtual UBool
151151
isNormalized(const UnicodeString &s, UErrorCode &errorCode) const {
152152
if(U_FAILURE(errorCode)) {
153-
return FALSE;
153+
return false;
154154
}
155155
const UChar *sArray=s.getBuffer();
156156
if(sArray==NULL) {
157157
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
158-
return FALSE;
158+
return false;
159159
}
160160
const UChar *sLimit=sArray+s.length();
161161
return sLimit==spanQuickCheckYes(sArray, sLimit, errorCode);
@@ -227,7 +227,7 @@ class ComposeNormalizer2 : public Normalizer2WithImpl {
227227
virtual void
228228
normalize(const UChar *src, const UChar *limit,
229229
ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
230-
impl.compose(src, limit, onlyContiguous, TRUE, buffer, errorCode);
230+
impl.compose(src, limit, onlyContiguous, true, buffer, errorCode);
231231
}
232232
using Normalizer2WithImpl::normalize; // Avoid warning about hiding base class function.
233233

@@ -256,24 +256,24 @@ class ComposeNormalizer2 : public Normalizer2WithImpl {
256256
virtual UBool
257257
isNormalized(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE {
258258
if(U_FAILURE(errorCode)) {
259-
return FALSE;
259+
return false;
260260
}
261261
const UChar *sArray=s.getBuffer();
262262
if(sArray==NULL) {
263263
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
264-
return FALSE;
264+
return false;
265265
}
266266
UnicodeString temp;
267267
ReorderingBuffer buffer(impl, temp);
268268
if(!buffer.init(5, errorCode)) { // small destCapacity for substring normalization
269-
return FALSE;
269+
return false;
270270
}
271-
return impl.compose(sArray, sArray+s.length(), onlyContiguous, FALSE, buffer, errorCode);
271+
return impl.compose(sArray, sArray+s.length(), onlyContiguous, false, buffer, errorCode);
272272
}
273273
virtual UBool
274274
isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) const U_OVERRIDE {
275275
if(U_FAILURE(errorCode)) {
276-
return FALSE;
276+
return false;
277277
}
278278
const uint8_t *s = reinterpret_cast<const uint8_t *>(sp.data());
279279
return impl.composeUTF8(0, onlyContiguous, s, s + sp.length(), nullptr, nullptr, errorCode);
@@ -343,7 +343,7 @@ class FCDNormalizer2 : public Normalizer2WithImpl {
343343

344344
struct Norm2AllModes : public UMemory {
345345
Norm2AllModes(Normalizer2Impl *i)
346-
: impl(i), comp(*i, FALSE), decomp(*i), fcd(*i), fcc(*i, TRUE) {}
346+
: impl(i), comp(*i, false), decomp(*i), fcd(*i), fcc(*i, true) {}
347347
~Norm2AllModes();
348348

349349
static Norm2AllModes *createInstance(Normalizer2Impl *impl, UErrorCode &errorCode);

icu4c/source/common/normalizer2impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class U_COMMON_API Normalizer2Impl : public UObject {
359359
return getFCD16FromNormData(c);
360360
}
361361

362-
/** Returns TRUE if the single-or-lead code unit c might have non-zero FCD data. */
362+
/** Returns true if the single-or-lead code unit c might have non-zero FCD data. */
363363
UBool singleLeadMightHaveNonZeroFCD16(UChar32 lead) const {
364364
// 0<=lead<=0xffff
365365
uint8_t bits=smallFCD[lead>>8];
@@ -397,8 +397,8 @@ class U_COMMON_API Normalizer2Impl : public UObject {
397397
MIN_YES_YES_WITH_CC=0xfe02,
398398
JAMO_VT=0xfe00,
399399
MIN_NORMAL_MAYBE_YES=0xfc00,
400-
JAMO_L=2, // offset=1 hasCompBoundaryAfter=FALSE
401-
INERT=1, // offset=0 hasCompBoundaryAfter=TRUE
400+
JAMO_L=2, // offset=1 hasCompBoundaryAfter=false
401+
INERT=1, // offset=0 hasCompBoundaryAfter=true
402402

403403
// norm16 bit 0 is comp-boundary-after.
404404
HAS_COMP_BOUNDARY_AFTER=1,

icu4c/source/common/patternprops.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ U_NAMESPACE_BEGIN
4444
class U_COMMON_API PatternProps {
4545
public:
4646
/**
47-
* @return TRUE if c is a Pattern_Syntax code point.
47+
* @return true if c is a Pattern_Syntax code point.
4848
*/
4949
static UBool isSyntax(UChar32 c);
5050

5151
/**
52-
* @return TRUE if c is a Pattern_Syntax or Pattern_White_Space code point.
52+
* @return true if c is a Pattern_Syntax or Pattern_White_Space code point.
5353
*/
5454
static UBool isSyntaxOrWhiteSpace(UChar32 c);
5555

5656
/**
57-
* @return TRUE if c is a Pattern_White_Space character.
57+
* @return true if c is a Pattern_White_Space character.
5858
*/
5959
static UBool isWhiteSpace(UChar32 c);
6060

@@ -78,7 +78,7 @@ class U_COMMON_API PatternProps {
7878
/**
7979
* Tests whether the string contains a "pattern identifier", that is,
8080
* whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
81-
* @return TRUE if there are no Pattern_White_Space or Pattern_Syntax characters in s.
81+
* @return true if there are no Pattern_White_Space or Pattern_Syntax characters in s.
8282
*/
8383
static UBool isIdentifier(const UChar *s, int32_t length);
8484

icu4c/source/common/pluralmap.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class PluralMap : public PluralMapBase {
234234
}
235235

236236
/**
237-
* Returns TRUE if this object equals rhs.
237+
* Returns true if this object equals rhs.
238238
*/
239239
UBool equals(
240240
const PluralMap<T> &rhs,
@@ -244,13 +244,13 @@ class PluralMap : public PluralMapBase {
244244
continue;
245245
}
246246
if (fVariants[i] == NULL || rhs.fVariants[i] == NULL) {
247-
return FALSE;
247+
return false;
248248
}
249249
if (!eqFunc(*fVariants[i], *rhs.fVariants[i])) {
250-
return FALSE;
250+
return false;
251251
}
252252
}
253-
return TRUE;
253+
return true;
254254
}
255255

256256
private:

icu4c/source/common/punycode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Adam M. Costello
5050
* @param caseFlags Vector of boolean values, one per input UChar,
5151
* indicating that the corresponding character is to be
5252
* marked for the decoder optionally
53-
* uppercasing (TRUE) or lowercasing (FALSE)
53+
* uppercasing (true) or lowercasing (false)
5454
* the character.
5555
* ASCII characters are output directly in the case as marked.
5656
* Flags corresponding to trail surrogates are ignored.
@@ -83,10 +83,10 @@ u_strToPunycode(const UChar *src, int32_t srcLength,
8383
* and of caseFlags in numbers of UBools.
8484
* @param caseFlags Output array for case flags as
8585
* defined by the Punycode string.
86-
* The caller should uppercase (TRUE) or lowercase (FASLE)
86+
* The caller should uppercase (true) or lowercase (FASLE)
8787
* the corresponding character in dest.
8888
* For supplementary characters, only the lead surrogate
89-
* is marked, and FALSE is stored for the trail surrogate.
89+
* is marked, and false is stored for the trail surrogate.
9090
* This is redundant and not necessary for ASCII characters
9191
* because they are already in the case indicated.
9292
* Can be NULL if the case flags are not needed.

0 commit comments

Comments
 (0)