From e9704f55dfc952f720f045f4b05dffa846b932fa Mon Sep 17 00:00:00 2001 From: Mizux Seiha Date: Mon, 5 Apr 2021 17:27:21 +0200 Subject: [PATCH] examples: [u]int32 -> [u]int32_t note: sed -i 's/\b\([u]\?int32\)\b/\1_t/g' *.h *.cc --- examples/cpp/cvrptw_lib.h | 4 ++-- examples/cpp/random_tsp.cc | 2 +- examples/cpp/uncapacitated_facility_location.cc | 8 ++++---- examples/tests/remote/tsp.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/cpp/cvrptw_lib.h b/examples/cpp/cvrptw_lib.h index c4490b2f2d..3f0f5b3dea 100644 --- a/examples/cpp/cvrptw_lib.h +++ b/examples/cpp/cvrptw_lib.h @@ -30,7 +30,7 @@ typedef std::function RoutingNodeEvaluator2; // Random seed generator. -int32 GetSeed(bool deterministic); +int32_t GetSeed(bool deterministic); // Location container, contains positions of orders and can be used to obtain // Manhattan distances/times between locations. @@ -130,7 +130,7 @@ void DisplayPlan( using NodeIndex = RoutingIndexManager::NodeIndex; -int32 GetSeed(bool deterministic) { +int32_t GetSeed(bool deterministic) { if (deterministic) { return ACMRandom::DeterministicSeed(); } else { diff --git a/examples/cpp/random_tsp.cc b/examples/cpp/random_tsp.cc index b0d0e57e9d..ca1fbc4fc6 100644 --- a/examples/cpp/random_tsp.cc +++ b/examples/cpp/random_tsp.cc @@ -55,7 +55,7 @@ ABSL_FLAG(std::string, routing_search_parameters, namespace operations_research { // Random seed generator. -int32 GetSeed() { +int32_t GetSeed() { if (absl::GetFlag(FLAGS_tsp_use_deterministic_random_seed)) { return ACMRandom::DeterministicSeed(); } else { diff --git a/examples/cpp/uncapacitated_facility_location.cc b/examples/cpp/uncapacitated_facility_location.cc index 29a14df0ba..21943fda42 100644 --- a/examples/cpp/uncapacitated_facility_location.cc +++ b/examples/cpp/uncapacitated_facility_location.cc @@ -55,12 +55,12 @@ static double Distance(const Location& src, const Location& dst) { } static void UncapacitatedFacilityLocation( - int32 facilities, int32 clients, double fix_cost, + int32_t facilities, int32_t clients, double fix_cost, MPSolver::OptimizationProblemType optimization_problem_type) { LOG(INFO) << "Starting " << __func__; // Local Constants - const int32 kXMax = 1000; - const int32 kYMax = 1000; + const int32_t kXMax = 1000; + const int32_t kYMax = 1000; const double kMaxDistance = 6 * sqrt((kXMax * kYMax)) / facilities; const int kStrLen = 1024; // char buffer for names @@ -186,7 +186,7 @@ static void UncapacitatedFacilityLocation( } } -void RunAllExamples(int32 facilities, int32 clients, double fix_cost) { +void RunAllExamples(int32_t facilities, int32_t clients, double fix_cost) { #if defined(USE_CBC) LOG(INFO) << "---- Integer programming example with CBC ----"; UncapacitatedFacilityLocation(facilities, clients, fix_cost, diff --git a/examples/tests/remote/tsp.cc b/examples/tests/remote/tsp.cc index 585eb82a6b..ccbebcdcb4 100644 --- a/examples/tests/remote/tsp.cc +++ b/examples/tests/remote/tsp.cc @@ -48,7 +48,7 @@ DECLARE_string(routing_first_solution); DECLARE_bool(routing_no_lns); // Random seed generator. -int32 GetSeed() { +int32_t GetSeed() { if (absl::GetFlag(FLAGS_tsp_use_deterministic_random_seed)) { return ACMRandom::DeterministicSeed(); } else {