From 620ce51f709dafce645131f03f6a12f9214a8509 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Tue, 3 Nov 2015 12:49:03 -0500 Subject: [PATCH] Fixed warnings on Windows --- CMakeLists.txt | 5 ++++- corelib/src/Rtabmap.cpp | 2 +- guilib/src/DatabaseViewer.cpp | 4 ++-- utilite/include/rtabmap/utilite/UStl.h | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76788e01..61d604db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ SET(CMAKE_DEBUG_POSTFIX "d") IF(WIN32 AND NOT MINGW) ADD_DEFINITIONS("-DNOMINMAX") - ADD_DEFINITIONS("-wd4100 -wd4127 -wd4191 -wd4242 -wd4244 -wd4251 -wd4305 -wd4365 -wd4512 -wd4514 -wd4548 -wd4571 -wd4619 -wd4625 -wd4626 -wd4628 -wd4668 -wd4710 -wd4711 -wd4738 -wd4820 -wd4946 -wd4986") + ADD_DEFINITIONS("-wd4100 -wd4127 -wd4150 -wd4191 -wd4242 -wd4244 -wd4251 -wd4305 -wd4365 -wd4512 -wd4514 -wd4548 -wd4571 -wd4619 -wd4625 -wd4626 -wd4628 -wd4668 -wd4710 -wd4711 -wd4738 -wd4820 -wd4946 -wd4986") ELSE () ADD_DEFINITIONS( "-Wall" ) ADD_DEFINITIONS("-Wno-unknown-pragmas") @@ -170,6 +170,9 @@ ENDIF(WITH_FREENECT) IF(WITH_FREENECT2) FIND_PACKAGE(freenect2 QUIET) IF(freenect2_FOUND) + IF(NOT freenect2_INCLUDE_DIRS) + SET(freenect2_INCLUDE_DIRS ${freenect2_INCLUDE_DIR}) + ENDIF(NOT freenect2_INCLUDE_DIRS) MESSAGE(STATUS "Found freenect2: ${freenect2_INCLUDE_DIRS}") ENDIF(freenect2_FOUND) ENDIF(WITH_FREENECT2) diff --git a/corelib/src/Rtabmap.cpp b/corelib/src/Rtabmap.cpp index 9ee13cce..5927185d 100644 --- a/corelib/src/Rtabmap.cpp +++ b/corelib/src/Rtabmap.cpp @@ -1144,7 +1144,7 @@ bool Rtabmap::process( iter!=statistics_.reducedIds().end(); ++iter) { - int erased = _optimizedPoses.erase(iter->first); + int erased = (int)_optimizedPoses.erase(iter->first); if(erased) { for(std::multimap::iterator jter = _constraints.begin(); jter!=_constraints.end();) diff --git a/guilib/src/DatabaseViewer.cpp b/guilib/src/DatabaseViewer.cpp index f8275f23..d5b4b20e 100644 --- a/guilib/src/DatabaseViewer.cpp +++ b/guilib/src/DatabaseViewer.cpp @@ -1102,9 +1102,9 @@ void DatabaseViewer::updateIds() //links bool addPose = false; - for(std::map::iterator jter=links.find(ids_[i]); jter!=links.end() && jter->first == ids_[i]; ++jter) + for(std::multimap::iterator jter=links.find(ids_[i]); jter!=links.end() && jter->first == ids_[i]; ++jter) { - std::map::iterator invertedLinkIter = graph::findLink(links, jter->second.to(), jter->second.from(), false); + std::multimap::iterator invertedLinkIter = graph::findLink(links, jter->second.to(), jter->second.from(), false); if( jter->second.isValid() && // null transform means a rehearsed location ids.find(jter->second.from()) != ids.end() && ids.find(jter->second.to()) != ids.end() && diff --git a/utilite/include/rtabmap/utilite/UStl.h b/utilite/include/rtabmap/utilite/UStl.h index 8a3f076e..fa0f26d9 100644 --- a/utilite/include/rtabmap/utilite/UStl.h +++ b/utilite/include/rtabmap/utilite/UStl.h @@ -614,10 +614,10 @@ inline bool uIsDigit(const char c) */ inline bool uIsInteger(const std::string & str) { - bool isInteger = str.size(); + bool isInteger = str.size()!=0; for(unsigned int i=0; i