X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=474e321c09fff8184330be1f27c79dae7c904d6f;hp=5c5211e565756d9572efc156991da9fc0ced76ab;hb=9c428afb6dd0dcba2aa4e2a367a6b35c6f335be0;hpb=0e835bd33496ef7ee467de6fd34c544191e4bab0 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 5c5211e5..474e321c 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008 Marco Costalba + Copyright (C) 2008-2009 Marco Costalba Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -302,7 +302,7 @@ union b_union { struct { uint32_t l; uint32_t h; - }; + } dw; }; // WARNING: Needs -fno-strict-aliasing compiler option @@ -313,15 +313,15 @@ Square pop_1st_bit(Bitboard *bb) { u.b = *bb; - if (u.l) + if (u.dw.l) { - b = u.l; + b = u.dw.l; *((uint32_t*)bb) = b & (b - 1); b ^= (b - 1); } else { - b = u.h; + b = u.dw.h; *((uint32_t*)bb+1) = b & (b - 1); // Little endian only? b = ~(b ^ (b - 1)); }