From: Marco Costalba Date: Sat, 29 Nov 2008 23:38:33 +0000 (+0100) Subject: piece_type_to_char() default argument in declaration X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=9d1e4d041d97d2a11a430a3bb6fa360fca31e69f piece_type_to_char() default argument in declaration Default argument should be in declaration where it is visible through header include, not in definition. Signed-off-by: Marco Costalba --- diff --git a/src/piece.cpp b/src/piece.cpp index a4c2220d..e06b6be2 100644 --- a/src/piece.cpp +++ b/src/piece.cpp @@ -72,7 +72,7 @@ const SquareDelta PawnPush[2] = { static const char PieceChars[] = " pnbrqk"; -char piece_type_to_char(PieceType pt, bool upcase = false) { +char 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 5b669499..59f22425 100644 --- a/src/piece.h +++ b/src/piece.h @@ -124,7 +124,7 @@ inline SquareDelta pawn_push(Color c) { //// Prototypes //// -extern char piece_type_to_char(PieceType pt, bool upcase); +extern char piece_type_to_char(PieceType pt, bool upcase = false); extern PieceType piece_type_from_char(char c); extern bool piece_is_ok(Piece pc); extern bool piece_type_is_ok(PieceType pt);