From 0b9f92218c82fccc7c05c48ce207fb518a3a2f88 Mon Sep 17 00:00:00 2001 From: Quinten Kock Date: Mon, 15 Jun 2020 22:49:45 +0200 Subject: [PATCH] Save SRAM with making `const` bytes `static const` --- Board.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Board.h b/Board.h index d4fcbd3..191e054 100644 --- a/Board.h +++ b/Board.h @@ -41,20 +41,20 @@ class Board { }; private: - const byte PTR_SIDE_AND_CASTLERIGHT = 0x08; //byte (1=side, 2,4=white castle, 8,16=black) - const byte PTR_PTR_UNMAKE = 0x09; //byte (points to index) - const byte PTR_W_KING = 0x0A; // byte (points to index or maybe 64-arr index) + static const byte PTR_SIDE_AND_CASTLERIGHT = 0x08; //byte (1=side, 2,4=white castle, 8,16=black) + static const byte PTR_PTR_UNMAKE = 0x09; //byte (points to index) + static const byte PTR_W_KING = 0x0A; // byte (points to index or maybe 64-arr index) // const byte PTR_B_KING = 0x0B; (PTR_W_KING | COLOR or PTR_W_KING + COLOR) - const byte PTR_ZOBRIST = 0x0C; // 4 bytes + static const byte PTR_ZOBRIST = 0x0C; // 4 bytes // 0x0D // 0x0E // 0x0F - const byte PTR_ENPASSANT = 0x18; - const byte PTR_REVMOV = 0x19; + static const byte PTR_ENPASSANT = 0x18; + static const byte PTR_REVMOV = 0x19; - const byte PTR_UNMAKE_START = 0x28; - const byte PTR_UNMAKE_LAST = 0x7F; + static const byte PTR_UNMAKE_START = 0x28; + static const byte PTR_UNMAKE_LAST = 0x7F; inline byte get_unmake() __attribute__((always_inline)) { return field[PTR_PTR_UNMAKE]; }