From 51127c161fc6fdaf7f8ec77a4a476faa6e219b52 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 26 Jun 2015 09:08:22 +0000 Subject: -Werror on user version compilation git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_ci@656 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 54943d15cd2f0ec784fbf447485e637517bad32d --- src/Alpha_shapes/include/gudhi/Alpha_shapes.h | 2 +- .../include/gudhi/Alpha_shapes/Delaunay_triangulation_off_io.h | 5 +++-- src/CMakeLists.txt | 4 +++- src/GudhUI/model/Model.h | 3 ++- src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp | 6 ++++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Alpha_shapes/include/gudhi/Alpha_shapes.h b/src/Alpha_shapes/include/gudhi/Alpha_shapes.h index b8efdb4d..deece712 100644 --- a/src/Alpha_shapes/include/gudhi/Alpha_shapes.h +++ b/src/Alpha_shapes/include/gudhi/Alpha_shapes.h @@ -171,7 +171,7 @@ class Alpha_shapes { /** \brief Returns the number of simplices in the complex. * * Does not count the empty simplex. */ - const unsigned int& num_simplices() const { + const unsigned int num_simplices() const { return _st.num_simplices(); } diff --git a/src/Alpha_shapes/include/gudhi/Alpha_shapes/Delaunay_triangulation_off_io.h b/src/Alpha_shapes/include/gudhi/Alpha_shapes/Delaunay_triangulation_off_io.h index 693b393e..b38ca4d6 100644 --- a/src/Alpha_shapes/include/gudhi/Alpha_shapes/Delaunay_triangulation_off_io.h +++ b/src/Alpha_shapes/include/gudhi/Alpha_shapes/Delaunay_triangulation_off_io.h @@ -190,15 +190,16 @@ class Delaunay_triangulation_off_writer { } // Finite cells list - for (auto cit = save_complex.finite_full_cells_begin(); cit != save_complex.finite_full_cells_end(); ++cit) { + /*for (auto cit = save_complex.finite_full_cells_begin(); cit != save_complex.finite_full_cells_end(); ++cit) { stream << std::distance(cit->vertices_begin(), cit->vertices_end()) << " "; // Dimension for (auto vit = cit->vertices_begin(); vit != cit->vertices_end(); ++vit) { auto vertexHdl = *vit; + std::cout << // auto vertexHdl = std::distance(save_complex.vertices_begin(), *vit) - 1; // stream << std::distance(save_complex.vertices_begin(), *(vit)) - 1 << " "; } stream << std::endl; - } + }*/ stream.close(); } else { std::cerr << "could not open file " << name_file << std::endl; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3be05c4f..7869bc4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,9 @@ endif() if(MSVC) SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wsign-compare -Werror") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif() set(Boost_USE_STATIC_LIBS ON) diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h index 87545989..17a7d278 100644 --- a/src/GudhUI/model/Model.h +++ b/src/GudhUI/model/Model.h @@ -315,7 +315,8 @@ private: void run_chomp(){ save_complex_in_file_for_chomp(); std::cout << "Call CHOMP library\n"; - system("utils/homsimpl chomp.sim"); + int returnValue = system("utils/homsimpl chomp.sim"); + std::cout << "CHOMP returns" << returnValue << std::endl; } void save_complex_in_file_for_chomp(){ diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp index 92fa17f3..126e32ec 100644 --- a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp +++ b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp @@ -64,8 +64,10 @@ int main (int argc, char *argv[]){ // or edges, complex.num_vertices() and complex.num_edges() are // more appropriated! unsigned num_vertices = 0; - for(auto v : complex.vertex_range()) - ++num_vertices; + for(auto v : complex.vertex_range()) { + std::cout << "Vertex " << v <