From: H.G. Muller Date: Mon, 22 Oct 2012 19:09:51 +0000 (+0200) Subject: Fix warnings X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=cddb5c485a52d0444e81b4df49e1fe921c78b53c;p=xboard.git Fix warnings The highTextStart/End are now declared in engineoutput.h, shared between nengineoutput.c and xengineoutput.c. Unused variables were removed. Also fix warnings in xboard.c and xoptions.c. --- diff --git a/engineoutput.h b/engineoutput.h index b0a2c31..522e0ef 100644 --- a/engineoutput.h +++ b/engineoutput.h @@ -55,6 +55,7 @@ enum ENGINE_STATE { STATE_UNKNOWN, STATE_THINKING, STATE_IDLE, STATE_PONDERING, extern int windowMode; extern char exclusionHeader[]; +extern int highTextStart[2], highTextEnd[2]; // back-end called by front-end void SetEngineState( int which, enum ENGINE_STATE state, char * state_data ); diff --git a/gtk/xboard.c b/gtk/xboard.c index 44c9984..77eef84 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -195,6 +195,7 @@ char *FindFont P((char *pattern, int targetPxlSize)); #endif void DelayedDrag P((void)); void ICSInputBoxPopUp P((void)); +void MoveTypeInProc P((GdkEventKey *eventkey)); gboolean KeyPressProc P((GtkWindow *window, GdkEventKey *eventkey, gpointer data)); Boolean TempBackwardActive = False; void DisplayMove P((int moveNumber)); @@ -368,12 +369,6 @@ String xboardResources[] = { }; #endif -/* Max possible square size */ -#define MAXSQSIZE 256 - -static int xpm_avail[MAXSQSIZE]; - - void BoardToTop () { @@ -793,7 +788,6 @@ main (int argc, char **argv) int boardWidth, boardHeight, w, h; char *p; int forceMono = False; - GError *gtkerror=NULL; srandom(time(0)); // [HGM] book: make random truly random @@ -1441,7 +1435,7 @@ static WindowPlacement wpNew; void CoDrag (GtkWidget *sh, WindowPlacement *wp) { - int j=0, touch=0, fudge = 2; + int touch=0, fudge = 2; GetActualPlacement(sh, wp); if(abs(wpMain.x + wpMain.width + 2*frameX - wp->x) < fudge) touch = 1; else // right touch if(abs(wp->x + wp->width + 2*frameX - wpMain.x) < fudge) touch = 2; else // left touch @@ -1807,12 +1801,6 @@ SetWindowTitle (char *text, char *title, char *icon) } -static int -NullXErrorCheck (Display *dpy, XErrorEvent *error_event) -{ - return 0; -} - void DisplayIcsInteractionTitle (String message) { diff --git a/gtk/xengineoutput.c b/gtk/xengineoutput.c index 576d58b..50f5471 100644 --- a/gtk/xengineoutput.c +++ b/gtk/xengineoutput.c @@ -69,12 +69,10 @@ extern char *getenv(); extern Option engoutOptions[]; // must go in header, but which? /* Module variables */ -static int currentPV, highTextStart[2], highTextEnd[2]; #ifdef TODO_GTK static Widget memoWidget; #endif static GdkPixbuf *iconsGTK[8]; -static GtkWidget *outputFieldGTK[2][7]; // [HGM] front-end array to translate output field to window handlestatic void *memoWidget; static void ReadIcon (gchar *svgFilename, int iconNr) @@ -128,15 +126,6 @@ InsertIntoMemo (int which, char * text, int where) } } -//--------------------------------- PV walking --------------------------------------- - -char memoTranslations[] = -":Ctrlc: CopyMemoProc() \n \ -: HandlePV() \n \ -Shift: select-start() extend-end() SelectPV(1) \n \ -Any: select-start() extend-end() SelectPV(0) \n \ -: StopPV() \n"; - //------------------------------- pane switching ----------------------------------- void diff --git a/gtk/xoptions.c b/gtk/xoptions.c index f5d223c..afc82a6 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -151,7 +151,7 @@ void GetWidgetTextGTK(GtkWidget *w, char **buf) GtkTextIter end; if (GTK_IS_ENTRY(w)) { - *buf = gtk_entry_get_text(GTK_ENTRY (w)); + *buf = (char *) gtk_entry_get_text(GTK_ENTRY (w)); } else if (GTK_IS_TEXT_BUFFER(w)) { gtk_text_buffer_get_start_iter(GTK_TEXT_BUFFER(w), &start); @@ -290,15 +290,11 @@ LoadListBox (Option *opt, char *emptyText, int n1, int n2) void HighlightItem (Option *opt, int index, int scroll) { - char *value, **data = (char **) (opt->target); GtkWidget *list = (GtkWidget *) (opt->handle); GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list)); - GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); - GtkListStore *store = GTK_LIST_STORE(model); GtkTreePath *path = gtk_tree_path_new_from_indices(index, -1); - GtkTreeIter iter; gtk_tree_selection_select_path(selection, path); - if(scroll) gtk_tree_view_scroll_to_cell(list, path, NULL, 0, 0, 0); + if(scroll) gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(list), path, NULL, 0, 0, 0); gtk_tree_path_free(path); } @@ -425,7 +421,7 @@ CreateMenuPopup (Option *opt, int n, int def) 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 - if(mb[i].handle == RADIO) gtk_check_menu_item_set_draw_as_radio(entry, True); + 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); @@ -561,7 +557,7 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) { // handle mouse clicks on text widgets that need it int w, h; int button=10, f=1; - Option *opt, *memo = (Option *) gdata; + Option *memo = (Option *) gdata; MemoCallback *userHandler = (MemoCallback *) memo->choice; GdkEventButton *bevent = (GdkEventButton *) event; GdkEventMotion *mevent = (GdkEventMotion *) event; @@ -588,8 +584,8 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) shiftState = bevent->state & GDK_SHIFT_MASK; controlState = bevent->state & GDK_CONTROL_MASK; // GTK_TODO: is this really the most efficient way to get the character at the mouse cursor??? - gtk_text_view_window_to_buffer_coords(widget, GTK_TEXT_WINDOW_WIDGET, w, h, &x, &y); - gtk_text_view_get_iter_at_location(widget, &start, x, y); + gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_WIDGET, w, h, &x, &y); + gtk_text_view_get_iter_at_location(GTK_TEXT_VIEW(widget), &start, x, y); gtk_text_buffer_place_cursor(memo->handle, &start); /* get cursor position into index */ g_object_get(memo->handle, "cursor-position", &index, NULL); @@ -793,7 +789,7 @@ static void GraphEventProc(GtkWidget *widget, GdkEvent *event, gpointer gdata) { // handle expose and mouse events on Graph widget int w, h; - int j, button=10, f=1, sizing=0; + int button=10, f=1, sizing=0; Option *opt, *graph = (Option *) gdata; PointerCallback *userHandler = graph->target; GdkEventExpose *eevent = (GdkEventExpose *) event; @@ -993,18 +989,17 @@ ListCallback (GtkWidget *widget, GdkEventButton *event, gpointer gdata) return TRUE; } +#ifdef TODO_GTK +// This is needed for color pickers? static char *oneLiner = "Return: redraw-display() \n \ Tab: TabProc() \n "; -static char scrollTranslations[] = - "(2): WheelProc(0 0 A) \n \ - : WheelProc(-1) \n \ - : WheelProc(1) \n "; +#endif +#ifdef TODO_GTK static void SqueezeIntoBox (Option *opt, int nr, int width) { // size buttons in bar to fit, clipping button names where necessary -#ifdef TODO_GTK int i, wtot = 0; Dimension widths[20], oldWidths[20]; Arg arg; @@ -1026,8 +1021,8 @@ SqueezeIntoBox (Option *opt, int nr, int width) XtSetValues(opt[i].handle, &arg, 1); } opt->min = wtot; -#endif } +#endif #ifdef TODO_GTK int @@ -1412,7 +1407,7 @@ printf("option =%2d, top =%2d\n", i, top); case Graph: option[i].handle = (void*) (graph = gtk_drawing_area_new()); gtk_widget_set_size_request(graph, option[i].max, option[i].value); - Pack(hbox, GTK_TABLE(table), graph, left, left+r, top, GTK_EXPAND); + Pack(hbox, table, graph, left, left+r, top, GTK_EXPAND); g_signal_connect (graph, "expose-event", G_CALLBACK (GraphEventProc), (gpointer) &option[i]); gtk_widget_add_events(GTK_WIDGET(graph), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK); g_signal_connect (graph, "button-press-event", G_CALLBACK (GraphEventProc), (gpointer) &option[i]); diff --git a/nengineoutput.c b/nengineoutput.c index cf304a0..7b39a72 100644 --- a/nengineoutput.c +++ b/nengineoutput.c @@ -69,7 +69,7 @@ extern char *getenv(); int windowMode = 1; char *mem1, *mem2; // dummies, as this dialog can never be OK'ed -static int currentPV, highTextStart[2], highTextEnd[2]; +int highTextStart[2], highTextEnd[2]; int MemoProc P((Option *opt, int n, int x, int y, char *text, int index)); diff --git a/xaw/xengineoutput.c b/xaw/xengineoutput.c index 78269b8..b3b74f1 100644 --- a/xaw/xengineoutput.c +++ b/xaw/xengineoutput.c @@ -97,7 +97,7 @@ extern char *getenv(); /* Module variables */ -static int currentPV, highTextStart[2], highTextEnd[2]; +static int currentPV; static Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle static Widget memoWidget;