From: H.G.Muller Date: Tue, 2 Feb 2016 11:09:17 +0000 (+0100) Subject: Fix two compiler warnings X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=f439f9680ca51033a0d99b777a994223a041f763;p=xboard.git Fix two compiler warnings --- diff --git a/backend.c b/backend.c index 37648d9..da945a6 100644 --- a/backend.c +++ b/backend.c @@ -192,7 +192,6 @@ void GameEnds P((ChessMove result, char *resultDetails, int whosays)); void EditPositionDone P((Boolean fakeRights)); void PrintOpponents P((FILE *fp)); void PrintPosition P((FILE *fp, int move)); -void StartChessProgram P((ChessProgramState *cps)); void SendToProgram P((char *message, ChessProgramState *cps)); void SendMoveToProgram P((int moveNum, ChessProgramState *cps)); void ReceiveFromProgram P((InputSourceRef isr, VOIDSTAR closure, @@ -8642,7 +8641,7 @@ HandleMachineMove (char *message, ChessProgramState *cps) ChessMove moveType; char promoChar, roar; char *p, *pv=buf1; - int machineWhite, oldError; + int oldError; char *bookHit; if(cps == &pairing && sscanf(message, "%d-%d", &savedWhitePlayer, &savedBlackPlayer) == 2) { @@ -8734,6 +8733,8 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h } else { + int machineWhite = FALSE; + switch (gameMode) { case BeginningOfGame: /* Extra move from before last reset; ignore */ @@ -8815,7 +8816,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h snprintf(buf1, MSG_SIZ*10, "Xboard: Forfeit due to invalid move: %s (%c%c%c%c via %c%c, %c%c) res=%d", machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, killX+AAA, killY+ONE, kill2X+AAA, kill2Y+ONE, moveType); if (gameMode == TwoMachinesPlay) { - GameEnds(machineWhite ? BlackWins : WhiteWins, + GameEnds(cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, buf1, GE_XBOARD); } return; @@ -8833,7 +8834,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h if(moveType == IllegalMove) { snprintf(buf1, MSG_SIZ*10, "Xboard: Forfeit due to illegal move: %s (%c%c%c%c)%c", machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, 0); - GameEnds(machineWhite ? BlackWins : WhiteWins, + GameEnds(cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, buf1, GE_XBOARD); return; } else if(!appData.fischerCastling) diff --git a/backend.h b/backend.h index c148271..9f95098 100644 --- a/backend.h +++ b/backend.h @@ -425,6 +425,7 @@ void CreateBookEvent P((void)); char *SupportedVariant P((char *list, VariantClass v, int w, int h, int s, int proto, char *engine)); char *CollectPieceDescriptors P((void)); void RefreshSettingsDialog P((ChessProgramState *cps, int val)); +void StartChessProgram P((ChessProgramState *cps)); /* A point in time */