Skip to content

Commit cc9b4e1

Browse files
committed
fix: misc linter warnings
1 parent 99c19ef commit cc9b4e1

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

libbenbot/include/libbenbot/engine/Engine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class [[nodiscard]] Engine final : public uci::EngineBase {
204204
},
205205
CustomCommand {
206206
.name = "options",
207-
.action = [this](const string_view args){ print_options(); },
207+
.action = CustomCommand::void_cb([this]{ print_options(); }),
208208
.description = "Dump current UCI option values",
209209
.argsHelp = {}
210210
},

libbenbot/include/libbenbot/search/Context.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ struct Context final {
5454
Context(Context&&) = delete;
5555
Context& operator=(Context&&) = delete;
5656

57+
~Context() = default;
58+
5759
/** Performs a search.
5860
Results will be propagated via the ``callbacks`` that have been
5961
assigned.

libbenbot/include/libbenbot/search/Options.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct Options final {
6969
*/
7070
chess::moves::MoveList movesToSearch;
7171

72-
/** If true, the search should not exit until a ``xtop`` or ``exit``
72+
/** If true, the search should not exit until a ``stop`` or ``exit``
7373
command is received.
7474
*/
7575
bool infinite { false };

libbenbot/src/engine/Bench.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ namespace {
8888
BenchSearcherThread(BenchSearcherThread&&) = delete;
8989
BenchSearcherThread& operator=(BenchSearcherThread&&) = delete;
9090

91+
~BenchSearcherThread() = default;
92+
9193
[[nodiscard]] auto finished() const noexcept -> bool { return not thread.context.in_progress(); }
9294

9395
[[nodiscard]] auto get_result() const noexcept -> SearchResult

libbenbot/src/engine/ColorPrinting.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ namespace {
4343

4444
void Engine::print_logo_and_version() const
4545
{
46-
const auto logoLines = get_at_most_n_lines<11uz>(resources::get_ascii_logo());
46+
static constexpr auto NumLogoLines = 11uz;
47+
48+
const auto logoLines = get_at_most_n_lines<NumLogoLines>(resources::get_ascii_logo());
4749

4850
cout << termcolor::grey << logoLines.front() << '\n'
4951
<< termcolor::blue;
5052

51-
for (const auto line : logoLines | std::views::drop(1) | std::views::take(logoLines.capacity() - 2uz))
53+
for (const auto line : logoLines | std::views::drop(1) | std::views::take(NumLogoLines - 2uz))
5254
cout << line << '\n';
5355

5456
cout << termcolor::grey << logoLines.back() << "\n\n"
@@ -91,9 +93,11 @@ void print_colored_board(
9193
{
9294
const auto boardStr = utf8 ? print_utf8(pos) : print_ascii(pos);
9395

94-
const auto lines = get_at_most_n_lines<9uz>(boardStr);
96+
static constexpr auto BoardLines = 9uz;
97+
98+
const auto lines = get_at_most_n_lines<BoardLines>(boardStr);
9599

96-
for (const auto line : lines | std::views::take(lines.capacity() - 1uz)) {
100+
for (const auto line : lines | std::views::take(BoardLines - 1uz)) {
97101
cout << line.substr(0uz, line.length() - 1uz)
98102
<< termcolor::white << line.back() << '\n'
99103
<< termcolor::reset;

libbenbot/src/search/Search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ namespace {
110110
{
111111
}
112112

113-
AlphaBetaContext(const AlphaBetaContext&) = delete;
113+
AlphaBetaContext(const AlphaBetaContext&) = default;
114114
AlphaBetaContext& operator=(const AlphaBetaContext&) = delete;
115115

116116
template <bool PVNode>

libbenbot/src/search/TimeManagement.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ struct Interrupter final {
6969
Interrupter(Interrupter&&) = delete;
7070
Interrupter& operator=(Interrupter&&) = delete;
7171

72+
~Interrupter() = default;
73+
7274
[[nodiscard]] auto get_search_duration() const noexcept -> milliseconds { return timer.get_duration(); }
7375

7476
// returns time remaining until abort time, or nullopt if there's no time bound

0 commit comments

Comments
 (0)