Skip to content

Commit

Permalink
[lint] linting C/C++ code
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Jun 28, 2021
1 parent 88604f9 commit f776478
Show file tree
Hide file tree
Showing 23 changed files with 102 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build
fix_typos
code_linter
src/version/_version.h
src/version/version.h

.DS_Store
.vagrant
Expand Down
1 change: 1 addition & 0 deletions include/cpp_common/Dmatrix.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.
#include <iostream>
#include <vector>
#include <map>
#include <utility>

#include "c_types/matrix_cell_t.h"

Expand Down
3 changes: 1 addition & 2 deletions include/dijkstra/pgr_dijkstra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include "c_types/pgr_combination_t.h"

#include <boost/graph/dijkstra_shortest_paths.hpp>

#include <deque>
Expand All @@ -48,6 +46,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <map>
#include <numeric>

#include "c_types/pgr_combination_t.h"
#include "cpp_common/basePath_SSEC.hpp"
#include "cpp_common/pgr_base_graph.hpp"
#include "cpp_common/interruption.h"
Expand Down
11 changes: 4 additions & 7 deletions include/max_flow/pgr_minCostMaxFlow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_MAX_FLOW_PGR_MINCOSTMAXFLOW_HPP_
#pragma once

#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>

#include <map>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <limits>

#include "max_flow/pgr_costFlowGraph.hpp"

#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>



#include "c_types/pgr_flow_t.h"
#include "c_types/pgr_costFlow_t.h"
#include "max_flow/pgr_costFlowGraph.hpp"

namespace pgrouting {
namespace graph {
Expand Down
3 changes: 1 addition & 2 deletions include/vrp/dnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ class Dnode : public Identifier {
friend std::ostream& operator << (std::ostream &log, const Dnode &node);

protected:
static Pgr_messages& msg() ;
static Pgr_messages& msg();

/** The problem */
static Pgr_pickDeliver* problem;

};

} // namespace vrp
Expand Down
3 changes: 1 addition & 2 deletions include/vrp/fleet.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ class Fleet {
const Vehicle_node&);

/** @brief the problem message */
static Pgr_messages& msg() ;
static Pgr_messages& msg();

/** The problem */
static Pgr_pickDeliver* problem;

};


Expand Down
5 changes: 0 additions & 5 deletions include/vrp/optimize.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ class Optimize : public Solution {
Vehicle_pickDeliver &from_truck,
Vehicle_pickDeliver &to_truck);
void save_if_best();

#if 0
private:
Swap_bk p_swaps;
#endif
};

} // namespace vrp
Expand Down
1 change: 0 additions & 1 deletion include/vrp/pd_orders.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class PD_Orders {

/** The problem */
static Pgr_pickDeliver* problem;

};

} // namespace vrp
Expand Down
1 change: 0 additions & 1 deletion include/vrp/pd_problem.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class Pgr_pickDeliver;

class PD_problem {
public:

/** @brief Initializing the problem pointer */
explicit PD_problem(Pgr_pickDeliver* p_problem);

Expand Down
1 change: 0 additions & 1 deletion include/vrp/pgr_pickDeliver.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class Pgr_pickDeliver : public PD_problem {
friend Initial_solution;

public:

Pgr_pickDeliver(
const std::vector<PickDeliveryOrders_t> &pd_orders,
const std::vector<Vehicle_t> &vehicles,
Expand Down
5 changes: 2 additions & 3 deletions include/vrp/solution.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ class Solution {
Vehicle::Cost cost() const;

/** The problem's message */
static Pgr_messages& msg() ;
static Pgr_messages& msg();

private:
private:
/** this solution belongs to this problem */
static Pgr_pickDeliver* problem;

};


Expand Down
8 changes: 0 additions & 8 deletions include/vrp/vehicle_pickDeliver.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,6 @@ class Vehicle_pickDeliver : public Vehicle {
Initials_code kind,
Identifiers<size_t> &unassigned,
Identifiers<size_t> &assigned);


/*!
* The order that is picked last is removed
*
* \returns id of the removed order
*/

};

} // namespace vrp
Expand Down
2 changes: 1 addition & 1 deletion src/alpha_shape/alphaShape_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* this file is not compiled with boost 1.53 or less
*/
#include "drivers/alpha_shape/alphaShape_driver.h"
#include <boost/geometry/io/wkt/write.hpp>

#include <cmath>
#include <vector>
Expand All @@ -41,7 +42,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "cpp_common/pgr_base_graph.hpp"
#include "cpp_common/bpoint.hpp"
#include "cpp_common/bline.hpp"
#include <boost/geometry/io/wkt/write.hpp>


namespace {
Expand Down
5 changes: 3 additions & 2 deletions src/cpp_common/Dmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include "cpp_common/Dmatrix.h"

#include <string.h>
#include <string>
#include <utility>
#include <sstream>
#include <algorithm>
#include <limits>
Expand Down Expand Up @@ -135,7 +136,7 @@ get_distance(std::pair<double, double> p1 , std::pair<double, double> p2) {
*/
Dmatrix::Dmatrix(const std::map<std::pair<double, double>, int64_t> &euclidean_data) {
ids.reserve(euclidean_data.size());
for (const auto &e: euclidean_data) {
for (const auto &e : euclidean_data) {
ids.push_back(e.second);
}
costs.resize(
Expand Down
2 changes: 1 addition & 1 deletion src/driving_distance/drivedist_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#undef WITH_TIME
#ifdef WITH_TIME
#include <ctime>
#include <chrono>
#include <chrono> // NOLINT [build/c++11]

static
void
Expand Down
1 change: 1 addition & 0 deletions src/pickDeliver/fleet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <memory>
#include <utility>
#include <limits>
#include <string>

#include "vrp/dnode.h"
#include "vrp/pgr_pickDeliver.h"
Expand Down
2 changes: 1 addition & 1 deletion src/pickDeliver/pd_orders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <vector>
#include <memory>
#include <utility>
#include <string>

#include "vrp/pgr_pickDeliver.h"
#include "vrp/dnode.h"
Expand All @@ -49,7 +50,6 @@ PD_Orders:: add_order(
const PickDeliveryOrders_t &order,
const Vehicle_node &pick,
const Vehicle_node &drop) {

/*
* add into an order
*/
Expand Down
6 changes: 3 additions & 3 deletions src/pickDeliver/pickDeliverEuclidean_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include "drivers/pickDeliver/pickDeliverEuclidean_driver.h"

#include <string.h>
#include <sstream>
#include <string>
#include <deque>
#include <vector>
#include <map>
#include <utility>

#include "vrp/pgr_pickDeliver.h"

Expand Down Expand Up @@ -95,13 +95,13 @@ do_pgr_pickDeliverEuclidean(
}

Identifiers<int64_t> unique_ids;
for (const auto &e: matrix_data) {
for (const auto &e : matrix_data) {
unique_ids += e.second;
}
if (unique_ids.size() != matrix_data.size()) {
// ignoring ids given by the user
int64_t id(0);
for (auto &e: matrix_data) {
for (auto &e : matrix_data) {
e.second = id++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pickDeliver/pickDeliver_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include "drivers/pickDeliver/pickDeliver_driver.h"

#include <string.h>
#include <sstream>
#include <string>
#include <deque>
#include <vector>
#include <utility>

#include "vrp/pgr_pickDeliver.h"
#include "vrp/initials_code.h"
Expand Down
3 changes: 1 addition & 2 deletions src/version/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ADD_LIBRARY(version OBJECT
version.c
_version.c
)
configure_file(_version.h.in ${CMAKE_CURRENT_LIST_DIR}/_version.h)
configure_file(version.h.in ${CMAKE_CURRENT_LIST_DIR}/version.h)
106 changes: 0 additions & 106 deletions src/version/_version.c

This file was deleted.

Loading

0 comments on commit f776478

Please sign in to comment.