From 48e737818c3407045b862bbe345adfa778901587 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Fri, 11 Aug 2017 10:50:39 +0200 Subject: [PATCH] Some code changes for GCC 7 --- ChangeLog | 4 ++++ src/ffiledialog.cpp | 2 +- src/fpoint.h | 7 +++++++ src/frect.h | 9 +++++++++ src/fvterm.cpp | 4 ++-- test/opti-move.cpp | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28a2b709..8bd4b8ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-08-11 Markus Gans + * Some code changes for GCC 7 + * Implementation of a copy constructor for FPoint and FRect + 2017-08-06 Markus Gans * Fix GNU Screen support for vte/gnome-terminals * Advanced streaming functionality for FTermBuffer diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 0745d901..6b4c1cf4 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -702,7 +702,7 @@ int FFileDialog::changeDir (const FString& dirname) printPath(directory); filename->redraw(); filebrowser->redraw(); - + // fall through default: return 0; } diff --git a/src/fpoint.h b/src/fpoint.h index 54fabc55..28a52fb3 100644 --- a/src/fpoint.h +++ b/src/fpoint.h @@ -23,6 +23,7 @@ class FPoint public: // Constructors FPoint (); + FPoint (const FPoint&); // copy constructor FPoint (int, int); // Destructor @@ -69,6 +70,12 @@ inline FPoint::FPoint() , ypos(0) { } +//---------------------------------------------------------------------- +inline FPoint::FPoint (const FPoint& p) // copy constructor + : xpos(p.xpos) + , ypos(p.ypos) +{ } + //---------------------------------------------------------------------- inline FPoint::FPoint (int x, int y) : xpos(short(x)) diff --git a/src/frect.h b/src/frect.h index 1f6ecc75..d170614d 100644 --- a/src/frect.h +++ b/src/frect.h @@ -27,6 +27,7 @@ class FRect public: // Constructors FRect (); + FRect (const FRect&); // copy constructor FRect (int, int, int, int); FRect (const FPoint&, const FPoint&); @@ -112,6 +113,14 @@ inline FRect::FRect() , Y2(-1) { } +//---------------------------------------------------------------------- +inline FRect::FRect (const FRect& r) // copy constructor + : X1(r.X1) + , Y1(r.Y1) + , X2(r.X2) + , Y2(r.Y2) +{ } + //---------------------------------------------------------------------- inline FRect::FRect (int x, int y, int width, int height) : X1(short(x)) diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 8c486062..84f1baa2 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -441,7 +441,7 @@ int FVTerm::print (term_area* area, const FString& s) { case '\n': area->cursor_y++; - + // fall through case '\r': area->cursor_x = 1; break; @@ -599,7 +599,7 @@ int FVTerm::print (term_area* area, const std::vector& termString) { case '\n': area->cursor_y++; - + // fall through case '\r': area->cursor_x = 1; break; diff --git a/test/opti-move.cpp b/test/opti-move.cpp index 85fd69cc..498c659b 100644 --- a/test/opti-move.cpp +++ b/test/opti-move.cpp @@ -67,7 +67,7 @@ void move (int xold, int yold, int xnew, int ynew) // prints the cursor move escape sequence std::string sequence; char* buffer; - char from[10], to[10], byte[15]; + char from[10], to[10], byte[20]; uInt len; term_boundaries(xold, yold);