From 679a1e6bf85166edc228b9428be1f424d11afbd1 Mon Sep 17 00:00:00 2001 From: Roland Kaminski Date: Thu, 28 Sep 2023 14:56:13 +0200 Subject: [PATCH] try to fix linter warnings on macos --- libclingo-dl/clingo-dl/config.hh | 2 +- libclingo-dl/src/clingo-dl.cc | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libclingo-dl/clingo-dl/config.hh b/libclingo-dl/clingo-dl/config.hh index 2348898f..b3fdf37d 100644 --- a/libclingo-dl/clingo-dl/config.hh +++ b/libclingo-dl/clingo-dl/config.hh @@ -137,7 +137,7 @@ struct PropagatorConfig { //! Helper to access per thread or global properties. template [[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; } diff --git a/libclingo-dl/src/clingo-dl.cc b/libclingo-dl/src/clingo-dl.cc index 708d8d79..8efc17c9 100644 --- a/libclingo-dl/src/clingo-dl.cc +++ b/libclingo-dl/src/clingo-dl.cc @@ -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( @@ -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(