Skip to content

Commit

Permalink
Added -Wnon-virtual-dtor and -Wcast-qual warning flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Aug 27, 2014
1 parent 3aa27a2 commit b97bdc0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/util/utf8_iterator.cpp
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/color.hpp
Expand Up @@ -70,7 +70,7 @@ class Color

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
Expand Down

0 comments on commit b97bdc0

Please sign in to comment.