From: Shane Carr Date: Fri, 22 Mar 2019 20:58:36 +0000 (-0700) Subject: ICU-20508 Fixing -Wextra-semi in library code. X-Git-Tag: release-64-1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b596462d5acc55d70d3eb33b2f7067d3493a9450;p=icu ICU-20508 Fixing -Wextra-semi in library code. --- diff --git a/icu4c/source/common/cmemory.h b/icu4c/source/common/cmemory.h index f121bcb8f11..f19715caf42 100644 --- a/icu4c/source/common/cmemory.h +++ b/icu4c/source/common/cmemory.h @@ -298,7 +298,7 @@ public: */ MaybeStackArray(int32_t newCapacity) : MaybeStackArray() { if (capacity < newCapacity) { resize(newCapacity); } - }; + } /** * Destructor deletes the array (if owned). */ diff --git a/icu4c/source/common/dictbe.cpp b/icu4c/source/common/dictbe.cpp index 0c2612ad3ca..c769138ae4b 100644 --- a/icu4c/source/common/dictbe.cpp +++ b/icu4c/source/common/dictbe.cpp @@ -103,8 +103,8 @@ private: int32_t cpLengths[POSSIBLE_WORD_LIST_MAX]; // Word Lengths, in code points. public: - PossibleWord() : count(0), prefix(0), offset(-1), mark(0), current(0) {}; - ~PossibleWord() {}; + PossibleWord() : count(0), prefix(0), offset(-1), mark(0), current(0) {} + ~PossibleWord() {} // Fill the list of candidates if needed, select the longest, and return the number found int32_t candidates( UText *text, DictionaryMatcher *dict, int32_t rangeEnd ); @@ -118,13 +118,13 @@ public: // Return the longest prefix this candidate location shares with a dictionary word // Return value is in code points. - int32_t longestPrefix() { return prefix; }; + int32_t longestPrefix() { return prefix; } // Mark the current candidate as the one we like - void markCurrent() { mark = current; }; + void markCurrent() { mark = current; } // Get length in code points of the marked word. - int32_t markedCPLength() { return cpLengths[mark]; }; + int32_t markedCPLength() { return cpLengths[mark]; } }; diff --git a/icu4c/source/common/dictionarydata.h b/icu4c/source/common/dictionarydata.h index 73b7d6753ba..0d303d9a8dc 100644 --- a/icu4c/source/common/dictionarydata.h +++ b/icu4c/source/common/dictionarydata.h @@ -68,7 +68,7 @@ public: */ class U_COMMON_API DictionaryMatcher : public UMemory { public: - DictionaryMatcher() {}; + DictionaryMatcher() {} virtual ~DictionaryMatcher(); // this should emulate CompactTrieDictionary::matches() /* @param text The text in which to look for matching words. Matching begins diff --git a/icu4c/source/common/rbbi.cpp b/icu4c/source/common/rbbi.cpp index 41490250b0b..3c2f7203e3a 100644 --- a/icu4c/source/common/rbbi.cpp +++ b/icu4c/source/common/rbbi.cpp @@ -720,7 +720,7 @@ struct LookAheadResults { int32_t fPositions[8]; int16_t fKeys[8]; - LookAheadResults() : fUsedSlotLimit(0), fPositions(), fKeys() {}; + LookAheadResults() : fUsedSlotLimit(0), fPositions(), fKeys() {} int32_t getPosition(int16_t key) { for (int32_t i=0; ifPosition = fBoundaries[fBufIdx]; fBI->fRuleStatusIndex = fStatuses[fBufIdx]; } - }; + } void nextOL(); @@ -178,7 +178,7 @@ class RuleBasedBreakIterator::BreakCache: public UMemory { void dumpCache(); private: - static inline int32_t modChunkSize(int index) { return index & (CACHE_SIZE - 1); }; + static inline int32_t modChunkSize(int index) { return index & (CACHE_SIZE - 1); } static constexpr int32_t CACHE_SIZE = 128; static_assert((CACHE_SIZE & (CACHE_SIZE-1)) == 0, "CACHE_SIZE must be power of two."); diff --git a/icu4c/source/common/rbbiscan.h b/icu4c/source/common/rbbiscan.h index 8bec8234e58..c51b4cf2a68 100644 --- a/icu4c/source/common/rbbiscan.h +++ b/icu4c/source/common/rbbiscan.h @@ -54,7 +54,7 @@ public: struct RBBIRuleChar { UChar32 fChar; UBool fEscaped; - RBBIRuleChar() : fChar(0), fEscaped(FALSE) {}; + RBBIRuleChar() : fChar(0), fEscaped(FALSE) {} }; RBBIRuleScanner(RBBIRuleBuilder *rb); diff --git a/icu4c/source/common/umutex.h b/icu4c/source/common/umutex.h index 7858b893784..d0a7e7afc5b 100755 --- a/icu4c/source/common/umutex.h +++ b/icu4c/source/common/umutex.h @@ -95,8 +95,8 @@ inline int32_t umtx_atomic_dec(u_atomic_int32_t *var) { struct UInitOnce { u_atomic_int32_t fState; UErrorCode fErrCode; - void reset() {fState = 0;}; - UBool isReset() {return umtx_loadAcquire(fState) == 0;}; + void reset() {fState = 0;} + UBool isReset() {return umtx_loadAcquire(fState) == 0;} // Note: isReset() is used by service registration code. // Thread safety of this usage needs review. }; diff --git a/icu4c/source/common/unifiedcache.h b/icu4c/source/common/unifiedcache.h index 4c9992be25e..d6c9945126c 100644 --- a/icu4c/source/common/unifiedcache.h +++ b/icu4c/source/common/unifiedcache.h @@ -137,7 +137,7 @@ class LocaleCacheKey : public CacheKey { protected: Locale fLoc; public: - LocaleCacheKey(const Locale &loc) : fLoc(loc) {}; + LocaleCacheKey(const Locale &loc) : fLoc(loc) {} LocaleCacheKey(const LocaleCacheKey &other) : CacheKey(other), fLoc(other.fLoc) { } virtual ~LocaleCacheKey() { } diff --git a/icu4c/source/i18n/csdetect.cpp b/icu4c/source/i18n/csdetect.cpp index 36552c4b762..2436760a9b2 100644 --- a/icu4c/source/i18n/csdetect.cpp +++ b/icu4c/source/i18n/csdetect.cpp @@ -36,9 +36,9 @@ U_NAMESPACE_BEGIN struct CSRecognizerInfo : public UMemory { CSRecognizerInfo(CharsetRecognizer *recognizer, UBool isDefaultEnabled) - : recognizer(recognizer), isDefaultEnabled(isDefaultEnabled) {}; + : recognizer(recognizer), isDefaultEnabled(isDefaultEnabled) {} - ~CSRecognizerInfo() {delete recognizer;}; + ~CSRecognizerInfo() {delete recognizer;} CharsetRecognizer *recognizer; UBool isDefaultEnabled; diff --git a/icu4c/source/i18n/number_decimalquantity.h b/icu4c/source/i18n/number_decimalquantity.h index 13613cf569f..06cc836c779 100644 --- a/icu4c/source/i18n/number_decimalquantity.h +++ b/icu4c/source/i18n/number_decimalquantity.h @@ -275,7 +275,7 @@ class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { inline bool isUsingBytes() { return usingBytes; } /** Visible for testing */ - inline bool isExplicitExactDouble() { return explicitExactDouble; }; + inline bool isExplicitExactDouble() { return explicitExactDouble; } bool operator==(const DecimalQuantity& other) const; diff --git a/icu4c/source/i18n/number_patternstring.h b/icu4c/source/i18n/number_patternstring.h index 387f41bfd15..0c908679f3c 100644 --- a/icu4c/source/i18n/number_patternstring.h +++ b/icu4c/source/i18n/number_patternstring.h @@ -98,7 +98,7 @@ struct U_I18N_API ParsedPatternInfo : public AffixPatternProvider, public UMemor int32_t offset = 0; explicit ParserState(const UnicodeString& _pattern) - : pattern(_pattern) {}; + : pattern(_pattern) {} ParserState& operator=(ParserState&& src) U_NOEXCEPT { // Leave pattern reference alone; it will continue to point to the same place in memory, diff --git a/icu4c/source/i18n/numparse_types.h b/icu4c/source/i18n/numparse_types.h index 0fd70faca99..f837d8d2795 100644 --- a/icu4c/source/i18n/numparse_types.h +++ b/icu4c/source/i18n/numparse_types.h @@ -347,7 +347,7 @@ class U_I18N_API NumberParseMatcher { */ virtual void postProcess(ParsedNumber&) const { // Default implementation: no-op - }; + } // String for debugging virtual UnicodeString toString() const = 0; diff --git a/icu4c/source/i18n/scriptset.h b/icu4c/source/i18n/scriptset.h index 385c3e3e534..99a71ec803f 100644 --- a/icu4c/source/i18n/scriptset.h +++ b/icu4c/source/i18n/scriptset.h @@ -40,7 +40,7 @@ class U_I18N_API ScriptSet: public UMemory { ~ScriptSet(); UBool operator == (const ScriptSet &other) const; - UBool operator != (const ScriptSet &other) const {return !(*this == other);}; + UBool operator != (const ScriptSet &other) const {return !(*this == other);} ScriptSet & operator = (const ScriptSet &other); UBool test(UScriptCode script, UErrorCode &status) const; diff --git a/icu4c/source/i18n/tzgnames.h b/icu4c/source/i18n/tzgnames.h index 2bd76135d8a..71d9d84dc04 100644 --- a/icu4c/source/i18n/tzgnames.h +++ b/icu4c/source/i18n/tzgnames.h @@ -46,7 +46,7 @@ public: static TimeZoneGenericNames* createInstance(const Locale& locale, UErrorCode& status); virtual UBool operator==(const TimeZoneGenericNames& other) const; - virtual UBool operator!=(const TimeZoneGenericNames& other) const {return !operator==(other);}; + virtual UBool operator!=(const TimeZoneGenericNames& other) const {return !operator==(other);} virtual TimeZoneGenericNames* clone() const; UnicodeString& getDisplayName(const TimeZone& tz, UTimeZoneGenericNameType type, diff --git a/icu4c/source/i18n/tznames.cpp b/icu4c/source/i18n/tznames.cpp index 36d27ca699b..acd6aecdc0c 100644 --- a/icu4c/source/i18n/tznames.cpp +++ b/icu4c/source/i18n/tznames.cpp @@ -108,7 +108,7 @@ public: virtual ~TimeZoneNamesDelegate(); virtual UBool operator==(const TimeZoneNames& other) const; - virtual UBool operator!=(const TimeZoneNames& other) const {return !operator==(other);}; + virtual UBool operator!=(const TimeZoneNames& other) const {return !operator==(other);} virtual TimeZoneNames* clone() const; StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; diff --git a/icu4c/source/i18n/unicode/alphaindex.h b/icu4c/source/i18n/unicode/alphaindex.h index 1c50ba217fc..91524a1ae52 100644 --- a/icu4c/source/i18n/unicode/alphaindex.h +++ b/icu4c/source/i18n/unicode/alphaindex.h @@ -651,7 +651,7 @@ private: /** * No assignment. */ - AlphabeticIndex &operator =(const AlphabeticIndex & /*other*/) { return *this;}; + AlphabeticIndex &operator =(const AlphabeticIndex & /*other*/) { return *this;} /** * No Equality operators. diff --git a/icu4c/source/i18n/unicode/dtitvfmt.h b/icu4c/source/i18n/unicode/dtitvfmt.h index d4b9f93657f..42d77d041f8 100644 --- a/icu4c/source/i18n/unicode/dtitvfmt.h +++ b/icu4c/source/i18n/unicode/dtitvfmt.h @@ -60,7 +60,7 @@ class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue { * Default constructor; makes an empty FormattedDateInterval. * @draft ICU 64 */ - FormattedDateInterval() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}; + FormattedDateInterval() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} /** * Move constructor: Leaves the source FormattedDateInterval in an undefined state. diff --git a/icu4c/source/i18n/unicode/formattedvalue.h b/icu4c/source/i18n/unicode/formattedvalue.h index ce59335e5f9..60f97edd4b2 100644 --- a/icu4c/source/i18n/unicode/formattedvalue.h +++ b/icu4c/source/i18n/unicode/formattedvalue.h @@ -122,7 +122,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory { */ inline int32_t getCategory() const { return fCategory; - }; + } /** * Gets the field for the current position. @@ -135,7 +135,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory { */ inline int32_t getField() const { return fField; - }; + } /** * Gets the INCLUSIVE start index for the current position. @@ -147,7 +147,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory { */ inline int32_t getStart() const { return fStart; - }; + } /** * Gets the EXCLUSIVE end index stored for the current position. @@ -159,7 +159,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory { */ inline int32_t getLimit() const { return fLimit; - }; + } //////////////////////////////////////////////////////////////////// //// The following methods are for FormattedValue implementers; //// diff --git a/icu4c/source/i18n/unicode/listformatter.h b/icu4c/source/i18n/unicode/listformatter.h index 121dd192ceb..9ce8ec8617c 100644 --- a/icu4c/source/i18n/unicode/listformatter.h +++ b/icu4c/source/i18n/unicode/listformatter.h @@ -85,7 +85,7 @@ class U_I18N_API FormattedList : public UMemory, public FormattedValue { * Default constructor; makes an empty FormattedList. * @draft ICU 64 */ - FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}; + FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} /** * Move constructor: Leaves the source FormattedList in an undefined state. diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 4fd6830518d..72f474886a0 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -2411,7 +2411,7 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue { * @draft ICU 64 */ FormattedNumber() - : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}; + : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} /** * Move constructor: Leaves the source FormattedNumber in an undefined state. diff --git a/icu4c/source/i18n/unicode/numberrangeformatter.h b/icu4c/source/i18n/unicode/numberrangeformatter.h index 4a386b80394..a67ee72666e 100644 --- a/icu4c/source/i18n/unicode/numberrangeformatter.h +++ b/icu4c/source/i18n/unicode/numberrangeformatter.h @@ -481,7 +481,7 @@ class U_I18N_API NumberRangeFormatterSettings { } fMacros.copyErrorTo(outErrorCode); return U_FAILURE(outErrorCode); - }; + } // NOTE: Uses default copy and move constructors. diff --git a/icu4c/source/i18n/unicode/reldatefmt.h b/icu4c/source/i18n/unicode/reldatefmt.h index 84d7c0a34d5..32344cd5f18 100644 --- a/icu4c/source/i18n/unicode/reldatefmt.h +++ b/icu4c/source/i18n/unicode/reldatefmt.h @@ -264,7 +264,7 @@ class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedVal * Default constructor; makes an empty FormattedRelativeDateTime. * @draft ICU 64 */ - FormattedRelativeDateTime() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}; + FormattedRelativeDateTime() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} /** * Move constructor: Leaves the source FormattedRelativeDateTime in an undefined state.