Skip to content

refactor: using int16_t for eval values#358

Merged
benthevining merged 4 commits intomainfrom
eval-value-range
Oct 4, 2025
Merged

refactor: using int16_t for eval values#358
benthevining merged 4 commits intomainfrom
eval-value-range

Conversation

@benthevining
Copy link
Owner

No description provided.

@benthevining benthevining linked an issue Oct 3, 2025 that may be closed by this pull request
objects to be transparently compared as integers.
*/
constexpr operator int() const noexcept { return value; } // NOLINT;
constexpr operator Value() const noexcept { return value; } // NOLINT;

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.

Copilot Autofix

AI 6 months ago

To fix the problem, the comment on line 74 (// NOLINT;) should be changed or removed. Since the preceding line is constexpr operator Value() const noexcept { return value; }, which is a typical spot for clang-tidy or other static analyzers to issue warnings about implicit conversion operators, the intent is likely to suppress such a warning. The fix is to use the correct suppression format: standard C++ tools accept // NOLINT alone as the annotation. Thus, the change is to replace // NOLINT; with // NOLINT and ensure no commented-out code or confusing punctuation remains. The relevant region in libbenbot/include/libbenbot/eval/Score.hpp is line 74; no other changes are needed.

Suggested changeset 1
libbenbot/include/libbenbot/eval/Score.hpp

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libbenbot/include/libbenbot/eval/Score.hpp b/libbenbot/include/libbenbot/eval/Score.hpp
--- a/libbenbot/include/libbenbot/eval/Score.hpp
+++ b/libbenbot/include/libbenbot/eval/Score.hpp
@@ -71,7 +71,7 @@
         This method is intentionally not explicit, which allows score
         objects to be transparently compared as integers.
      */
-    constexpr operator Value() const noexcept { return value; } // NOLINT;
+    constexpr operator Value() const noexcept { return value; } // NOLINT
 
     /** Inverts the score. */
     [[nodiscard]] constexpr auto operator-() const noexcept -> Score { return { static_cast<Value>(-value) }; }
EOF
@@ -71,7 +71,7 @@
This method is intentionally not explicit, which allows score
objects to be transparently compared as integers.
*/
constexpr operator Value() const noexcept { return value; } // NOLINT;
constexpr operator Value() const noexcept { return value; } // NOLINT

/** Inverts the score. */
[[nodiscard]] constexpr auto operator-() const noexcept -> Score { return { static_cast<Value>(-value) }; }
Copilot is powered by AI and may make mistakes. Always verify output.
@benthevining benthevining merged commit 998a259 into main Oct 4, 2025
3 of 18 checks passed
@benthevining benthevining deleted the eval-value-range branch October 4, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use int16_t for evals everywhere

1 participant