From: Ingo Ruhnke Date: Wed, 27 Aug 2014 19:56:26 +0000 (+0200) Subject: Added -Wnon-virtual-dtor and -Wcast-qual warning flags X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b97bdc0920e0862de6defc2df382a38383db1069;p=supertux.git Added -Wnon-virtual-dtor and -Wcast-qual warning flags --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d3be8e22..3c7f7432a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,7 +272,7 @@ IF(CMAKE_COMPILER_IS_GNUCC) # -Wold-style-cast -Wpadded -Wabi -Winline -Wunsafe-loop-optimizations -Wstrict-overflow=5 # fails on MinGW: # -ansi - SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wstrict-null-sentinel -Wno-unused-parameter -Wshadow") + SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wstrict-null-sentinel -Wno-unused-parameter -Wshadow -Wnon-virtual-dtor -Wcast-qual") ENDIF(WARNINGS) ENDIF(CMAKE_COMPILER_IS_GNUCC) diff --git a/src/util/utf8_iterator.cpp b/src/util/utf8_iterator.cpp index 5bd0923c7..01234d2b7 100644 --- a/src/util/utf8_iterator.cpp +++ b/src/util/utf8_iterator.cpp @@ -94,7 +94,7 @@ UTF8Iterator::UTF8Iterator(const std::string& text_) : try { chr = decode_utf8(text, pos); } catch (std::exception) { - log_debug << "Malformed utf-8 sequence beginning with " << *((uint32_t*)(text.c_str() + pos)) << " found " << std::endl; + log_debug << "Malformed utf-8 sequence beginning with " << *((const uint32_t*)(text.c_str() + pos)) << " found " << std::endl; chr = 0; } } @@ -110,7 +110,7 @@ UTF8Iterator::operator++() { try { chr = decode_utf8(text, pos); } catch (std::exception) { - log_debug << "Malformed utf-8 sequence beginning with " << *((uint32_t*)(text.c_str() + pos)) << " found " << std::endl; + log_debug << "Malformed utf-8 sequence beginning with " << *((const uint32_t*)(text.c_str() + pos)) << " found " << std::endl; chr = 0; ++pos; } diff --git a/src/video/color.hpp b/src/video/color.hpp index 6900d7cf1..9155157cb 100644 --- a/src/video/color.hpp +++ b/src/video/color.hpp @@ -70,7 +70,7 @@ public: float greyscale() const { - return red * 0.30 + green * 0.59 + blue * 0.11; + return red * 0.30f + green * 0.59f + blue * 0.11f; } bool operator < (const Color& other) const