mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Fully qualify memset and memcpy
And other trivial touches. Ispired by Lucas's DiscoCheck No functional change.
This commit is contained in:
@@ -163,7 +163,7 @@ void Position::init() {
|
||||
|
||||
Position& Position::operator=(const Position& pos) {
|
||||
|
||||
memcpy(this, &pos, sizeof(Position));
|
||||
std::memcpy(this, &pos, sizeof(Position));
|
||||
startState = *st;
|
||||
st = &startState;
|
||||
nodes = 0;
|
||||
@@ -722,7 +722,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
|
||||
// Copy some fields of old state to our new StateInfo object except the ones
|
||||
// which are going to be recalculated from scratch anyway, then switch our state
|
||||
// pointer to point to the new, ready to be updated, state.
|
||||
memcpy(&newSt, st, StateCopySize64 * sizeof(uint64_t));
|
||||
std::memcpy(&newSt, st, StateCopySize64 * sizeof(uint64_t));
|
||||
|
||||
newSt.previous = st;
|
||||
st = &newSt;
|
||||
@@ -1089,7 +1089,7 @@ void Position::do_null_move(StateInfo& newSt) {
|
||||
|
||||
assert(!checkers());
|
||||
|
||||
memcpy(&newSt, st, sizeof(StateInfo)); // Fully copy here
|
||||
std::memcpy(&newSt, st, sizeof(StateInfo)); // Fully copy here
|
||||
|
||||
newSt.previous = st;
|
||||
st = &newSt;
|
||||
@@ -1239,7 +1239,7 @@ int Position::see(Move m, int asymmThreshold) const {
|
||||
|
||||
void Position::clear() {
|
||||
|
||||
memset(this, 0, sizeof(Position));
|
||||
std::memset(this, 0, sizeof(Position));
|
||||
startState.epSquare = SQ_NONE;
|
||||
st = &startState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user