From: H.G. Muller Date: Mon, 4 Feb 2013 20:59:05 +0000 (+0100) Subject: Fix warnings of build server X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=92a2f96e6d5eb2ef50a0a60c64e2bd55e0855ce6;p=xboard.git Fix warnings of build server --- diff --git a/dialogs.c b/dialogs.c index 8ea9f30..6624aeb 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1150,7 +1150,7 @@ ICSInputSendText () void IcsKey (int n) { // [HGM] input: let up-arrow recall previous line from history - char *val; + char *val = NULL; // to suppress spurious warning if (!shellUp[InputBoxDlg]) return; switch(n) { diff --git a/draw.c b/draw.c index b7f5aeb..2034be3 100644 --- a/draw.c +++ b/draw.c @@ -544,6 +544,7 @@ DrawBorder (int x, int y, int type, int odd) case 0: col = "#000000"; break; case 1: col = appData.highlightSquareColor; break; case 2: col = appData.premoveHighlightColor; break; + default: col = "#808080"; break; // cannot happen } cr = cairo_create(csBoardWindow); cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); @@ -608,11 +609,12 @@ BlankSquare (cairo_surface_t *dest, int x, int y, int color, ChessSquare piece, cairo_fill (cr); cairo_destroy (cr); } else { // evenly colored squares - char *col; + char *col = NULL; switch (color) { case 0: col = appData.darkSquareColor; break; case 1: col = appData.lightSquareColor; break; case 2: col = "#000000"; break; + default: col = "#808080"; break; // cannot happen } SetPen(cr, 2.0, col, 0); cairo_rectangle (cr, fac*x, fac*y, squareSize, squareSize); diff --git a/gtk/xoptions.c b/gtk/xoptions.c index defdfa4..6eea01c 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -555,7 +555,7 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) GtkTextIter start, end; String val = NULL; gboolean res; - gint index, x, y; + gint index = 0, x, y; switch(event->type) { // figure out what's up case GDK_MOTION_NOTIFY: @@ -1071,7 +1071,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent GtkWidget *box; GtkWidget *checkbutton; GtkWidget *entry; - GtkWidget *oldHbox, *hbox = NULL; + GtkWidget *oldHbox = NULL, *hbox = NULL; GtkWidget *pane = NULL; GtkWidget *button; GtkWidget *table; @@ -1086,10 +1086,10 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent GtkWidget *list; GtkWidget *graph; GtkWidget *menuButton; - GtkWidget *menuBar; + GtkWidget *menuBar = NULL; GtkWidget *menu; - int i, j, arraysize, left, top, height=999, width=1, boxStart, breakType = 0, r; + int i, j, arraysize, left, top, height=999, width=1, boxStart=0, breakType = 0, r; char def[MSG_SIZ], *msg, engineDlg = (currentCps != NULL && dlgNr != BrowserDlg); if(dlgNr < PromoDlg && shellUp[dlgNr]) return 0; // already up