From e5876bb39d5f30d92865ff5f37b0b60f15e4fa87 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 21 Jan 2013 10:26:20 +0100 Subject: [PATCH] Fix some warnings --- backend.c | 9 ++++++--- backend.h | 3 +++ dialogs.c | 9 +-------- dialogs.h | 4 +++- draw.c | 4 +--- gtk/xboard.c | 2 +- gtk/xboard.h | 1 + gtk/xoptions.c | 8 ++++---- menus.h | 2 -- xaw/xoptions.c | 2 +- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/backend.c b/backend.c index f608f60..7269a75 100644 --- a/backend.c +++ b/backend.c @@ -4180,9 +4180,13 @@ read_from_ics (InputSourceRef isr, VOIDSTAR closure, char *data, int count, int void ParseBoard12 (char *string) { +#if ZIPPY + int i, takeback; + char *bookHit = NULL; // [HGM] book +#endif GameMode newGameMode; - int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0, i; - int j, k, n, moveNum, white_stren, black_stren, white_time, black_time, takeback; + int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0; + int j, k, n, moveNum, white_stren, black_stren, white_time, black_time; int double_push, castle_ws, castle_wl, castle_bs, castle_bl, irrev_count; char to_play, board_chars[200]; char move_str[MSG_SIZ], str[MSG_SIZ], elapsed_time[MSG_SIZ]; @@ -4194,7 +4198,6 @@ ParseBoard12 (char *string) int fromX, fromY, toX, toY; char promoChar; int ranks=1, files=0; /* [HGM] ICS80: allow variable board size */ - char *bookHit = NULL; // [HGM] book Boolean weird = FALSE, reqFlag = FALSE; fromX = fromY = toX = toY = -1; diff --git a/backend.h b/backend.h index e62b9b1..5234b44 100644 --- a/backend.h +++ b/backend.h @@ -96,6 +96,8 @@ #include "lists.h" +typedef int (*FileProc) P((FILE *f, int n, char *title)); + extern char *wbOptions; extern int gotPremove; extern GameMode gameMode; @@ -114,6 +116,7 @@ extern Boolean bookUp; extern int tinyLayout, smallLayout; extern Boolean mcMode; +void MarkMenuItem P((char *menuRef, int state)); char *CmailMsg P((void)); /* Tord: Added the useFEN960 parameter in PositionToFEN() below */ char *PositionToFEN P((int move, char* useFEN960)); diff --git a/dialogs.c b/dialogs.c index 09afb95..8ea9f30 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2568,14 +2568,7 @@ FileNamePopUp (char *label, char *def, char *filter, FileProc proc, char *openMo { fileProc = proc; /* I can't see a way not */ fileOpenMode = openMode; /* to use globals here */ -#ifdef TODO_GTK - { // [HGM] use file-selector dialog stolen from Ghostview - // int index; // this is not supported yet - Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, &openName, &openFP); - } -#else - FileNamePopUpGTK(label, def, filter, proc, False, openMode, &openName, &openFP); -#endif + FileNamePopUpWrapper(label, def, filter, proc, False, openMode, &openName, &openFP); } void diff --git a/dialogs.h b/dialogs.h index ad483e9..c237215 100644 --- a/dialogs.h +++ b/dialogs.h @@ -164,7 +164,9 @@ void AddHandler P((Option *opt, DialogClass dlg, int nr)); void SendText P((int n)); void DisplayLogos P((Option *left, Option *right)); void Browse P((DialogClass dlg, char *label, char *proposed, char *ext, - Boolean pathFlag, char *mode, char **name, FILE **fp)); + Boolean pathFlag, char *mode, char **name, FILE **fp)); +void FileNamePopUpWrapper P((char *label, char *def, char *filter, FileProc proc, + Boolean pathFlag, char *openMode, char **openName, FILE **openFP)); void InitDrawingParams P((int reload)); // in draw.c void InitDrawingHandle P((Option *opt)); diff --git a/draw.c b/draw.c index 0f34e24..b7f5aeb 100644 --- a/draw.c +++ b/draw.c @@ -168,7 +168,7 @@ InitDrawingSizes (BoardSize boardSize, int flags) int boardWidth, boardHeight; static int oldWidth, oldHeight; static VariantClass oldVariant; - static int oldMono = -1, oldTwoBoards = 0; + static int oldTwoBoards = 0; if(!mainOptions[W_BOARD].handle) return; @@ -199,11 +199,9 @@ InitDrawingSizes (BoardSize boardSize, int flags) SelectPieces(gameInfo.variant); - oldMono = -10; // kludge to force recreation of animation masks oldVariant = gameInfo.variant; } CreateAnimVars(); - oldMono = appData.monoMode; } void diff --git a/gtk/xboard.c b/gtk/xboard.c index c52a080..afe8ef7 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -2061,7 +2061,7 @@ UpdateLogos (int displ) return; } -void FileNamePopUpGTK(label, def, filter, proc, pathFlag, openMode, name, fp) +void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp) char *label; char *def; char *filter; diff --git a/gtk/xboard.h b/gtk/xboard.h index c995110..781871d 100644 --- a/gtk/xboard.h +++ b/gtk/xboard.h @@ -133,6 +133,7 @@ typedef struct { void NewTagsPopup P((char *text, char *msg)); int AppendText P((Option *opt, char *s)); void NewCommentPopup P((char *title, char *text, int index)); +void GetActualPlacement P((GtkWidget *shell, WindowPlacement *wp)); #ifdef TODO_GTK void CatchDeleteWindow(Widget w, String procname); void GenericPopDown P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); diff --git a/gtk/xoptions.c b/gtk/xoptions.c index ecdbd30..c108c1b 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -427,7 +427,7 @@ CreateMenuPopup (Option *opt, int n, int def) if(mb[i].handle == RADIO) gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(entry), True); } else entry = gtk_menu_item_new_with_label(msg); - gtk_signal_connect_object (GTK_OBJECT (entry), "activate", GTK_SIGNAL_FUNC(MenuSelect), (gpointer) (n<<16)+i); + gtk_signal_connect_object (GTK_OBJECT (entry), "activate", GTK_SIGNAL_FUNC(MenuSelect), (gpointer) (intptr_t) ((n<<16)+i)); gtk_widget_show(entry); } else entry = gtk_separator_menu_item_new(); gtk_menu_append(GTK_MENU (menu), entry); @@ -515,7 +515,7 @@ ShiftKeys () static gboolean GameListEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) { - int n = (int) gdata; + int n = (intptr_t) gdata; if(n == 4) { if(((GdkEventKey *) event)->keyval != GDK_Return) return FALSE; @@ -612,7 +612,7 @@ AddHandler (Option *opt, DialogClass dlg, int nr) case 5: // game list g_signal_connect(opt->handle, "button-press-event", G_CALLBACK (GameListEvent), (gpointer) 0 ); case 4: // game-list filter - g_signal_connect(opt->handle, "key-press-event", G_CALLBACK (GameListEvent), (gpointer) nr ); + g_signal_connect(opt->handle, "key-press-event", G_CALLBACK (GameListEvent), (gpointer) (intptr_t) nr ); break; case 6: // engine output (uses generic textview callback) break; @@ -1384,7 +1384,7 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); 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) ); + g_signal_connect(list, "button-press-event", G_CALLBACK(ListCallback), (gpointer) (intptr_t) (dlgNr<<16 | i) ); /* never has label, so let listbox occupy all columns */ Pack(hbox, table, sw, left, left+r, top, GTK_EXPAND); diff --git a/menus.h b/menus.h index b7cbf03..bc6c504 100644 --- a/menus.h +++ b/menus.h @@ -52,7 +52,6 @@ typedef void MenuProc P((void)); -typedef int (*FileProc) P((FILE *f, int n, char *title)); typedef struct { char *string; @@ -74,7 +73,6 @@ typedef struct { extern Menu menuBar[]; -void MarkMenuItem P((char *menuRef, int state)); void ErrorPopUp P((char *title, char *text, int modal)); void AppendEnginesToMenu P((char *list)); void LoadGameProc P((void)); diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 5cdb2e0..5db8614 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -1230,7 +1230,7 @@ HardSetFocus (Option *opt) } void -FileNamePopUpGTK(char *label, char *def, char *filter, FileProc proc, Boolean pathFlag, char *openMode, char **openName, FILE **openFP) +FileNamePopUpWrapper (char *label, char *def, char *filter, FileProc proc, Boolean pathFlag, char *openMode, char **openName, FILE **openFP) { Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, openName, openFP); } -- 1.7.0.4