From bb52b6fd7e7b7087eea8182f2eddddcc859d6e36 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 4 Apr 2020 20:58:47 +0200 Subject: [PATCH] Correction of methods that were unnecessarily declared as virtual --- doc/benchmark.md | 2 +- examples/rotozoomer.cpp | 2 +- examples/string-operations.cpp | 2 +- examples/transparent.cpp | 2 +- examples/ui.cpp | 2 +- examples/watch.cpp | 4 ++-- src/flistview.cpp | 3 +-- src/include/final/fcolorpalette.h | 4 ++-- src/include/final/fkeyboard.h | 4 ++-- src/include/final/foptiattr.h | 2 +- src/include/final/foptimove.h | 2 +- src/include/final/fstartoptions.h | 4 ++-- src/include/final/fterm.h | 4 ++-- src/include/final/ftermcap.h | 2 +- src/include/final/ftermcapquirks.h | 4 ++-- src/include/final/ftermdetection.h | 2 +- src/include/final/ftermfreebsd.h | 2 +- src/include/final/ftermios.h | 2 +- src/include/final/ftermlinux.h | 2 +- src/include/final/ftermopenbsd.h | 2 +- src/include/final/ftermxterminal.h | 2 +- src/include/final/sgr_optimizer.h | 2 +- 22 files changed, 28 insertions(+), 29 deletions(-) diff --git a/doc/benchmark.md b/doc/benchmark.md index 8eaa7153..71aa23c7 100644 --- a/doc/benchmark.md +++ b/doc/benchmark.md @@ -4,7 +4,7 @@ Benchmark The Rotozoomer example can perform a benchmark run with the parameter "-b" to determine the FINAL CUT character speed in the terminal. -[![rotozoomer-benchmark](https://asciinema.org/a/smuTNcVd7uJ9InchzXmGhDtIX.svg)](https://asciinema.org/a/smuTNcVd7uJ9InchzXmGhDtIX) +[![rotozoomer-benchmark](https://asciinema.org/a/316531.svg)](https://asciinema.org/a/316531) Speed tests diff --git a/examples/rotozoomer.cpp b/examples/rotozoomer.cpp index 276a17d4..1cbda478 100644 --- a/examples/rotozoomer.cpp +++ b/examples/rotozoomer.cpp @@ -211,7 +211,7 @@ inline finalcut::FString RotoZoomer::getReport() void RotoZoomer::onShow (finalcut::FShowEvent*) { if ( ! benchmark ) - addTimer(33); + addTimer(33); // Starts the timer every 33 milliseconds else { for (path = 1; path < loops; path++) diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp index 04521419..b17119fd 100644 --- a/examples/string-operations.cpp +++ b/examples/string-operations.cpp @@ -623,7 +623,7 @@ void indexExample() { // Test: get character access at a specified index position finalcut::FString index{5}; // string with five characters - index = "index"; + index.setString("index"); try { diff --git a/examples/transparent.cpp b/examples/transparent.cpp index ab40bca5..84addcf5 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -250,7 +250,7 @@ void MainWindow::onClose (finalcut::FCloseEvent* ev) //---------------------------------------------------------------------- void MainWindow::onShow (finalcut::FShowEvent*) { - addTimer(100); + addTimer(100); // Call onTimer() every 100 ms } //---------------------------------------------------------------------- diff --git a/examples/ui.cpp b/examples/ui.cpp index dcc1ce3d..1a15cffc 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -128,7 +128,7 @@ ProgressDialog::~ProgressDialog() // destructor //---------------------------------------------------------------------- void ProgressDialog::onShow (finalcut::FShowEvent*) { - addTimer(15); + addTimer(15); // Starts the timer every 15 ms } //---------------------------------------------------------------------- diff --git a/examples/watch.cpp b/examples/watch.cpp index 914234ab..28f57ac3 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -156,11 +156,11 @@ void Watch::cb_clock (finalcut::FWidget*, FDataPtr) if ( clock_sw.isChecked() ) { printTime(); - addTimer(1000); + addTimer(1000); // Call onTimer() every second (1000 ms) } else { - delAllTimer(); + delAllTimer(); // Delete all timers and stop updating the time time_str = "--:--:--"; time_str.redraw(); } diff --git a/src/flistview.cpp b/src/flistview.cpp index 4688adca..e3500a00 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -2738,12 +2738,11 @@ void FListView::stepBackward (int distance) //---------------------------------------------------------------------- void FListView::scrollToX (int x) { - const int xoffset_end = int(max_line_width) - int(getClientWidth()); - if ( xoffset == x ) return; xoffset = x; + const int xoffset_end = int(max_line_width) - int(getClientWidth()); if ( xoffset > xoffset_end ) xoffset = xoffset_end; diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index d6c6fc15..79700b71 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -51,13 +51,13 @@ class FColorPalette final FColorPalette() = default; // Destructor - virtual ~FColorPalette(); + ~FColorPalette(); // Typedefs typedef void (*funcp)(FColor, int, int, int); // Accessor - virtual const FString getClassName() const; + const FString getClassName() const; // Methods static void set8ColorPalette (funcp); diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 4405af2c..6deda4f2 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -93,13 +93,13 @@ class FKeyboard final FKeyboard (const FKeyboard&) = delete; // Destructor - virtual ~FKeyboard(); + ~FKeyboard(); // Disable assignment operator (=) FKeyboard& operator = (const FKeyboard&) = delete; // Accessors - virtual const FString getClassName() const; + const FString getClassName() const; FKey getKey(); const FString getKeyName (const FKey); keybuffer& getKeyBuffer(); diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 9549a103..980025ca 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -121,7 +121,7 @@ class FOptiAttr final FOptiAttr (const FOptiAttr&) = delete; // Destructor - virtual ~FOptiAttr(); + ~FOptiAttr(); // Disable assignment operator (=) FOptiAttr& operator = (const FOptiAttr&) = delete; diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index 7cd63c1f..453f2063 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -106,7 +106,7 @@ class FOptiMove final explicit FOptiMove (int = 0); // Destructor - virtual ~FOptiMove(); + ~FOptiMove(); // Accessors const FString getClassName() const; diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index 6647c75c..21277f6a 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -58,13 +58,13 @@ class FStartOptions final FStartOptions (const FStartOptions&) = delete; // Destructor - virtual ~FStartOptions(); + ~FStartOptions(); // Disable assignment operator (=) FStartOptions& operator = (const FStartOptions&) = delete; // Accessors - virtual const FString getClassName(); + const FString getClassName(); static FStartOptions& getFStartOptions(); // Mutator diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index a3004e8c..7e685725 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -167,13 +167,13 @@ class FTerm final FTerm (const FTerm&) = delete; // Destructor - virtual ~FTerm(); + ~FTerm(); // Disable assignment operator (=) FTerm& operator = (const FTerm&) = delete; // Accessors - virtual const FString getClassName() const; + const FString getClassName() const; static std::size_t getLineNumber(); static std::size_t getColumnNumber(); static const FString getKeyName (FKey); diff --git a/src/include/final/ftermcap.h b/src/include/final/ftermcap.h index 94f60e7e..bef2567b 100644 --- a/src/include/final/ftermcap.h +++ b/src/include/final/ftermcap.h @@ -87,7 +87,7 @@ class FTermcap final FTermcap() = default; // Destructor - virtual ~FTermcap() = default; + ~FTermcap() = default; // Accessors const FString getClassName() const; diff --git a/src/include/final/ftermcapquirks.h b/src/include/final/ftermcapquirks.h index e16d55e5..35b6ad23 100644 --- a/src/include/final/ftermcapquirks.h +++ b/src/include/final/ftermcapquirks.h @@ -53,10 +53,10 @@ class FTermcapQuirks final FTermcapQuirks(); // Destructor - virtual ~FTermcapQuirks(); + ~FTermcapQuirks(); // Accessor - virtual const FString getClassName() const; + const FString getClassName() const; // Methods static void terminalFixup(); diff --git a/src/include/final/ftermdetection.h b/src/include/final/ftermdetection.h index 42f82e55..a5326b98 100644 --- a/src/include/final/ftermdetection.h +++ b/src/include/final/ftermdetection.h @@ -82,7 +82,7 @@ class FTermDetection final FTermDetection(); // Destructor - virtual ~FTermDetection(); + ~FTermDetection(); // Accessor const FString getClassName() const; diff --git a/src/include/final/ftermfreebsd.h b/src/include/final/ftermfreebsd.h index 9f8857c7..06bb3020 100644 --- a/src/include/final/ftermfreebsd.h +++ b/src/include/final/ftermfreebsd.h @@ -89,7 +89,7 @@ class FTermFreeBSD final FTermFreeBSD (const FTermFreeBSD&) = delete; // Destructor - virtual ~FTermFreeBSD() = default; + ~FTermFreeBSD() = default; // Disable assignment operator (=) FTermFreeBSD& operator = (const FTermFreeBSD&) = delete; diff --git a/src/include/final/ftermios.h b/src/include/final/ftermios.h index cb7c8dc4..e90c12da 100644 --- a/src/include/final/ftermios.h +++ b/src/include/final/ftermios.h @@ -55,7 +55,7 @@ class FTermios final FTermios(); // Destructor - virtual ~FTermios(); + ~FTermios(); // Accessors const FString getClassName() const; diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h index 8b2e6c22..33c24287 100644 --- a/src/include/final/ftermlinux.h +++ b/src/include/final/ftermlinux.h @@ -87,7 +87,7 @@ class FTermLinux final FTermLinux (const FTermLinux&) = delete; // Destructor - virtual ~FTermLinux(); + ~FTermLinux(); // Disable assignment operator (=) FTermLinux& operator = (const FTermLinux&) = delete; diff --git a/src/include/final/ftermopenbsd.h b/src/include/final/ftermopenbsd.h index 196f3a14..331699a2 100644 --- a/src/include/final/ftermopenbsd.h +++ b/src/include/final/ftermopenbsd.h @@ -81,7 +81,7 @@ class FTermOpenBSD final FTermOpenBSD (const FTermOpenBSD&) = delete; // Destructor - virtual ~FTermOpenBSD(); + ~FTermOpenBSD(); // Disable assignment operator (=) FTermOpenBSD& operator = (const FTermOpenBSD&) = delete; diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index 9f902d45..196b10d4 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -57,7 +57,7 @@ class FTermXTerminal final FTermXTerminal (const FTermXTerminal&) = delete; // Destructor - virtual ~FTermXTerminal(); + ~FTermXTerminal(); // Disable assignment operator (=) FTermXTerminal& operator = (const FTermXTerminal&) = delete; diff --git a/src/include/final/sgr_optimizer.h b/src/include/final/sgr_optimizer.h index a7508711..e6e48f54 100644 --- a/src/include/final/sgr_optimizer.h +++ b/src/include/final/sgr_optimizer.h @@ -57,7 +57,7 @@ class SGRoptimizer final explicit SGRoptimizer (attributebuffer&); // Destructor - virtual ~SGRoptimizer(); + ~SGRoptimizer(); // Disable copy constructor SGRoptimizer (const SGRoptimizer&) = delete;