Fully qualify memset and memcpy

And other trivial touches.

Ispired by Lucas's DiscoCheck

No functional change.
This commit is contained in:
Marco Costalba
2013-07-13 17:21:24 +02:00
parent 6960f41e03
commit 4ede49cd85
10 changed files with 20 additions and 22 deletions

View File

@@ -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;