Skip to content

Commit 633438f

Browse files
committed
ICU-20973 Change all equality operator return types from UBool to bool.
1 parent ee7468a commit 633438f

File tree

163 files changed

+331
-331
lines changed

Some content is hidden

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

163 files changed

+331
-331
lines changed

icu4c/source/common/bytestriebuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ BytesTrieBuilder::BTLinearMatchNode::BTLinearMatchNode(const char *bytes, int32_
343343
static_cast<uint32_t>(hash)*37u + static_cast<uint32_t>(ustr_hashCharsN(bytes, len)));
344344
}
345345

346-
UBool
346+
bool
347347
BytesTrieBuilder::BTLinearMatchNode::operator==(const Node &other) const {
348348
if(this==&other) {
349349
return TRUE;

icu4c/source/common/dtintrv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ DateInterval::clone() const {
5353
}
5454

5555

56-
UBool
56+
bool
5757
DateInterval::operator==(const DateInterval& other) const {
5858
return ( fromDate == other.fromDate && toDate == other.toDate );
5959
}

icu4c/source/common/filteredbrk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class SimpleFilteredSentenceBreakIterator : public BreakIterator {
193193
}
194194
virtual SimpleFilteredSentenceBreakIterator* clone() const { return new SimpleFilteredSentenceBreakIterator(*this); }
195195
virtual UClassID getDynamicClassID(void) const { return NULL; }
196-
virtual UBool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; }
196+
virtual bool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; }
197197

198198
/* -- text modifying -- */
199199
virtual void setText(UText *text, UErrorCode &status) { fDelegate->setText(text,status); }

icu4c/source/common/locid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ Locale::clone() const {
483483
return new Locale(*this);
484484
}
485485

486-
UBool
486+
bool
487487
Locale::operator==( const Locale& other) const
488488
{
489489
return (uprv_strcmp(other.fullName, fullName) == 0);

icu4c/source/common/lsr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ UBool LSR::isEquivalentTo(const LSR &other) const {
7272
(regionIndex > 0 || uprv_strcmp(region, other.region) == 0);
7373
}
7474

75-
UBool LSR::operator==(const LSR &other) const {
75+
bool LSR::operator==(const LSR &other) const {
7676
return
7777
uprv_strcmp(language, other.language) == 0 &&
7878
uprv_strcmp(script, other.script) == 0 &&

icu4c/source/common/lsr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ struct LSR final : public UMemory {
6565
static int32_t indexForRegion(const char *region);
6666

6767
UBool isEquivalentTo(const LSR &other) const;
68-
UBool operator==(const LSR &other) const;
68+
bool operator==(const LSR &other) const;
6969

70-
inline UBool operator!=(const LSR &other) const {
70+
inline bool operator!=(const LSR &other) const {
7171
return !operator==(other);
7272
}
7373

icu4c/source/common/messagepattern.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ MessagePattern::clear() {
309309
numericValuesLength=0;
310310
}
311311

312-
UBool
312+
bool
313313
MessagePattern::operator==(const MessagePattern &other) const {
314314
if(this==&other) {
315315
return TRUE;
@@ -387,7 +387,7 @@ MessagePattern::getPluralOffset(int32_t pluralStart) const {
387387

388388
// MessagePattern::Part ---------------------------------------------------- ***
389389

390-
UBool
390+
bool
391391
MessagePattern::Part::operator==(const Part &other) const {
392392
if(this==&other) {
393393
return TRUE;

icu4c/source/common/normlzr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int32_t Normalizer::hashCode() const
108108
return text->hashCode() + fUMode + fOptions + buffer.hashCode() + bufferPos + currentIndex + nextIndex;
109109
}
110110

111-
UBool Normalizer::operator==(const Normalizer& that) const
111+
bool Normalizer::operator==(const Normalizer& that) const
112112
{
113113
return
114114
this==&that ||

icu4c/source/common/rbbi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,10 @@ RuleBasedBreakIterator::clone() const {
366366
}
367367

368368
/**
369-
* Equality operator. Returns TRUE if both BreakIterators are of the
369+
* Equality operator. Returns true if both BreakIterators are of the
370370
* same class, have the same behavior, and iterate over the same text.
371371
*/
372-
UBool
372+
bool
373373
RuleBasedBreakIterator::operator==(const BreakIterator& that) const {
374374
if (typeid(*this) != typeid(that)) {
375375
return FALSE;

icu4c/source/common/rbbidata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ RBBIDataWrapper::~RBBIDataWrapper() {
170170
// should still be ==.
171171
//
172172
//-----------------------------------------------------------------------------
173-
UBool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const {
173+
bool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const {
174174
if (fHeader == other.fHeader) {
175175
return TRUE;
176176
}

icu4c/source/common/rbbidata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class RBBIDataWrapper : public UMemory {
171171
void init(const RBBIDataHeader *data, UErrorCode &status);
172172
RBBIDataWrapper *addReference();
173173
void removeReference();
174-
UBool operator ==(const RBBIDataWrapper &other) const;
174+
bool operator ==(const RBBIDataWrapper &other) const;
175175
int32_t hashCode();
176176
const UnicodeString &getRuleSourceString() const;
177177
void printData();

icu4c/source/common/rbbinode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class RBBINode : public UMemory {
108108

109109
private:
110110
RBBINode &operator = (const RBBINode &other); // No defs.
111-
UBool operator == (const RBBINode &other); // Private, so these functions won't accidentally be used.
111+
bool operator == (const RBBINode &other); // Private, so these functions won't accidentally be used.
112112

113113
#ifdef RBBI_DEBUG
114114
public:

icu4c/source/common/schriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ StringCharacterIterator::operator=(const StringCharacterIterator& that) {
7979
return *this;
8080
}
8181

82-
UBool
82+
bool
8383
StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const {
8484
if (this == &that) {
8585
return TRUE;

icu4c/source/common/stringtriebuilder.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ StringTrieBuilder::equalNodes(const void *left, const void *right) {
383383
return *(const Node *)left==*(const Node *)right;
384384
}
385385

386-
UBool
386+
bool
387387
StringTrieBuilder::Node::operator==(const Node &other) const {
388388
return this==&other || (typeid(*this)==typeid(other) && hash==other.hash);
389389
}
@@ -396,7 +396,7 @@ StringTrieBuilder::Node::markRightEdgesFirst(int32_t edgeNumber) {
396396
return edgeNumber;
397397
}
398398

399-
UBool
399+
bool
400400
StringTrieBuilder::FinalValueNode::operator==(const Node &other) const {
401401
if(this==&other) {
402402
return TRUE;
@@ -413,7 +413,7 @@ StringTrieBuilder::FinalValueNode::write(StringTrieBuilder &builder) {
413413
offset=builder.writeValueAndFinal(value, TRUE);
414414
}
415415

416-
UBool
416+
bool
417417
StringTrieBuilder::ValueNode::operator==(const Node &other) const {
418418
if(this==&other) {
419419
return TRUE;
@@ -425,7 +425,7 @@ StringTrieBuilder::ValueNode::operator==(const Node &other) const {
425425
return hasValue==o.hasValue && (!hasValue || value==o.value);
426426
}
427427

428-
UBool
428+
bool
429429
StringTrieBuilder::IntermediateValueNode::operator==(const Node &other) const {
430430
if(this==&other) {
431431
return TRUE;
@@ -451,7 +451,7 @@ StringTrieBuilder::IntermediateValueNode::write(StringTrieBuilder &builder) {
451451
offset=builder.writeValueAndFinal(value, FALSE);
452452
}
453453

454-
UBool
454+
bool
455455
StringTrieBuilder::LinearMatchNode::operator==(const Node &other) const {
456456
if(this==&other) {
457457
return TRUE;
@@ -471,7 +471,7 @@ StringTrieBuilder::LinearMatchNode::markRightEdgesFirst(int32_t edgeNumber) {
471471
return edgeNumber;
472472
}
473473

474-
UBool
474+
bool
475475
StringTrieBuilder::ListBranchNode::operator==(const Node &other) const {
476476
if(this==&other) {
477477
return TRUE;
@@ -550,7 +550,7 @@ StringTrieBuilder::ListBranchNode::write(StringTrieBuilder &builder) {
550550
}
551551
}
552552

553-
UBool
553+
bool
554554
StringTrieBuilder::SplitBranchNode::operator==(const Node &other) const {
555555
if(this==&other) {
556556
return TRUE;
@@ -584,7 +584,7 @@ StringTrieBuilder::SplitBranchNode::write(StringTrieBuilder &builder) {
584584
offset=builder.write(unit);
585585
}
586586

587-
UBool
587+
bool
588588
StringTrieBuilder::BranchHeadNode::operator==(const Node &other) const {
589589
if(this==&other) {
590590
return TRUE;

icu4c/source/common/ucharstriebuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const UChar *units, in
290290
hash=hash*37u+ustr_hashUCharsN(units, len);
291291
}
292292

293-
UBool
293+
bool
294294
UCharsTrieBuilder::UCTLinearMatchNode::operator==(const Node &other) const {
295295
if(this==&other) {
296296
return TRUE;

icu4c/source/common/uchriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ UCharCharacterIterator::operator=(const UCharCharacterIterator& that) {
6666
UCharCharacterIterator::~UCharCharacterIterator() {
6767
}
6868

69-
UBool
69+
bool
7070
UCharCharacterIterator::operator==(const ForwardCharacterIterator& that) const {
7171
if (this == &that) {
7272
return TRUE;

icu4c/source/common/unicode/brkiter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ class U_COMMON_API BreakIterator : public UObject {
124124
* object, and styles are not considered.
125125
* @stable ICU 2.0
126126
*/
127-
virtual UBool operator==(const BreakIterator&) const = 0;
127+
virtual bool operator==(const BreakIterator&) const = 0;
128128

129129
/**
130130
* Returns the complement of the result of operator==
131131
* @param rhs The BreakIterator to be compared for inequality
132132
* @return the complement of the result of operator==
133133
* @stable ICU 2.0
134134
*/
135-
UBool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); }
135+
bool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); }
136136

137137
/**
138138
* Return a polymorphic copy of this object. This is an abstract

icu4c/source/common/unicode/bytestriebuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class U_COMMON_API BytesTrieBuilder : public StringTrieBuilder {
156156
class BTLinearMatchNode : public LinearMatchNode {
157157
public:
158158
BTLinearMatchNode(const char *units, int32_t len, Node *nextNode);
159-
virtual UBool operator==(const Node &other) const;
159+
virtual bool operator==(const Node &other) const;
160160
virtual void write(StringTrieBuilder &builder);
161161
private:
162162
const char *s;

icu4c/source/common/unicode/chariter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject {
114114
* character in the same character-storage object
115115
* @stable ICU 2.0
116116
*/
117-
virtual UBool operator==(const ForwardCharacterIterator& that) const = 0;
117+
virtual bool operator==(const ForwardCharacterIterator& that) const = 0;
118118

119119
/**
120120
* Returns true when the iterators refer to different
@@ -126,7 +126,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject {
126126
* same text-storage object
127127
* @stable ICU 2.0
128128
*/
129-
inline UBool operator!=(const ForwardCharacterIterator& that) const;
129+
inline bool operator!=(const ForwardCharacterIterator& that) const;
130130

131131
/**
132132
* Generates a hash code for this iterator.
@@ -692,7 +692,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
692692
int32_t end;
693693
};
694694

695-
inline UBool
695+
inline bool
696696
ForwardCharacterIterator::operator!=(const ForwardCharacterIterator& that) const {
697697
return !operator==(that);
698698
}

icu4c/source/common/unicode/dtintrv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ class U_COMMON_API DateInterval : public UObject {
109109
* @return true if the two DateIntervals are the same
110110
* @stable ICU 4.0
111111
*/
112-
virtual UBool operator==(const DateInterval& other) const;
112+
virtual bool operator==(const DateInterval& other) const;
113113

114114
/**
115115
* Non-equality operator
116116
* @return true if the two DateIntervals are not the same
117117
* @stable ICU 4.0
118118
*/
119-
inline UBool operator!=(const DateInterval& other) const;
119+
inline bool operator!=(const DateInterval& other) const;
120120

121121

122122
/**
@@ -151,7 +151,7 @@ DateInterval::getToDate() const {
151151
}
152152

153153

154-
inline UBool
154+
inline bool
155155
DateInterval::operator!=(const DateInterval& other) const {
156156
return ( !operator==(other) );
157157
}

icu4c/source/common/unicode/locid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,20 +326,20 @@ class U_COMMON_API Locale : public UObject {
326326
* Checks if two locale keys are the same.
327327
*
328328
* @param other The locale key object to be compared with this.
329-
* @return True if the two locale keys are the same, false otherwise.
329+
* @return true if the two locale keys are the same, false otherwise.
330330
* @stable ICU 2.0
331331
*/
332-
UBool operator==(const Locale& other) const;
332+
bool operator==(const Locale& other) const;
333333

334334
/**
335335
* Checks if two locale keys are not the same.
336336
*
337337
* @param other The locale key object to be compared with this.
338-
* @return True if the two locale keys are not the same, false
338+
* @return true if the two locale keys are not the same, false
339339
* otherwise.
340340
* @stable ICU 2.0
341341
*/
342-
inline UBool operator!=(const Locale& other) const;
342+
inline bool operator!=(const Locale& other) const;
343343

344344
/**
345345
* Clone this object.
@@ -1163,7 +1163,7 @@ class U_COMMON_API Locale : public UObject {
11631163
friend void U_CALLCONV locale_available_init();
11641164
};
11651165

1166-
inline UBool
1166+
inline bool
11671167
Locale::operator!=(const Locale& other) const
11681168
{
11691169
return !operator==(other);

icu4c/source/common/unicode/messagepattern.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,14 +526,14 @@ class U_COMMON_API MessagePattern : public UObject {
526526
* @return true if this object is equivalent to the other one.
527527
* @stable ICU 4.8
528528
*/
529-
UBool operator==(const MessagePattern &other) const;
529+
bool operator==(const MessagePattern &other) const;
530530

531531
/**
532532
* @param other another object to compare with.
533533
* @return false if this object is equivalent to the other one.
534534
* @stable ICU 4.8
535535
*/
536-
inline UBool operator!=(const MessagePattern &other) const {
536+
inline bool operator!=(const MessagePattern &other) const {
537537
return !operator==(other);
538538
}
539539

@@ -797,14 +797,14 @@ class U_COMMON_API MessagePattern : public UObject {
797797
* @return true if this object is equivalent to the other one.
798798
* @stable ICU 4.8
799799
*/
800-
UBool operator==(const Part &other) const;
800+
bool operator==(const Part &other) const;
801801

802802
/**
803803
* @param other another object to compare with.
804804
* @return false if this object is equivalent to the other one.
805805
* @stable ICU 4.8
806806
*/
807-
inline UBool operator!=(const Part &other) const {
807+
inline bool operator!=(const Part &other) const {
808808
return !operator==(other);
809809
}
810810

icu4c/source/common/unicode/normlzr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class U_COMMON_API Normalizer : public UObject {
584584
* @return comparison result
585585
* @deprecated ICU 56 Use Normalizer2 instead.
586586
*/
587-
UBool operator==(const Normalizer& that) const;
587+
bool operator==(const Normalizer& that) const;
588588

589589
/**
590590
* Returns false when both iterators refer to the same character in the same
@@ -594,7 +594,7 @@ class U_COMMON_API Normalizer : public UObject {
594594
* @return comparison result
595595
* @deprecated ICU 56 Use Normalizer2 instead.
596596
*/
597-
inline UBool operator!=(const Normalizer& that) const;
597+
inline bool operator!=(const Normalizer& that) const;
598598

599599
/**
600600
* Returns a pointer to a new Normalizer that is a clone of this one.
@@ -777,7 +777,7 @@ class U_COMMON_API Normalizer : public UObject {
777777
//-------------------------------------------------------------------------
778778

779779
#ifndef U_HIDE_DEPRECATED_API
780-
inline UBool
780+
inline bool
781781
Normalizer::operator!= (const Normalizer& other) const
782782
{ return ! operator==(other); }
783783

0 commit comments

Comments
 (0)