From 30883e6487840a6e01e90bf94b02d1fa37149983 Mon Sep 17 00:00:00 2001 From: Patrick Brosi Date: Sun, 22 Jul 2018 18:37:03 +0200 Subject: [PATCH] fix some compiler warnings --- CMakeLists.txt | 8 +++----- src/cppgtfs | 2 +- src/pfaedle/CMakeLists.txt | 2 +- src/util/geo/Box.h | 2 +- src/util/geo/Geo.h | 28 +++++++++++++++++----------- src/util/geo/Grid.h | 2 +- src/util/geo/Grid.tpp | 38 +++++++++++++++++++------------------- 7 files changed, 43 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30be1e8..7b271bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if(OPENMP_FOUND) endif() # set compiler flags, see http://stackoverflow.com/questions/7724569/debug-vs-release-in-cmake -set(CMAKE_CXX_FLAGS "-fopenmp -Ofast -fno-signed-zeros -fno-trapping-math -frename-registers -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2 -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ -I/usr/lib/gcc/x86_64-linux-gnu/5/include/") +set(CMAKE_CXX_FLAGS "-fopenmp -Ofast -fno-signed-zeros -fno-trapping-math -frename-registers -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2") set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -DLOGLEVEL=3") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DLOGLEVEL=2") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DLOGLEVEL=2") @@ -33,12 +33,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if ((GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)) + if ((GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - elseif (GCC_VERSION VERSION_EQUAL 4.6) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else () - message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.6 or greater.") + message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.8 or greater!") endif () elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11") diff --git a/src/cppgtfs b/src/cppgtfs index 8d25597..3a462c3 160000 --- a/src/cppgtfs +++ b/src/cppgtfs @@ -1 +1 @@ -Subproject commit 8d255970a97c31891277f63ba8b39a3ea2b7e133 +Subproject commit 3a462c37358da19f10e89f77fb7a277d69c6c4dc diff --git a/src/pfaedle/CMakeLists.txt b/src/pfaedle/CMakeLists.txt index e75b714..5963842 100644 --- a/src/pfaedle/CMakeLists.txt +++ b/src/pfaedle/CMakeLists.txt @@ -16,5 +16,5 @@ configure_file ( add_executable(pfaedle ${pfaedle_main}) add_library(pfaedle_dep ${pfaedle_SRC}) -target_include_directories(pfaedle_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src) +include_directories(pfaedle_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src) target_link_libraries(pfaedle pfaedle_dep util xml configparser ad_cppgtfs ${Boost_LIBRARIES} -lpthread) diff --git a/src/util/geo/Box.h b/src/util/geo/Box.h index f2e77de..43f05e9 100644 --- a/src/util/geo/Box.h +++ b/src/util/geo/Box.h @@ -29,7 +29,7 @@ class Box { bool operator==(const Box& b) const { return getLowerLeft() == b.getLowerLeft() && - getUpperRight == b.getUpperRight(); + getUpperRight() == b.getUpperRight(); } bool operator!=(const Box& p) const { return !(*this == p); } diff --git a/src/util/geo/Geo.h b/src/util/geo/Geo.h index a020c55..c63e3b1 100644 --- a/src/util/geo/Geo.h +++ b/src/util/geo/Geo.h @@ -96,7 +96,7 @@ inline Point centroid(const Box box) { } // _____________________________________________________________________________ -template typename Geometry> +template class Geometry> inline Point centroid(std::vector> multigeo) { Line a; for (const auto& g : multigeo) a.push_back(centroid(g)); @@ -106,6 +106,7 @@ inline Point centroid(std::vector> multigeo) { // _____________________________________________________________________________ template inline Point rotate(const Point& p, double deg) { + UNUSED(deg); return p; } @@ -153,7 +154,7 @@ inline Polygon rotate(Polygon geo, double deg, const Point& c) { } // _____________________________________________________________________________ -template typename Geometry> +template