mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Fix casting warnings under Intel Compiler
Int to Char warning fixed changing the function signature to int. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
2ea7449f2a
commit
fa322b3768
3 changed files with 6 additions and 6 deletions
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
inline int file_to_char(File f) {
|
||||||
return char(f - FILE_A) + 'a';
|
return int(f - FILE_A) + 'a';
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Rank rank_from_char(char c) {
|
inline Rank rank_from_char(char c) {
|
||||||
return Rank(c - '1') + RANK_1;
|
return Rank(c - '1') + RANK_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char rank_to_char(Rank r) {
|
inline int rank_to_char(Rank r) {
|
||||||
return char(r - RANK_1) + '1';
|
return int(r - RANK_1) + '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Square square_from_string(const std::string& str) {
|
inline Square square_from_string(const std::string& str) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue