Skip to content

Commit

Permalink
Fix regressions
Browse files Browse the repository at this point in the history
Remove superflous runtime checks on the vector size.
Address narrowing conversion compiler diagnostics.
  • Loading branch information
jngrad committed Jul 31, 2024
1 parent 887e11e commit 7d1d73c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <memory>
#include <vector>

Expand Down Expand Up @@ -397,7 +396,7 @@ class InteractionsNonBonded : public System::Leaf<InteractionsNonBonded> {
auto get_ia_param_key(int i, int j) const {
assert(i >= 0 and i <= max_seen_particle_type);
assert(j >= 0 and j <= max_seen_particle_type);
auto const key = static_cast<std::size_t>(
auto const key = static_cast<unsigned int>(
Utils::lower_triangular(std::max(i, j), std::min(i, j)));
assert(key < m_nonbonded_ia_params.size());
return key;
Expand All @@ -415,15 +414,15 @@ class InteractionsNonBonded : public System::Leaf<InteractionsNonBonded> {
* @return Reference to interaction parameters for the type pair.
*/
auto &get_ia_param(int i, int j) {
return *m_nonbonded_ia_params.at(get_ia_param_key(i, j));
return *m_nonbonded_ia_params[get_ia_param_key(i, j)];
}

auto const &get_ia_param(int i, int j) const {
return *m_nonbonded_ia_params.at(get_ia_param_key(i, j));
return *m_nonbonded_ia_params[get_ia_param_key(i, j)];
}

auto get_ia_param_ref_counted(int i, int j) const {
return m_nonbonded_ia_params.at(get_ia_param_key(i, j));
return m_nonbonded_ia_params[get_ia_param_key(i, j)];
}

void set_ia_param(int i, int j, std::shared_ptr<IA_parameters> const &ia) {
Expand Down
1 change: 1 addition & 0 deletions src/python/espressomd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_compile_options(
espresso_pyx_flags
INTERFACE
$<$<NOT:$<CXX_COMPILER_ID:Intel,IntelLLVM>>:-Wno-pedantic>
$<$<NOT:$<CXX_COMPILER_ID:Intel,IntelLLVM>>:-Wno-cast-qual>
$<$<NOT:$<CXX_COMPILER_ID:Intel,IntelLLVM>>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:Intel,IntelLLVM>:-diag-disable=1224>
$<$<CXX_COMPILER_ID:GNU>:-Wno-cpp>
Expand Down

0 comments on commit 7d1d73c

Please sign in to comment.