From 3830e6aea9b487049e7e1ca9961a848f64ba98eb Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Fri, 17 Sep 2010 21:47:22 -0700 Subject: [PATCH] cleaned up -Wall warnings (apart from settings some parentheses) removed unsused variables, etc mostly everything from -Wall -Wno-parenthesis --- Makefile.am | 2 +- backend.c | 12 ++++++------ frontend.h | 3 +++ xboard.c | 27 +++++++++++---------------- xengineoutput.c | 38 +++++++++++++++++--------------------- xevalgraph.c | 54 +++++++++++++++++++----------------------------------- xevalgraph.h | 29 +++++++++++++++++++++++++++++ xgamelist.c | 46 ++++++++++++++++++---------------------------- xhistory.c | 1 + xoptions.c | 40 +++++++++++++++++++--------------------- 10 files changed, 124 insertions(+), 128 deletions(-) create mode 100644 xevalgraph.h diff --git a/Makefile.am b/Makefile.am index 178c36e..fba80a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ xboard_SOURCES = backend.c backend.h backendz.h \ xedittags.c xedittags.h \ engineoutput.c engineoutput.h \ xengineoutput.c \ - evalgraph.c evalgraph.h xevalgraph.c \ + evalgraph.c evalgraph.h xevalgraph.c xevalgraph.h\ xgamelist.c xgamelist.h\ xhistory.c xhistory.h \ xoptions.c \ diff --git a/backend.c b/backend.c index 67a1c1a..170b9c3 100644 --- a/backend.c +++ b/backend.c @@ -14864,12 +14864,12 @@ ParseFEN(board, blackPlaysFirst, fen) while(*p==' ') p++; if( gameInfo.holdingsWidth && p[-1] == '/' || *p == '[') { if(*p == '[') p++; - if(*p == '-' ) *p++; /* empty holdings */ else { + if(*p == '-' ) p++; /* empty holdings */ else { if( !gameInfo.holdingsWidth ) return FALSE; /* no room to put holdings! */ /* if we would allow FEN reading to set board size, we would */ /* have to add holdings and shift the board read so far here */ while( (piece = CharToPiece(*p) ) != EmptySquare ) { - *p++; + p++; if((int) piece >= (int) BlackPawn ) { i = (int)piece - (int)BlackPawn; i = PieceToNumber((ChessSquare)i); @@ -14885,7 +14885,7 @@ ParseFEN(board, blackPlaysFirst, fen) } } } - if(*p == ']') *p++; + if(*p == ']') p++; } while(*p == ' ') p++; @@ -15020,7 +15020,7 @@ ParseFEN(board, blackPlaysFirst, fen) char c = *p++ - AAA; if(c < BOARD_LEFT || c >= BOARD_RGHT) return TRUE; - if(*p >= '0' && *p <='9') *p++; + if(*p >= '0' && *p <='9') p++; board[EP_STATUS] = c; } } @@ -15219,11 +15219,11 @@ PopTail(Boolean annotate) if(annotate) { int cnt = 10; if(!WhiteOnMove(currentMove)) - snprintf(buf, sizeof(buf)/sizeof(buf[0]),"(%d...", currentMove+2>>1); + snprintf(buf, sizeof(buf)/sizeof(buf[0]),"(%d...", (currentMove+2)>>1); else safeStrCpy(buf, "(", sizeof(buf)/sizeof(buf[0])); for(i=currentMove; i>1, SavePart(parseList[i])); + snprintf(moveBuf, sizeof(moveBuf)/sizeof(moveBuf[0]), " %d. %s", (i+2)>>1, SavePart(parseList[i])); else snprintf(moveBuf, sizeof(moveBuf)/sizeof(moveBuf[0])," %s", SavePart(parseList[i])); strcat(buf, moveBuf); if(commentList[i]) { strcat(buf, " "); strcat(buf, commentList[i]); } diff --git a/frontend.h b/frontend.h index 63b1080..15a955c 100644 --- a/frontend.h +++ b/frontend.h @@ -223,6 +223,9 @@ void EvalGraphPopUp P((void)); void EvalGraphPopDown P((void)); Boolean EvalGraphIsUp P((void)); int EvalGraphDialogExists P((void)); + +/* these are in xhistory.c */ Boolean MoveHistoryIsUp P((void)); +void HistoryPopUp P((void)); #endif diff --git a/xboard.c b/xboard.c index e9925ae..dcc58b5 100644 --- a/xboard.c +++ b/xboard.c @@ -191,6 +191,7 @@ extern char *getenv(); #include "frontend.h" #include "backend.h" +#include "backendz.h" #include "moves.h" #include "xboard.h" #include "childio.h" @@ -1450,7 +1451,7 @@ SetCommPortDefaults() void SaveFontArg(FILE *f, ArgDescriptor *ad) { - char *name, buf[MSG_SIZ]; + char *name; int i, n = (int)ad->argLoc; switch(n) { case 0: // CLOCK_FONT @@ -5136,13 +5137,6 @@ void FileNamePopUp(label, def, proc, openMode) FileProc proc; char *openMode; { - Arg args[16]; - Widget popup, layout, dialog, edit; - Window root, child; - int x, y, i; - int win_x, win_y; - unsigned int mask; - fileProc = proc; /* I can't see a way not */ fileOpenMode = openMode; /* to use globals here */ { // [HGM] use file-selector dialog stolen from Ghostview @@ -5150,8 +5144,8 @@ void FileNamePopUp(label, def, proc, openMode) int index; // this is not supported yet FILE *f; if(f = XsraSelFile(shellWidget, label, NULL, NULL, "could not open: ", - def, openMode, NULL, &name)) - (void) (*fileProc)(f, index=0, name); + def, openMode, NULL, &name)) + (void) (*fileProc)(f, index=0, name); } } @@ -8941,14 +8935,15 @@ int get_term_width() return default_width; } -void update_ics_width() +void +update_ics_width() { - static int old_width = 0; - int new_width = get_term_width(); + static int old_width = 0; + int new_width = get_term_width(); - if (old_width != new_width) - ics_printf("set width %d\n", new_width); - old_width = new_width; + if (old_width != new_width) + ics_printf("set width %d\n", new_width); + old_width = new_width; } void NotifyFrontendLogin() diff --git a/xengineoutput.c b/xengineoutput.c index 2d2a9a7..f1ab452 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -157,13 +157,12 @@ void ReadIcon(char *pixData[], int iconNr) &(icons[iconNr]), NULL, NULL /*&attr*/)) != 0) { fprintf(stderr, _("Error %d loading icon image\n"), r); - exit(1); - } + exit(1); + } } static void InitializeEngineOutput() -{ int i; - +{ ReadIcon(WHITE_14, nColorWhite); ReadIcon(BLACK_14, nColorBlack); ReadIcon(UNKNOWN_14, nColorUnknown); @@ -175,7 +174,7 @@ static void InitializeEngineOutput() } void DoSetWindowText(int which, int field, char *s_label) -{ +{ Arg arg; XtSetArg(arg, XtNlabel, (XtArgVal) s_label); @@ -184,9 +183,10 @@ void DoSetWindowText(int which, int field, char *s_label) void InsertIntoMemo( int which, char * text, int where ) { - Arg arg; XawTextBlock t; Widget edit; + XawTextBlock t; + Widget edit; - /* the backend adds \r\n, which is needed for winboard, + /* the backend adds \r\n, which is needed for winboard, * for xboard we delete them again over here */ if(t.ptr = strchr(text, '\r')) *t.ptr = ' '; @@ -211,14 +211,12 @@ void SetIcon( int which, int field, int nIcon ) } void DoClearMemo(int which) -{ - Arg args[16]; - int j; +{ Widget edit; - edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); - XtCallActionProc(edit, "select-all", NULL, NULL, 0); - XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); + edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); + XtCallActionProc(edit, "select-all", NULL, NULL, 0); + XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); } // cloned from CopyPositionProc. Abuse selected_fen_position to hold selection @@ -240,7 +238,7 @@ void SelectPV (Widget w, XEvent * event, String * params, Cardinal * nParams) { // [HGM] pv: translate click to PV line, and load it for display String val; - int start, end, memo, j; + int start, end; XawTextPosition index, dummy; int x, y; Arg arg; @@ -286,7 +284,7 @@ void CopyMemoProc(w, event, prms, nprms) { if(appData.pasteSelection) return; if (selected_fen_position) free(selected_fen_position); - XtGetSelectionValue(menuBarWidget, + XtGetSelectionValue(menuBarWidget, XA_PRIMARY, XA_STRING, /* (XtSelectionCallbackProc) */ MemoCB, NULL, /* client_data passed to PastePositionCB */ @@ -410,7 +408,7 @@ Widget EngineOutputCreate(name, text) char *name, *text; { Arg args[16]; - Widget shell, layout, form, form2, edit; + Widget shell, layout, form, form2; Dimension bw_width, bw_height; int j; @@ -424,7 +422,7 @@ Widget EngineOutputCreate(name, text) j = 0; XtSetArg(args[j], XtNresizable, True); j++; shell = -#if TOPLEVEL +#if TOPLEVEL XtCreatePopupShell(name, topLevelShellWidgetClass, #else XtCreatePopupShell(name, transientShellWidgetClass, @@ -465,8 +463,7 @@ Widget EngineOutputCreate(name, text) if (engineOutputX == -1) { int xx, yy; Window junk; - Dimension pw_height; - Dimension ew_height; + engineOutputH = bw_height/2; engineOutputW = bw_width-16; @@ -495,7 +492,6 @@ Widget EngineOutputCreate(name, text) XtSetArg(args[j], XtNx, engineOutputX); j++; XtSetArg(args[j], XtNy, engineOutputY); j++; XtSetValues(shell, args, j); -// XtSetKeyboardFocus(shell, edit); return shell; } @@ -537,7 +533,7 @@ void ResizeWindowControls(mode) } } -void +void EngineOutputPopUp() { Arg args[16]; diff --git a/xevalgraph.c b/xevalgraph.c index 4f53d7a..ebb0565 100644 --- a/xevalgraph.c +++ b/xevalgraph.c @@ -84,15 +84,6 @@ extern char *getenv(); #include -// [HGM] pixmaps of some ICONS used in the engine-outut window -#include "pixmaps/WHITE_14.xpm" -#include "pixmaps/BLACK_14.xpm" -#include "pixmaps/CLEAR_14.xpm" -#include "pixmaps/UNKNOWN_14.xpm" -#include "pixmaps/THINKING_14.xpm" -#include "pixmaps/PONDER_14.xpm" -#include "pixmaps/ANALYZING_14.xpm" - #ifdef SNAP #include "wsnap.h" #endif @@ -138,14 +129,15 @@ static HDC hdcPB = NULL; static HBITMAP hbmPB = NULL; #endif -// [HGM] front-end, added as wrapper to avoid use of LineTo and MoveToEx in other routines (so they can be back-end) +// [HGM] front-end, added as wrapper to avoid use of LineTo and MoveToEx in other routines (so they can be back-end) void DrawSegment( int x, int y, int *lastX, int *lastY, int penType ) { -static curX, curY; - if(penType != PEN_NONE) - XDrawLine(yDisplay, eGraphWindow, pens[penType], curX, curY, x, y); - if(lastX != NULL) { *lastX = curX; *lastY = curY; } - curX = x; curY = y; + static int curX, curY; + + if(penType != PEN_NONE) + XDrawLine(yDisplay, eGraphWindow, pens[penType], curX, curY, x, y); + if(lastX != NULL) { *lastX = curX; *lastY = curY; } + curX = x; curY = y; } // front-end wrapper for drawing functions to do rectangles @@ -225,19 +217,15 @@ static void DisplayEvalGraph() } static void InitializeEvalGraph() -{ int i; XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground - | GCBackground | GCFunction | GCPlaneMask; - XGCValues gc_values; -// GC copyInvertedGC; - - pens[PEN_BLACK] = CreateGC(1, "black", "black", LineSolid); - pens[PEN_DOTTED] = CreateGC(1, "#A0A0A0", "#A0A0A0", LineOnOffDash); - pens[PEN_BLUEDOTTED] = CreateGC(1, "#0000FF", "#0000FF", LineOnOffDash); - pens[PEN_BOLD] = CreateGC(3, crWhite, crWhite, LineSolid); - pens[PEN_BOLD+1] = CreateGC(3, crBlack, crBlack, LineSolid); - hbrHist[0] = CreateGC(3, crWhite, crWhite, LineSolid); - hbrHist[1] = CreateGC(3, crBlack, crBlack, LineSolid); - hbrHist[2] = CreateGC(3, "#E0E0F0", "#E0E0F0", LineSolid);; // background (a bit blueish, for contrst with yellow curve) +{ + pens[PEN_BLACK] = CreateGC(1, "black", "black", LineSolid); + pens[PEN_DOTTED] = CreateGC(1, "#A0A0A0", "#A0A0A0", LineOnOffDash); + pens[PEN_BLUEDOTTED] = CreateGC(1, "#0000FF", "#0000FF", LineOnOffDash); + pens[PEN_BOLD] = CreateGC(3, crWhite, crWhite, LineSolid); + pens[PEN_BOLD+1] = CreateGC(3, crBlack, crBlack, LineSolid); + hbrHist[0] = CreateGC(3, crWhite, crWhite, LineSolid); + hbrHist[1] = CreateGC(3, crBlack, crBlack, LineSolid); + hbrHist[2] = CreateGC(3, "#E0E0F0", "#E0E0F0", LineSolid);; // background (a bit blueish, for contrst with yellow curve) } void EvalClick(widget, unused, event) @@ -279,7 +267,7 @@ Widget EvalGraphCreate(name) char *name; { Arg args[16]; - Widget shell, layout, form, form2, edit; + Widget shell, layout, form; Dimension bw_width, bw_height; int j; @@ -293,7 +281,7 @@ Widget EvalGraphCreate(name) j = 0; XtSetArg(args[j], XtNresizable, True); j++; shell = -#if TOPLEVEL +#if TOPLEVEL XtCreatePopupShell(name, topLevelShellWidgetClass, #else XtCreatePopupShell(name, transientShellWidgetClass, @@ -324,8 +312,6 @@ Widget EvalGraphCreate(name) if (evalGraphX == -1) { int xx, yy; Window junk; - Dimension pw_height; - Dimension ew_height; evalGraphH = bw_height/4; evalGraphW = bw_width-16; @@ -354,7 +340,6 @@ Widget EvalGraphCreate(name) XtSetArg(args[j], XtNx, evalGraphX); j++; XtSetArg(args[j], XtNy, evalGraphY); j++; XtSetValues(shell, args, j); -// XtSetKeyboardFocus(shell, edit); yDisplay = XtDisplay(shell); eGraphWindow = XtWindow(form); @@ -366,12 +351,11 @@ Widget EvalGraphCreate(name) return shell; } -void +void EvalGraphPopUp() { Arg args[16]; int j; - Widget edit; static int needInit = TRUE; static char *title = _("Evaluation graph"); diff --git a/xevalgraph.h b/xevalgraph.h new file mode 100644 index 0000000..7ed1c9b --- /dev/null +++ b/xevalgraph.h @@ -0,0 +1,29 @@ +/* + * xevalgraph.h + * + * Copyright 2010 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. */ + +#ifndef _XEVALGRAPH_H +#define _XEVALGRAPH_H 1 + +void EvalGraphSet P(( int first, int last, int current, ChessProgramStats_Move * pvInfo )); + +#endif diff --git a/xgamelist.c b/xgamelist.c index c2065e0..2ed39da 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -184,7 +184,7 @@ GameListCreate(name, callback, client_data) XtSetArg(args[j], XtNdefaultColumns, 1); j++; XtSetArg(args[j], XtNforceColumns, True); j++; XtSetArg(args[j], XtNverticalList, True); j++; - listwidg = + listwidg = XtCreateManagedWidget("list", listWidgetClass, viewport, args, j); XawListHighlight(listwidg, 0); XtAugmentTranslations(listwidg, @@ -357,14 +357,13 @@ GameListPrepare() static void GameListReplace() -{ // [HGM] filter: put in separate routine, to make callable from call-back - Arg args[16]; - int j; - Widget listwidg; +{ + // filter: put in separate routine, to make callable from call-back + Widget listwidg; - listwidg = XtNameToWidget(glc->shell, "*form.viewport.list"); - XawListChange(listwidg, glc->strings, 0, 0, True); - XawListHighlight(listwidg, 0); + listwidg = XtNameToWidget(glc->shell, "*form.viewport.list"); + XawListChange(listwidg, glc->strings, 0, 0, True); + XawListHighlight(listwidg, 0); } void @@ -434,9 +433,7 @@ GameListPopUp(fp, filename) char *filename; { Arg args[16]; - int j, nstrings; - Widget listwidg; - ListGame *lg; + int j; char **st; if (glc == NULL) { @@ -461,7 +458,7 @@ GameListPopUp(fp, filename) if (glc->shell == NULL) { - glc->shell = GameListCreate(filename, GameListCallback, glc); + glc->shell = GameListCreate(filename, GameListCallback, glc); } else { GameListReplace(); // [HGM] filter: code put in separate routine j = 0; @@ -538,7 +535,7 @@ LoadSelectedProc(w, event, prms, nprms) index = rs->list_index; if (index < 0) return; if(direction != 0) { - index += direction; + index += direction; if(direction == -2) index = 0; if(direction == 2) index = listLength-1; if(index < 0 || index >= listLength) return; @@ -655,14 +652,12 @@ void GLT_DeSelectList() void GameListOptionsPopDown() { - Arg args[16]; - int j; + if (gameListOptShell == NULL) return; - if (gameListOptShell == NULL) return; - XtPopdown(gameListOptShell); - XtDestroyWidget(gameListOptShell); - gameListOptShell = 0; - XtSetKeyboardFocus(shellWidget, formWidget); + XtPopdown(gameListOptShell); + XtDestroyWidget(gameListOptShell); + gameListOptShell = 0; + XtSetKeyboardFocus(shellWidget, formWidget); } void @@ -822,15 +817,10 @@ GameListOptionsCreate() void GameListOptionsPopUp(Widget w, XEvent *event, String *prms, Cardinal *nprms) { - Arg args[16]; - int j, nstrings; - Widget listwidg; - - if (gameListOptShell == NULL) { - gameListOptShell = GameListOptionsCreate(); - } + if (gameListOptShell == NULL) + gameListOptShell = GameListOptionsCreate(); - XtPopup(gameListOptShell, XtGrabNone); + XtPopup(gameListOptShell, XtGrabNone); } diff --git a/xhistory.c b/xhistory.c index fe48893..d7d3e7f 100644 --- a/xhistory.c +++ b/xhistory.c @@ -67,6 +67,7 @@ extern char *getenv(); #include "xboard.h" #include "xhistory.h" #include "gettext.h" +#include "xevalgraph.h" #ifdef ENABLE_NLS # define _(s) gettext (s) diff --git a/xoptions.c b/xoptions.c index 92643c1..b5368a3 100644 --- a/xoptions.c +++ b/xoptions.c @@ -259,7 +259,6 @@ void TimeControlCallback(w, client_data, call_data) XtPointer client_data, call_data; { String name, txt; - Widget w2; Arg args[16]; char buf[MSG_SIZ]; int j; @@ -324,7 +323,7 @@ void TimeControlCallback(w, client_data, call_data) return; } if (strcmp(name, _(" OK ")) == 0) { - int inc, mps, tc, ok; + int inc, mps, ok; XtSetArg(args[0], XtNstring, &txt); XtGetValues(tcData, args, 1); switch(tcInc) { @@ -384,7 +383,7 @@ void TimeControlCallback(w, client_data, call_data) void TimeControlPopUp() { Arg args[16]; - Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, mess; + Widget popup, layout, form, b_ok, b_cancel, b_clas, b_inc, mess; Window root, child; int x, y, i, j; int win_x, win_y; @@ -644,9 +643,7 @@ void EngineCallback(w, client_data, call_data) XtPointer client_data, call_data; { String name; - Widget s2; Arg args[16]; - char buf[80]; int j; XtSetArg(args[0], XtNlabel, &name); @@ -690,7 +687,7 @@ void EngineCallback(w, client_data, call_data) void EnginePopUp() { Arg args[16]; - Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, s1; + Widget popup, layout, form, b_ok, b_cancel, s1; Window root, child; int x, y, i, j, width; int win_x, win_y; @@ -1004,9 +1001,7 @@ void NewVariantCallback(w, client_data, call_data) XtPointer client_data, call_data; { String name; - Widget w2; Arg args[16]; - char buf[MSG_SIZ]; VariantClass v; XtSetArg(args[0], XtNlabel, &name); @@ -1046,12 +1041,11 @@ void NewVariantCallback(w, client_data, call_data) void NewVariantPopUp() { Arg args[16]; - Widget popup, layout, dialog, edit, form, last = NULL, b_ok, b_cancel; + Widget popup, layout, form, last = NULL, b_ok, b_cancel; Window root, child; int x, y, i, j; int win_x, win_y; unsigned int mask; - char def[80]; XrmValue vFrom, vTo; i = 0; @@ -1193,14 +1187,13 @@ void UciCallback(w, client_data, call_data) { String name; Arg args[16]; - char buf[80]; int oldCores = appData.smpCores, ponder = 0; XtSetArg(args[0], XtNlabel, &name); XtGetValues(w, args, 1); if (strcmp(name, _("OK")) == 0) { - int nr, i, j; String name; + int i, j; String name; for(i=0; i<6; i++) { XtSetArg(args[0], XtNstring, &name); XtGetValues(controlDesc[i].handle, args, 1); @@ -1243,7 +1236,7 @@ void UciCallback(w, client_data, call_data) void UciPopUp() { Arg args[16]; - Widget popup, layout, dialog, edit, form, b_ok, b_cancel, last = NULL, new, upperLeft; + Widget popup, layout, form, b_ok, b_cancel, last = NULL, new, upperLeft; Window root, child; int x, y, i, j; int win_x, win_y; @@ -1392,10 +1385,9 @@ void SpinCallback(w, client_data, call_data) XtPointer client_data, call_data; { String name, val; - Widget w2; Arg args[16]; char buf[MSG_SIZ]; - int i, j; + int j; int data = (intptr_t) client_data; XtSetArg(args[0], XtNlabel, &name); @@ -1421,7 +1413,6 @@ void SettingsCallback(w, client_data, call_data) XtPointer client_data, call_data; { String name, val; - Widget w2; Arg args[16]; char buf[MSG_SIZ]; int i, j; @@ -1435,8 +1426,6 @@ void SettingsCallback(w, client_data, call_data) return; } if (strcmp(name, _("OK")) == 0 || data) { // save buttons imply OK - int nr; - for(i=0; inrOptions; i++) { // send all options that had to be OK-ed to engine switch(currentCps->option[i].type) { case TextBox: @@ -1478,6 +1467,10 @@ void SettingsCallback(w, client_data, call_data) SendToProgram(buf, currentCps); } break; + default: + if( appData.debugMode ) + fprintf(debugFP, "SettingsPopUp: unexpected case in switch.\n"); + break; } } if(data) { // send save-button command to engine @@ -1530,15 +1523,16 @@ void CreateComboPopup(parent, name, n, mb) } } -void SettingsPopUp(ChessProgramState *cps) +void +SettingsPopUp(ChessProgramState *cps) { Arg args[16]; - Widget popup, layout, dialog, edit=NULL, form, oldform, last, b_ok, b_cancel, leftMargin = NULL, textField = NULL; + Widget popup, layout, dialog, edit=NULL, form, last, b_ok, b_cancel, leftMargin = NULL, textField = NULL; Window root, child; int x, y, i, j, height, width, h, c; int win_x, win_y, maxWidth, maxTextWidth; unsigned int mask; - char def[MSG_SIZ], *p, *q; + char def[MSG_SIZ]; static char pane[6] = "paneX"; Widget texts[100], forelast = NULL, anchor, widest; @@ -1662,6 +1656,10 @@ void SettingsPopUp(ChessProgramState *cps) CreateComboPopup(last, cps->option[i].name, i, (char **) cps->option[i].textValue); values[i] = cps->option[i].value; break; + default: + if( appData.debugMode ) + fprintf(debugFP, "SettingsPopUp: unexpected case in switch.\n"); + break; } } -- 1.7.0.4