Skip to content

Commit

Permalink
ICU-20973 Change all equality operator return types from UBool to bool.
Browse files Browse the repository at this point in the history
  • Loading branch information
roubert committed Aug 16, 2021
1 parent ee7468a commit 633438f
Show file tree
Hide file tree
Showing 163 changed files with 331 additions and 331 deletions.
2 changes: 1 addition & 1 deletion icu4c/source/common/bytestriebuilder.cpp
Expand Up @@ -343,7 +343,7 @@ BytesTrieBuilder::BTLinearMatchNode::BTLinearMatchNode(const char *bytes, int32_
static_cast<uint32_t>(hash)*37u + static_cast<uint32_t>(ustr_hashCharsN(bytes, len)));
}

UBool
bool
BytesTrieBuilder::BTLinearMatchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/dtintrv.cpp
Expand Up @@ -53,7 +53,7 @@ DateInterval::clone() const {
}


UBool
bool
DateInterval::operator==(const DateInterval& other) const {
return ( fromDate == other.fromDate && toDate == other.toDate );
}
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/filteredbrk.cpp
Expand Up @@ -193,7 +193,7 @@ class SimpleFilteredSentenceBreakIterator : public BreakIterator {
}
virtual SimpleFilteredSentenceBreakIterator* clone() const { return new SimpleFilteredSentenceBreakIterator(*this); }
virtual UClassID getDynamicClassID(void) const { return NULL; }
virtual UBool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; }
virtual bool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; }

/* -- text modifying -- */
virtual void setText(UText *text, UErrorCode &status) { fDelegate->setText(text,status); }
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/locid.cpp
Expand Up @@ -483,7 +483,7 @@ Locale::clone() const {
return new Locale(*this);
}

UBool
bool
Locale::operator==( const Locale& other) const
{
return (uprv_strcmp(other.fullName, fullName) == 0);
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/lsr.cpp
Expand Up @@ -72,7 +72,7 @@ UBool LSR::isEquivalentTo(const LSR &other) const {
(regionIndex > 0 || uprv_strcmp(region, other.region) == 0);
}

UBool LSR::operator==(const LSR &other) const {
bool LSR::operator==(const LSR &other) const {
return
uprv_strcmp(language, other.language) == 0 &&
uprv_strcmp(script, other.script) == 0 &&
Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/common/lsr.h
Expand Up @@ -65,9 +65,9 @@ struct LSR final : public UMemory {
static int32_t indexForRegion(const char *region);

UBool isEquivalentTo(const LSR &other) const;
UBool operator==(const LSR &other) const;
bool operator==(const LSR &other) const;

inline UBool operator!=(const LSR &other) const {
inline bool operator!=(const LSR &other) const {
return !operator==(other);
}

Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/common/messagepattern.cpp
Expand Up @@ -309,7 +309,7 @@ MessagePattern::clear() {
numericValuesLength=0;
}

UBool
bool
MessagePattern::operator==(const MessagePattern &other) const {
if(this==&other) {
return TRUE;
Expand Down Expand Up @@ -387,7 +387,7 @@ MessagePattern::getPluralOffset(int32_t pluralStart) const {

// MessagePattern::Part ---------------------------------------------------- ***

UBool
bool
MessagePattern::Part::operator==(const Part &other) const {
if(this==&other) {
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/normlzr.cpp
Expand Up @@ -108,7 +108,7 @@ int32_t Normalizer::hashCode() const
return text->hashCode() + fUMode + fOptions + buffer.hashCode() + bufferPos + currentIndex + nextIndex;
}

UBool Normalizer::operator==(const Normalizer& that) const
bool Normalizer::operator==(const Normalizer& that) const
{
return
this==&that ||
Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/common/rbbi.cpp
Expand Up @@ -366,10 +366,10 @@ RuleBasedBreakIterator::clone() const {
}

/**
* Equality operator. Returns TRUE if both BreakIterators are of the
* Equality operator. Returns true if both BreakIterators are of the
* same class, have the same behavior, and iterate over the same text.
*/
UBool
bool
RuleBasedBreakIterator::operator==(const BreakIterator& that) const {
if (typeid(*this) != typeid(that)) {
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/rbbidata.cpp
Expand Up @@ -170,7 +170,7 @@ RBBIDataWrapper::~RBBIDataWrapper() {
// should still be ==.
//
//-----------------------------------------------------------------------------
UBool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const {
bool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const {
if (fHeader == other.fHeader) {
return TRUE;
}
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/rbbidata.h
Expand Up @@ -171,7 +171,7 @@ class RBBIDataWrapper : public UMemory {
void init(const RBBIDataHeader *data, UErrorCode &status);
RBBIDataWrapper *addReference();
void removeReference();
UBool operator ==(const RBBIDataWrapper &other) const;
bool operator ==(const RBBIDataWrapper &other) const;
int32_t hashCode();
const UnicodeString &getRuleSourceString() const;
void printData();
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/rbbinode.h
Expand Up @@ -108,7 +108,7 @@ class RBBINode : public UMemory {

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

#ifdef RBBI_DEBUG
public:
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/schriter.cpp
Expand Up @@ -79,7 +79,7 @@ StringCharacterIterator::operator=(const StringCharacterIterator& that) {
return *this;
}

UBool
bool
StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const {
if (this == &that) {
return TRUE;
Expand Down
16 changes: 8 additions & 8 deletions icu4c/source/common/stringtriebuilder.cpp
Expand Up @@ -383,7 +383,7 @@ StringTrieBuilder::equalNodes(const void *left, const void *right) {
return *(const Node *)left==*(const Node *)right;
}

UBool
bool
StringTrieBuilder::Node::operator==(const Node &other) const {
return this==&other || (typeid(*this)==typeid(other) && hash==other.hash);
}
Expand All @@ -396,7 +396,7 @@ StringTrieBuilder::Node::markRightEdgesFirst(int32_t edgeNumber) {
return edgeNumber;
}

UBool
bool
StringTrieBuilder::FinalValueNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand All @@ -413,7 +413,7 @@ StringTrieBuilder::FinalValueNode::write(StringTrieBuilder &builder) {
offset=builder.writeValueAndFinal(value, TRUE);
}

UBool
bool
StringTrieBuilder::ValueNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand All @@ -425,7 +425,7 @@ StringTrieBuilder::ValueNode::operator==(const Node &other) const {
return hasValue==o.hasValue && (!hasValue || value==o.value);
}

UBool
bool
StringTrieBuilder::IntermediateValueNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand All @@ -451,7 +451,7 @@ StringTrieBuilder::IntermediateValueNode::write(StringTrieBuilder &builder) {
offset=builder.writeValueAndFinal(value, FALSE);
}

UBool
bool
StringTrieBuilder::LinearMatchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand All @@ -471,7 +471,7 @@ StringTrieBuilder::LinearMatchNode::markRightEdgesFirst(int32_t edgeNumber) {
return edgeNumber;
}

UBool
bool
StringTrieBuilder::ListBranchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand Down Expand Up @@ -550,7 +550,7 @@ StringTrieBuilder::ListBranchNode::write(StringTrieBuilder &builder) {
}
}

UBool
bool
StringTrieBuilder::SplitBranchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand Down Expand Up @@ -584,7 +584,7 @@ StringTrieBuilder::SplitBranchNode::write(StringTrieBuilder &builder) {
offset=builder.write(unit);
}

UBool
bool
StringTrieBuilder::BranchHeadNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/ucharstriebuilder.cpp
Expand Up @@ -290,7 +290,7 @@ UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const UChar *units, in
hash=hash*37u+ustr_hashUCharsN(units, len);
}

UBool
bool
UCharsTrieBuilder::UCTLinearMatchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/uchriter.cpp
Expand Up @@ -66,7 +66,7 @@ UCharCharacterIterator::operator=(const UCharCharacterIterator& that) {
UCharCharacterIterator::~UCharCharacterIterator() {
}

UBool
bool
UCharCharacterIterator::operator==(const ForwardCharacterIterator& that) const {
if (this == &that) {
return TRUE;
Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/common/unicode/brkiter.h
Expand Up @@ -124,15 +124,15 @@ class U_COMMON_API BreakIterator : public UObject {
* object, and styles are not considered.
* @stable ICU 2.0
*/
virtual UBool operator==(const BreakIterator&) const = 0;
virtual bool operator==(const BreakIterator&) const = 0;

/**
* Returns the complement of the result of operator==
* @param rhs The BreakIterator to be compared for inequality
* @return the complement of the result of operator==
* @stable ICU 2.0
*/
UBool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); }
bool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); }

/**
* Return a polymorphic copy of this object. This is an abstract
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/unicode/bytestriebuilder.h
Expand Up @@ -156,7 +156,7 @@ class U_COMMON_API BytesTrieBuilder : public StringTrieBuilder {
class BTLinearMatchNode : public LinearMatchNode {
public:
BTLinearMatchNode(const char *units, int32_t len, Node *nextNode);
virtual UBool operator==(const Node &other) const;
virtual bool operator==(const Node &other) const;
virtual void write(StringTrieBuilder &builder);
private:
const char *s;
Expand Down
6 changes: 3 additions & 3 deletions icu4c/source/common/unicode/chariter.h
Expand Up @@ -114,7 +114,7 @@ class U_COMMON_API ForwardCharacterIterator : public UObject {
* character in the same character-storage object
* @stable ICU 2.0
*/
virtual UBool operator==(const ForwardCharacterIterator& that) const = 0;
virtual bool operator==(const ForwardCharacterIterator& that) const = 0;

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

/**
* Generates a hash code for this iterator.
Expand Down Expand Up @@ -692,7 +692,7 @@ class U_COMMON_API CharacterIterator : public ForwardCharacterIterator {
int32_t end;
};

inline UBool
inline bool
ForwardCharacterIterator::operator!=(const ForwardCharacterIterator& that) const {
return !operator==(that);
}
Expand Down
6 changes: 3 additions & 3 deletions icu4c/source/common/unicode/dtintrv.h
Expand Up @@ -109,14 +109,14 @@ class U_COMMON_API DateInterval : public UObject {
* @return true if the two DateIntervals are the same
* @stable ICU 4.0
*/
virtual UBool operator==(const DateInterval& other) const;
virtual bool operator==(const DateInterval& other) const;

/**
* Non-equality operator
* @return true if the two DateIntervals are not the same
* @stable ICU 4.0
*/
inline UBool operator!=(const DateInterval& other) const;
inline bool operator!=(const DateInterval& other) const;


/**
Expand Down Expand Up @@ -151,7 +151,7 @@ DateInterval::getToDate() const {
}


inline UBool
inline bool
DateInterval::operator!=(const DateInterval& other) const {
return ( !operator==(other) );
}
Expand Down
10 changes: 5 additions & 5 deletions icu4c/source/common/unicode/locid.h
Expand Up @@ -326,20 +326,20 @@ class U_COMMON_API Locale : public UObject {
* Checks if two locale keys are the same.
*
* @param other The locale key object to be compared with this.
* @return True if the two locale keys are the same, false otherwise.
* @return true if the two locale keys are the same, false otherwise.
* @stable ICU 2.0
*/
UBool operator==(const Locale& other) const;
bool operator==(const Locale& other) const;

/**
* Checks if two locale keys are not the same.
*
* @param other The locale key object to be compared with this.
* @return True if the two locale keys are not the same, false
* @return true if the two locale keys are not the same, false
* otherwise.
* @stable ICU 2.0
*/
inline UBool operator!=(const Locale& other) const;
inline bool operator!=(const Locale& other) const;

/**
* Clone this object.
Expand Down Expand Up @@ -1163,7 +1163,7 @@ class U_COMMON_API Locale : public UObject {
friend void U_CALLCONV locale_available_init();
};

inline UBool
inline bool
Locale::operator!=(const Locale& other) const
{
return !operator==(other);
Expand Down
8 changes: 4 additions & 4 deletions icu4c/source/common/unicode/messagepattern.h
Expand Up @@ -526,14 +526,14 @@ class U_COMMON_API MessagePattern : public UObject {
* @return true if this object is equivalent to the other one.
* @stable ICU 4.8
*/
UBool operator==(const MessagePattern &other) const;
bool operator==(const MessagePattern &other) const;

/**
* @param other another object to compare with.
* @return false if this object is equivalent to the other one.
* @stable ICU 4.8
*/
inline UBool operator!=(const MessagePattern &other) const {
inline bool operator!=(const MessagePattern &other) const {
return !operator==(other);
}

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

/**
* @param other another object to compare with.
* @return false if this object is equivalent to the other one.
* @stable ICU 4.8
*/
inline UBool operator!=(const Part &other) const {
inline bool operator!=(const Part &other) const {
return !operator==(other);
}

Expand Down
6 changes: 3 additions & 3 deletions icu4c/source/common/unicode/normlzr.h
Expand Up @@ -584,7 +584,7 @@ class U_COMMON_API Normalizer : public UObject {
* @return comparison result
* @deprecated ICU 56 Use Normalizer2 instead.
*/
UBool operator==(const Normalizer& that) const;
bool operator==(const Normalizer& that) const;

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

/**
* Returns a pointer to a new Normalizer that is a clone of this one.
Expand Down Expand Up @@ -777,7 +777,7 @@ class U_COMMON_API Normalizer : public UObject {
//-------------------------------------------------------------------------

#ifndef U_HIDE_DEPRECATED_API
inline UBool
inline bool
Normalizer::operator!= (const Normalizer& other) const
{ return ! operator==(other); }

Expand Down

0 comments on commit 633438f

Please sign in to comment.