Skip to content

Commit

Permalink
try to fix linter warnings on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaminsk committed Sep 28, 2023
1 parent 699f56c commit 679a1e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion libclingo-dl/clingo-dl/config.hh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct PropagatorConfig {
//! Helper to access per thread or global properties.
template <class T, class P> [[nodiscard]] auto get_prop(Clingo::id_t thread_id, T &&def, P &&prop) const -> T {
if (thread_id < thread_config.size() && thread_config[thread_id].*prop) {
return *(thread_config[thread_id].*prop);
return *(thread_config[thread_id].*prop); // NOLINT(bugprone-unchecked-optional-access)
}
return def;
}
Expand Down
22 changes: 11 additions & 11 deletions libclingo-dl/src/clingo-dl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,17 @@ auto parse_mutex(const char *value, void *data) -> bool {
auto parse_mode(const char *value, void *data) -> bool {
PropagationMode mode = PropagationMode::Check;
char const *rem = nullptr;
if ((rem = iequals_pre(value, "no")) != nullptr) {
if (rem = iequals_pre(value, "no"); rem != nullptr) {
mode = PropagationMode::Check;
} else if ((rem = iequals_pre(value, "inverse")) != nullptr) {
} else if (rem = iequals_pre(value, "inverse"); rem != nullptr) {
mode = PropagationMode::Trivial;
} else if ((rem = iequals_pre(value, "partial+")) != nullptr) {
} else if (rem = iequals_pre(value, "partial+"); rem != nullptr) {
mode = PropagationMode::WeakPlus;
} else if ((rem = iequals_pre(value, "partial")) != nullptr) {
} else if (rem = iequals_pre(value, "partial"); rem != nullptr) {
mode = PropagationMode::Weak;
} else if ((rem = iequals_pre(value, "zero")) != nullptr) {
} else if (rem = iequals_pre(value, "zero"); rem != nullptr) {
mode = PropagationMode::Zero;
} else if ((rem = iequals_pre(value, "full")) != nullptr) {
} else if (rem = iequals_pre(value, "full"); rem != nullptr) {
mode = PropagationMode::Strong;
}
return rem != nullptr && set_config(
Expand All @@ -368,15 +368,15 @@ auto parse_mode(const char *value, void *data) -> bool {
auto parse_sort(const char *value, void *data) -> bool {
SortMode sort = SortMode::Weight;
char const *rem = nullptr;
if ((rem = iequals_pre(value, "no")) != nullptr) {
if (rem = iequals_pre(value, "no"); rem != nullptr) {
sort = SortMode::No;
} else if ((rem = iequals_pre(value, "weight-reversed")) != nullptr) {
} else if (rem = iequals_pre(value, "weight-reversed"); rem != nullptr) {
sort = SortMode::WeightRev;
} else if ((rem = iequals_pre(value, "weight")) != nullptr) {
} else if (rem = iequals_pre(value, "weight"); rem != nullptr) {
sort = SortMode::Weight;
} else if ((rem = iequals_pre(value, "potential-reversed")) != nullptr) {
} else if (rem = iequals_pre(value, "potential-reversed"); rem != nullptr) {
sort = SortMode::PotentialRev;
} else if ((rem = iequals_pre(value, "potential")) != nullptr) {
} else if (rem = iequals_pre(value, "potential"); rem != nullptr) {
sort = SortMode::Potential;
}
return rem != nullptr && set_config(
Expand Down

0 comments on commit 679a1e6

Please sign in to comment.