From 1ec47983c7f4585a2f2135d6e348565bb85dc236 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Wed, 30 Nov 2022 12:53:09 -0500 Subject: [PATCH] Fix centos build. References #2415 for pgRouting 3.4.2 --- CMakeLists.txt | 4 ++-- src/trsp/trsp.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc4e5e913cd..38ecc95fe94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ string(TIMESTAMP COMPILATION_DATE "%Y/%m/%d" UTC) set(MINORS 3.4 3.3 3.2 3.1 3.0 2.6) set(OLD_SIGNATURES - 3.4.1 + 3.4.1 3.4.0 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 3.3.0 3.2.2 3.2.1 3.2.0 @@ -315,7 +315,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") endif() set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wconversion -Wmissing-prototypes -W -Wunused -Wuninitialized -Wextra -Wdouble-promotion") - add_definitions(-Wsign-conversion -Wfloat-conversion) + add_definitions(-Wsign-conversion) if(BOOST_Geometry_VERSION_OK) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wconversion -pedantic -W -Wunused -Wuninitialized -Wextra -Wdouble-promotion") else() diff --git a/src/trsp/trsp.c b/src/trsp/trsp.c index 7f9397acb0c..4870762c56e 100644 --- a/src/trsp/trsp.c +++ b/src/trsp/trsp.c @@ -159,7 +159,8 @@ static int compute_trsp( int64_t v_max_id = 0; int64_t v_min_id = INT_MAX; - for (size_t z = 0; z < total_tuples; z++) { + size_t z; + for (z = 0; z < total_tuples; z++) { PGR_DBG("id %ld source %ld target %ld cost %f rev %f", edges[z].id, edges[z].source, edges[z].target, edges[z].cost, edges[z].reverse_cost); if (edges[z].source < v_min_id) @@ -181,7 +182,7 @@ static int compute_trsp( /* track if start and end are both in edge tuples */ int s_count = 0; int t_count = 0; - for (size_t z = 0; z < total_tuples; z++) { + for (z = 0; z < total_tuples; z++) { // check if edges[] contains source and target if (dovertex) { if (edges[z].source == start_id || edges[z].target == start_id) @@ -309,7 +310,7 @@ static int compute_trsp( // :::::::::::::::::::::::::::::::: // :: restoring original vertex id // :::::::::::::::::::::::::::::::: - for (size_t z = 0; z < *path_count; z++) { + for (z = 0; z < *path_count; z++) { if (z || (*path)[z].vertex_id != -1) (*path)[z].vertex_id += v_min_id; }