From 1c03d229073e56dda9e5856db5adaae51576a3bb Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Wed, 9 Jan 2013 07:57:43 -0800 Subject: [PATCH] removed trailing whitespace --- autogen.sh | 14 ++-- backend.c | 64 +++++++++--------- board.c | 4 +- board.h | 1 - book.c | 14 ++-- childio.c | 6 +- childio.h | 2 +- common.h | 1 - dialogs.c | 11 ++-- dialogs.h | 5 +- draw.c | 6 +- draw.h | 1 - engineoutput.h | 1 - evalgraph.c | 4 +- evalgraph.h | 1 - gamelist.c | 1 - gtk/xboard.c | 21 +++--- gtk/xboard.h | 1 - gtk/xengineoutput.c | 3 +- gtk/xoptions.c | 188 +++++++++++++++++++++++++-------------------------- gtk/xtimer.c | 2 - history.c | 9 +-- install-sh | 16 ++-- menus.c | 6 +- menus.h | 1 - moves.c | 18 +++--- moves.h | 6 +- nengineoutput.c | 1 - nevalgraph.c | 1 - ngamelist.c | 3 +- nhistory.c | 2 +- parser.c | 8 +- uci.c | 4 +- usounds.c | 2 - usystem.c | 6 +- usystem.h | 1 - xaw/xboard.c | 1 - xaw/xboard.h | 1 - xaw/xengineoutput.c | 1 - xaw/xgamelist.c | 1 - xaw/xhistory.c | 3 +- xaw/xoptions.c | 9 +-- zic2xpm.c | 78 +++++++++++----------- 43 files changed, 246 insertions(+), 283 deletions(-) diff --git a/autogen.sh b/autogen.sh index a3117f0..9e86c22 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,23 +1,23 @@ #! /bin/sh # This file is part of GNU XBoard. -# +# # Copyright 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. -# +# # GNU XBoard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. -# +# # GNU XBoard is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -# See the file ChangeLog for a revision history. +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# See the file ChangeLog for a revision history. aclocal -I m4 \ && autoheader \ diff --git a/backend.c b/backend.c index c6112e3..34ffd0a 100644 --- a/backend.c +++ b/backend.c @@ -876,7 +876,7 @@ ReplaceEngine (ChessProgramState *cps, int n) extern char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params; extern Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick; -static char resetOptions[] = +static char resetOptions[] = "-reuse -firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 " "-firstInitString \"" INIT_STRING "\" -firstComputerString \"" COMPUTER_STRING "\" " "-firstFeatures \"\" -firstLogo \"\" -firstAccumulateTC 1 " @@ -948,7 +948,7 @@ Load (ChessProgramState *cps, int i) if(nickName[0]) snprintf(buf, MSG_SIZ, "\"%s\" -fcp ", nickName); else buf[0] = NULLCHAR; quote = strchr(p, '"') ? '\'' : '"'; // use single quotes around engine command if it contains double quotes snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), "%c%s%c -fd \"%s\"%s%s%s%s%s%s%s%s\n", - quote, p, quote, appData.directory[i], + quote, p, quote, appData.directory[i], useNick ? " -fn \"" : "", useNick ? nickName : "", useNick ? "\"" : "", @@ -1285,16 +1285,16 @@ ParseTimeControl (char *tc, float ti, int mps) if(mps) snprintf(buf, MSG_SIZ, ":%d/%s+%g", mps, mytc, ti); - else + else snprintf(buf, MSG_SIZ, ":%s+%g", mytc, ti); } else { if(mps) snprintf(buf, MSG_SIZ, ":%d/%s", mps, mytc); - else + else snprintf(buf, MSG_SIZ, ":%s", mytc); } fullTimeControlString = StrSave(buf); // this should now be in PGN format - + if( NextTimeControlFromString( &tc, &tc1 ) != 0 ) { return FALSE; } @@ -6082,7 +6082,7 @@ InitPosition (int redraw) initialPosition[2][0] = BlackAngel; initialPosition[6][BOARD_WIDTH-1] = WhiteMarshall; initialPosition[5][BOARD_WIDTH-1] = WhiteAngel; - initialPosition[1][1] = initialPosition[2][1] = + initialPosition[1][1] = initialPosition[2][1] = initialPosition[6][BOARD_WIDTH-2] = initialPosition[5][BOARD_WIDTH-2] = 1; } if (appData.debugMode) { @@ -6537,7 +6537,7 @@ OKToStartUserMove (int x, int y) } Boolean -OnlyMove (int *x, int *y, Boolean captures) +OnlyMove (int *x, int *y, Boolean captures) { DisambiguateClosure cl; if (appData.zippyPlay || !appData.testLegality) return FALSE; @@ -6750,12 +6750,12 @@ UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) if( (fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) && fromY != DROP_RANK ) { if( pup != EmptySquare ) return; moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; - if(appData.debugMode) fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n", + if(appData.debugMode) fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n", moveType, currentMove, fromX, fromY, boards[currentMove][fromY][fromX]); // holdings might not be sent yet in ICS play; we have to figure out which piece belongs here if(fromX == 0) fromY = BOARD_HEIGHT-1 - fromY; // black holdings upside-down fromX = fromX ? WhitePawn : BlackPawn; // first piece type in selected holdings - while(PieceToChar(fromX) == '.' || PieceToNumber(fromX) != fromY && fromX != (int) EmptySquare) fromX++; + while(PieceToChar(fromX) == '.' || PieceToNumber(fromX) != fromY && fromX != (int) EmptySquare) fromX++; fromY = DROP_RANK; } @@ -7212,7 +7212,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) } } if(x == fromX && y == fromY) return; // if OnlyMove altered (x,y) we go on - second = FALSE; + second = FALSE; } // ignore clicks on holdings if(x < BOARD_LEFT || x >= BOARD_RGHT) return; @@ -8021,7 +8021,7 @@ LoadError (char *errmess, ChessProgramState *cps) if(cps->initDone) return FALSE; cps->isr = NULL; // this should suppress further error popups from breaking pipes DestroyChildProcess(cps->pr, 9 ); // just to be sure - cps->pr = NoProc; + cps->pr = NoProc; if(cps == &first) { appData.noChessProgram = TRUE; gameMode = MachinePlaysBlack; ModeHighlight(); // kludge to unmark Machine Black menu @@ -8396,7 +8396,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. return; // [HGM] This return was missing, causing option features to be recognized as non-compliant commands! } - if ((!appData.testLegality || gameInfo.variant == VariantFairy) && + if ((!appData.testLegality || gameInfo.variant == VariantFairy) && !strncmp(message, "setup ", 6)) { // [HGM] allow first engine to define opening position int dummy, s=6; char buf[MSG_SIZ]; if(appData.icsActive || forwardMostMove != 0 || cps != &first) return; @@ -9452,7 +9452,7 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) ) { /* white pawn promotion */ board[toY][toX] = CharToPiece(ToUpper(promoChar)); - if((gameInfo.variant==VariantBughouse || gameInfo.variant==VariantCrazyhouse) + if((gameInfo.variant==VariantBughouse || gameInfo.variant==VariantCrazyhouse) && PieceToChar(PROMOTED board[toY][toX]) == '~') /* [HGM] use shadow piece (if available) */ board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); board[fromY][fromX] = EmptySquare; @@ -9513,7 +9513,7 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) ) { /* black pawn promotion */ board[toY][toX] = CharToPiece(ToLower(promoChar)); - if((gameInfo.variant==VariantBughouse || gameInfo.variant==VariantCrazyhouse) + if((gameInfo.variant==VariantBughouse || gameInfo.variant==VariantCrazyhouse) && PieceToChar(PROMOTED board[toY][toX]) == '~') /* [HGM] use shadow piece (if available) */ board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); board[fromY][fromX] = EmptySquare; @@ -10357,7 +10357,7 @@ Pairing (int nr, int nPlayers, int *whitePlayer, int *blackPlayer, int *syncInte *blackPlayer = curRound + appData.tourneyType; } - // take care of white/black alternation per round. + // take care of white/black alternation per round. // For cycles and games this is already taken care of by default, derived from matchGame! return curRound & 1; } @@ -10406,7 +10406,7 @@ NextTourneyGame (int nr, int *swapColors) SendToProgram(buf, &pairing); return 0; // wait for pairing engine to answer (which causes NextTourneyGame to be called again... } - pairingReceived = 0; // ... so we continue here + pairingReceived = 0; // ... so we continue here *swapColors = 0; appData.matchGames = appData.tourneyCycles * syncInterval - 1; whitePlayer = savedWhitePlayer-1; blackPlayer = savedBlackPlayer-1; @@ -11781,12 +11781,12 @@ InitSearch () if(piece < BlackPawn) piece += BlackPawn; else if(piece < EmptySquare) piece -= BlackPawn; // color-flip reverseBoard[r][f] = piece; } - reverseBoard[EP_STATUS-1] = soughtBoard[EP_STATUS-1] ^ 3; + reverseBoard[EP_STATUS-1] = soughtBoard[EP_STATUS-1] ^ 3; for(r=0; r<6; r++) reverseBoard[CASTLING][r] = boards[currentMove][CASTLING][(r+3)%6]; if(appData.findMirror && appData.searchMode <= 3 && (!nrCastlingRights - || (boards[currentMove][CASTLING][2] == NoRights || + || (boards[currentMove][CASTLING][2] == NoRights || boards[currentMove][CASTLING][0] == NoRights && boards[currentMove][CASTLING][1] == NoRights ) - && (boards[currentMove][CASTLING][5] == NoRights || + && (boards[currentMove][CASTLING][5] == NoRights || boards[currentMove][CASTLING][3] == NoRights && boards[currentMove][CASTLING][4] == NoRights ) ) ) { flipSearch = TRUE; @@ -13485,9 +13485,9 @@ PauseEvent () StopClocks(); } else if(appData.ponderNextMove) SendToProgram("easy\n", &first); // pre-emptively bring out of ponder } else { // human on move, pause pondering by either method - if(first.pause) + if(first.pause) PauseEngine(&first); - else if(appData.ponderNextMove) + else if(appData.ponderNextMove) SendToProgram("easy\n", &first); StopClocks(); } @@ -13817,7 +13817,7 @@ DisplayTwoMachinesTitle () gameInfo.white, _("vs."), gameInfo.black, nextGame+1, appData.matchGames+1, appData.tourneyType>0 ? "gt" : appData.tourneyType<0 ? "sw" : "rr"); - } else + } else if (first.twoMachinesColor[0] == 'w') { snprintf(buf, MSG_SIZ, "%s %s %s (%d-%d-%d)", gameInfo.white, _("vs."), gameInfo.black, @@ -14892,7 +14892,7 @@ BackwardInner (int target) for(i=target; i>backwardMostMove; i--) { // seek back to start or previous null move if(moveList[i-1][1] == '@' && moveList[i-1][0] == '@') break; } - SendBoard(&first, i); + SendBoard(&first, i); if(second.analyzing) SendBoard(&second, i); for(currentMove=i; currentMove= 2); @@ -16167,9 +16167,9 @@ AskQuestionEvent (char *title, char *question, char *replyPrefix, char *which) void TypeInEvent (char firstChar) { - if ((gameMode == BeginningOfGame && !appData.icsActive) || + if ((gameMode == BeginningOfGame && !appData.icsActive) || gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack || - gameMode == AnalyzeMode || gameMode == EditGame || + gameMode == AnalyzeMode || gameMode == EditGame || gameMode == EditPosition || gameMode == IcsExamining || gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || isdigit(firstChar) && // [HGM] movenum: allow typing in of move nr in 'passive' modes @@ -16205,16 +16205,16 @@ TypeInDoneEvent (char *move) return; } - if (gameMode != EditGame && currentMove != forwardMostMove && + if (gameMode != EditGame && currentMove != forwardMostMove && gameMode != Training) { DisplayMoveError(_("Displayed move is not current")); } else { - int ok = ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, + int ok = ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, &moveType, &fromX, &fromY, &toX, &toY, &promoChar); if(!ok && move[0] >= 'a') { move[0] += 'A' - 'a'; ok = 2; } // [HGM] try also capitalized - if (ok==1 || ok && ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, + if (ok==1 || ok && ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, &moveType, &fromX, &fromY, &toX, &toY, &promoChar)) { - UserMoveEvent(fromX, fromY, toX, toY, promoChar); + UserMoveEvent(fromX, fromY, toX, toY, promoChar); } else { DisplayMoveError(_("Could not parse move")); } @@ -17632,7 +17632,7 @@ LoadTheme () snprintf(buf, MSG_SIZ, "\"%s\"", nickName); if(appData.useBitmaps) { snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ubt true -lbtf \"%s\" -dbtf \"%s\" -lbtm %d -dbtm %d", - appData.liteBackTextureFile, appData.darkBackTextureFile, + appData.liteBackTextureFile, appData.darkBackTextureFile, appData.liteBackTextureMode, appData.darkBackTextureMode ); } else { diff --git a/board.c b/board.c index d28fb75..d4afa00 100644 --- a/board.c +++ b/board.c @@ -163,7 +163,7 @@ SetHighlights (int fromX, int fromY, int toX, int toY) drawHighlight(hi2X, hi2Y, 0); } } - + if(arrow) // there currently is an arrow displayed ArrowDamage(hi1X, hi1Y, hi2X, hi2Y); // mark which squares it damaged @@ -1242,5 +1242,3 @@ DrawArrowHighlight (int fromX, int fromY, int toX,int toY) if( IsDrawArrowEnabled() && fromX >= 0 && fromY >= 0 && toX >= 0 && toY >= 0) DrawArrowBetweenSquares(fromX, fromY, toX, toY); } - - diff --git a/board.h b/board.h index 5c34bc8..0d80544 100644 --- a/board.h +++ b/board.h @@ -96,4 +96,3 @@ void SwitchWindow P((void)); extern int damage[2][BOARD_RANKS][BOARD_FILES]; extern Option *currBoard; - diff --git a/book.c b/book.c index 1c7f2fe..e491615 100644 --- a/book.c +++ b/book.c @@ -2,7 +2,7 @@ * book.c -- code for probing Polyglot opening books * * This code was first released in the public domain by Michel Van den Bergh. - * The array Random64 is taken from the Polyglot source code. + * The array Random64 is taken from the Polyglot source code. * I am pretty sure that a table of random numbers is never protected * by copyright. * @@ -65,7 +65,7 @@ typedef unsigned short uint16; typedef unsigned int uint32; typedef struct { - uint64 key; + uint64 key; uint16 move; uint16 weight; uint16 learnPoints; @@ -358,7 +358,7 @@ hash (int moveNr) f = boards[moveNr][EP_STATUS]; if(f >= 0 && f < 8){ if(!WhiteOnMove(moveNr)){ - // the test for neighboring Pawns might not be needed, + // the test for neighboring Pawns might not be needed, // as epStatus already kept track of it, but better safe than sorry. if((f>0 && boards[moveNr][3][f-1]==BlackPawn)|| (f<7 && boards[moveNr][3][f+1]==BlackPawn)){ @@ -515,7 +515,7 @@ move_to_string (char move_s[6], uint16 move) if(gameInfo.variant != VariantNormal) return; - // correct FRC-style castlings in variant normal. + // correct FRC-style castlings in variant normal. // [HGM] This is buggy code! e1h1 could very well be a normal R or Q move. if(!strcmp(move_s,"e1h1")){ safeStrCpy(move_s,"e1g1", 6); @@ -567,7 +567,7 @@ ReadFromBookFile (int moveNr, char *book, entry_t entries[]) static FILE *f = NULL; static char curBook[MSG_SIZ]; - if(book == NULL) return -1; + if(book == NULL) return -1; if(!f || strcmp(book, curBook)){ // keep book file open until book changed strncpy(curBook, book, MSG_SIZ); if(f) fclose(f); @@ -665,14 +665,14 @@ MCprobe (moveNr) char *ProbeBook (int moveNr, char *book) -{ // +{ // entry_t entries[MOVE_BUF]; int count; int i, j; static char move_s[6]; int total_weight; - if(moveNr >= 2*appData.bookDepth) return NULL; + if(moveNr >= 2*appData.bookDepth) return NULL; if(mcMode) return MCprobe(moveNr); if((count = ReadFromBookFile(moveNr, book, entries)) <= 0) return NULL; // no book, or no hit diff --git a/childio.c b/childio.c index 1bf2459..da1a452 100644 --- a/childio.c +++ b/childio.c @@ -1,8 +1,8 @@ /* - * childio.c -- set up communication with child processes + * childio.c -- set up communication with child processes * * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. + * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. @@ -133,7 +133,7 @@ PseudoTTY (char pty_name[]) extern char *ptsname(); char *ptss; int fd; - + fd = open("/dev/ptmx", O_RDWR); if (fd < 0) return fd; if (grantpt(fd) == -1) return -1; diff --git a/childio.h b/childio.h index b3b3112..0a1b494 100644 --- a/childio.h +++ b/childio.h @@ -2,7 +2,7 @@ * childio.h -- set up communication with child processes * * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. + * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. diff --git a/common.h b/common.h index e99227f..2829caf 100644 --- a/common.h +++ b/common.h @@ -842,4 +842,3 @@ void DisplayError P((String message, int error)); #define secondOptions engOptions[1] #endif - diff --git a/dialogs.c b/dialogs.c index 5cbd14f..09afb95 100644 --- a/dialogs.c +++ b/dialogs.c @@ -606,7 +606,7 @@ IcsOptionsProc () //-------------------------------------------- Load Game Options --------------------------------- -static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"), +static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"), N_("Same material"), N_("Material range (top board half optional)"), N_("Material difference (optional stuff balanced)"), NULL }; static char *modeValues[] = { "1", "2", "3", "4", "5", "6" }; static char *searchMode; @@ -1127,7 +1127,7 @@ NextInHistory () { if (histP == histIn) return NULL; histP = (histP + 1) % HISTORY_SIZE; - return history[histP]; + return history[histP]; } // end of borrowed code @@ -1838,7 +1838,7 @@ ErrorPopUp (char *title, char *label, int modal) { errorUp = True; errorOptions[1].name = label; - if(dialogError = shellUp[TransientDlg]) + if(dialogError = shellUp[TransientDlg]) GenericPopUp(errorOptions+1, title, FatalDlg, TransientDlg, MODAL, 0); // pop up as daughter of the transient dialog else GenericPopUp(errorOptions+modal, title, modal ? FatalDlg: ErrorDlg, BoardWindow, modal, 0); // kludge: option start address indicates modality @@ -2009,7 +2009,7 @@ DisplayLogos (Option *w1, Option *w2) { void *whiteLogo = first.programLogo, *blackLogo = second.programLogo; if(appData.autoLogo) { - + switch(gameMode) { // pick logos based on game mode case IcsObserving: whiteLogo = second.programLogo; // ICS logo @@ -2116,7 +2116,7 @@ SizeKludge (int n) int w = width - 44 - mainOptions[n].min; mainOptions[W_TITLE].max = w; // width left behind menu bar if(w < 0.4*width) // if no reasonable amount of space for title, force small layout - mainOptions[W_SMALL].type = mainOptions[W_TITLE].type, mainOptions[W_TITLE].type = -1; + mainOptions[W_SMALL].type = mainOptions[W_TITLE].type, mainOptions[W_TITLE].type = -1; } void @@ -2588,4 +2588,3 @@ Col2Text (int n) { return NULL; } - diff --git a/dialogs.h b/dialogs.h index 9c35f16..ad483e9 100644 --- a/dialogs.h +++ b/dialogs.h @@ -87,14 +87,14 @@ #define W_WHITE 12 #define W_BLACK 13 #define W_SMALL 15 // title in small layout -#define W_MESSG 16 +#define W_MESSG 16 #define W_BUTTON 17 // button bar #define W_PAUSE 20 #define W_BOARD 24 #define W_MENUW 25 #define W_MENUB 26 #define W_DROP 27 // drop (popup) menu - + typedef enum { // identifier of dialogs done by GenericPopup TransientDlg=0, // transient: grabs mouse events and is destroyed at pop-down (so other dialog can use this ID next time) CommentDlg, TagsDlg, TextMenuDlg, InputBoxDlg, ChatDlg, DummyDlg, HistoryDlg, // persistent: no grab and reused @@ -191,4 +191,3 @@ void SendString P((char *p)); // in ngamelist.c int GameListClicks P((int direction)); void SetFilter P((void)); - diff --git a/draw.c b/draw.c index c681eae..0f34e24 100644 --- a/draw.c +++ b/draw.c @@ -232,8 +232,8 @@ CreatePNGBoard (char *s, int kind) } char *pngPieceNames[] = // must be in same order as internal piece encoding -{ "Pawn", "Knight", "Bishop", "Rook", "Queen", "Advisor", "Elephant", "Archbishop", "Marshall", "Gold", "Commoner", - "Canon", "Nightrider", "CrownedBishop", "CrownedRook", "Princess", "Chancellor", "Hawk", "Lance", "Cobra", "Unicorn", "King", +{ "Pawn", "Knight", "Bishop", "Rook", "Queen", "Advisor", "Elephant", "Archbishop", "Marshall", "Gold", "Commoner", + "Canon", "Nightrider", "CrownedBishop", "CrownedRook", "Princess", "Chancellor", "Hawk", "Lance", "Cobra", "Unicorn", "King", "GoldKnight", "GoldLance", "GoldPawn", "GoldSilver", NULL }; @@ -921,5 +921,3 @@ DrawEvalText (char *buf, int cbBuf, int y) /* free memory */ cairo_destroy (cr); } - - diff --git a/draw.h b/draw.h index ed8b596..b666150 100644 --- a/draw.h +++ b/draw.h @@ -74,4 +74,3 @@ float Color P((char *col, int n)); // defined in xoptions.c void GraphExpose P((Option *opt, int x, int y, int w, int h)); - diff --git a/engineoutput.h b/engineoutput.h index e15825b..098f6a8 100644 --- a/engineoutput.h +++ b/engineoutput.h @@ -71,4 +71,3 @@ int EngineOutputDialogExists(); void SetEngineOutputTitle( char *title ); void InitEngineOutput P((Option *opt, Option *memo2)); // XB only void DrawWidgetIcon P((Option *opt, int nIcon)); // XB only - diff --git a/evalgraph.c b/evalgraph.c index b380731..2da07fd 100644 --- a/evalgraph.c +++ b/evalgraph.c @@ -102,7 +102,7 @@ MakeEvalTitle (char *title) if( depth <=0 ) return title; if( currCurrent & 1 ) score = -score; /* Flip score for black */ - snprintf(buf, MSG_SIZ, "%s {%d: %s%.2f/%-2d %d}", title, currCurrent/2+1, + snprintf(buf, MSG_SIZ, "%s {%d: %s%.2f/%-2d %d}", title, currCurrent/2+1, score>0 ? "+" : " ", score/100., depth, (currPvInfo[currCurrent].time+50)/100); return buf; @@ -152,7 +152,7 @@ static void DrawAxis () { int cy = nHeightPB / 2, space = nHeightPB/(6 + appData.zoom); - + DrawAxisSegmentHoriz( +5, TRUE ); DrawAxisSegmentHoriz( +3, space >= 20 ); DrawAxisSegmentHoriz( +1, space >= 20 && space*appData.zoom >= 40 ); diff --git a/evalgraph.h b/evalgraph.h index 3ad22b4..2e05db6 100644 --- a/evalgraph.h +++ b/evalgraph.h @@ -55,4 +55,3 @@ void EvalGraphSet P(( int first, int last, int current, ChessProgramStats_Move * extern int GetMoveIndexFromPoint( int x, int y ); extern void PaintEvalGraph( void ); extern char *MakeEvalTitle( char *title ); - diff --git a/gamelist.c b/gamelist.c index dc84ecd..c8bdc4e 100644 --- a/gamelist.c +++ b/gamelist.c @@ -672,4 +672,3 @@ GLT_ParseList () idx++; } while( id != '\0' ); } - diff --git a/gtk/xboard.c b/gtk/xboard.c index fed6aa3..0837911 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -1565,7 +1565,7 @@ ModeHighlight () /* Always toggle, don't set. Previous code messes up when invoked while the button is pressed, as releasing it toggles the state again. */ - GdkColor color; + GdkColor color; gdk_color_parse( pausing ? "#808080" : "#F0F0F0", &color ); gtk_widget_modify_bg ( GTK_WIDGET(optList[W_PAUSE].handle), GTK_STATE_NORMAL, &color ); } @@ -1618,7 +1618,7 @@ void CopyFileToClipboard(gchar *filename) return; } selection_tmp[len] = NULLCHAR; // file is now in selection_tmp - + // copy selection_tmp to clipboard GdkDisplay *gdisp = gdk_display_get_default(); if (!gdisp) { @@ -1627,7 +1627,7 @@ void CopyFileToClipboard(gchar *filename) } cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); gtk_clipboard_set_text(cb, selection_tmp, -1); - g_free(selection_tmp); + g_free(selection_tmp); } void @@ -1649,9 +1649,9 @@ PastePositionProc () gchar *fenstr; if (gdisp == NULL) return; - cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); + cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); fenstr = gtk_clipboard_wait_for_text(cb); - if (fenstr==NULL) return; // nothing had been selected to copy + if (fenstr==NULL) return; // nothing had been selected to copy EditPositionPasteFEN(fenstr); return; } @@ -1667,14 +1667,14 @@ PasteGameProc () // get game from clipboard GdkDisplay *gdisp = gdk_display_get_default(); if (gdisp == NULL) return; - cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); + cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); text = gtk_clipboard_wait_for_text(cb); - if (text == NULL) return; // nothing to paste + if (text == NULL) return; // nothing to paste len = strlen(text); // write to temp file if (text == NULL || len == 0) { - return; //nothing to paste + return; //nothing to paste } f = fopen(gamePasteFilename, "w"); if (f == NULL) { @@ -1684,7 +1684,7 @@ PasteGameProc () fwrite(text, 1, len, f); fclose(f); - // load from file + // load from file LoadGameFromFile(gamePasteFilename, 0, gamePasteFilename, TRUE); return; } @@ -1710,7 +1710,7 @@ void MoveTypeInProc(eventkey) buf[0]=eventkey->keyval; buf[1]='\0'; - if (*buf >= 32) + if (*buf >= 32) BoxAutoPopUp (buf); } @@ -2160,4 +2160,3 @@ void FileNamePopUpGTK(label, def, filter, proc, pathFlag, openMode, name, fp) return; } - diff --git a/gtk/xboard.h b/gtk/xboard.h index ed66f3b..c995110 100644 --- a/gtk/xboard.h +++ b/gtk/xboard.h @@ -172,4 +172,3 @@ extern char *selected_fen_position; #define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */ - diff --git a/gtk/xengineoutput.c b/gtk/xengineoutput.c index 34a960c..ceda49e 100644 --- a/gtk/xengineoutput.c +++ b/gtk/xengineoutput.c @@ -111,7 +111,7 @@ InsertIntoMemo (int which, char * text, int where) { char *p; GtkTextIter start; - + /* the backend adds \r\n, which is needed for winboard, * for xboard we delete them again over here */ if(p = strchr(text, '\r')) *p = ' '; @@ -135,4 +135,3 @@ ResizeWindowControls (int mode) if(mode) gtk_widget_show(engoutOptions[13].handle); else gtk_widget_hide(engoutOptions[13].handle); } - diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 0f197de..ecdbd30 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -50,7 +50,7 @@ extern char *getenv(); #include #include #include -#include +#include #include "common.h" #include "backend.h" @@ -146,9 +146,9 @@ MarkMenuItem (char *menuRef, int state) } void GetWidgetTextGTK(GtkWidget *w, char **buf) -{ +{ GtkTextIter start; - GtkTextIter end; + GtkTextIter end; if (GTK_IS_ENTRY(w)) { *buf = (char *) gtk_entry_get_text(GTK_ENTRY (w)); @@ -160,7 +160,7 @@ void GetWidgetTextGTK(GtkWidget *w, char **buf) } else { printf("error in GetWidgetText, invalid widget\n"); - *buf = NULL; + *buf = NULL; } } @@ -175,7 +175,7 @@ GetWidgetText (Option *opt, char **buf) case PathName: case TextBox: GetWidgetTextGTK((GtkWidget *) opt->handle, buf); break; case Spin: - x = gtk_spin_button_get_value (GTK_SPIN_BUTTON(opt->handle)); + x = gtk_spin_button_get_value (GTK_SPIN_BUTTON(opt->handle)); snprintf(val, 12, "%d", x); *buf = val; break; default: @@ -185,19 +185,19 @@ GetWidgetText (Option *opt, char **buf) } void SetSpinValue(Option *opt, char *val, int n) -{ +{ if (opt->type == Spin) { if (!strcmp(val, _("Unused"))) gtk_widget_set_sensitive(opt->handle, FALSE); else { - gtk_widget_set_sensitive(opt->handle, TRUE); + gtk_widget_set_sensitive(opt->handle, TRUE); gtk_spin_button_set_value(opt->handle, atoi(val)); } } else - printf("error in SetSpinValue, unknown type %d\n", opt->type); + printf("error in SetSpinValue, unknown type %d\n", opt->type); } void SetWidgetTextGTK(GtkWidget *w, char *text) @@ -274,14 +274,14 @@ LoadListBox (Option *opt, char *emptyText, int n1, int n2) GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); GtkListStore *store = GTK_LIST_STORE(model); GtkTreeIter iter; - + if(n1 >= 0 && n2 >= 0) { SetListBoxItem(store, n1, data[n1]); SetListBoxItem(store, n2, data[n2]); return; } - if (gtk_tree_model_get_iter_first(model, &iter)) + if (gtk_tree_model_get_iter_first(model, &iter)) gtk_list_store_clear(store); while(*data) { // add elements to listbox one by one @@ -366,7 +366,7 @@ void ComboSelect(GtkWidget *widget, gpointer addr) gint i = ((intptr_t)addr) & 255; // option number gint g; - g = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); + g = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); values[i] = g; // store in temporary, for transfer at OK #if TODO_GTK @@ -416,11 +416,11 @@ CreateMenuPopup (Option *opt, int n, int def) menu = gtk_menu_new(); // menu = XtCreatePopupShell(opt->name, simpleMenuWidgetClass, parent, NULL, 0); - for (i=0; 1; i++) + for (i=0; 1; i++) { char *msg = mb[i].string; if(!msg) break; - if(strcmp(msg, "----")) { // + if(strcmp(msg, "----")) { // if(!(opt->min & NO_GETTEXT)) msg = _(msg); if(mb[i].handle) { entry = gtk_check_menu_item_new_with_label(msg); // should be used for items that can be checkmarked @@ -585,7 +585,7 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) /* get text from textbuffer */ gtk_text_buffer_get_start_iter (memo->handle, &start); gtk_text_buffer_get_end_iter (memo->handle, &end); - val = gtk_text_buffer_get_text (memo->handle, &start, &end, FALSE); + val = gtk_text_buffer_get_text (memo->handle, &start, &end, FALSE); break; default: return FALSE; // should not happen @@ -661,7 +661,7 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) SubstructureRedirectMask | SubstructureNotifyMask, &xev); - XFlush(xDisplay); + XFlush(xDisplay); XSync(xDisplay, False); #endif } @@ -669,13 +669,13 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) int PopDown (DialogClass n) { - //Arg args[10]; - - if (!shellUp[n] || !shells[n]) return 0; + //Arg args[10]; + + if (!shellUp[n] || !shells[n]) return 0; if(n && wp[n]) { // remember position GetActualPlacement(shells[n], wp[n]); } - + gtk_widget_hide(shells[n]); shellUp[n]--; // count rather than clear @@ -717,7 +717,7 @@ gboolean GenericPopDown(w, resptype, gdata) #endif shells[dlg] = w; // make sure we pop down the right one in case of multiple instances - /* OK pressed */ + /* OK pressed */ if (resptype == GTK_RESPONSE_ACCEPT) { if (GenericReadout(currentOption, -1)) PopDown(dlg); return TRUE; @@ -732,11 +732,11 @@ gboolean GenericPopDown(w, resptype, gdata) } int AppendText(Option *opt, char *s) -{ +{ char *v; int len; - GtkTextIter end; - + GtkTextIter end; + GetWidgetTextGTK(opt->handle, &v); len = strlen(v); g_free(v); @@ -867,8 +867,8 @@ GraphExpose (Option *opt, int x, int y, int w, int h) void GenericCallback(GtkWidget *widget, gpointer gdata) { const gchar *name; - char buf[MSG_SIZ]; - int data = (intptr_t) gdata; + char buf[MSG_SIZ]; + int data = (intptr_t) gdata; DialogClass dlg; #ifdef TODO_GTK GtkWidget *sh = XtParent(XtParent(XtParent(w))), *oldSh; @@ -883,18 +883,18 @@ void GenericCallback(GtkWidget *widget, gpointer gdata) oldSh = shells[dlg]; shells[dlg] = sh; // bow to reality if (data == 30000) { // cancel - PopDown(dlg); + PopDown(dlg); } else if (data == 30001) { // save buttons imply OK if(GenericReadout(currentOption, -1)) PopDown(dlg); // calls OK-proc after full readout, but no popdown if it returns false } else if(currentCps) { - name = gtk_button_get_label (GTK_BUTTON(widget)); + name = gtk_button_get_label (GTK_BUTTON(widget)); if(currentOption[data].type == SaveButton) GenericReadout(currentOption, -1); snprintf(buf, MSG_SIZ, "option %s\n", name); SendToProgram(buf, currentCps); - } else ((ButtonCallback*) currentOption[data].target)(data); + } else ((ButtonCallback*) currentOption[data].target)(data); shells[dlg] = oldSh; // in case of multiple instances, restore previous (as this one could be popped down now) } @@ -907,7 +907,7 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) GtkFileFilter *gtkfilter_all; int opt_i = (intptr_t) gdata; GtkFileChooserAction fc_action; - + gtkfilter = gtk_file_filter_new(); gtkfilter_all = gtk_file_filter_new(); @@ -930,11 +930,11 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) gtk_file_filter_add_pattern(gtkfilter_all, "*"); gtk_file_filter_set_name (gtkfilter_all, "All Files"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),gtkfilter_all); - + /* filter for specific filetypes e.g. pgn or fen */ - if (currentOption[opt_i].textValue != NULL && (strcmp(currentOption[opt_i].textValue, "") != 0) ) - { - strcat(fileext, currentOption[opt_i].textValue); + if (currentOption[opt_i].textValue != NULL && (strcmp(currentOption[opt_i].textValue, "") != 0) ) + { + strcat(fileext, currentOption[opt_i].textValue); gtk_file_filter_add_pattern(gtkfilter, fileext); gtk_file_filter_set_name (gtkfilter, currentOption[opt_i].textValue); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER(dialog),gtkfilter); @@ -942,14 +942,14 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(dialog),gtkfilter); } else - gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(dialog),gtkfilter_all); + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(dialog),gtkfilter_all); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { char *filename; - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); entry = currentOption[opt_i].handle; - gtk_entry_set_text (GTK_ENTRY (entry), filename); + gtk_entry_set_text (GTK_ENTRY (entry), filename); g_free (filename); } @@ -1064,32 +1064,32 @@ Pack (GtkWidget *hbox, GtkWidget *table, GtkWidget *entry, int left, int right, int GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent, int modal, int topLevel) -{ +{ GtkWidget *dialog = NULL; gint w; GtkWidget *label; GtkWidget *box; GtkWidget *checkbutton; GtkWidget *entry; - GtkWidget *oldHbox, *hbox = NULL; + GtkWidget *oldHbox, *hbox = NULL; GtkWidget *pane = NULL; GtkWidget *button; GtkWidget *table; - GtkWidget *spinner; + GtkWidget *spinner; GtkAdjustment *spinner_adj; GtkWidget *combobox; GtkWidget *textview; - GtkTextBuffer *textbuffer; - GdkColor color; + GtkTextBuffer *textbuffer; + GdkColor color; GtkWidget *actionarea; - GtkWidget *sw; - GtkWidget *list; - GtkWidget *graph; - GtkWidget *menuButton; - GtkWidget *menuBar; - GtkWidget *menu; - - int i, j, arraysize, left, top, height=999, width=1, boxStart, breakType = 0, r; + GtkWidget *sw; + GtkWidget *list; + GtkWidget *graph; + GtkWidget *menuButton; + GtkWidget *menuBar; + GtkWidget *menu; + + int i, j, arraysize, left, top, height=999, width=1, boxStart, breakType = 0, r; char def[MSG_SIZ], *msg, engineDlg = (currentCps != NULL && dlgNr != BrowserDlg); if(dlgNr < PromoDlg && shellUp[dlgNr]) return 0; // already up @@ -1113,7 +1113,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent printf("n=%d, h=%d, w=%d\n",n,height,width); // if(n && (currentOption[n-1].type == Button || currentOption[n-1].type == SaveButton)) currentOption[n].min = SAME_ROW; // OK on same line currentOption[n].type = EndMark; currentOption[n].target = NULL; // delimit list by callback-less end mark - } + } parents[dlgNr] = parent; #ifdef TODO_GTK @@ -1130,20 +1130,20 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); (modal ? GTK_DIALOG_MODAL : 0), GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, - NULL ); + NULL ); shells[dlgNr] = dialog; box = gtk_dialog_get_content_area( GTK_DIALOG( dialog ) ); -// gtk_box_set_spacing(GTK_BOX(box), 5); +// gtk_box_set_spacing(GTK_BOX(box), 5); arraysize = 0; for (i=0;option[i].type != EndMark;i++) { - arraysize++; + arraysize++; } table = gtk_table_new(arraysize, r=TableWidth(option), FALSE); left = 0; - top = -1; + top = -1; for (i=0;option[i].type != EndMark;i++) { if(option[i].type == -1) continue; @@ -1162,7 +1162,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); gtk_box_pack_start (GTK_BOX (pane), table, TRUE, TRUE, 0); table = gtk_table_new(arraysize - i, r=TableWidth(option + i), FALSE); top = 0; - } + } if(!SameRow(&option[i])) { if(SameRow(&option[i+1])) { GtkAttachOptions x = GTK_FILL; @@ -1177,7 +1177,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); } else hbox = NULL; //and also make sure no hbox exists if only singl option on row } else top--; switch(option[i].type) { - case Fractional: + case Fractional: snprintf(def, MSG_SIZ, "%.2f", *(float*)option[i].target); option[i].value = *(float*)option[i].target; goto tBox; @@ -1185,7 +1185,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); if(!currentCps) option[i].value = *(int*)option[i].target; snprintf(def, MSG_SIZ, "%d", option[i].value); case TextBox: - case FileName: + case FileName: case PathName: tBox: label = gtk_label_new(option[i].name); @@ -1197,7 +1197,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); if(option[i].type == FileName || option[i].type == PathName) w -= 55; if (option[i].type==TextBox && option[i].value > 80){ - textview = gtk_text_view_new(); + textview = gtk_text_view_new(); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(textview), option[i].min & T_WRAP ? GTK_WRAP_WORD : GTK_WRAP_NONE); #ifdef TODO_GTK if(option[i].min & T_FILL) { XtSetArg(args[j], XtNautoFill, True); j++; } @@ -1211,9 +1211,9 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); gtk_container_add(GTK_CONTAINER(sw), textview); gtk_widget_set_size_request(GTK_WIDGET(sw), w, -1); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_OUT); - - textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); - /* check if label is empty */ + + textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); + /* check if label is empty */ if (strcmp(option[i].name,"") != 0) { gtk_table_attach(GTK_TABLE(table), label, left, left+1, top, top+1, GTK_FILL, GTK_FILL, 2, 1); Pack(hbox, table, sw, left+1, left+r, top, 0); @@ -1221,11 +1221,11 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); else { /* no label so let textview occupy all columns */ Pack(hbox, table, sw, left, left+r, top, GTK_EXPAND); - } + } if ( *(char**)option[i].target != NULL ) gtk_text_buffer_set_text (textbuffer, *(char**)option[i].target, -1); else - gtk_text_buffer_set_text (textbuffer, "", -1); + gtk_text_buffer_set_text (textbuffer, "", -1); option[i].handle = (void*)textbuffer; option[i].textValue = (char*)textview; if(option[i].choice) { // textviews can request a handler for mouse events in the choice field @@ -1233,7 +1233,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); g_signal_connect(textview, "button-release-event", G_CALLBACK (MemoEvent), (gpointer) &option[i] ); g_signal_connect(textview, "motion-notify-event", G_CALLBACK (MemoEvent), (gpointer) &option[i] ); } - break; + break; } entry = gtk_entry_new(); @@ -1243,7 +1243,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); else if (currentCps) gtk_entry_set_text (GTK_ENTRY (entry), option[i].textValue); else if ( *(char**)option[i].target != NULL ) - gtk_entry_set_text (GTK_ENTRY (entry), *(char**)option[i].target); + gtk_entry_set_text (GTK_ENTRY (entry), *(char**)option[i].target); //gtk_entry_set_width_chars (GTK_ENTRY (entry), 18); gtk_entry_set_max_length (GTK_ENTRY (entry), w); @@ -1252,7 +1252,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); if (strcmp(option[i].name, "") != 0) gtk_table_attach(GTK_TABLE(table), label, left, left+1, top, top+1, GTK_FILL, GTK_FILL, 2, 1); // leading names do not expand - if (option[i].type == Spin) { + if (option[i].type == Spin) { spinner_adj = (GtkAdjustment *) gtk_adjustment_new (option[i].value, option[i].min, option[i].max, 1.0, 0.0, 0.0); spinner = gtk_spin_button_new (spinner_adj, 1.0, 0); gtk_table_attach(GTK_TABLE(table), spinner, left+1, left+r, top, top+1, GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 1); @@ -1263,26 +1263,26 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); button = gtk_button_new_with_label ("Browse"); gtk_table_attach(GTK_TABLE(table), button, left+2, left+r, top, top+1, GTK_FILL, GTK_FILL, 2, 1); // Browse button does not expand g_signal_connect (button, "clicked", G_CALLBACK (BrowseGTK), (gpointer)(intptr_t) i); - option[i].handle = (void*)entry; + option[i].handle = (void*)entry; } else { Pack(hbox, table, entry, left + (strcmp(option[i].name, "") != 0), left+r, top, 0); option[i].handle = (void*)entry; - } + } break; case CheckBox: - checkbutton = gtk_check_button_new_with_label(option[i].name); + checkbutton = gtk_check_button_new_with_label(option[i].name); if(!currentCps) option[i].value = *(Boolean*)option[i].target; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton), option[i].value); gtk_table_attach(GTK_TABLE(table), checkbutton, left, left+r, top, top+1, GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 0); - option[i].handle = (void *)checkbutton; - break; - case Icon: + option[i].handle = (void *)checkbutton; + break; + case Icon: option[i].handle = (void *) (label = gtk_image_new_from_pixbuf(NULL)); gtk_widget_set_size_request(label, option[i].max ? option[i].max : -1, -1); Pack(hbox, table, label, left, left+2, top, 0); - break; - case Label: + break; + case Label: option[i].handle = (void *) (label = gtk_label_new(option[i].name)); /* Left Justify */ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); @@ -1317,47 +1317,47 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); gdk_color_parse( option[i].textValue, &color ); gtk_widget_modify_bg ( GTK_WIDGET(button), GTK_STATE_NORMAL, &color ); gtk_widget_set_sensitive(button, appData.noChessProgram || option[i].value < 0 - || strstr(first.variants, VariantName(option[i].value))); + || strstr(first.variants, VariantName(option[i].value))); } - + Pack(hbox, table, button, left, left+1, top, 0); - g_signal_connect (button, "clicked", G_CALLBACK (GenericCallback), (gpointer)(intptr_t) i + (dlgNr<<16)); - option[i].handle = (void*)button; - break; + g_signal_connect (button, "clicked", G_CALLBACK (GenericCallback), (gpointer)(intptr_t) i + (dlgNr<<16)); + option[i].handle = (void*)button; + break; case ComboBox: label = gtk_label_new(option[i].name); /* Left Justify */ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_table_attach(GTK_TABLE(table), label, left, left+1, top, top+1, GTK_FILL, GTK_FILL, 2, 1); - combobox = gtk_combo_box_new_text(); + combobox = gtk_combo_box_new_text(); for(j=0;;j++) { if ( ((char **) option[i].textValue)[j] == NULL) break; - gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), ((char **) option[i].choice)[j]); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), ((char **) option[i].choice)[j]); } if(currentCps) option[i].choice = (char**) option[i].textValue; else { - for(j=0; option[i].choice[j]; j++) { + for(j=0; option[i].choice[j]; j++) { if(*(char**)option[i].target && !strcmp(*(char**)option[i].target, ((char**)(option[i].textValue))[j])) break; } /* If choice is NULL set to first */ if (option[i].choice[j] == NULL) option[i].value = 0; - else + else option[i].value = j; } - //option[i].value = j + (option[i].choice[j] == NULL); - gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), option[i].value); - + //option[i].value = j + (option[i].choice[j] == NULL); + gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), option[i].value); + Pack(hbox, table, combobox, left+1, left+r, top, 0); g_signal_connect(G_OBJECT(combobox), "changed", G_CALLBACK(ComboSelect), (gpointer) (intptr_t) (i + 256*dlgNr)); option[i].handle = (void*)combobox; - values[i] = option[i].value; + values[i] = option[i].value; break; case ListBox: { @@ -1382,7 +1382,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); gtk_container_add(GTK_CONTAINER(sw), list); gtk_widget_set_size_request(GTK_WIDGET(sw), option[i].max ? option[i].max : -1, option[i].value ? option[i].value : -1); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_OUT); - + if(option[i].textValue) // generic callback for double-clicking listbox item g_signal_connect(list, "button-press-event", G_CALLBACK(ListCallback), (gpointer) (dlgNr<<16 | i) ); @@ -1449,7 +1449,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); case BarEnd: top--; gtk_table_attach(GTK_TABLE(table), menuBar, left, left+r, top, top+1, GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 1); - + if(option[i].target) ((ButtonCallback*)option[i].target)(boxStart); // callback that can make sizing decisions break; case BoxEnd: @@ -1461,15 +1461,15 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); case Break: breakType = option[i].min & SAME_ROW; top = height; // force next option to start in a new table - break; + break; case PopUp: top--; - break; + break; default: printf("GenericPopUp: unexpected case in switch. i=%d type=%d name=%s.\n", i, option[i].type, option[i].name); break; - } + } } if(pane) @@ -1482,7 +1482,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_NONE); /* Show dialog */ - gtk_widget_show_all( dialog ); + gtk_widget_show_all( dialog ); /* hide OK/cancel buttons */ if((option[i].min & NO_OK)) { @@ -1561,5 +1561,3 @@ HardSetFocus (Option *opt) { FocusOnWidget(opt, 0); // second arg not used in GDK } - - diff --git a/gtk/xtimer.c b/gtk/xtimer.c index 31b4dfe..7f17c92 100644 --- a/gtk/xtimer.c +++ b/gtk/xtimer.c @@ -235,5 +235,3 @@ StartClockTimer (long millisec) { clockTimerTag = g_timeout_add(millisec,(GSourceFunc) ClockTimerCallback,NULL); } - - diff --git a/history.c b/history.c index ca4e001..ef9a936 100644 --- a/history.c +++ b/history.c @@ -21,7 +21,7 @@ * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. + * along with this program. If not, see http://www.gnu.org/licenses/. * * ------------------------------------------------------------------------ ** See the file ChangeLog for a revision history. */ @@ -79,7 +79,7 @@ OnlyCurrentPositionChanged () if( lastFirst >= 0 && lastLast >= lastFirst && - lastCurrent >= lastFirst && + lastCurrent >= lastFirst && currFirst == lastFirst && currLast == lastLast && currCurrent >= 0 && @@ -145,7 +145,7 @@ AppendMoveToMemo (int index) /* PV info (if any) */ if( appData.showEvalInMoveHistory && currPvInfo[index].depth > 0 ) { - sprintf( buf, "{%s%.2f/%d} ", + sprintf( buf, "{%s%.2f/%d} ", currPvInfo[index].score >= 0 ? "+" : "", currPvInfo[index].score / 100.0, currPvInfo[index].depth ); @@ -172,7 +172,7 @@ static void DoHighlight (int index, int onoff) { if( index >= 0 && index < MAX_MOVES ) { - HighlightMove( histMoves[index].memoOffset, + HighlightMove( histMoves[index].memoOffset, histMoves[index].memoOffset + histMoves[index].memoLength, onoff ); } } @@ -255,4 +255,3 @@ MoveHistorySet (char movelist[][2*MOVE_LEN], int first, int last, int current, C if(MoveHistoryDialogExists()) UpdateMoveHistory(); // [HGM] call this directly, in stead of through call-back } - diff --git a/install-sh b/install-sh index ebc6691..058b26c 100755 --- a/install-sh +++ b/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: else @@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -134,7 +134,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -162,7 +162,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' +defaultIFS=' ' IFS="${IFS-${defaultIFS}}" @@ -201,17 +201,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -242,7 +242,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/menus.c b/menus.c index 0cbaa77..1ed7306 100644 --- a/menus.c +++ b/menus.c @@ -171,7 +171,7 @@ ReloadPositionProc () } void -LoadPositionProc() +LoadPositionProc() { if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { Reset(FALSE, TRUE); @@ -359,7 +359,7 @@ AboutProc () #else char *zippy = ""; #endif - snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), _("%s%s\n\n" "Copyright 1991 Digital Equipment Corporation\n" "Enhancements Copyright 1992-2012 Free Software Foundation\n" @@ -1219,5 +1219,3 @@ InitMenuMarkers() MarkMenuItem("Options.SaveSettingsonExit", True); } } - - diff --git a/menus.h b/menus.h index 790c2cd..b7cbf03 100644 --- a/menus.h +++ b/menus.h @@ -196,4 +196,3 @@ extern int firstEngineItem; #define OPTIONSDIALOG #define INFOFILE "xboard.info" - diff --git a/moves.c b/moves.c index 0aa6ad1..2b6fd8a 100644 --- a/moves.c +++ b/moves.c @@ -520,7 +520,7 @@ GenPseudoLegal (Board board, int flags, MoveCallback callback, VOIDSTAR closure, } if(gameInfo.variant == VariantSpartan) rookRange = 2; // in Spartan Chess restrict range to modern Dababba goto doRook; - + /* Shogi Dragon King has to continue as Ferz after Rook moves */ case SHOGI WhiteDragon: case SHOGI BlackDragon: @@ -673,14 +673,14 @@ GenPseudoLegal (Board board, int flags, MoveCallback callback, VOIDSTAR closure, rf, ff, rf + 1, ff, closure); for (s = -1; s <= 1; s += 2) { if (rf < BOARD_HEIGHT-1 && ff + s >= BOARD_LEFT && ff + s < BOARD_RGHT && board[rf + 1][ff + s] == EmptySquare) - callback(board, flags, + callback(board, flags, rf >= BOARD_HEIGHT-1-promoRank ? WhitePromotion : NormalMove, rf, ff, rf + 1, ff + s, closure); if (rf == 1 && ff + 2*s >= BOARD_LEFT && ff + 2*s < BOARD_RGHT && board[3][ff + 2*s] == EmptySquare ) callback(board, flags, NormalMove, rf, ff, 3, ff + 2*s, closure); } break; - + case BlackLance: if(gameInfo.variant == VariantSuper) goto Amazon; if (rf > 0 && WhitePiece(board[rf - 1][ff])) @@ -689,7 +689,7 @@ GenPseudoLegal (Board board, int flags, MoveCallback callback, VOIDSTAR closure, rf, ff, rf - 1, ff, closure); for (s = -1; s <= 1; s += 2) { if (rf > 0 && ff + s >= BOARD_LEFT && ff + s < BOARD_RGHT && board[rf - 1][ff + s] == EmptySquare) - callback(board, flags, + callback(board, flags, rf <= promoRank ? BlackPromotion : NormalMove, rf, ff, rf - 1, ff + s, closure); if (rf == BOARD_HEIGHT-2 && ff + 2*s >= BOARD_LEFT && ff + 2*s < BOARD_RGHT && board[rf-2][ff + 2*s] == EmptySquare ) @@ -721,7 +721,7 @@ extern void GenLegalCallback P((Board board, int flags, ChessMove kind, int rf, int ff, int rt, int ft, VOIDSTAR closure)); -void +void GenLegalCallback (Board board, int flags, ChessMove kind, int rf, int ff, int rt, int ft, VOIDSTAR closure) { register GenLegalClosure *cl = (GenLegalClosure *) closure; @@ -1104,7 +1104,7 @@ LegalityTest (Board board, int flags, int rf, int ff, int rt, int ft, int promoC if(quickFlag) flags = flags & ~1 | quickFlag & 1; // [HGM] speed: in quick mode quickFlag specifies side-to-move. if(rf == DROP_RANK) return LegalDrop(board, flags, ff, rt, ft); piece = filterPiece = board[rf][ff]; - if(PieceToChar(piece) == '~') filterPiece = DEMOTED piece; + if(PieceToChar(piece) == '~') filterPiece = DEMOTED piece; /* [HGM] Cobra and Falcon are wildcard pieces; consider all their moves legal */ /* (perhaps we should disallow moves that obviously leave us in check?) */ @@ -1383,7 +1383,7 @@ Disambiguate (Board board, int flags, DisambiguateClosure *closure) piece == WhiteKnight && closure->rt > BOARD_HEIGHT-3) /* promotion mandatory */ closure->kind = c == '=' ? IllegalMove : WhitePromotion; else /* promotion optional, default is defer */ - closure->kind = c == '+' ? WhitePromotion : WhiteNonPromotion; + closure->kind = c == '+' ? WhitePromotion : WhiteNonPromotion; } else closure->kind = c == '+' ? IllegalMove : NormalMove; } else { if( (int) piece < (int) BlackWazir && (closure->rf < BOARD_HEIGHT/3 || closure->rt < BOARD_HEIGHT/3) ) { @@ -1629,7 +1629,7 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p /* [HGM] in Shogi non-pawns can promote */ *outp++ = promoChar; // Don't bother to correct move type, return value is never used! } - else if (gameInfo.variant != VariantSuper && promoChar && + else if (gameInfo.variant != VariantSuper && promoChar && (piece == WhiteLance || piece == BlackLance) ) { // Lance sometimes represents Pawn *outp++ = '='; *outp++ = ToUpper(promoChar); @@ -1640,7 +1640,7 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p } *outp = NULLCHAR; return cl.kind; - + case EmptySquare: /* Moving a nonexistent piece */ break; diff --git a/moves.h b/moves.h index 152d78a..5a7e9ae 100644 --- a/moves.h +++ b/moves.h @@ -77,7 +77,7 @@ typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind, #define F_IGNORE_CHECK 32 #define F_KRIEGSPIEL_CAPTURE 64 /* pawns can try to capture invisible pieces */ #define F_ATOMIC_CAPTURE 128 /* capturing piece explodes, destroying itself - and all non-pawns on adjacent squares; + and all non-pawns on adjacent squares; destroying your own king is illegal */ #define F_FRC_TYPE_CASTLING 256 /* generate castlings as captures of own Rook */ #define F_MANDATORY_CAPTURE 0x200 @@ -107,7 +107,7 @@ typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind, extern void GenPseudoLegal P((Board board, int flags, MoveCallback callback, VOIDSTAR closure, ChessSquare filter)); -/* Like GenPseudoLegal, but include castling moves and (unless +/* Like GenPseudoLegal, but include castling moves and (unless F_IGNORE_CHECK is set in the flags) omit moves that would leave the king in check. The CASTLE_OK flags are true if castling is not yet ruled out by a move of the king or rook. Return TRUE if the player @@ -122,7 +122,7 @@ extern int GenLegal P((Board board, int flags, e.p. capture. The possibility of castling out of a check along the back rank is not accounted for (i.e., we still return nonzero), as this is illegal anyway. Return value is the number of times the - king is in check. */ + king is in check. */ extern int CheckTest P((Board board, int flags, int rf, int ff, int rt, int ft, int enPassant)); diff --git a/nengineoutput.c b/nengineoutput.c index 89cb3d0..088cc1c 100644 --- a/nengineoutput.c +++ b/nengineoutput.c @@ -192,4 +192,3 @@ EngineOutputProc () { if (!PopDown(EngOutDlg)) EngineOutputPopUp(); } - diff --git a/nevalgraph.c b/nevalgraph.c index 28e24b2..5ab171c 100644 --- a/nevalgraph.c +++ b/nevalgraph.c @@ -187,4 +187,3 @@ EvalGraphSet (int first, int last, int current, ChessProgramStats_Move * pvInfo) DisplayEvalGraph(); } } - diff --git a/ngamelist.c b/ngamelist.c index 058b4c8..d43920b 100644 --- a/ngamelist.c +++ b/ngamelist.c @@ -358,7 +358,7 @@ SaveGameListAsText (FILE *f) /* Copy the list into the global memory block */ if( f != NULL ) { - + lg = (ListGame *) gameList.head; for (nItem = 0; nItem < ((ListGame *) gameList.tailPred)->number; nItem++){ @@ -375,4 +375,3 @@ SaveGameListAsText (FILE *f) } return False; } - diff --git a/nhistory.c b/nhistory.c index f66aa26..809cbfb 100644 --- a/nhistory.c +++ b/nhistory.c @@ -15,7 +15,7 @@ * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. + * along with this program. If not, see http://www.gnu.org/licenses/. * * ------------------------------------------------------------------------ ** See the file ChangeLog for a revision history. */ diff --git a/parser.c b/parser.c index d86c8b8..e0b4ff4 100644 --- a/parser.c +++ b/parser.c @@ -151,7 +151,7 @@ PromoSuffix (char **p) { char *start = *p; if(**p == 'e' && (Match("ep", p) || Match("e.p.", p))) { *p = start; return NULLCHAR; } // non-compliant e.p. suffix is no promoChar! - if(**p == '+' && gameInfo.variant == VariantShogi) { (*p)++; return '+'; } + if(**p == '+' && gameInfo.variant == VariantShogi) { (*p)++; return '+'; } if(**p == '=' || (gameInfo.variant == VariantSChess) && **p == '/') (*p)++; // optional = (or / for Seirawan gating) if(**p == '(' && (*p)[2] == ')' && isalpha( (*p)[1] )) { (*p) += 3; return ToLower((*p)[-2]); } if(isalpha(**p)) return ToLower(*(*p)++); @@ -222,7 +222,7 @@ NextUnit (char **p) } // 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 && + if(piece && type[1] == NOTHING && type[0] == NUMERIC && type[2] == NUMERIC && (separator == '+' || separator == '=' || separator == '-')) { // Xiangqi traditional @@ -334,7 +334,7 @@ badMove:// we failed to find algebraic move if(**p == '[') { oldp = ++(*p); if(Match("--", p)) { // "[--" could be start of position diagram - if(!Scan(']', p) && (*p)[-3] == '-' && (*p)[-2] == '-') return PositionDiagram; + if(!Scan(']', p) && (*p)[-3] == '-' && (*p)[-2] == '-') return PositionDiagram; *p = oldp; } SkipWhite(p); @@ -355,7 +355,7 @@ badMove:// we failed to find algebraic move // ********* SAN Castings ************************************* if(**p == 'O' || **p == 'o' || **p == '0') { int castlingType = 0; - if(Match("O-O-O", p) || Match("o-o-o", p) || Match("0-0-0", p) || + if(Match("O-O-O", p) || Match("o-o-o", p) || Match("0-0-0", p) || Match("OOO", p) || Match("ooo", p) || Match("000", p)) castlingType = 2; else if(Match("O-O", p) || Match("o-o", p) || Match("0-0", p) || Match("OO", p) || Match("oo", p) || Match("00", p)) castlingType = 1; diff --git a/uci.c b/uci.c index 17145a7..4a6c177 100644 --- a/uci.c +++ b/uci.c @@ -20,7 +20,7 @@ * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. + * along with this program. If not, see http://www.gnu.org/licenses/. * * ------------------------------------------------------------------------ */ @@ -31,7 +31,7 @@ #include "common.h" #include "backend.h" -Boolean GetArgValue(char *a); +Boolean GetArgValue(char *a); void InitEngineUCI (const char *iniDir, ChessProgramState *cps) diff --git a/usounds.c b/usounds.c index 82801b8..67afdb0 100644 --- a/usounds.c +++ b/usounds.c @@ -172,5 +172,3 @@ PlaySoundForColor (ColorClass cc) break; } } - - diff --git a/usystem.c b/usystem.c index 5b22eae..c46cb87 100644 --- a/usystem.c +++ b/usystem.c @@ -1,5 +1,5 @@ /* - * usystem.c -- X-free, but Unix-like code for XBoard front end + * usystem.c -- X-free, but Unix-like code for XBoard front end * * Copyright 1991 by Digital Equipment Corporation, Maynard, * Massachusetts. @@ -572,7 +572,7 @@ OpenTCP (char *host, char *port, ProcRef *pr) host, port, gai_strerror(error)); return ENOENT; } - + for (ai = ais; ai != NULL; ai = ai->ai_next) { if ((s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) { error = errno; @@ -790,5 +790,3 @@ NotifyFrontendLogin () { update_ics_width(); } - - diff --git a/usystem.h b/usystem.h index 660da94..b1ddd48 100644 --- a/usystem.h +++ b/usystem.h @@ -73,4 +73,3 @@ char *ExpandPathName P((char *path)); int MySearchPath P((char *installDir, char *name, char *fullname)); int MyGetFullPathName P((char *name, char *fullname)); void PlaySoundForColor P((ColorClass cc)); - diff --git a/xaw/xboard.c b/xaw/xboard.c index 9d2eeef..40e901c 100644 --- a/xaw/xboard.c +++ b/xaw/xboard.c @@ -2528,4 +2528,3 @@ UpdateLogos (int displ) if(displ) DisplayLogos(&optList[W_WHITE-1], &optList[W_BLACK+1]); return; } - diff --git a/xaw/xboard.h b/xaw/xboard.h index 213c1bd..04692b5 100644 --- a/xaw/xboard.h +++ b/xaw/xboard.h @@ -174,4 +174,3 @@ extern int savedIndex; #define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */ - diff --git a/xaw/xengineoutput.c b/xaw/xengineoutput.c index 4839633..1a63866 100644 --- a/xaw/xengineoutput.c +++ b/xaw/xengineoutput.c @@ -283,4 +283,3 @@ ResizeWindowControls (int mode) XtSetValues(form2, args, j); } } - diff --git a/xaw/xgamelist.c b/xaw/xgamelist.c index 288b373..910729d 100644 --- a/xaw/xgamelist.c +++ b/xaw/xgamelist.c @@ -115,4 +115,3 @@ SetFilterProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) { SetFilter(); } - diff --git a/xaw/xhistory.c b/xaw/xhistory.c index 393f51d..8b6adb1 100644 --- a/xaw/xhistory.c +++ b/xaw/xhistory.c @@ -15,7 +15,7 @@ * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. + * along with this program. If not, see http://www.gnu.org/licenses/. * * ------------------------------------------------------------------------ ** See the file ChangeLog for a revision history. */ @@ -109,4 +109,3 @@ SelectMoveX (Widget w, XEvent * event, String * params, Cardinal * nParams) XawTextGetSelectionPos(w, &index, &dummy); FindMoveByCharIndex( index ); // [HGM] also does the actual moving to it, now } - diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 42f8977..5cdb2e0 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -385,7 +385,7 @@ CreateComboPopup (Widget parent, Option *opt, int n, int fromList, int def) if(list[0] == NULL) return NULL; // avoid empty menus, as they cause crash menu = XtCreatePopupShell(opt->name, simpleMenuWidgetClass, parent, NULL, 0); - for (i=0; 1; i++) + for (i=0; 1; i++) { char *msg = fromList ? list[i] : mb[i].string; if(!msg) break; @@ -457,7 +457,7 @@ RaiseWindow (DialogClass dlg) SubstructureRedirectMask | SubstructureNotifyMask, &xev); - XFlush(xDisplay); + XFlush(xDisplay); XSync(xDisplay, False); } @@ -638,7 +638,7 @@ GenericCallback (Widget w, XtPointer client_data, XtPointer call_data) currentOption = dialogOptions[dlg=data>>16]; data &= 0xFFFF; oldSh = shells[dlg]; shells[dlg] = sh; // bow to reality if (data == 30000) { // cancel - PopDown(dlg); + PopDown(dlg); } else if (data == 30001) { // save buttons imply OK if(GenericReadout(currentOption, -1)) PopDown(dlg); // calls OK-proc after full readout, but no popdown if it returns false @@ -873,7 +873,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent XtSetArg(args[j], XtNdisplayCaret, False); j++; XtSetArg(args[j], XtNresizable, True); j++; XtSetArg(args[j], XtNinsertPosition, 9999); j++; - XtSetArg(args[j], XtNstring, option[i].type==Spin || option[i].type==Fractional ? def : + XtSetArg(args[j], XtNstring, option[i].type==Spin || option[i].type==Fractional ? def : engineDlg ? option[i].textValue : *(char**)option[i].target); j++; edit = last; option[i].handle = (void*) @@ -1234,4 +1234,3 @@ FileNamePopUpGTK(char *label, char *def, char *filter, FileProc proc, Boolean pa { Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, openName, openFP); } - diff --git a/zic2xpm.c b/zic2xpm.c index 6bc2273..2fdd078 100644 --- a/zic2xpm.c +++ b/zic2xpm.c @@ -7,15 +7,15 @@ Copyright (C) 1996, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. NOTICE: The piece images distributed with ZIICS are - copyrighted works of their original creators. Images + copyrighted works of their original creators. Images converted with zic2xpm may not be redistributed without the permission of the copyright holders. Do not contact the authors of zic2xpm or of ZIICS itself to request - permission. + permission. NOTICE: The format of the ZIICS piece file was gleaned from SHOWSETS.PAS, a part of ZIICS. Thanks to Andy McFarland - (Zek on ICC) for making this source available! ZIICS is a + (Zek on ICC) for making this source available! ZIICS is a completely separate and copyrighted work of Andy McFarland. Use and distribution of ZIICS falls under the ZIICS license, NOT the GNU General Public License. @@ -30,13 +30,13 @@ License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + GNU XBoard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. @@ -59,7 +59,7 @@ size = Piece size. Plus 4 files for the light & dark squares. - + This means that you can extract multiple SIZES in one directory without name clashes. Extracting two sets of the SAME size in a directory will cause the second to overwrite @@ -269,7 +269,7 @@ write_xim_header (FILE *fp, int w, int h) { fputc( w, fp ); fputc( h, fp ); - + return 0; } @@ -312,7 +312,7 @@ create_piece_xim (char *outname, FILE *fpin, int W, int H) unsigned char *lump, *p, *line; long size; z2xim *ent; - + fpout = fopen( outname, "wb" ); if ( !fpout ) fatal( "Can't create output file."); @@ -323,11 +323,11 @@ create_piece_xim (char *outname, FILE *fpin, int W, int H) c = fgetc( fpin ); h = (fgetc(fpin) << 8) | c; - + ++w; ++h; if ( w != W || h != H ) - fatal( "Bad header." ); + fatal( "Bad header." ); size = vga_imagesize( w, h ) - 4; lump = (unsigned char*)malloc( size ); @@ -342,19 +342,19 @@ create_piece_xim (char *outname, FILE *fpin, int W, int H) write_xim_header( fpout, w, h ); p = lump; - + /* Write XIM data */ for( i=0; ixval, fpout ); } } - + free( lump ); free( line ); fclose( fpout ); @@ -368,7 +368,7 @@ create_piece_xpm (char *outname, FILE *fpin, int W, int H) unsigned char *lump, *p, *line; long size; z2xpm *cv; - + fpout = fopen( outname, "wb" ); if ( !fpout ) fatal( "Can't create output file."); @@ -379,11 +379,11 @@ create_piece_xpm (char *outname, FILE *fpin, int W, int H) c = fgetc( fpin ); h = (fgetc(fpin) << 8) | c; - + ++w; ++h; if ( w != W || h != H ) - fatal( "Bad header." ); + fatal( "Bad header." ); size = vga_imagesize( w, h ) - 4; lump = (unsigned char*)malloc( size ); @@ -398,12 +398,12 @@ create_piece_xpm (char *outname, FILE *fpin, int W, int H) write_xpm_header( fpout, w, h ); p = lump; - + /* Write XPM data */ for( i=0; i