From a7e23a531c9f35ad804e3ae161ac0179745a6888 Mon Sep 17 00:00:00 2001 From: Fredrik Roubert Date: Tue, 23 Apr 2024 14:45:10 +0200 Subject: [PATCH] ICU-22721 Clang-Tidy: modernize-use-override https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-override.html --- .../source/layoutex/layout/ParagraphLayout.h | 6 +- icu4c/source/layoutex/layout/RunArrays.h | 20 +++--- icu4c/source/layoutex/plruns.cpp | 6 +- .../samples/translit/answers/unaccent.h | 8 +-- icu4c/source/samples/translit/unaccent.h | 8 +-- .../source/test/letest/PortableFontInstance.h | 30 ++++---- icu4c/source/test/letest/SimpleFontInstance.h | 28 ++++---- icu4c/source/test/letest/cmaps.h | 4 +- .../test/perf/DateFmtPerf/DateFmtPerf.h | 50 ++++++------- icu4c/source/test/perf/charperf/charperf.h | 14 ++-- icu4c/source/test/perf/collperf/collperf.cpp | 24 +++---- .../source/test/perf/collperf2/collperf2.cpp | 70 +++++++++---------- .../test/perf/dicttrieperf/dicttrieperf.cpp | 20 +++--- .../perf/howExpensiveIs/howExpensiveIs.cpp | 42 +++++------ .../test/perf/leperf/PortableFontInstance.h | 30 ++++---- .../test/perf/leperf/SimpleFontInstance.h | 28 ++++---- icu4c/source/test/perf/leperf/cmaps.h | 4 +- .../test/perf/localecanperf/localecanperf.cpp | 10 +-- icu4c/source/test/perf/normperf/dtfmtrtperf.h | 6 +- icu4c/source/test/perf/normperf/normperf.h | 10 +-- .../test/perf/normperf/simplenormperf.cpp | 4 +- .../test/perf/strsrchperf/strsrchperf.h | 6 +- icu4c/source/test/perf/ubrkperf/ubrkperf.h | 16 ++--- .../test/perf/unisetperf/draft/bitset.cpp | 2 +- .../test/perf/unisetperf/draft/trieset.cpp | 2 +- .../test/perf/unisetperf/unisetperf.cpp | 16 ++--- icu4c/source/test/perf/usetperf/usetperf.cpp | 10 +-- icu4c/source/test/perf/ustrperf/stringperf.h | 12 ++-- icu4c/source/test/perf/utfperf/utfperf.cpp | 10 +-- .../test/perf/utrie2perf/utrie2perf.cpp | 10 +-- 30 files changed, 253 insertions(+), 253 deletions(-) diff --git a/icu4c/source/layoutex/layout/ParagraphLayout.h b/icu4c/source/layoutex/layout/ParagraphLayout.h index f6167ae3292..4efca1fb03e 100644 --- a/icu4c/source/layoutex/layout/ParagraphLayout.h +++ b/icu4c/source/layoutex/layout/ParagraphLayout.h @@ -156,7 +156,7 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } private: @@ -319,7 +319,7 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } private: @@ -550,7 +550,7 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } private: diff --git a/icu4c/source/layoutex/layout/RunArrays.h b/icu4c/source/layoutex/layout/RunArrays.h index 08e32826642..69d57a0ebed 100644 --- a/icu4c/source/layoutex/layout/RunArrays.h +++ b/icu4c/source/layoutex/layout/RunArrays.h @@ -161,7 +161,7 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } protected: /** @@ -361,11 +361,11 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } protected: - virtual void init(le_int32 capacity); - virtual void grow(le_int32 capacity); + void init(le_int32 capacity) override; + void grow(le_int32 capacity) override; private: @@ -498,11 +498,11 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } protected: - virtual void init(le_int32 capacity); - virtual void grow(le_int32 capacity); + void init(le_int32 capacity) override; + void grow(le_int32 capacity) override; /** * @internal @@ -635,11 +635,11 @@ public: * * @stable ICU 3.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + inline UClassID getDynamicClassID() const override { return getStaticClassID(); } protected: - virtual void init(le_int32 capacity); - virtual void grow(le_int32 capacity); + void init(le_int32 capacity) override; + void grow(le_int32 capacity) override; private: diff --git a/icu4c/source/layoutex/plruns.cpp b/icu4c/source/layoutex/plruns.cpp index e2796ad24d2..2bae89fb2bd 100644 --- a/icu4c/source/layoutex/plruns.cpp +++ b/icu4c/source/layoutex/plruns.cpp @@ -301,11 +301,11 @@ public: * * @draft ICU 3.8 */ - virtual inline UClassID getDynamicClassID() const; + inline UClassID getDynamicClassID() const override; protected: - virtual void init(le_int32 capacity); - virtual void grow(le_int32 capacity); + void init(le_int32 capacity) override; + void grow(le_int32 capacity) override; private: diff --git a/icu4c/source/samples/translit/answers/unaccent.h b/icu4c/source/samples/translit/answers/unaccent.h index 839d4a95df8..ca45a6b5840 100644 --- a/icu4c/source/samples/translit/answers/unaccent.h +++ b/icu4c/source/samples/translit/answers/unaccent.h @@ -29,7 +29,7 @@ class UnaccentTransliterator : public Transliterator { */ virtual ~UnaccentTransliterator(); - virtual UClassID getDynamicClassID() const override; + UClassID getDynamicClassID() const override; U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); protected: @@ -37,9 +37,9 @@ class UnaccentTransliterator : public Transliterator { /** * Implement Transliterator API */ - virtual void handleTransliterate(Replaceable& text, - UTransPosition& index, - UBool incremental) const; + void handleTransliterate(Replaceable& text, + UTransPosition& index, + UBool incremental) const override; private: diff --git a/icu4c/source/samples/translit/unaccent.h b/icu4c/source/samples/translit/unaccent.h index aa27a56dd2a..69037332a54 100644 --- a/icu4c/source/samples/translit/unaccent.h +++ b/icu4c/source/samples/translit/unaccent.h @@ -32,9 +32,9 @@ class UnaccentTransliterator : public Transliterator { /** * Implement Transliterator API */ - virtual void handleTransliterate(Replaceable& text, - UTransPosition& index, - UBool incremental) const; + void handleTransliterate(Replaceable& text, + UTransPosition& index, + UBool incremental) const override; private: @@ -83,7 +83,7 @@ public: * different class IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID() const { return getStaticClassID(); }; + UClassID getDynamicClassID() const override { return getStaticClassID(); }; private: diff --git a/icu4c/source/test/letest/PortableFontInstance.h b/icu4c/source/test/letest/PortableFontInstance.h index a8d86348883..9405674ed18 100644 --- a/icu4c/source/test/letest/PortableFontInstance.h +++ b/icu4c/source/test/letest/PortableFontInstance.h @@ -66,14 +66,14 @@ private: protected: const void *readFontTable(LETag tableTag) const { size_t ignored; return readFontTable(tableTag, ignored); } - const void *readFontTable(LETag tableTag, size_t &length) const; + const void *readFontTable(LETag tableTag, size_t &length) const override; public: PortableFontInstance(const char *fileName, float pointSize, LEErrorCode &status); virtual ~PortableFontInstance(); - virtual const void *getFontTable(LETag tableTag, size_t &length) const; + const void *getFontTable(LETag tableTag, size_t &length) const override; virtual const char *getNameString(le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language) const; @@ -83,39 +83,39 @@ public: virtual void deleteNameString(const LEUnicode16 *name) const; - virtual le_int32 getUnitsPerEM() const; + le_int32 getUnitsPerEM() const override; virtual le_uint32 getFontChecksum() const; virtual le_uint32 getRawChecksum() const; - virtual le_int32 getAscent() const; + le_int32 getAscent() const override; - virtual le_int32 getDescent() const; + le_int32 getDescent() const override; - virtual le_int32 getLeading() const; + le_int32 getLeading() const override; // We really want to inherit this method from the superclass, but some compilers // issue a warning if we don't implement it... - virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const; + LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const override; // We really want to inherit this method from the superclass, but some compilers // issue a warning if we don't implement it... - virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const; + LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const override; - virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const; + LEGlyphID mapCharToGlyph(LEUnicode32 ch) const override; - virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const; + void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const override; - virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const; + le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const override; - float getXPixelsPerEm() const; + float getXPixelsPerEm() const override; - float getYPixelsPerEm() const; + float getYPixelsPerEm() const override; - float getScaleFactorX() const; + float getScaleFactorX() const override; - float getScaleFactorY() const; + float getScaleFactorY() const override; }; diff --git a/icu4c/source/test/letest/SimpleFontInstance.h b/icu4c/source/test/letest/SimpleFontInstance.h index 521cb8886bf..471a029d1e4 100644 --- a/icu4c/source/test/letest/SimpleFontInstance.h +++ b/icu4c/source/test/letest/SimpleFontInstance.h @@ -36,37 +36,37 @@ public: virtual ~SimpleFontInstance(); - virtual const void *getFontTable(LETag tableTag, size_t &length) const; + const void *getFontTable(LETag tableTag, size_t &length) const override; - virtual le_int32 getUnitsPerEM() const; + le_int32 getUnitsPerEM() const override; - virtual le_int32 getAscent() const; + le_int32 getAscent() const override; - virtual le_int32 getDescent() const; + le_int32 getDescent() const override; - virtual le_int32 getLeading() const; + le_int32 getLeading() const override; // We really want to inherit this method from the superclass, but some compilers // issue a warning if we don't implement it... - virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const; + LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const override; // We really want to inherit this method from the superclass, but some compilers // issue a warning if we don't implement it... - virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const; + LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const override; - virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const; + LEGlyphID mapCharToGlyph(LEUnicode32 ch) const override; - virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const; + void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const override; - virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const; + le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const override; - float getXPixelsPerEm() const; + float getXPixelsPerEm() const override; - float getYPixelsPerEm() const; + float getYPixelsPerEm() const override; - float getScaleFactorX() const; + float getScaleFactorX() const override; - float getScaleFactorY() const; + float getScaleFactorY() const override; }; diff --git a/icu4c/source/test/letest/cmaps.h b/icu4c/source/test/letest/cmaps.h index 875bb97ee24..f5580d0d84f 100644 --- a/icu4c/source/test/letest/cmaps.h +++ b/icu4c/source/test/letest/cmaps.h @@ -40,7 +40,7 @@ public: virtual ~CMAPFormat4Mapper(); - virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const; + LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const override; protected: CMAPFormat4Mapper() {}; @@ -61,7 +61,7 @@ public: virtual ~CMAPGroupMapper(); - virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const; + LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const override; protected: CMAPGroupMapper() {}; diff --git a/icu4c/source/test/perf/DateFmtPerf/DateFmtPerf.h b/icu4c/source/test/perf/DateFmtPerf/DateFmtPerf.h index d41dcc55e03..37456d5eee0 100644 --- a/icu4c/source/test/perf/DateFmtPerf/DateFmtPerf.h +++ b/icu4c/source/test/perf/DateFmtPerf/DateFmtPerf.h @@ -61,7 +61,7 @@ public: BreakItFunction(){num = -1;} BreakItFunction(int a, bool b){num = a; wordIteration = b;} - virtual void call(UErrorCode * status) + void call(UErrorCode* status) override { BreakIterator* boundary; @@ -102,7 +102,7 @@ public: } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { if(wordIteration) return 125*num; else return 355*num; @@ -161,7 +161,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* status) + void call(UErrorCode* status) override { UErrorCode status2 = U_ZERO_ERROR; @@ -208,7 +208,7 @@ public: //u_cleanup(); } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return NUM_DATES * num; } @@ -250,7 +250,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { Locale loc(locale); @@ -263,7 +263,7 @@ public: } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -289,7 +289,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { Locale loc(locale); UErrorCode status2 = U_ZERO_ERROR; @@ -302,7 +302,7 @@ public: delete fmt; } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -336,7 +336,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { UErrorCode status2 = U_ZERO_ERROR; Calendar *cal; @@ -357,7 +357,7 @@ public: delete cal; } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -391,7 +391,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { Locale loc(locale); UnicodeString tzname("UTC"); @@ -401,7 +401,7 @@ public: } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -435,7 +435,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { UErrorCode status2 = U_ZERO_ERROR; Locale loc(locale); @@ -446,7 +446,7 @@ public: } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -480,7 +480,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { UErrorCode status2 = U_ZERO_ERROR; Locale loc(locale); @@ -493,7 +493,7 @@ public: delete gen; } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -527,7 +527,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* /* status */) + void call(UErrorCode* /*status*/) override { UErrorCode status2 = U_ZERO_ERROR; Locale loc(locale); @@ -541,7 +541,7 @@ public: delete gen; } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -575,7 +575,7 @@ public: strcpy(locale, loc); } - virtual void call(UErrorCode* status2) + void call(UErrorCode* status2) override { Locale loc(locale); UErrorCode status = U_ZERO_ERROR; @@ -657,7 +657,7 @@ public: } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -704,7 +704,7 @@ class StdioNumFmtFunction : public UPerfFunction strcpy(locale, loc); } - virtual void call(UErrorCode* status2) + void call(UErrorCode* status2) override { Locale loc(locale); UErrorCode status = U_ZERO_ERROR; @@ -737,7 +737,7 @@ class StdioNumFmtFunction : public UPerfFunction } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -783,7 +783,7 @@ public: init(); } - virtual void call(UErrorCode* status2) + void call(UErrorCode* status2) override { uint32_t listSize = UPRV_LENGTHOF(collation_strings_escaped); UErrorCode status = U_ZERO_ERROR; @@ -803,7 +803,7 @@ public: delete coll; } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return num; } @@ -817,7 +817,7 @@ public: DateFormatPerfTest(int32_t argc, const char* argv[], UErrorCode& status); ~DateFormatPerfTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec,const char* &name, char* par); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par) override; UPerfFunction* DateFmt250(); UPerfFunction* DateFmt10000(); diff --git a/icu4c/source/test/perf/charperf/charperf.h b/icu4c/source/test/perf/charperf/charperf.h index d9d652a7a09..b0654dae126 100644 --- a/icu4c/source/test/perf/charperf/charperf.h +++ b/icu4c/source/test/perf/charperf/charperf.h @@ -26,14 +26,14 @@ typedef void (*StdLibCharPerfFn)(wchar_t ch); class CharPerfFunction : public UPerfFunction { public: - virtual void call(UErrorCode* status) + void call(UErrorCode* status) override { for (UChar32 i = MIN_; i < MAX_; i ++) { (*m_fn_)(i); } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return MAX_ - MIN_; } @@ -53,7 +53,7 @@ private: class StdLibCharPerfFunction : public UPerfFunction { public: - virtual void call(UErrorCode* status) + void call(UErrorCode* status) override { // note wchar_t is unsigned, it will revert to 0 once it reaches // 65535 @@ -62,7 +62,7 @@ public: } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return MAX_ - MIN_; } @@ -89,9 +89,9 @@ class CharPerformanceTest : public UPerfTest public: CharPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status); ~CharPerformanceTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, - const char *&name, - char *par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, + const char*& name, + char* par = nullptr) override; UPerfFunction* TestIsAlpha(); UPerfFunction* TestIsUpper(); UPerfFunction* TestIsLower(); diff --git a/icu4c/source/test/perf/collperf/collperf.cpp b/icu4c/source/test/perf/collperf/collperf.cpp index cceb58dd967..e9cb217cebb 100644 --- a/icu4c/source/test/perf/collperf/collperf.cpp +++ b/icu4c/source/test/perf/collperf/collperf.cpp @@ -102,9 +102,9 @@ public: CmdKeyGen(UErrorCode, UCollator * col,DWORD win_langid, int32_t count, DataIndex * data,Func fn,int32_t) :col(col),win_langid(win_langid), count(count), data(data), fn(fn){} - virtual long getOperationsPerIteration(){return count;} + long getOperationsPerIteration() override { return count; } - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { for(int32_t i = 0; i< count; i++){ (this->*fn)(i); } @@ -155,9 +155,9 @@ public: ucol_closeElements(iter); } - virtual long getOperationsPerIteration(){return exec_count ? exec_count : 1;} + long getOperationsPerIteration() override { return exec_count ? exec_count : 1; } - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { exec_count = 0; for(int32_t i = 0; i< count; i++){ (this->*fn)(status, i); @@ -215,9 +215,9 @@ public: fn = &CmdIterAll::icu_backward_all; } } - virtual long getOperationsPerIteration(){return exec_count ? exec_count : 1;} + long getOperationsPerIteration() override { return exec_count ? exec_count : 1; } - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { (this->*fn)(status); } @@ -379,18 +379,18 @@ public: return utimer_getDeltaSeconds(&start,&stop); // ms } - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { exec_count = 0; memcpy(base, backup, num * width); qsort(base, num, width, fn); } - virtual double time(int32_t n, UErrorCode* status) { + double time(int32_t n, UErrorCode* status) override { double t1 = time_empty(n,status); double t2 = UPerfFunction::time(n, status); return t2-t1;// < 0 ? t2 : t2-t1; } - virtual long getOperationsPerIteration(){ return exec_count?exec_count:1;} + long getOperationsPerIteration() override { return exec_count ? exec_count : 1; } }; int32_t CmdQsort::exec_count; @@ -411,13 +411,13 @@ public: :col(col),win_langid(win_langid), count(count), rnd(rnd), ord(ord), fn(fn),exec_count(0){} - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { exec_count = 0; for(int32_t i = 0; i< count; i++){ // search all data binary_search(i); } } - virtual long getOperationsPerIteration(){ return exec_count?exec_count:1;} + long getOperationsPerIteration() override { return exec_count ? exec_count : 1; } void binary_search(int32_t random) { int low = 0; @@ -684,7 +684,7 @@ public: temp++\ - virtual UPerfFunction* runIndexedTest( /*[in]*/int32_t index, /*[in]*/UBool exec, /*[out]*/const char* &name, /*[in]*/ char* par = nullptr ){ + UPerfFunction* runIndexedTest(/*[in]*/int32_t index, /*[in]*/UBool exec, /*[out]*/const char*& name, /*[in]*/char* par = nullptr) override { int temp = 0; #define TEST_KEYGEN(testname, func)\ diff --git a/icu4c/source/test/perf/collperf2/collperf2.cpp b/icu4c/source/test/perf/collperf2/collperf2.cpp index e0a367189f8..9f9d95a4892 100644 --- a/icu4c/source/test/perf/collperf2/collperf2.cpp +++ b/icu4c/source/test/perf/collperf2/collperf2.cpp @@ -60,8 +60,8 @@ class Strcoll : public UPerfFunction public: Strcoll(const UCollator* coll, const CA_uchar* source, UBool useLen); ~Strcoll(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const UCollator *coll; @@ -120,8 +120,8 @@ class Strcoll_2 : public UPerfFunction public: Strcoll_2(const UCollator* coll, const CA_uchar* source, const CA_uchar* target, UBool useLen); ~Strcoll_2(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const UCollator *coll; @@ -172,8 +172,8 @@ class StrcollUTF8 : public UPerfFunction public: StrcollUTF8(const UCollator* coll, const CA_char* source, UBool useLen); ~StrcollUTF8(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const UCollator *coll; @@ -232,8 +232,8 @@ class StrcollUTF8_2 : public UPerfFunction public: StrcollUTF8_2(const UCollator* coll, const CA_char* source, const CA_char* target, UBool useLen); ~StrcollUTF8_2(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const UCollator *coll; @@ -283,8 +283,8 @@ class GetSortKey : public UPerfFunction public: GetSortKey(const UCollator* coll, const CA_uchar* source, UBool useLen); ~GetSortKey(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const UCollator *coll; @@ -337,9 +337,9 @@ class NextSortKeyPart : public UPerfFunction public: NextSortKeyPart(const UCollator* coll, const CA_uchar* source, int32_t bufSize, int32_t maxIteration = -1); ~NextSortKeyPart(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); - virtual long getEventsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; + long getEventsPerIteration() override; private: const UCollator *coll; @@ -404,9 +404,9 @@ class NextSortKeyPartUTF8 : public UPerfFunction public: NextSortKeyPartUTF8(const UCollator* coll, const CA_char* source, int32_t bufSize, int32_t maxIteration = -1); ~NextSortKeyPartUTF8(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); - virtual long getEventsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; + long getEventsPerIteration() override; private: const UCollator *coll; @@ -472,8 +472,8 @@ class CppCompare : public UPerfFunction public: CppCompare(const Collator* coll, const CA_uchar* source, UBool useLen); ~CppCompare(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const Collator *coll; @@ -531,8 +531,8 @@ class CppCompare_2 : public UPerfFunction public: CppCompare_2(const Collator* coll, const CA_uchar* source, const CA_uchar* target, UBool useLen); ~CppCompare_2(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const Collator *coll; @@ -582,8 +582,8 @@ class CppCompareUTF8 : public UPerfFunction public: CppCompareUTF8(const Collator* coll, const CA_char* source, UBool useLen); ~CppCompareUTF8(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const Collator *coll; @@ -652,8 +652,8 @@ class CppCompareUTF8_2 : public UPerfFunction public: CppCompareUTF8_2(const Collator* coll, const CA_char* source, const CA_char* target, UBool useLen); ~CppCompareUTF8_2(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const Collator *coll; @@ -709,8 +709,8 @@ class CppGetCollationKey : public UPerfFunction public: CppGetCollationKey(const Collator* coll, const CA_uchar* source, UBool useLen); ~CppGetCollationKey(); - virtual void call(UErrorCode* status); - virtual long getOperationsPerIteration(); + void call(UErrorCode* status) override; + long getOperationsPerIteration() override; private: const Collator *coll; @@ -772,7 +772,7 @@ public: : coll(coll), ucoll(ucoll), ops(0) {} virtual ~CollPerfFunction(); /** Calls call() to set the ops field, and returns that. */ - virtual long getOperationsPerIteration(); + long getOperationsPerIteration() override; protected: const Collator& coll; @@ -820,7 +820,7 @@ public: : UniStrCollPerfFunction(coll, ucoll, data16), dest(new UnicodeString*[d16->count]) {} virtual ~UniStrSort(); - virtual void call(UErrorCode* status); + void call(UErrorCode* status) override; private: UnicodeString** dest; // aliases only @@ -910,7 +910,7 @@ public: StringPieceSortCpp(const Collator& coll, const UCollator *ucoll, const CA_char* data8) : StringPieceSort(coll, ucoll, data8) {} virtual ~StringPieceSortCpp(); - virtual void call(UErrorCode* status); + void call(UErrorCode* status) override; }; StringPieceSortCpp::~StringPieceSortCpp() {} @@ -934,7 +934,7 @@ public: StringPieceSortC(const Collator& coll, const UCollator *ucoll, const CA_char* data8) : StringPieceSort(coll, ucoll, data8) {} virtual ~StringPieceSortC(); - virtual void call(UErrorCode* status); + void call(UErrorCode* status) override; }; StringPieceSortC::~StringPieceSortC() {} @@ -958,7 +958,7 @@ public: UniStrBinSearch(const Collator& coll, const UCollator *ucoll, const CA_uchar* data16) : UniStrCollPerfFunction(coll, ucoll, data16) {} virtual ~UniStrBinSearch(); - virtual void call(UErrorCode* status); + void call(UErrorCode* status) override; }; UniStrBinSearch::~UniStrBinSearch() {} @@ -994,7 +994,7 @@ public: StringPieceBinSearchCpp(const Collator& coll, const UCollator *ucoll, const CA_char* data8) : StringPieceBinSearch(coll, ucoll, data8) {} virtual ~StringPieceBinSearchCpp(); - virtual void call(UErrorCode* status); + void call(UErrorCode* status) override; }; StringPieceBinSearchCpp::~StringPieceBinSearchCpp() {} @@ -1021,7 +1021,7 @@ public: StringPieceBinSearchC(const Collator& coll, const UCollator *ucoll, const CA_char* data8) : StringPieceBinSearch(coll, ucoll, data8) {} virtual ~StringPieceBinSearchC(); - virtual void call(UErrorCode* status); + void call(UErrorCode* status) override; }; StringPieceBinSearchC::~StringPieceBinSearchC() {} @@ -1045,8 +1045,8 @@ class CollPerf2Test : public UPerfTest public: CollPerf2Test(int32_t argc, const char *argv[], UErrorCode &status); ~CollPerf2Test(); - virtual UPerfFunction* runIndexedTest( - int32_t index, UBool exec, const char *&name, char *par = nullptr); + UPerfFunction* runIndexedTest( + int32_t index, UBool exec, const char*& name, char* par = nullptr) override; private: UCollator* coll; diff --git a/icu4c/source/test/perf/dicttrieperf/dicttrieperf.cpp b/icu4c/source/test/perf/dicttrieperf/dicttrieperf.cpp index 8fdfa76fc20..a880c79a54c 100644 --- a/icu4c/source/test/perf/dicttrieperf/dicttrieperf.cpp +++ b/icu4c/source/test/perf/dicttrieperf/dicttrieperf.cpp @@ -66,7 +66,7 @@ public: } } - virtual UPerfFunction *runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override; const char *getSourceDir() const { return sourceDir; } @@ -99,7 +99,7 @@ public: // virtual void call(UErrorCode* pErrorCode) { ... } - virtual long getOperationsPerIteration() { + long getOperationsPerIteration() override { return pkg.getItemCount(); } @@ -159,7 +159,7 @@ public: delete[] toc; } - virtual void call(UErrorCode * /*pErrorCode*/) { + void call(UErrorCode* /*pErrorCode*/) override { int32_t count=pkg.getItemCount(); const char *itemNameChars=itemNames.data(); const char *name=itemNameChars; @@ -249,7 +249,7 @@ public: PrefixBinarySearchPackageLookup(const DictionaryTriePerfTest &perf) : BinarySearchPackageLookup(perf) {} - virtual void call(UErrorCode * /*pErrorCode*/) { + void call(UErrorCode* /*pErrorCode*/) override { int32_t count=pkg.getItemCount(); const char *itemNameChars=itemNames.data(); const char *name=itemNameChars; @@ -306,7 +306,7 @@ public: delete builder; } - virtual void call(UErrorCode *pErrorCode) { + void call(UErrorCode* pErrorCode) override { int32_t count=pkg.getItemCount(); const char *nameTrieBytes=builder->buildStringPiece(USTRINGTRIE_BUILD_SMALL, *pErrorCode).data(); const char *name=itemNames.data(); @@ -331,7 +331,7 @@ class DictLookup : public UPerfFunction { public: DictLookup(const DictionaryTriePerfTest &perfTest) : perf(perfTest) {} - virtual long getOperationsPerIteration() { + long getOperationsPerIteration() override { return perf.numTextLines; } @@ -439,7 +439,7 @@ public: UCharsTrieDictMatches(const DictionaryTriePerfTest &perfTest) : UCharsTrieDictLookup(perfTest) {} - virtual void call(UErrorCode *pErrorCode) { + void call(UErrorCode* pErrorCode) override { UText text=UTEXT_INITIALIZER; int32_t lengths[20]; const ULine *lines=perf.getCachedLines(); @@ -465,7 +465,7 @@ public: UCharsTrieDictContains(const DictionaryTriePerfTest &perfTest) : UCharsTrieDictLookup(perfTest) {} - virtual void call(UErrorCode * /*pErrorCode*/) { + void call(UErrorCode* /*pErrorCode*/) override { const ULine *lines=perf.getCachedLines(); int32_t numLines=perf.getNumLines(); for(int32_t i=0; i testCases; }; @@ -51,8 +51,8 @@ public: ~LocaleCanonicalizationPerfTest() { } - virtual UPerfFunction* runIndexedTest( - int32_t index, UBool exec, const char *&name, char *par = nullptr); + UPerfFunction* runIndexedTest( + int32_t index, UBool exec, const char*& name, char* par = nullptr) override; private: UPerfFunction* TestLocaleCreateCanonical() diff --git a/icu4c/source/test/perf/normperf/dtfmtrtperf.h b/icu4c/source/test/perf/normperf/dtfmtrtperf.h index 08a0af6317b..00e2f8362a0 100644 --- a/icu4c/source/test/perf/normperf/dtfmtrtperf.h +++ b/icu4c/source/test/perf/normperf/dtfmtrtperf.h @@ -66,7 +66,7 @@ public: nLocales = locs; } - virtual void call(UErrorCode* status) + void call(UErrorCode* status) override { *status = U_ZERO_ERROR; @@ -207,7 +207,7 @@ public: } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { return NUM_PATTERNS * nLocales * 6; } @@ -222,7 +222,7 @@ public: DateTimeRoundTripPerfTest(int32_t argc, const char* argv[], UErrorCode& status); ~DateTimeRoundTripPerfTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec,const char* &name, char* par); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par) override; UPerfFunction* RoundTripLocale1(); UPerfFunction* RoundTripLocale10(); diff --git a/icu4c/source/test/perf/normperf/normperf.h b/icu4c/source/test/perf/normperf/normperf.h index 1ba042cbc8a..45f1a9abaed 100644 --- a/icu4c/source/test/perf/normperf/normperf.h +++ b/icu4c/source/test/perf/normperf/normperf.h @@ -46,7 +46,7 @@ private: int32_t options; public: - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { if(line_mode){ if(uselen){ for(int32_t i = 0; i< numLines; i++){ @@ -67,7 +67,7 @@ public: } } - virtual long getOperationsPerIteration(){ + long getOperationsPerIteration() override { if(line_mode){ int32_t totalChars=0; for(int32_t i =0; i< numLines; i++){ @@ -117,7 +117,7 @@ private: int32_t options; public: - virtual void call(UErrorCode* status){ + void call(UErrorCode* status) override { if(line_mode){ if(uselen){ for(int32_t i = 0; i< numLines; i++){ @@ -136,7 +136,7 @@ public: } } } - virtual long getOperationsPerIteration(){ + long getOperationsPerIteration() override { if(line_mode){ int32_t totalChars=0; for(int32_t i =0; i< numLines; i++){ @@ -197,7 +197,7 @@ public: NormalizerPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status); ~NormalizerPerformanceTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec,const char* &name, char* par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override; /* NFC performance */ UPerfFunction* TestICU_NFC_NFD_Text(); UPerfFunction* TestICU_NFC_NFC_Text(); diff --git a/icu4c/source/test/perf/normperf/simplenormperf.cpp b/icu4c/source/test/perf/normperf/simplenormperf.cpp index 8b2fbd48ce2..adff8eb1666 100644 --- a/icu4c/source/test/perf/normperf/simplenormperf.cpp +++ b/icu4c/source/test/perf/normperf/simplenormperf.cpp @@ -236,7 +236,7 @@ public: NormalizeUTF16(const Normalizer2 &n2, const UnicodeString &text) : norm2(n2), src(text), s(src.getBuffer()) {} virtual ~NormalizeUTF16(); - virtual double call(int32_t iterations, int32_t pieceLength); + double call(int32_t iterations, int32_t pieceLength) override; private: const Normalizer2 &norm2; @@ -269,7 +269,7 @@ public: s = src.data(); } virtual ~NormalizeUTF8(); - virtual double call(int32_t iterations, int32_t pieceLength); + double call(int32_t iterations, int32_t pieceLength) override; private: const Normalizer2 &norm2; diff --git a/icu4c/source/test/perf/strsrchperf/strsrchperf.h b/icu4c/source/test/perf/strsrchperf/strsrchperf.h index 3344c7cc012..008c7f4b6a2 100644 --- a/icu4c/source/test/perf/strsrchperf/strsrchperf.h +++ b/icu4c/source/test/perf/strsrchperf/strsrchperf.h @@ -28,11 +28,11 @@ private: UStringSearch* srch; public: - virtual void call(UErrorCode* status) { + void call(UErrorCode* status) override { (*fn)(srch, src, srcLen, pttrn, pttrnLen, status); } - virtual long getOperationsPerIteration() { + long getOperationsPerIteration() override { return (long) srcLen; } @@ -57,7 +57,7 @@ private: public: StringSearchPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status); ~StringSearchPerformanceTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char *&name, char *par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override; UPerfFunction* Test_ICU_Forward_Search(); UPerfFunction* Test_ICU_Backward_Search(); }; diff --git a/icu4c/source/test/perf/ubrkperf/ubrkperf.h b/icu4c/source/test/perf/ubrkperf/ubrkperf.h index 341f4cd285c..999769546d2 100644 --- a/icu4c/source/test/perf/ubrkperf/ubrkperf.h +++ b/icu4c/source/test/perf/ubrkperf/ubrkperf.h @@ -52,9 +52,9 @@ public: } ~ICUBreakFunction() { delete m_brkIt_; } - virtual void call(UErrorCode *status) = 0; - virtual long getOperationsPerIteration() { return m_fileLen_; } - virtual long getEventsPerIteration() { return m_noBreaks_; } + void call(UErrorCode* status) override = 0; + long getOperationsPerIteration() override { return m_fileLen_; } + long getEventsPerIteration() override { return m_noBreaks_; } virtual UErrorCode getStatus() { return m_status_; } }; @@ -73,7 +73,7 @@ public: } } } - virtual void call(UErrorCode *status) + void call(UErrorCode* status) override { m_noBreaks_ = 0; int32_t j = 0; @@ -97,7 +97,7 @@ public: m_noBreaks_++; } } - virtual void call(UErrorCode *status) + void call(UErrorCode* status) override { m_noBreaks_ = 0; m_brkIt_->first(); @@ -109,7 +109,7 @@ public: class DarwinBreakFunction : public UPerfFunction { public: - virtual void call(UErrorCode *status) {}; + void call(UErrorCode* status) override {}; }; class BreakIteratorPerformanceTest : public UPerfTest { @@ -122,8 +122,8 @@ public: BreakIteratorPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status); ~BreakIteratorPerformanceTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, - const char* &name, char* par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, + const char*& name, char* par = nullptr) override; UPerfFunction* TestICUForward(); UPerfFunction* TestICUIsBound(); diff --git a/icu4c/source/test/perf/unisetperf/draft/bitset.cpp b/icu4c/source/test/perf/unisetperf/draft/bitset.cpp index 12c824ce841..49a3fd72745 100644 --- a/icu4c/source/test/perf/unisetperf/draft/bitset.cpp +++ b/icu4c/source/test/perf/unisetperf/draft/bitset.cpp @@ -188,7 +188,7 @@ public: delete restSet; } - UBool contains(UChar32 c) const { + UBool contains(UChar32 c) const override { if((uint32_t)c<=0xff) { return (UBool)((latin1Set[c>>5]&((uint32_t)1<<(c&0x1f)))!=0); } else if((uint32_t)c<0xffff) { diff --git a/icu4c/source/test/perf/unisetperf/draft/trieset.cpp b/icu4c/source/test/perf/unisetperf/draft/trieset.cpp index e05458cc46a..4e875136840 100644 --- a/icu4c/source/test/perf/unisetperf/draft/trieset.cpp +++ b/icu4c/source/test/perf/unisetperf/draft/trieset.cpp @@ -106,7 +106,7 @@ public: delete restSet; } - UBool contains(UChar32 c) const { + UBool contains(UChar32 c) const override { if((uint32_t)c<=0xff) { return (UBool)latin1[c]; } else if((uint32_t)c<0xffff) { diff --git a/icu4c/source/test/perf/unisetperf/unisetperf.cpp b/icu4c/source/test/perf/unisetperf/unisetperf.cpp index 9310a06950f..99232e41e02 100644 --- a/icu4c/source/test/perf/unisetperf/unisetperf.cpp +++ b/icu4c/source/test/perf/unisetperf/unisetperf.cpp @@ -89,7 +89,7 @@ public: } } - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override; // Count spans of characters that are in the set, // and spans of characters that are not in the set. @@ -142,13 +142,13 @@ public: // virtual void call(UErrorCode* pErrorCode) { ... } - virtual long getOperationsPerIteration() { + long getOperationsPerIteration() override { // Number of code points tested: // Input code points, plus one for the end of each span except the last span. return testcase.countInputCodePoints+testcase.spanCount-1; } - virtual long getEventsPerIteration() { + long getEventsPerIteration() override { return testcase.spanCount; } @@ -175,7 +175,7 @@ public: static UPerfFunction* get(const UnicodeSetPerformanceTest &testcase) { return new Contains(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { const UnicodeSet &set=testcase.set; const char16_t *s=testcase.getBuffer(); int32_t length=testcase.getBufferLen(); @@ -237,7 +237,7 @@ public: static UPerfFunction* get(const UnicodeSetPerformanceTest &testcase) { return new SpanUTF16(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { const UnicodeSet &set=testcase.set; const char16_t *s=testcase.getBuffer(); int32_t length=testcase.getBufferLen(); @@ -288,7 +288,7 @@ public: static UPerfFunction* get(const UnicodeSetPerformanceTest &testcase) { return new SpanBackUTF16(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { const UnicodeSet &set=testcase.set; const char16_t *s=testcase.getBuffer(); int32_t length=testcase.getBufferLen(); @@ -338,7 +338,7 @@ public: static UPerfFunction* get(const UnicodeSetPerformanceTest &testcase) { return new SpanUTF8(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { const UnicodeSet &set=testcase.set; const char *s=testcase.utf8; int32_t length=testcase.utf8Length; @@ -384,7 +384,7 @@ public: static UPerfFunction* get(const UnicodeSetPerformanceTest &testcase) { return new SpanBackUTF8(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { const UnicodeSet &set=testcase.set; const char *s=testcase.utf8; int32_t length=testcase.utf8Length; diff --git a/icu4c/source/test/perf/usetperf/usetperf.cpp b/icu4c/source/test/perf/usetperf/usetperf.cpp index 6bceab9e006..a2227b77d8d 100644 --- a/icu4c/source/test/perf/usetperf/usetperf.cpp +++ b/icu4c/source/test/perf/usetperf/usetperf.cpp @@ -36,10 +36,10 @@ private: public: CmdPattern(const char * pattern):pat(pattern,""){ } - virtual long getOperationsPerIteration(){ + long getOperationsPerIteration() override { return 1; } - virtual void call(UErrorCode* pErrorCode){ + void call(UErrorCode* pErrorCode) override { set.applyPattern(pat, *pErrorCode); } }; @@ -61,11 +61,11 @@ public: } } } - virtual long getOperationsPerIteration(){ + long getOperationsPerIteration() override { return total; } - virtual void call(UErrorCode* pErrorCode){ + void call(UErrorCode* pErrorCode) override { (this->*op)(); } void add(){ @@ -101,7 +101,7 @@ public: UsetPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status) :UPerfTest(argc,argv,status){ } - virtual UPerfFunction* runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = nullptr ){ + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override { switch (index) { case 0: name = "titlecase_letter_add"; if (exec) return new CmdOp(U_TITLECASE_LETTER, &CmdOp::add) ; break; diff --git a/icu4c/source/test/perf/ustrperf/stringperf.h b/icu4c/source/test/perf/ustrperf/stringperf.h index b846ddf128c..d1d6c3b9661 100644 --- a/icu4c/source/test/perf/ustrperf/stringperf.h +++ b/icu4c/source/test/perf/ustrperf/stringperf.h @@ -68,7 +68,7 @@ class StringPerfFunction : public UPerfFunction { public: - virtual long getEventsPerIteration(){ + long getEventsPerIteration() override { int loops = LOOPS; delete catICU; delete catStd; @@ -90,7 +90,7 @@ public: return -1; } - virtual void call(UErrorCode* status) + void call(UErrorCode* status) override { if(line_mode_==true){ if(uselen_){ @@ -127,7 +127,7 @@ public: } } - virtual long getOperationsPerIteration() + long getOperationsPerIteration() override { if(line_mode_==true){ return numLines_; @@ -350,9 +350,9 @@ class StringPerformanceTest : public UPerfTest public: StringPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status); ~StringPerformanceTest(); - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, - const char *&name, - char *par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, + const char*& name, + char* par = nullptr) override; UPerfFunction* TestCtor(); UPerfFunction* TestCtor1(); UPerfFunction* TestCtor2(); diff --git a/icu4c/source/test/perf/utfperf/utfperf.cpp b/icu4c/source/test/perf/utfperf/utfperf.cpp index 706f2c9655a..4ad218cccc4 100644 --- a/icu4c/source/test/perf/utfperf/utfperf.cpp +++ b/icu4c/source/test/perf/utfperf/utfperf.cpp @@ -93,7 +93,7 @@ public: } } - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override; const char16_t *getBuffer() const { return buffer; } int32_t getBufferLen() const { return bufferLen; } @@ -139,7 +139,7 @@ public: } } // virtual void call(UErrorCode* pErrorCode) { ... } - virtual long getOperationsPerIteration(){ + long getOperationsPerIteration() override { return countInputCodePoints; } @@ -164,7 +164,7 @@ public: return nullptr; } } - virtual void call(UErrorCode* pErrorCode){ + void call(UErrorCode* pErrorCode) override { const char16_t *pIn, *pInLimit; char16_t *pOut, *pOutLimit; char *pInter, *pInterLimit; @@ -231,7 +231,7 @@ public: return nullptr; } } - virtual void call(UErrorCode* pErrorCode){ + void call(UErrorCode* pErrorCode) override { const char16_t *pIn, *pInLimit; char *pInter, *pInterLimit; @@ -284,7 +284,7 @@ public: ~FromUTF8() { ucnv_close(utf8Cnv); } - virtual void call(UErrorCode* pErrorCode){ + void call(UErrorCode* pErrorCode) override { const char *pIn, *pInLimit; char *pInter, *pInterLimit; char16_t *pivotSource, *pivotTarget, *pivotLimit; diff --git a/icu4c/source/test/perf/utrie2perf/utrie2perf.cpp b/icu4c/source/test/perf/utrie2perf/utrie2perf.cpp index 5cbef68ad12..32ae5301268 100644 --- a/icu4c/source/test/perf/utrie2perf/utrie2perf.cpp +++ b/icu4c/source/test/perf/utrie2perf/utrie2perf.cpp @@ -81,7 +81,7 @@ public: } } - virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = nullptr); + UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char*& name, char* par = nullptr) override; const char16_t *getBuffer() const { return buffer; } int32_t getBufferLen() const { return bufferLen; } @@ -103,7 +103,7 @@ public: // virtual void call(UErrorCode* pErrorCode) { ... } - virtual long getOperationsPerIteration() { + long getOperationsPerIteration() override { // Number of code points tested. return testcase.countInputCodePoints; } @@ -121,7 +121,7 @@ public: static UPerfFunction* get(const UTrie2PerfTest &testcase) { return new CheckFCD(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { UErrorCode errorCode=U_ZERO_ERROR; qcResult=unorm_quickCheck(testcase.getBuffer(), testcase.getBufferLen(), UNORM_FCD, &errorCode); @@ -189,7 +189,7 @@ public: static UPerfFunction* get(const UTrie2PerfTest &testcase) { return new ToNFC(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { UErrorCode errorCode=U_ZERO_ERROR; int32_t destLength=unorm_normalize(testcase.getBuffer(), testcase.getBufferLen(), UNORM_NFC, 0, @@ -213,7 +213,7 @@ public: static UPerfFunction* get(const UTrie2PerfTest &testcase) { return new GetBiDiClass(testcase); } - virtual void call(UErrorCode* pErrorCode) { + void call(UErrorCode* pErrorCode) override { const char16_t *buffer=testcase.getBuffer(); int32_t length=testcase.getBufferLen(); UChar32 c;