piece_type_to_char() default argument in declaration
authorMarco Costalba <mcostalba@gmail.com>
Sat, 29 Nov 2008 23:38:33 +0000 (00:38 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 29 Nov 2008 23:38:33 +0000 (00:38 +0100)
Default argument should be in declaration where it
is visible through header include, not in definition.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

src/piece.cpp
src/piece.h

index a4c2220..e06b6be 100644 (file)
@@ -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];
 }
 
index 5b66949..59f2242 100644 (file)
@@ -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);