X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=2317626e3d39cfe6604ce2fc41f7465a7ccbe8e1;hp=03053591f05c5426392b5c494562fde2409a28bd;hb=3d8c0f16c237b1fddaec75c5db70545da47e8bcc;hpb=de2ba70830b0540311fd1e33994a135edaffdb88 diff --git a/src/types.h b/src/types.h index 03053591..2317626e 100644 --- a/src/types.h +++ b/src/types.h @@ -391,11 +391,11 @@ inline bool opposite_colors(Square s1, Square s2) { return ((s >> 3) ^ s) & 1; } -inline char file_to_char(File f, bool tolower = true) { +inline char to_char(File f, bool tolower = true) { return char(f - FILE_A + (tolower ? 'a' : 'A')); } -inline char rank_to_char(Rank r) { +inline char to_char(Rank r) { return char(r - RANK_1 + '1'); } @@ -434,8 +434,8 @@ inline bool is_ok(Move m) { #include -inline const std::string square_to_string(Square s) { - char ch[] = { file_to_char(file_of(s)), rank_to_char(rank_of(s)), 0 }; +inline const std::string to_string(Square s) { + char ch[] = { to_char(file_of(s)), to_char(rank_of(s)), 0 }; return ch; }