mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Safe guard some wild and ugly casts
These casts are needed but plain ugly, at least be sure they don't hide any subtle conversion bug. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
6cddf9183c
commit
feb5342b39
2 changed files with 4 additions and 0 deletions
|
@ -89,6 +89,7 @@ void generate_kpk_bitbase(uint8_t bitbase[]) {
|
|||
int i, j, b;
|
||||
for(i = 0; i < 24576; i++) {
|
||||
for(b = 0, j = 0; j < 8; b |= (compress_result(Bitbase[8*i+j]) << j), j++);
|
||||
assert(b == int(uint8_t(b)));
|
||||
bitbase[i] = (uint8_t)b;
|
||||
}
|
||||
|
||||
|
|
|
@ -490,7 +490,10 @@ void init_eval(int threads) {
|
|||
}
|
||||
|
||||
for (Bitboard b = 0ULL; b < 256ULL; b++)
|
||||
{
|
||||
assert(count_1s(b) == int(uint8_t(count_1s(b))));
|
||||
BitCount8Bit[b] = (uint8_t)count_1s(b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue