diff options
| author | Scott Gasch <[email protected]> | 2026-09-03 17:01:58 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-09-03 17:01:58 -0700 |
| commit | 6d76699e44f2ed0fb2368ccf0a19ae692a2d4697 (patch) | |
| tree | 1984904fa82e5bc2626364e0ca28c00179938a3b /src/book.c | |
| parent | 5441d2a6ce12eb4169e9d1f194a333684474dc5f (diff) | |
Fix all build warnings across release/DEBUG/TEST profiles
Clean gmake GENETIC=1 PERF_COUNTERS=1 MP=1 SIXTYFOUR=1 build had 100
warnings; DEBUG=1 and TEST=1 builds had more once actually exercised.
- OFFSET_OF/CONTAINING_STRUCT (chess.h) and PTR_TO_ALLOC_HASH (unix.c)
truncated pointers through 32-bit ULONG before use in offset/hash
arithmetic on this 64-bit build -- routed through size_t instead.
- Diagnostic int<->void* round-trips (command.c, root.c, split.c,
sig.c, data.c, unix.c, util.c) widened/narrowed via size_t to avoid
implicit truncation.
- ABS_DIFF on unsigned COOR now casts to int before abs().
- Dropped -fexpensive-optimizations (GCC-only, clang silently ignores
it) from GNUmakefile.
- Removed genuinely dead variables (book.c, gamelist.c, split.c,
testgenerate.c, testhash.c).
- Guarded DEBUG/PERF_COUNTERS/_X86_-only variables and the
_CMEvidenceBucket helper under the #ifdef that actually reads them,
since ASSERT/EVAL_TERM/KEEP_TRACK_OF_FIRST_MOVE_FHs compile away
outside those builds.
- Added missing prototypes for SlidePawn, SlidePawnWithoutSigs,
SlidePieceWithoutSigs (move.c), previously undeclared in chess.h.
- Removed dead _SystemIsRoot (unix.c).
Verified via precommit_check.sh: TEST=1 self-test suite passes,
DEBUG=1 smoke test (10 random ECM positions, sd 4) passes with no
crashes/assertions, release build restored -- all three profiles now
build with zero warnings.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014Cmv11sJZqVfanrPh6UnWE
Diffstat (limited to 'src/book.c')
| -rwxr-xr-x | src/book.c | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -1165,7 +1165,6 @@ Return value: ULONG uCounter; ULONG x; double d; - CHAR *szName = NULL; FLAG fOldValue = g_Options.fShouldAnnounceOpening; g_Options.fShouldAnnounceOpening = FALSE; @@ -1265,7 +1264,6 @@ Return value: (bvFlags & BOOKMOVE_SELECT_MOVE)) { mvBook = entry.mvNext; - szName = szNames[uMoveNum]; goto end; } @@ -1310,7 +1308,6 @@ Return value: _BookRead(&entry); mvBook = entry.mvNext; ASSERT(uBestIndex >= uLow); - szName = szNames[uBestIndex - uLow]; goto end; } } @@ -1368,7 +1365,6 @@ Return value: _BookSeek(uLow + uIndex); _BookRead(&entry); mvBook = entry.mvNext; - szName = szNames[uIndex]; goto end; } } @@ -1899,7 +1895,6 @@ Return value: **/ { - ULONG i; int ifd; CHAR *szTempBook = "tempbook.bin"; CHAR szCmd[SMALL_STRING_LEN_CHAR]; @@ -1917,8 +1912,6 @@ Return value: { return(FALSE); } - i = g_uMemBookCount; - // // Drops all book entries with less than limit occurrances // |
