From 8f383a4def87c168650ed94c1b24614274e5671a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 19:33:12 +0200 Subject: [PATCH] More function declared as const --- src/foptimove.cpp | 10 +++++----- src/fvterm.cpp | 10 +++++----- src/include/final/fdata.h | 5 ++++- src/include/final/foptimove.h | 10 +++++----- src/include/final/fvterm.h | 10 +++++----- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/foptimove.cpp b/src/foptimove.cpp index e93d5b14..6f815346 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -927,7 +927,7 @@ inline bool FOptiMove::isMethod0Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod1Faster ( int& move_time , int xold, int yold - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 1: local movement @@ -949,7 +949,7 @@ inline bool FOptiMove::isMethod1Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod2Faster ( int& move_time , int yold - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 2: carriage-return + local movement @@ -971,7 +971,7 @@ inline bool FOptiMove::isMethod2Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod3Faster ( int& move_time - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 3: home-cursor + local movement @@ -993,7 +993,7 @@ inline bool FOptiMove::isMethod3Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod4Faster ( int& move_time - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 4: home-down + local movement if ( F_cursor_to_ll.cap ) @@ -1017,7 +1017,7 @@ inline bool FOptiMove::isMethod4Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod5Faster ( int& move_time , int yold - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 5: left margin for wrap to right-hand side if ( automatic_left_margin diff --git a/src/fvterm.cpp b/src/fvterm.cpp index f05bfcd5..0a9db678 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2444,7 +2444,7 @@ void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max //---------------------------------------------------------------------- void FVTerm::printFullWidthCharacter ( uInt& x, uInt y - , FChar*& print_char ) + , FChar*& print_char ) const { const auto vt = vterm; auto next_char = &vt->data[y * uInt(vt->width) + x + 1]; @@ -2483,7 +2483,7 @@ void FVTerm::printFullWidthCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y - , FChar*& print_char) + , FChar*& print_char) const { const auto vt = vterm; auto prev_char = &vt->data[y * uInt(vt->width) + x - 1]; @@ -2528,7 +2528,7 @@ void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y - , FChar*& print_char ) + , FChar*& print_char ) const { const auto vt = vterm; auto prev_char = &vt->data[y * uInt(vt->width) + x - 1]; @@ -2576,7 +2576,7 @@ inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y - , bool draw_trailing_ws ) + , bool draw_trailing_ws ) const { // Erase a number of characters to draw simple whitespaces @@ -2641,7 +2641,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y } //---------------------------------------------------------------------- -FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) +FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const { // Repeat one character n-fold diff --git a/src/include/final/fdata.h b/src/include/final/fdata.h index a59a90d7..c8c0b6da 100644 --- a/src/include/final/fdata.h +++ b/src/include/final/fdata.h @@ -30,10 +30,13 @@ template struct FData { - explicit FData (T v) + explicit FData (T v) // constructor : value{v} { } + ~FData() // destructor + { } + FData (const FData& d) // Copy constructor : value{d.value} { } diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index 7c8914c1..dc02ca5a 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -179,11 +179,11 @@ class FOptiMove final bool isWideMove (int, int, int, int) const; bool isMethod0Faster (int&, int, int); - bool isMethod1Faster (int&, int, int, int, int); - bool isMethod2Faster (int&, int, int, int); - bool isMethod3Faster (int&, int, int); - bool isMethod4Faster (int&, int, int); - bool isMethod5Faster (int&, int, int, int); + bool isMethod1Faster (int&, int, int, int, int) const; + bool isMethod2Faster (int&, int, int, int) const; + bool isMethod3Faster (int&, int, int) const; + bool isMethod4Faster (int&, int, int) const; + bool isMethod5Faster (int&, int, int, int) const; void moveByMethod (int, int, int, int, int); // Data members diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index a146e485..2efeeb62 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -393,12 +393,12 @@ class FVTerm void printRange (uInt, uInt, uInt, bool); void replaceNonPrintableFullwidth (uInt, FChar*&) const; void printCharacter (uInt&, uInt, bool, FChar*&); - void printFullWidthCharacter (uInt&, uInt, FChar*&); - void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&); - void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&); + void printFullWidthCharacter (uInt&, uInt, FChar*&) const; + void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&) const; + void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&) const; void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const; - exit_state eraseCharacters (uInt&, uInt, uInt, bool); - exit_state repeatCharacter (uInt&, uInt, uInt); + exit_state eraseCharacters (uInt&, uInt, uInt, bool) const; + exit_state repeatCharacter (uInt&, uInt, uInt) const; bool isFullWidthChar (const FChar* const&) const; bool isFullWidthPaddingChar (const FChar* const&) const; static void cursorWrap();