Skip to content

Commit

Permalink
Fixing some problems detected with clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Feb 20, 2024
1 parent 0a67c75 commit 15cfd52
Show file tree
Hide file tree
Showing 31 changed files with 44 additions and 89 deletions.
9 changes: 4 additions & 5 deletions include/c_types/trsp/trsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#ifdef __cplusplus
# include <cstdint>
typedef int64_t int64;
typedef double float8;
#else
# include <stdint.h>
#endif

struct restrict_t {
int target_id;
float8 to_cost;
double to_cost;
int via[MAX_RULE_LENGTH];
};

struct path_element_tt {
int64 vertex_id;
int64 edge_id;
float8 cost;
int64_t vertex_id;
int64_t edge_id;
double cost;
};


Expand Down
3 changes: 2 additions & 1 deletion include/coloring/pgr_bipartite_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "cpp_common/pgr_messages.hpp"
#include "cpp_common/interruption.hpp"
typedef struct II_t_rt II_t_rt;
#include "c_types/ii_t_rt.h"

namespace pgrouting {
namespace functions {
Expand Down Expand Up @@ -78,7 +79,7 @@ class Pgr_Bipartite : public pgrouting::Pgr_messages {
int64_t vid = graph[*v].id;
boost::get(partition_map, *v) ==
boost::color_traits <boost::default_color_type>::white() ?
results.push_back({{vid}, {0}}) :results.push_back({{vid}, {1}});
results.push_back({{vid}, {0}}) : results.push_back({{vid}, {1}});
}
return results;
}
Expand Down
3 changes: 3 additions & 0 deletions include/contraction/pgr_deadEndContraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <queue>
#include <functional>
#include <vector>

#include <boost/graph/adjacency_list.hpp>

#include "cpp_common/identifiers.hpp"
#include "cpp_common/interruption.hpp"

Expand Down
2 changes: 2 additions & 0 deletions include/contraction/pgr_linearContraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/adjacency_list.hpp>

#include "cpp_common/ch_edge.hpp"
#include "cpp_common/identifiers.hpp"


Expand Down
2 changes: 1 addition & 1 deletion include/cpp_common/basePath_SSEC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Path {
ConstpthIt end() const {return path.end();}


void erase(pthIt pos) {path.erase(pos);}
void erase(const pthIt &pos) {path.erase(pos);}
const Path_t& back() const {return path.back();}
Path_t& back() {return path.back();}
const Path_t& front() const {return path.front();}
Expand Down
1 change: 1 addition & 0 deletions include/cpp_common/bline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_BLINE_HPP_
#pragma once

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/multi_point.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/multi_linestring.hpp>
Expand Down
7 changes: 1 addition & 6 deletions include/cpp_common/coordinate_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_COORDINATE_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
#include <cstdint>

struct Coordinate_t {
int64_t id;
Expand Down
8 changes: 1 addition & 7 deletions include/cpp_common/costFlow_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_COSTFLOW_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif

#include <cstdint>

struct CostFlow_t {
int64_t edge_id;
Expand Down
7 changes: 1 addition & 6 deletions include/cpp_common/delauny_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_DELAUNY_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
#include <cstdint>

struct Delauny_t {
int64_t tid;
Expand Down
7 changes: 1 addition & 6 deletions include/cpp_common/edge_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_EDGE_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
#include <cstdint>

struct Edge_t{
int64_t id;
Expand Down
8 changes: 1 addition & 7 deletions include/cpp_common/edge_xy_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_EDGE_XY_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif

#include <cstdint>

struct Edge_xy_t {
int64_t id;
Expand Down
13 changes: 1 addition & 12 deletions include/cpp_common/orders_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_PICKDELIVER_ORDERS_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
#include <cstdint>

/**************************************************************************
* pickDelivery types
* ***********************************************************************/
/*
* its with either (foo_x, foo_y) pairs (for euclidean or with foo_node_id (for matrix)
*/
struct Orders_t {
int64_t id;
double demand;
Expand Down
7 changes: 1 addition & 6 deletions include/cpp_common/point_on_edge_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_POINT_ON_EDGE_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
#include <cstdint>

struct Point_on_edge_t {
int64_t pid;
Expand Down
8 changes: 2 additions & 6 deletions include/cpp_common/restriction_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_RESTRICTION_T_HPP_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
#include <cstdint>
#include <cstddef>

struct Restriction_t {
double cost;
Expand Down
12 changes: 2 additions & 10 deletions include/cpp_common/vehicle_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_CPP_COMMON_VEHICLE_T_H_
#pragma once

/* for int64_t */
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif

/*
* its with either (foo_x, foo_y) pairs for euclidean or with foo_node_id (for matrix)
*/
#include <cstdint>

struct Vehicle_t {
int64_t id;
double capacity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "cpp_common/interruption.hpp"
#include "cpp_common/pgr_messages.hpp"
#include "cpp_common/pgr_base_graph.hpp"
#include "c_types/ii_t_rt.h"


namespace pgrouting {
Expand Down
1 change: 1 addition & 0 deletions include/drivers/allpairs/floydWarshall_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
using IID_t_rt = struct IID_t_rt;
#else
# include <stddef.h>
#include <stdbool.h>
typedef struct IID_t_rt IID_t_rt;
#endif

Expand Down
1 change: 1 addition & 0 deletions include/drivers/allpairs/johnson_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
using IID_t_rt = struct IID_t_rt;
#else
# include <stddef.h>
#include <stdbool.h>
typedef struct IID_t_rt IID_t_rt;
#endif

Expand Down
1 change: 1 addition & 0 deletions include/drivers/chinese/chinesePostman_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
using Path_rt = struct Path_rt;
#else
# include <stddef.h>
#include <stdbool.h>
typedef struct Path_rt Path_rt;
#endif

Expand Down
2 changes: 0 additions & 2 deletions include/drivers/lineGraph/lineGraphFull_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
/* for size-t */
#ifdef __cplusplus
# include <cstddef>
using Edge_t = struct Edge_t;
using Line_graph_full_rt = struct Line_graph_full_rt;
#else
# include <stddef.h>
typedef struct Edge_t Edge_t;
typedef struct Line_graph_full_rt Line_graph_full_rt;
#endif

Expand Down
1 change: 1 addition & 0 deletions include/drivers/lineGraph/lineGraph_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
using Edge_rt = struct Edge_rt;
#else
# include <stddef.h>
#include <stdbool.h>
typedef struct Edge_rt Edge_rt;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_DRIVERS_MAX_FLOW_MAXIMUM_CARDINALITY_MATCHING_DRIVER_H_
#pragma once

#include <stddef.h>

#ifdef __cplusplus
#include <cstddef>
using Only_int_rt = struct Only_int_rt;
#else
#include <stddef.h>
#include <stdbool.h>
typedef struct Only_int_rt Only_int_rt;
#endif

Expand Down
6 changes: 2 additions & 4 deletions include/drivers/planar/isPlanar_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_DRIVERS_PLANAR_ISPLANAR_DRIVER_H_
#pragma once

#ifdef __cplusplus
# include <cstddef>
#else
# include <stddef.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif

#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions include/drivers/trsp/trsp_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#else
# include <stddef.h>
# include <stdint.h>
#include <stdbool.h>
#endif

typedef struct restrict_t restrict_t;
Expand Down
1 change: 1 addition & 0 deletions include/drivers/tsp/TSP_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using TSP_tour_rt = struct TSP_tour_rt;
#else
# include <stddef.h>
# include <stdint.h>
#include <stdbool.h>
typedef struct TSP_tour_rt TSP_tour_rt;
#endif

Expand Down
1 change: 1 addition & 0 deletions include/drivers/tsp/euclideanTSP_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using TSP_tour_rt = struct TSP_tour_rt;
# include <stddef.h>
# include <stdint.h>
typedef struct TSP_tour_rt TSP_tour_rt;
#include <stdbool.h>
#endif

#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions include/drivers/yen/turnRestrictedPath_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ using Path_rt = struct Path_rt;
#else
# include <stddef.h>
# include <stdint.h>
#include <stdbool.h>
typedef struct Path_rt Path_rt;
#endif

Expand Down
1 change: 1 addition & 0 deletions include/visitors/dijkstra_visitors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <set>
#include <vector>
#include "visitors/found_goals.hpp"
#include "cpp_common/pgr_assert.hpp"

namespace pgrouting {
namespace visitors {
Expand Down
6 changes: 2 additions & 4 deletions include/vrp/optimize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_VRP_OPTIMIZE_HPP_
#pragma once

#include "vrp/optimize.hpp"
#include "vrp/solution.hpp"
#include "vrp/pgr_pickDeliver.hpp"

namespace pgrouting {
namespace vrp {

class Solution;
class Pgr_pickDeliver;


class Optimize : public Solution {
public:
Expand Down
5 changes: 2 additions & 3 deletions include/vrp/pd_orders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "cpp_common/identifiers.hpp"

#include "vrp/pd_problem.hpp"
#include "vrp/order.hpp"
#include "vrp/vehicle_node.hpp"


namespace pgrouting {
namespace vrp {

class Order;
class Vehicle_node;

class PD_Orders {
/** PD_rpblem needs access to set up the problem pointer */
friend class PD_problem;
Expand Down
2 changes: 1 addition & 1 deletion src/driving_distance/many_to_dist_driving_distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static
void process(
char* edges_sql,
ArrayType *starts,
float8 distance,
double distance,
bool directed,
bool equicost,
MST_rt **result_tuples,
Expand Down

0 comments on commit 15cfd52

Please sign in to comment.