From: Marco Costalba Date: Sat, 7 Feb 2009 11:31:53 +0000 (+0100) Subject: Fix casting warnings under Intel Compiler X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=fa322b376823a1d8868eb45d07e2e4331359faae;hp=2ea7449f2a328213b85e043f2de9697d4517d6f7 Fix casting warnings under Intel Compiler Int to Char warning fixed changing the function signature to int. Signed-off-by: Marco Costalba --- diff --git a/src/piece.cpp b/src/piece.cpp index 707c8c57..382ed645 100644 --- a/src/piece.cpp +++ b/src/piece.cpp @@ -35,7 +35,7 @@ static const char PieceChars[] = " pnbrqk"; -char piece_type_to_char(PieceType pt, bool upcase) { +int piece_type_to_char(PieceType pt, bool upcase) { return upcase? toupper(PieceChars[pt]) : PieceChars[pt]; } diff --git a/src/piece.h b/src/piece.h index e0dcc783..d7f11b6c 100644 --- a/src/piece.h +++ b/src/piece.h @@ -160,7 +160,7 @@ inline bool piece_is_ok(Piece pc) { //// Prototypes //// -extern char piece_type_to_char(PieceType pt, bool upcase = false); +extern int piece_type_to_char(PieceType pt, bool upcase = false); extern PieceType piece_type_from_char(char c); diff --git a/src/square.h b/src/square.h index 4f024c96..e8c69327 100644 --- a/src/square.h +++ b/src/square.h @@ -163,16 +163,16 @@ inline File file_from_char(char c) { return File(c - 'a') + FILE_A; } -inline char file_to_char(File f) { - return char(f - FILE_A) + 'a'; +inline int file_to_char(File f) { + return int(f - FILE_A) + 'a'; } inline Rank rank_from_char(char c) { return Rank(c - '1') + RANK_1; } -inline char rank_to_char(Rank r) { - return char(r - RANK_1) + '1'; +inline int rank_to_char(Rank r) { + return int(r - RANK_1) + '1'; } inline Square square_from_string(const std::string& str) {