stellarUCI Chess engine written in C++20 |
git clone git://git.dimitrijedobrota.com/stellar.git |
Log | Files | Refs | README | LICENSE | |
commit | 8a21b456bb5189594052f3038c5b2871c87abe35 |
parent | d22cfaeb45ea65c1cfcdd598d524d10603b700b1 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Thu, 20 Jun 2024 18:36:47 +0200 |
Fix __UINT32_MAX__ not supported on Windows
Diffstat:M | CMakeLists.txt | | | +- |
M | src/engine/evaluate.cpp | | | +++-- |
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -3,7 +3,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(
Stellar
VERSION 1.4.2
VERSION 1.4.3
DESCRIPTION "Chess engine written in C++"
HOMEPAGE_URL https://git.dimitrijedobrota.com/stellar.git
LANGUAGES CXX
diff --git a/src/engine/evaluate.cpp b/src/engine/evaluate.cpp
@@ -7,6 +7,7 @@
#include <array>
#include <vector>
#include <numeric>
namespace evaluate {
@@ -78,7 +79,7 @@ template <U32 SIZE> struct PTable {
[[nodiscard]] static inline U32 read(U32 hash, Color side) {
const U32 key = side * SIZE + hash % SIZE;
const Hashe &phashe = table[key];
return phashe.key == hash ? key : __UINT32_MAX__;
return phashe.key == hash ? key : std::numeric_limits<uint32_t>::max();
}
[[nodiscard]] static inline int16_t read_opening(U32 key) { return table[key].opening; }
@@ -121,7 +122,7 @@ int16_t score_position_side(const Board &board, const Color side, const uint16_t
const U32 hash = board.get_hash_pawn();
const U32 key = ptable.read(hash, side);
if (key == __UINT32_MAX__) {
if (key == std::numeric_limits<uint32_t>::max()) {
bitboard = board.get_bitboard_piece(PAWN, side);
bitboard_for_each_bit(square_i, bitboard) {
const auto square = static_cast<Square>(square_i);