We cannot cast a pointer type to an unrelated pointer type.
This is a violation of the strict aliasing rules.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Square pop_1st_bit(Bitboard* bb) {
Square pop_1st_bit(Bitboard* bb) {
- ret = Square(BitTable[((u->dw.l ^ (u->dw.l - 1)) * 0x783a9b23) >> 26]);
- u->dw.l &= (u->dw.l - 1);
+ ret = Square(BitTable[((u.dw.l ^ (u.dw.l - 1)) * 0x783a9b23) >> 26]);
+ u.dw.l &= (u.dw.l - 1);
+ *bb = u.b;
- ret = Square(BitTable[((~(u->dw.h ^ (u->dw.h - 1))) * 0x783a9b23) >> 26]);
- u->dw.h &= (u->dw.h - 1);
+ ret = Square(BitTable[((~(u.dw.h ^ (u.dw.h - 1))) * 0x783a9b23) >> 26]);
+ u.dw.h &= (u.dw.h - 1);
+ *bb = u.b;