Skip to content

Commit

Permalink
fixing style-check
Browse files Browse the repository at this point in the history
  • Loading branch information
squarege committed Jul 1, 2023
1 parent e1f05cc commit 0aedb04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/driving_distance/v4withPointsDD.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ void process(
bool details,
bool equicost,

MST_rt **result_tuples,
MST_rt **result_tuples,
size_t *result_count) {

pgr_SPI_connect();
char* log_msg = NULL;
char* notice_msg = NULL;
Expand Down
25 changes: 11 additions & 14 deletions src/driving_distance/v4withPoints_dd_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include "drivers/driving_distance/withPoints_dd_driver.h"

#include "c_types/mst_rt.h"

#include <sstream>
#include <deque>
#include <vector>
Expand All @@ -41,28 +43,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "withPoints/pgr_withPoints.hpp"
#include "driving_distance/withPointsDD.hpp"

#include "c_types/mst_rt.h"

#include "cpp_common/pgr_alloc.hpp"


char
estimate_drivingSide_dd(char driving_side, bool directed, char** err_msg){
estimate_drivingSide_dd(char driving_side, bool directed, char** err_msg) {
using pgrouting::pgr_msg;
try {
char d_side = static_cast<char>(tolower(driving_side));
if (strchr("rlb", d_side) == NULL) {
throw std::string("Invalid driving side specified!");
}
else if (directed && d_side == 'b') {
} else if (directed && d_side == 'b') {
throw std::string("Cannot use 'b' driving side with directed graph!");
}
else{
} else {
return d_side;
}
} catch (const std::string &ex) {
*err_msg = pgr_msg(ex.c_str());
return '\0'; // Or some other appropriate default value
return '\0';
} catch(...) {
*err_msg = pgr_msg("Caught unknown exception!");
return '\0';
Expand Down Expand Up @@ -161,9 +159,8 @@ do_withPointsDD(

paths = pgr_drivingDistance(
digraph, start_vids, distance, equiCost, log);

pgrouting::functions::ShortestPath_tree<pgrouting::DirectedGraph> spt;
results = spt.get_depths(digraph, paths, details);
pgrouting::functions::ShortestPath_tree<pgrouting::DirectedGraph> spt;
results = spt.get_depths(digraph, paths, details);
} else {
pgrouting::UndirectedGraph undigraph(gType);
undigraph.insert_edges(edges, total_edges);
Expand All @@ -172,8 +169,8 @@ do_withPointsDD(
paths = pgr_drivingDistance(
undigraph, start_vids, distance, equiCost, log);

pgrouting::functions::ShortestPath_tree<pgrouting::UndirectedGraph> spt;
results = spt.get_depths(undigraph, paths, details);
pgrouting::functions::ShortestPath_tree<pgrouting::UndirectedGraph> spt;
results = spt.get_depths(undigraph, paths, details);
}

size_t count(results.size());
Expand All @@ -184,7 +181,7 @@ do_withPointsDD(
return;
}
*return_tuples = pgr_alloc(count, (*return_tuples));
for (size_t i = 0; i < count; i++) {
for (size_t i = 0; i < count; i++) {
*((*return_tuples) + i) = results[i];
}
(*return_count) = count;
Expand Down

0 comments on commit 0aedb04

Please sign in to comment.