Skip to content

Commit

Permalink
core: Fix -Wrange-loop-analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Oct 28, 2020
1 parent 7af98c5 commit 926fce0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ target_compile_options(
$<$<BOOL:${WARNINGS_ARE_ERRORS}>:-Werror>
# add extra warnings
$<$<CXX_COMPILER_ID:Clang>:-Wextern-initializer>
$<$<CXX_COMPILER_ID:Clang>:-Wrange-loop-analysis>
# disable warnings from -Wextra
-Wno-sign-compare
-Wno-unused-function
Expand Down
2 changes: 1 addition & 1 deletion src/core/cluster_analysis/ClusterStructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void ClusterStructure::run_for_all_pairs() {
void ClusterStructure::run_for_bonded_particles() {
clear();
for (const auto &p : partCfg()) {
for (auto const &bond : p.bonds()) {
for (auto const bond : p.bonds()) {
if (bond.partner_ids().size() == 1) {
add_pair(p, get_particle_data(bond.partner_ids()[0]));
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/particle_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ void auto_exclusions(int distance) {
/* determine initial connectivity */
for (auto const &part1 : partCfg()) {
auto const p1 = part1.p.identity;
for (auto const &bond : part1.bonds()) {
for (auto const bond : part1.bonds()) {
if ((bond.partner_ids().size() == 1) and (bond.partner_ids()[0] != p1)) {
auto const p2 = bond.partner_ids()[0];
add_partner(partners[p1], p1, p2, 1);
Expand Down

0 comments on commit 926fce0

Please sign in to comment.