Commit 9679d374 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Disable one warning (strict-overflow) which created problems with GCC 8

parent 43212220
......@@ -81,7 +81,7 @@ ENDIF("${IsSystemDir}" STREQUAL "-1")
#########################################
# Set standard build flags
SET(COMPILER_FLAGS -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wconversion -Wuseless-cast -Wctor-dtor-privacy -Wzero-as-null-pointer-constant -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wshadow -Wformat-security -Wdeprecated -fdiagnostics-color=auto -Wheader-hygiene)
SET(COMPILER_FLAGS -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wconversion -Wuseless-cast -Wctor-dtor-privacy -Wzero-as-null-pointer-constant -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wundef -Werror -Wshadow -Wformat-security -Wdeprecated -fdiagnostics-color=auto -Wheader-hygiene)
# Require a C++14 compiler but do allow extensions
SET(CMAKE_CXX_STANDARD 14)
......
......@@ -81,20 +81,25 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
while(addedPixel) {
addedPixel = false;
for(int row = (pixel->row() - 1); row <= (pixel->row() + 1); row++) {
for(int row = pixel->row() - 1; row <= pixel->row() + 1; row++) {
// If out of bounds for row
if(row < 0 || row >= nRows)
if(row < 0 || row >= nRows) {
continue;
for(int col = (pixel->column() - 1); col <= (pixel->column() + 1); col++) {
}
for(int col = pixel->column() - 1; col <= pixel->column() + 1; col++) {
// If out of bounds for column
if(col < 0 || col >= nCols)
if(col < 0 || col >= nCols) {
continue;
}
// If no pixel in this position, or is already in a cluster, do nothing
if(!hitmap[row][col])
if(!hitmap[row][col]) {
continue;
if(used[hitmap[row][col]])
}
if(used[hitmap[row][col]]) {
continue;
}
// Otherwise add the pixel to the cluster and store it as a found
// neighbour
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment