X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftypes.h;h=b7bcb4e89f168c9fdf48cdad1fcfc9d596712ccd;hb=c67fb8ef04439dbd208bfcd53a89367372ef84e7;hp=785d98986ea39e1cbcab7bbb8e65562ace65efe7;hpb=9edc7d6958fd616daecb0ab9ae2aa92042b3d34a;p=stockfish diff --git a/src/types.h b/src/types.h index 785d9898..b7bcb4e8 100644 --- a/src/types.h +++ b/src/types.h @@ -164,7 +164,7 @@ enum Bound { BOUND_NONE = 0, BOUND_UPPER = 1, BOUND_LOWER = 2, - BOUND_EXACT = BOUND_UPPER | BOUND_LOWER | 4 + BOUND_EXACT = BOUND_UPPER | BOUND_LOWER }; enum Value { @@ -441,8 +441,8 @@ inline int square_distance(Square s1, Square s2) { return SquareDistance[s1][s2]; } -inline char file_to_char(File f) { - return char(f - FILE_A + 'a'); +inline char file_to_char(File f, bool tolower = true) { + return char(f - FILE_A + (tolower ? 'a' : 'A')); } inline char rank_to_char(Rank r) { @@ -475,7 +475,7 @@ inline Move make_move(Square from, Square to) { template inline Move make(Square from, Square to, PieceType pt = KNIGHT) { - return Move(to | (from << 6) | T | ((pt - KNIGHT) << 12)) ; + return Move(to | (from << 6) | T | ((pt - KNIGHT) << 12)); } inline bool is_ok(Move m) {