From f454837a7f70e5e71ebabf69f74e57f446b8ffea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2026 05:55:06 +0000 Subject: [PATCH] auto clang-format action --- include/warthog/domain/grid.h | 25 +++++++++++++++---------- include/warthog/util/pqueue.h | 2 +- src/scenario/grid_patch_set.cpp | 10 ++++++---- src/scenario/scenario_manager.cpp | 27 +++++++++++++++++---------- src/scenario/scenario_runner.cpp | 10 ++++++---- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/include/warthog/domain/grid.h b/include/warthog/domain/grid.h index b5e8ab3..faea379 100644 --- a/include/warthog/domain/grid.h +++ b/include/warthog/domain/grid.h @@ -246,8 +246,9 @@ dir_cw90(direction d) noexcept | ((uint64_t)(SOUTHEAST) << (NORTHEAST_ID << 3)) | ((uint64_t)(SOUTHWEST) << (SOUTHEAST_ID << 3)) | ((uint64_t)(NORTHWEST) << (SOUTHWEST_ID << 3)); - int index = std::countr_zero(static_cast( - d | 256u)); // |256u to ensure no branch in compiler + int index = std::countr_zero( + static_cast( + d | 256u)); // |256u to ensure no branch in compiler return static_cast(sel >> index * 8); } @@ -279,8 +280,9 @@ dir_cw45(direction d) noexcept | ((uint64_t)(SOUTHEAST) << (EAST_ID << 3)) | ((uint64_t)(SOUTHWEST) << (SOUTH_ID << 3)) | ((uint64_t)(NORTHWEST) << (WEST_ID << 3)); - int index = std::countr_zero(static_cast( - d | 256u)); // |256u to ensure no branch in compiler + int index = std::countr_zero( + static_cast( + d | 256u)); // |256u to ensure no branch in compiler return static_cast(sel >> index * 8); } @@ -312,8 +314,9 @@ dir_ccw90(direction d) noexcept | ((uint64_t)(SOUTHEAST) << (SOUTHWEST_ID << 3)) | ((uint64_t)(SOUTHWEST) << (NORTHWEST_ID << 3)) | ((uint64_t)(NORTHWEST) << (NORTHEAST_ID << 3)); - int index = std::countr_zero(static_cast( - d | 256u)); // |256u to ensure no branch in compiler + int index = std::countr_zero( + static_cast( + d | 256u)); // |256u to ensure no branch in compiler return static_cast(sel >> index * 8); } @@ -345,8 +348,9 @@ dir_ccw45(direction d) noexcept | ((uint64_t)(SOUTHEAST) << (SOUTH_ID << 3)) | ((uint64_t)(SOUTHWEST) << (WEST_ID << 3)) | ((uint64_t)(NORTHWEST) << (NORTH_ID << 3)); - int index = std::countr_zero(static_cast( - d | 256u)); // |256u to ensure no branch in compiler + int index = std::countr_zero( + static_cast( + d | 256u)); // |256u to ensure no branch in compiler return static_cast(sel >> index * 8); } @@ -378,8 +382,9 @@ dir_flip(direction d) noexcept | ((uint64_t)(SOUTHEAST) << (NORTHWEST_ID << 3)) | ((uint64_t)(SOUTHWEST) << (NORTHEAST_ID << 3)) | ((uint64_t)(NORTHWEST) << (SOUTHEAST_ID << 3)); - int index = std::countr_zero(static_cast( - d | 256u)); // |256u to ensure no branch in compiler + int index = std::countr_zero( + static_cast( + d | 256u)); // |256u to ensure no branch in compiler return static_cast(sel >> index * 8); } diff --git a/include/warthog/util/pqueue.h b/include/warthog/util/pqueue.h index 42b4d88..1e96040 100644 --- a/include/warthog/util/pqueue.h +++ b/include/warthog/util/pqueue.h @@ -227,7 +227,7 @@ class pqueue throw std::logic_error("newsize < queuesize_"); } - search::search_node** tmp = new search::search_node* [newsize] {}; + search::search_node** tmp = new search::search_node* [newsize] { }; for(unsigned int i = 0; i < queuesize_; i++) { tmp[i] = elts_[i]; diff --git a/src/scenario/grid_patch_set.cpp b/src/scenario/grid_patch_set.cpp index b5689ff..990ade7 100644 --- a/src/scenario/grid_patch_set.cpp +++ b/src/scenario/grid_patch_set.cpp @@ -54,8 +54,9 @@ grid_patch_set::load(io::bittable_serialize& S, int max_grids, uint32_t flags) // header not read if((flags & SKIP_HEADER) != 0) { - WARTHOG_GWARN("grid patch SKIP_HEADER for serializer when header " - "has not been read."); + WARTHOG_GWARN( + "grid patch SKIP_HEADER for serializer when header " + "has not been read."); return -1; } if(auto r = S.read_header(); !r) @@ -70,8 +71,9 @@ grid_patch_set::load(io::bittable_serialize& S, int max_grids, uint32_t flags) // header has been read, check if((flags & FORCE_HEADER) != 0) { - WARTHOG_GWARN("grid patch FORCE_HEADER for serializer when header " - "has already been read."); + WARTHOG_GWARN( + "grid patch FORCE_HEADER for serializer when header " + "has already been read."); return -1; } } diff --git a/src/scenario/scenario_manager.cpp b/src/scenario/scenario_manager.cpp index 1848595..23d8137 100644 --- a/src/scenario/scenario_manager.cpp +++ b/src/scenario/scenario_manager.cpp @@ -183,8 +183,10 @@ scenario_manager::load_gppc_scenario_body_v1(io::scenario_serialize& si) (uint32_t)Q.goal_y, si.get_map_width(), si.get_map_height(), cost_value, map_string); experiments_.push_back(ex); - commands_.push_back(scenario_command::make_inst( - Q.bucket, inst_count_++, (uint32_t)(experiments_.size() - 1))); + commands_.push_back( + scenario_command::make_inst( + Q.bucket, inst_count_++, + (uint32_t)(experiments_.size() - 1))); } else if(*con == io::scenario_serialize::FINAL) { break; } else @@ -268,8 +270,9 @@ scenario_manager::load_gppc_scenario_body_v2(io::scenario_serialize& si) if(last_type == -1) { // only used if first command is a inst - commands_.push_back(scenario_command::make_snapshot( - Q.bucket, snapshot_count_++)); + commands_.push_back( + scenario_command::make_snapshot( + Q.bucket, snapshot_count_++)); } if(last_type == -1 || last_type == io::scenario_serialize::CMD_PATCH) @@ -289,8 +292,10 @@ scenario_manager::load_gppc_scenario_body_v2(io::scenario_serialize& si) Q.start_x, Q.start_y, Q.goal_x, Q.goal_y, si.get_map_width(), si.get_map_height(), ex_cost, map_string); experiments_.push_back(ex); - commands_.push_back(scenario_command::make_inst( - Q.bucket, inst_count_++, (uint32_t)(experiments_.size() - 1))); + commands_.push_back( + scenario_command::make_inst( + Q.bucket, inst_count_++, + (uint32_t)(experiments_.size() - 1))); } else if(*con == io::scenario_serialize::CMD_PATCH) { @@ -305,14 +310,16 @@ scenario_manager::load_gppc_scenario_body_v2(io::scenario_serialize& si) if(last_type != io::scenario_serialize::CMD_PATCH || last_bucket != P.bucket) { - commands_.push_back(scenario_command::make_snapshot( - P.bucket, snapshot_count_++)); + commands_.push_back( + scenario_command::make_snapshot( + P.bucket, snapshot_count_++)); } last_type = io::scenario_serialize::CMD_PATCH; last_bucket = P.bucket; - commands_.push_back(scenario_command::make_patch( - P.bucket, P.patch_id, P.loc_x, P.loc_y)); + commands_.push_back( + scenario_command::make_patch( + P.bucket, P.patch_id, P.loc_x, P.loc_y)); } else if(*con == io::scenario_serialize::FINAL) { break; } else diff --git a/src/scenario/scenario_runner.cpp b/src/scenario/scenario_runner.cpp index 0209202..45d28e5 100644 --- a/src/scenario/scenario_runner.cpp +++ b/src/scenario/scenario_runner.cpp @@ -46,8 +46,9 @@ scenario_runner::experiment_next(uint32_t count, bool progress) default: // should never be reached ++command_at_; - WARTHOG_GDEBUG("scenario_runner::experiment_next invalid command " - "type in " WARTHOG_FILENAME_LINE); + WARTHOG_GDEBUG( + "scenario_runner::experiment_next invalid command " + "type in " WARTHOG_FILENAME_LINE); } // exits loop } @@ -101,8 +102,9 @@ scenario_runner::snapshot_next(bool clear_patch) // snapshot_patches increments snapshot_at_ break; default: - WARTHOG_GDEBUG("scenario_runner::snapshot_next invalid command " - "type in " WARTHOG_FILENAME_LINE); + WARTHOG_GDEBUG( + "scenario_runner::snapshot_next invalid command " + "type in " WARTHOG_FILENAME_LINE); } } return false;