mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Explicitly annotate a few variables
as [[maybe_unused]], avoiding the (void)foo trick. closes https://github.com/official-stockfish/Stockfish/pull/4162 No functional change
This commit is contained in:
parent
82bb21dc7a
commit
5a871e174f
2 changed files with 3 additions and 13 deletions
|
@ -378,10 +378,9 @@ void std_aligned_free(void* ptr) {
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
||||||
static void* aligned_large_pages_alloc_windows(size_t allocSize) {
|
static void* aligned_large_pages_alloc_windows([[maybe_unused]] size_t allocSize) {
|
||||||
|
|
||||||
#if !defined(_WIN64)
|
#if !defined(_WIN64)
|
||||||
(void)allocSize; // suppress unused-parameter compiler warning
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -626,8 +625,7 @@ string argv0; // path+name of the executable binary, as given by argv
|
||||||
string binaryDirectory; // path of the executable directory
|
string binaryDirectory; // path of the executable directory
|
||||||
string workingDirectory; // path of the working directory
|
string workingDirectory; // path of the working directory
|
||||||
|
|
||||||
void init(int argc, char* argv[]) {
|
void init([[maybe_unused]] int argc, char* argv[]) {
|
||||||
(void)argc;
|
|
||||||
string pathSeparator;
|
string pathSeparator;
|
||||||
|
|
||||||
// extract the path+name of the executable binary
|
// extract the path+name of the executable binary
|
||||||
|
|
|
@ -106,7 +106,7 @@ void MovePicker::score() {
|
||||||
|
|
||||||
static_assert(Type == CAPTURES || Type == QUIETS || Type == EVASIONS, "Wrong type");
|
static_assert(Type == CAPTURES || Type == QUIETS || Type == EVASIONS, "Wrong type");
|
||||||
|
|
||||||
Bitboard threatened, threatenedByPawn, threatenedByMinor, threatenedByRook;
|
[[maybe_unused]] Bitboard threatened, threatenedByPawn, threatenedByMinor, threatenedByRook;
|
||||||
if constexpr (Type == QUIETS)
|
if constexpr (Type == QUIETS)
|
||||||
{
|
{
|
||||||
Color us = pos.side_to_move();
|
Color us = pos.side_to_move();
|
||||||
|
@ -122,14 +122,6 @@ void MovePicker::score() {
|
||||||
| (pos.pieces(us, ROOK) & threatenedByMinor)
|
| (pos.pieces(us, ROOK) & threatenedByMinor)
|
||||||
| (pos.pieces(us, KNIGHT, BISHOP) & threatenedByPawn);
|
| (pos.pieces(us, KNIGHT, BISHOP) & threatenedByPawn);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Silence unused variable warnings
|
|
||||||
(void) threatened;
|
|
||||||
(void) threatenedByPawn;
|
|
||||||
(void) threatenedByMinor;
|
|
||||||
(void) threatenedByRook;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& m : *this)
|
for (auto& m : *this)
|
||||||
if constexpr (Type == CAPTURES)
|
if constexpr (Type == CAPTURES)
|
||||||
|
|
Loading…
Add table
Reference in a new issue