From 690075675e98ea687862e4884b85ab6414cf5d05 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Mon, 14 Oct 2019 15:58:46 +0200 Subject: [PATCH] Fix compiler warnings for large-board version No functional change. --- src/bitbase.cpp | 7 +++++-- src/position.cpp | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bitbase.cpp b/src/bitbase.cpp index 29a012d..c172aa6 100644 --- a/src/bitbase.cpp +++ b/src/bitbase.cpp @@ -84,7 +84,11 @@ bool Bitbases::probe(Square wksq, Square wpsq, Square bksq, Color us) { void Bitbases::init() { -#ifndef LARGEBOARDS +#ifdef LARGEBOARDS + // Bitbases are not working for large-board version + return; +#endif + std::vector db(MAX_INDEX); unsigned idx, repeat = 1; @@ -102,7 +106,6 @@ void Bitbases::init() { for (idx = 0; idx < MAX_INDEX; ++idx) if (db[idx] == WIN) KPKBitbase[idx / 32] |= 1 << (idx & 0x1F); -#endif } diff --git a/src/position.cpp b/src/position.cpp index 7a186e9..9f3351e 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -269,8 +269,8 @@ Position& Position::set(const Variant* v, const string& fenStr, bool isChess960, size_t idx; std::istringstream ss(fenStr); - std::memset(this, 0, sizeof(Position)); - std::memset(si, 0, sizeof(StateInfo)); + std::memset(static_cast(this), 0, sizeof(Position)); + std::memset(static_cast(si), 0, sizeof(StateInfo)); std::fill_n(&pieceList[0][0], sizeof(pieceList) / sizeof(Square), SQ_NONE); var = v; st = si; @@ -1057,7 +1057,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { // Copy some fields of the old state to our new StateInfo object except the // ones which are going to be recalculated from scratch anyway and then switch // our state pointer to point to the new (ready to be updated) state. - std::memcpy(&newSt, st, offsetof(StateInfo, key)); + std::memcpy(static_cast(&newSt), static_cast(st), offsetof(StateInfo, key)); newSt.previous = st; st = &newSt; -- 1.7.0.4