Skip to content

Commit

Permalink
(C++) fix warning on C++13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Oct 13, 2024
1 parent 52205a5 commit 312e99c
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/astar/astar.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ _pgr_astar(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;
int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t)call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/bdAstar/bdAstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ _pgr_bdastar(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;
int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;

values[0] = Int32GetDatum(call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/bdDijkstra/bdDijkstra.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ PGDLLEXPORT Datum _pgr_bddijkstra(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;
int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;

values[0] = Int32GetDatum(call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/bellman_ford/bellman_ford.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ _pgr_bellmanford(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum(funcctx->call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/bellman_ford/bellman_ford_neg.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ _pgr_bellmanfordneg(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum(funcctx->call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/bellman_ford/edwardMoore.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t) funcctx->call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/breadthFirstSearch/binaryBreadthFirstSearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ PGDLLEXPORT Datum _pgr_binarybreadthfirstsearch(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/dagShortestPath/dagShortestPath.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ PGDLLEXPORT Datum _pgr_dagshortestpath(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].edge);
values[4] = Float8GetDatum(result_tuples[funcctx->call_cntr].cost);
Expand Down
4 changes: 2 additions & 2 deletions src/dijkstra/dijkstra.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ _pgr_dijkstra(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;
int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t)call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[call_cntr].node);
Expand Down
6 changes: 3 additions & 3 deletions src/ksp/ksp.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ _pgr_ksp(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t path_id = 1;
int64_t path_id = 1;
if (funcctx->call_cntr != 0) {
if (path[funcctx->call_cntr - 1].edge == -1) {
path_id = path[funcctx->call_cntr - 1].start_id + 1;
} else {
path_id = path[funcctx->call_cntr - 1].start_id;
}
}
int32_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].end_id;
int64_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].end_id;

values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
values[1] = Int32GetDatum(path_id);
values[2] = Int32GetDatum(seq);
values[2] = Int32GetDatum((int32_t)seq);
if (PG_NARGS() != 6) {
values[3] = Int64GetDatum(path[funcctx->call_cntr].start_id);
values[4] = Int64GetDatum(path[funcctx->call_cntr].end_id);
Expand Down
4 changes: 2 additions & 2 deletions src/ksp/turnRestrictedPath.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ _pgr_turnrestrictedpath(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
values[1] = Int32GetDatum(path[funcctx->call_cntr].start_id + 1);
values[2] = Int32GetDatum(seq);
values[2] = Int32GetDatum((int32_t)seq);
values[3] = Int64GetDatum(path[funcctx->call_cntr].node);
values[4] = Int64GetDatum(path[funcctx->call_cntr].edge);
values[5] = Float8GetDatum(path[funcctx->call_cntr].cost);
Expand Down
4 changes: 2 additions & 2 deletions src/ksp/withPoints_ksp.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ PGDLLEXPORT Datum _pgr_withpointsksp(PG_FUNCTION_ARGS) {
path_id = result_tuples[funcctx->call_cntr - 1].start_id;
}
}
int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].end_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].end_id;

values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
values[1] = Int32GetDatum(path_id);
values[2] = Int32GetDatum(seq);
values[2] = Int32GetDatum((int32_t)seq);
if (PG_NARGS() != 9) {
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id);
values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id);
Expand Down
4 changes: 2 additions & 2 deletions src/max_flow/edge_disjoint_paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ _pgr_edgedisjointpaths(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t path_id = 1;
int32_t seq 1;
int64_t path_id = 1;
int64_t seq = 1;
if (funcctx->call_cntr != 0) {
if (result_tuples[funcctx->call_cntr - 1].edge == -1) {
path_id = result_tuples[funcctx->call_cntr - 1].start_id + 1;
Expand Down
4 changes: 2 additions & 2 deletions src/trsp/trsp_withPoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ _pgr_trsp_withpoints(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;
int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id;
values[0] = Int32GetDatum((int32_t)call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[call_cntr].node);
Expand Down
4 changes: 2 additions & 2 deletions src/withPoints/withPoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ _pgr_withpoints(PG_FUNCTION_ARGS) {
nulls[i] = false;
}

int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;
int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id;

values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
values[1] = Int32GetDatum(seq);
values[1] = Int32GetDatum((int32_t)seq);
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id);
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id);
values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
Expand Down

0 comments on commit 312e99c

Please sign in to comment.