From 1ad61ea11715ade1cc28b271a27c3fc5b0774b70 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 3 May 2019 12:39:03 -0230 Subject: [PATCH] Removed some redundant 'const', and with it re-enabled '-Wignored-qualifiers'. --- Makefile | 10 +++++----- src/common/StellaKeys.hxx | 2 +- src/common/Variant.hxx | 10 +++++----- src/common/ZipHandler.cxx | 2 +- src/common/ZipHandler.hxx | 2 +- src/gui/GameList.hxx | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 318efa343..3b23bceae 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ else CXXFLAGS:= -O2 -x c++ endif -CXXFLAGS+= -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers +CXXFLAGS+= -Wall -Wextra -Wno-unused-parameter ifdef HAVE_GCC CXXFLAGS+= -Wno-multichar -Wunused -fno-rtti -Woverloaded-virtual -Wnon-virtual-dtor -std=c++14 @@ -74,15 +74,15 @@ ifdef PROFILE endif ifdef DEBUG - CXXFLAGS += -g + CXXFLAGS += -g else ifdef HAVE_GCC CXXFLAGS+= -fomit-frame-pointer endif - ifdef HAVE_CLANG - CXXFLAGS+= -fomit-frame-pointer - endif + ifdef HAVE_CLANG + CXXFLAGS+= -fomit-frame-pointer + endif endif ####################################################################### diff --git a/src/common/StellaKeys.hxx b/src/common/StellaKeys.hxx index 7e68347ea..0b0bb79e5 100644 --- a/src/common/StellaKeys.hxx +++ b/src/common/StellaKeys.hxx @@ -439,7 +439,7 @@ namespace StellaModTest namespace StellaKeyName { - inline const char* const forKey(StellaKey key) + inline const char* forKey(StellaKey key) { #ifdef SDL_SUPPORT return SDL_GetScancodeName(SDL_Scancode(key)); diff --git a/src/common/Variant.hxx b/src/common/Variant.hxx index 215d75e1f..8be83e957 100644 --- a/src/common/Variant.hxx +++ b/src/common/Variant.hxx @@ -56,23 +56,23 @@ class Variant // Conversion methods const string& toString() const { return data; } - const char* const toCString() const { return data.c_str(); } - const Int32 toInt() const { + const char* toCString() const { return data.c_str(); } + Int32 toInt() const { istringstream ss(data); Int32 parsed; ss >> parsed; return parsed; } - const float toFloat() const { + float toFloat() const { istringstream ss(data); float parsed; ss >> parsed; return parsed; } - const bool toBool() const { return data == "1" || data == "true"; } - const Common::Size toSize() const { return Common::Size(data); } + bool toBool() const { return data == "1" || data == "true"; } + Common::Size toSize() const { return Common::Size(data); } // Comparison bool operator==(const Variant& v) const { return data == v.data; } diff --git a/src/common/ZipHandler.cxx b/src/common/ZipHandler.cxx index 91ccbcda6..0c6b38781 100644 --- a/src/common/ZipHandler.cxx +++ b/src/common/ZipHandler.cxx @@ -341,7 +341,7 @@ bool ZipHandler::ZipFile::readStream(ByteBuffer& out, uInt64 offset, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const ZipHandler::ZipHeader* const ZipHandler::ZipFile::nextFile() +const ZipHandler::ZipHeader* ZipHandler::ZipFile::nextFile() { // Make sure we have enough data // If we're at or past the end, we're done diff --git a/src/common/ZipHandler.hxx b/src/common/ZipHandler.hxx index 5f3081908..3d878bd3b 100644 --- a/src/common/ZipHandler.hxx +++ b/src/common/ZipHandler.hxx @@ -137,7 +137,7 @@ class ZipHandler bool readStream(ByteBuffer& out, uInt64 offset, uInt64 length, uInt64& actual); /** Return the next entry in the ZIP file */ - const ZipHeader* const nextFile(); + const ZipHeader* nextFile(); /** Decompress the most recently found file in the ZIP into target buffer */ void decompress(ByteBuffer& out, uInt64 length); diff --git a/src/gui/GameList.hxx b/src/gui/GameList.hxx index 46ef67e10..95f21ba49 100644 --- a/src/gui/GameList.hxx +++ b/src/gui/GameList.hxx @@ -37,7 +37,7 @@ class GameList { return i < myArray.size() ? myArray[i]._path : EmptyString; } const string& md5(uInt32 i) const { return i < myArray.size() ? myArray[i]._md5 : EmptyString; } - const bool isDir(uInt32 i) const + bool isDir(uInt32 i) const { return i < myArray.size() ? myArray[i]._isdir: false; } void setMd5(uInt32 i, const string& md5)