]> git.sesse.net Git - stockfish/commitdiff
Fix casting warnings under Intel Compiler
authorMarco Costalba <mcostalba@gmail.com>
Sat, 7 Feb 2009 11:31:53 +0000 (12:31 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 7 Feb 2009 12:26:29 +0000 (13:26 +0100)
Int to Char warning fixed changing the function
signature to int.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/piece.cpp
src/piece.h
src/square.h

index 707c8c57dfae3d53ae3de96d44de1a40d53e91f4..382ed6456312604c73e2ceea1f9ad40b37c9776e 100644 (file)
@@ -35,7 +35,7 @@
 
 static const char PieceChars[] = " pnbrqk";
 
 
 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];
 }
 
   return upcase? toupper(PieceChars[pt]) : PieceChars[pt];
 }
 
index e0dcc783baa433881814deba72097cd39ab0919a..d7f11b6c3a7ec7c3980efb3546d565a00bc742b6 100644 (file)
@@ -160,7 +160,7 @@ inline bool piece_is_ok(Piece pc) {
 //// Prototypes
 ////
 
 //// 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);
 
 
 extern PieceType piece_type_from_char(char c);
 
 
index 4f024c961df33b8c3c40caed7617b1b14196ccf9..e8c693276b051f5a082a58e045269bfe542ac95d 100644 (file)
@@ -163,16 +163,16 @@ inline File file_from_char(char c) {
   return File(c - 'a') + FILE_A;
 }
 
   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 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) {
 }
 
 inline Square square_from_string(const std::string& str) {