Retire to_char() helpers

Remove some useless wrappers and make
the conversion explicit and starightforward.

No functional change.
This commit is contained in:
Marco Costalba
2014-10-26 19:39:37 +00:00
committed by Joona Kiiski
parent 4f6b1bf3be
commit 428962a2e8
2 changed files with 5 additions and 13 deletions
+1 -9
View File
@@ -30,16 +30,8 @@ std::string score_to_uci(Value v, Value alpha = -VALUE_INFINITE, Value beta = VA
Move move_from_uci(const Position& pos, std::string& str);
const std::string move_to_uci(Move m, bool chess960);
inline char to_char(File f, bool tolower = true) {
return char(f - FILE_A + (tolower ? 'a' : 'A'));
}
inline char to_char(Rank r) {
return char(r - RANK_1 + '1');
}
inline const std::string to_string(Square s) {
char ch[] = { to_char(file_of(s)), to_char(rank_of(s)), 0 };
char ch[] = { 'a' + file_of(s), '1' + rank_of(s), 0 };
return ch;
}