From: H.G. Muller Date: Fri, 10 Feb 2012 17:39:09 +0000 (+0100) Subject: Remove some of the most verbose debug output X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=a68d4f3896442273c5134c7d8d2876bb8c4d2e83 Remove some of the most verbose debug output --- diff --git a/backend.c b/backend.c index c196662..e931764 100644 --- a/backend.c +++ b/backend.c @@ -1242,11 +1242,9 @@ GetTimeQuota (int movenr, int lastUsed, char *tcString) char *s = tcString; if(!*s) return 0; // empty TC string means we ran out of the last sudden-death version - if(appData.debugMode) fprintf(debugFP, "TC string = '%s'\n", tcString); do { if(moves) NextSessionFromString(&s, &moves, &time, &increment, &incType); nextSession = s; suddenDeath = moves == 0 && increment == 0; - if(appData.debugMode) fprintf(debugFP, "mps=%d tc=%d inc=%d\n", moves, (int) time, (int) increment); if(movenr == -1) return time; /* last move before new session */ if(incType == '*') increment = 0; else // for sandclock, time is added while not thinking if(incType == '!' && lastUsed < increment) increment = lastUsed; @@ -1426,7 +1424,7 @@ ReserveGame (int gameNr, char resChar) UnloadEngine(&first); // next game belongs to other pairing; UnloadEngine(&second); // already unload the engines, so TwoMachinesEvent will load new ones. } - if(appData.debugMode) fprintf(debugFP, "Reserved, next=%d, nr=%d, procs=(%x,%x)\n", nextGame, gameNr, first.pr, second.pr); + if(appData.debugMode) fprintf(debugFP, "Reserved, next=%d, nr=%d\n", nextGame, gameNr); } void @@ -7563,14 +7561,6 @@ Adjudicate (ChessProgramState *cps) } } else moveCount = 6; } - if (appData.debugMode) { int i; - fprintf(debugFP, "repeat test fmm=%d bmm=%d ep=%d, reps=%d\n", - forwardMostMove, backwardMostMove, boards[backwardMostMove][EP_STATUS], - appData.drawRepeats); - for( i=forwardMostMove; i>=backwardMostMove; i-- ) - fprintf(debugFP, "%d ep=%d\n", i, (signed char)boards[i][EP_STATUS]); - - } // Repetition draws and 50-move rule can be applied independently of legality testing @@ -7906,11 +7896,6 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h return; } - if (appData.debugMode) { int f = forwardMostMove; - fprintf(debugFP, "machine move %d, castling = %d %d %d %d %d %d\n", f, - boards[f][CASTLING][0],boards[f][CASTLING][1],boards[f][CASTLING][2], - boards[f][CASTLING][3],boards[f][CASTLING][4],boards[f][CASTLING][5]); - } if(cps->alphaRank) AlphaRank(machineMove, 4); if (!ParseOneMove(machineMove, forwardMostMove, &moveType, &fromX, &fromY, &toX, &toY, &promoChar)) { @@ -7936,12 +7921,6 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h ChessMove moveType; moveType = LegalityTest(boards[forwardMostMove], PosFlags(forwardMostMove), fromY, fromX, toY, toX, promoChar); - if (appData.debugMode) { - int i; - for(i=0; i< nrCastlingRights; i++) fprintf(debugFP, "(%d,%d) ", - boards[forwardMostMove][CASTLING][i], castlingRank[i]); - fprintf(debugFP, "castling rights\n"); - } 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); @@ -9460,9 +9439,6 @@ MakeMove (int fromX, int fromY, int toX, int toY, int promoChar) strcat(parseList[forwardMostMove - 1], "#"); break; } - if (appData.debugMode) { - fprintf(debugFP, "move: %s, parse: %s (%c)\n", moveList[forwardMostMove-1], parseList[forwardMostMove-1], moveList[forwardMostMove-1][4]); - } } @@ -15251,9 +15227,6 @@ SendTimeRemaining (ChessProgramState *cps, int machineWhite) } /* [HGM] translate opponent's time by time-odds factor */ otime = (otime * cps->other->timeOdds) / cps->timeOdds; - if (appData.debugMode) { - fprintf(debugFP, "time odds: %f %f \n", cps->timeOdds, cps->other->timeOdds); - } if (time <= 0) time = 1; if (otime <= 0) otime = 1; diff --git a/moves.c b/moves.c index 02ced64..0de99f7 100644 --- a/moves.c +++ b/moves.c @@ -1088,9 +1088,6 @@ LegalityTestCallback (Board board, int flags, ChessMove kind, int rf, int ff, in { register LegalityTestClosure *cl = (LegalityTestClosure *) closure; -// if (appData.debugMode) { -// fprintf(debugFP, "Legality test: %c%c%c%c\n", ff+AAA, rf+ONE, ft+AAA, rt+ONE); -// } if(board[rt][ft] != EmptySquare || kind==WhiteCapturesEnPassant || kind==BlackCapturesEnPassant) cl->captures++; // [HGM] losers: count legal captures if (rf == cl->rf && ff == cl->ff && rt == cl->rt && ft == cl->ft) @@ -1107,11 +1104,6 @@ LegalityTest (Board board, int flags, int rf, int ff, int rt, int ft, int promoC piece = filterPiece = board[rf][ff]; if(PieceToChar(piece) == '~') filterPiece = DEMOTED piece; - if (appData.debugMode) { - int i; - for(i=0; i<6; i++) fprintf(debugFP, "%d ", castlingRights[i]); - fprintf(debugFP, "Legality test? %c%c%c%c\n", ff+AAA, rf+ONE, ft+AAA, rt+ONE); - } /* [HGM] Cobra and Falcon are wildcard pieces; consider all their moves legal */ /* (perhaps we should disallow moves that obviously leave us in check?) */ if(piece == WhiteFalcon || piece == BlackFalcon || @@ -1234,7 +1226,6 @@ MateTest (Board board, int flags) else hisPieces++; } } - if(appData.debugMode) fprintf(debugFP, "MateTest: K=%d, my=%d, his=%d\n", nrKing, myPieces, hisPieces); switch(gameInfo.variant) { // [HGM] losers: extinction wins case VariantShatranj: if(hisPieces == 1) return myPieces > 1 ? MT_BARE : MT_DRAW; @@ -1501,8 +1492,6 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p piece = board[rf][ff]; if(PieceToChar(piece)=='~') piece = (ChessSquare)(DEMOTED piece); - if (appData.debugMode) - fprintf(debugFP, "CoordsToAlgebraic, piece=%d (%d,%d)-(%d,%d) %c\n", (int)piece,ff,rf,ft,rt,promoChar >= ' ' ? promoChar : '-'); switch (piece) { case WhitePawn: case BlackPawn: @@ -1532,8 +1521,6 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p } /* Use promotion suffix style "=Q" */ *outp = NULLCHAR; - if (appData.debugMode) - fprintf(debugFP, "movetype=%d, promochar=%d=%c\n", (int)kind, promoChar, promoChar >= ' ' ? promoChar : '-'); if (promoChar != NULLCHAR) { if(gameInfo.variant == VariantShogi) { /* [HGM] ... but not in Shogi! */ diff --git a/parser.c b/parser.c index c4330d1..c195d7e 100644 --- a/parser.c +++ b/parser.c @@ -220,7 +220,6 @@ NextUnit (char **p) type[1] = NOTHING; // disambiguator goes in first two positions n = 4; } -if(appData.debugMode)fprintf(debugFP, "trial %d,%d,%d,%d type %d%d%d%d\n", coord[0], coord[1], coord[2], coord[3], type[0], type[1], type[2], type[3]); // we always get here; move must be completely read now, with to-square coord(s) at end if(n == 3) { // incomplete to-square. Could be Xiangqi traditional, or stuff like fxg if(piece && type[1] == NOTHING && type[0] == NUMERIC && type[2] == NUMERIC && diff --git a/xboard.c b/xboard.c index 310274d..dbea540 100644 --- a/xboard.c +++ b/xboard.c @@ -8247,11 +8247,6 @@ AnimateMove (Board board, int fromX, int fromY, int toX, int toY) hop = abs(fromX-toX) == 1 && abs(fromY-toY) == 2 || abs(fromX-toX) == 2 && abs(fromY-toY) == 1; #endif - if (appData.debugMode) { - fprintf(debugFP, hop ? _("AnimateMove: piece %d hops from %d,%d to %d,%d \n") : - _("AnimateMove: piece %d slides from %d,%d to %d,%d \n"), - piece, fromX, fromY, toX, toY); } - ScreenSquare(fromX, fromY, &start, &startColor); ScreenSquare(toX, toY, &finish, &endColor); diff --git a/xoptions.c b/xoptions.c index 22aac1e..7de5912 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1161,7 +1161,6 @@ GenericPopUp (Option *option, char *title, int dlgNr) XtSetArg(args[j], XtNleft, XtChainLeft); j++; XtSetArg(args[j], XtNright, XtChainLeft); j++; XtSetArg(args[j], XtNborderWidth, 0); j++; -printf("%d\n",textHeight); if(textHeight < 24) dialog = last; else dialog = XtCreateManagedWidget(" ", labelWidgetClass, form, args, j); j=0;