add pos_copy(); pos->king[] set at higher level
This commit is contained in:
@@ -62,6 +62,21 @@ pos_t *pos_dup(const pos_t *pos)
|
||||
return newpos;
|
||||
}
|
||||
|
||||
/**
|
||||
* pos_copy() - copy a position into another one.
|
||||
* @from: &position to duplicate.
|
||||
* @to: &destination position.
|
||||
*
|
||||
* Return a copy of @from into @to.
|
||||
*
|
||||
* @Return: @to.
|
||||
*/
|
||||
pos_t *pos_copy(const pos_t *from, pos_t *to)
|
||||
{
|
||||
*to = *from;
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* pos_del() - delete a position.
|
||||
* @pos: &position.
|
||||
@@ -87,6 +102,7 @@ pos_t *pos_clear(pos_t *pos)
|
||||
pos->turn = WHITE;
|
||||
|
||||
/* move_do/undo position state */
|
||||
pos->key = 0;
|
||||
pos->en_passant = SQUARE_NONE;
|
||||
pos->castle = 0;
|
||||
pos->clock_50 = 0;
|
||||
@@ -336,9 +352,9 @@ bool pos_ok(const pos_t *pos, const bool strict)
|
||||
|
||||
/* force BUG_ON and WARN_ON */
|
||||
# pragma push_macro("BUG_ON")
|
||||
# pragma push_macro("WARN_ON")
|
||||
# undef BUG_ON
|
||||
# define BUG_ON
|
||||
# pragma push_macro("WARN_ON")
|
||||
# undef WARN_ON
|
||||
# define WARN_ON
|
||||
|
||||
|
Reference in New Issue
Block a user