"#define key_t" -> hkey_t type

This commit is contained in:
2024-06-06 07:38:01 +02:00
parent 06904f8a77
commit 00fc61020c
4 changed files with 21 additions and 13 deletions

View File

@@ -24,7 +24,7 @@
#define HASH_SIZE_MIN 4
#define HASH_SIZE_MAX 32768 /* 32Gb */
#define key_t u64 /* cannot use typedef for key_t */
typedef u64 hkey_t; /* cannot use typedef for key_t */
/**
* hentry_t: hashtable bucket.
@@ -33,7 +33,7 @@
* 16 bytes in future, it should be updated to be exactly 32 bytes.
*/
typedef struct {
key_t key; /* zobrist */
hkey_t key; /* zobrist */
union {
u64 data;
struct {
@@ -81,15 +81,15 @@ typedef struct {
*/
#define EP_ZOBRIST_IDX(ep) ( ( (ep) >> 3 ) | sq_file(ep) )
extern key_t zobrist_pieces[16][64];
extern key_t zobrist_castling[4 * 4 + 1];
extern key_t zobrist_turn; /* for black, XOR each ply */
extern key_t zobrist_ep[9]; /* 0-7: ep file, 8: SQUARE_NONE */
extern hkey_t zobrist_pieces[16][64];
extern hkey_t zobrist_castling[4 * 4 + 1];
extern hkey_t zobrist_turn; /* for black, XOR each ply */
extern hkey_t zobrist_ep[9]; /* 0-7: ep file, 8: SQUARE_NONE */
extern hasht_t hash_tt; /* main transposition table */
void zobrist_init(void);
key_t zobrist_calc(pos_t *pos);
hkey_t zobrist_calc(pos_t *pos);
#ifdef ZOBRIST_VERIFY
bool zobrist_verify(pos_t *pos);