From 4d773ca2814b118bdfe3f3a883a8147db6f56a9f Mon Sep 17 00:00:00 2001 From: Mohcine Chraibi <m.chraibi@gmail.com> Date: Fri, 2 May 2014 19:03:33 +0200 Subject: [PATCH] Silenced some warnings. These warning still live in the code. Please fix. EventManager.cpp Line 236 warning Why is a char compared to NULL? SensorManager.h Line 44 warning private field 'building' is not used --- CMakeLists.txt | 30 ++++++++++--------- events/EventManager.cpp | 6 ++-- geometry/Building.cpp | 4 ++- inputfiles/subway/ini_subway.xml | 2 +- routing/NavMesh.cpp | 4 +-- routing/RoutingEngine.cpp | 2 +- routing/SafestPathRouter.h | 8 ++--- .../navigation_graph/GraphEdge.h | 2 +- 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0d6bb1e..8c992294 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,17 +11,23 @@ project(JPScore) set(CMAKE_COLOR_MAKEFILE ON) set(JPSCORE_MAJOR_VERSION 0) -set(JPSCORE_MINOR_VERSION 1) +set(JPSCORE_MINOR_VERSION 5) set(JPSCORE_PATCH_VERSION 0) set(JPSCORE_VERSION ${JPSCORE_MAJOR_VERSION}.${JPSCORE_MINOR_VERSION}.${JPSCORE_PATCH_VERSION}) message( STATUS "JPSCORE_VERSION: " ${JPSCORE_VERSION} ) if(NOT BUILD_TESTING) - set(BUILD_TESTING OFF) + set(BUILD_TESTING OFF) # test units are not generated. endif(NOT BUILD_TESTING) - message( STATUS "BUILD_TESTING: " ${BUILD_TESTING} ) + +if(NOT CMAKE_EXPORT_COMPILE_COMMANDS) +# To generate a compilation database "compilation_commands.json" for clang_check + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +endif(NOT CMAKE_EXPORT_COMPILE_COMMANDS) + +# Get number of processors. Mac is not supported if(NOT DEFINED PROCESSOR_COUNT) # Unknown: set(PROCESSOR_COUNT 0) @@ -55,16 +61,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE}) set(CMAKE_TEST_DIR ${CMAKE_SOURCE_DIR}/Utest) -#include_directories( ${LIBRARY_OUTPUT_PATH} ) -#add_subdirectory(${LIBRARY_OUTPUT_PATH} ) -message( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} ) -message( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} ) -message( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} ) -message( STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY: " ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) -message( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} ) -message( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} ) -#add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) - +# Debug messages +# message( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} ) +# message( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} ) +# message( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} ) +# message( STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY: " ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +# message( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} ) +# message( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} ) # add a target to generate API documentation with Doxygen find_package(Doxygen) @@ -304,7 +307,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_BUILD_TYPE MATCHES Debug) - message(STATUS "In Debug Build") set(CMAKE_CXX_LDFLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") message(STATUS "Debug flags: " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_DEBUG} ) else(CMAKE_BUILD_TYPE MATCHES Debug) diff --git a/events/EventManager.cpp b/events/EventManager.cpp index 8a3e8591..8f6baa89 100644 --- a/events/EventManager.cpp +++ b/events/EventManager.cpp @@ -14,7 +14,7 @@ EventManager::EventManager(Building *_b) _event_ids=vector<int>(); _projectFilename = ""; _building = _b; - _deltaT=NULL; + _deltaT= 0; // NULL; _eventCounter=0; _dynamic=false; _file = fopen("../events/events.txt","r"); @@ -149,7 +149,7 @@ void EventManager::Update_Events(double time, double d) _allPedestrians[p]->ResetRerouting(); } } - int i; + unsigned int i; for(i=0; i<_event_times.size(); i++) { if(fabs(_event_times[i]-time)<0.0000001) { //Event findet statt @@ -209,7 +209,7 @@ void EventManager::changeRouting(int id, string state) //Abstand der aktuellen Position des Pedestrians zur entsprechenden Tuer: Tuer als Linie sehen und mit //DistTo(ped.GetPos()) den Abstand messen Line* l = new Line(t->GetPoint1(),t->GetPoint2()); - for (int p = 0; p < nSize; ++p) { + for (unsigned int p = 0; p < nSize; ++p) { //if(_allPedestrians[p]->GetExitIndex()==t->GetUniqueID()){ double dist = l->DistTo(_allPedestrians[p]->GetPos()); if(dist>0.0&&dist<0.5) { diff --git a/geometry/Building.cpp b/geometry/Building.cpp index 8fd5bf57..c56fed0f 100644 --- a/geometry/Building.cpp +++ b/geometry/Building.cpp @@ -536,7 +536,9 @@ void Building::LoadBuildingFromFile() xTrans = xTrans->NextSiblingElement("transition")) { int id = xmltoi(xTrans->Attribute("id"), -1); - string caption = "door " + id; + // string caption = "door " + id; + string caption = "door "; + caption += to_string(id); caption = xmltoa(xTrans->Attribute("caption"), caption.c_str()); int room1_id = xmltoi(xTrans->Attribute("room1_id"), -1); int room2_id = xmltoi(xTrans->Attribute("room2_id"), -1); diff --git a/inputfiles/subway/ini_subway.xml b/inputfiles/subway/ini_subway.xml index 3f5f01c8..526d0548 100644 --- a/inputfiles/subway/ini_subway.xml +++ b/inputfiles/subway/ini_subway.xml @@ -46,7 +46,7 @@ <agents> <agents_distribution> - <group group_id="1" room_id="0" subroom_id="0" number="1" goal_id="" router_id="2" route_id=""/> + <group group_id="1" room_id="0" subroom_id="0" number="100" goal_id="" router_id="2" route_id=""/> </agents_distribution> diff --git a/routing/NavMesh.cpp b/routing/NavMesh.cpp index 2b4fae45..a3d34107 100644 --- a/routing/NavMesh.cpp +++ b/routing/NavMesh.cpp @@ -1174,8 +1174,8 @@ void NavMesh::FinalizeAlphaShape() exit(EXIT_FAILURE); } - const Point& env_center=outside->GetSubRoom(0)->GetCentroid(); - double env_radius= outside->GetSubRoom(0)->GetWall(0).DistTo(env_center); + // const Point& env_center=outside->GetSubRoom(0)->GetCentroid(); + // double env_radius= outside->GetSubRoom(0)->GetWall(0).DistTo(env_center); //outside->WriteToErrorLog(); //cout<<"Center:" <<env_center.toString()<<endl; //cout<<"Radius:" <<env_radius<<endl; exit(0); diff --git a/routing/RoutingEngine.cpp b/routing/RoutingEngine.cpp index dc77bcd2..927e1330 100644 --- a/routing/RoutingEngine.cpp +++ b/routing/RoutingEngine.cpp @@ -55,7 +55,7 @@ const vector<string> RoutingEngine::GetTrip(int index) const else { char tmp[CLENGTH]; sprintf(tmp, "ERROR: \tWrong 'index' [%d] > [%d] in Routing::GetTrip()", - index, _tripsCollection.size()); + index, int(_tripsCollection.size())); Log->Write(tmp); exit(EXIT_FAILURE); } diff --git a/routing/SafestPathRouter.h b/routing/SafestPathRouter.h index 0441fdf8..af80d542 100644 --- a/routing/SafestPathRouter.h +++ b/routing/SafestPathRouter.h @@ -99,7 +99,7 @@ private: */ void MappingFloorIDtoIndex( ); - int MapSection; + // int MapSection; @@ -124,10 +124,10 @@ private: - int *preSub; + // int *preSub; int *flo; double maximalSquare; - double *lenthOfSection; + // double *lenthOfSection; // double rR[1][11]; double *rR; @@ -140,7 +140,7 @@ private: double **dPreOFP; FileHandler* _phiFile; - FileHandler* _finalLineEvac; + // FileHandler* _finalLineEvac; // double rR[1][11]; diff --git a/routing/cognitive_map/navigation_graph/GraphEdge.h b/routing/cognitive_map/navigation_graph/GraphEdge.h index f90d1c56..2ae54d3a 100644 --- a/routing/cognitive_map/navigation_graph/GraphEdge.h +++ b/routing/cognitive_map/navigation_graph/GraphEdge.h @@ -73,7 +73,7 @@ private: //WEIGHTS DEPRECATED! double approximate_distance; - double density = 0.0; + // double density = 0.0; }; -- GitLab