From: H.G. Muller Date: Sat, 16 Jul 2011 12:53:14 +0000 (+0200) Subject: Suppress some XBoard warnings X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6dc1a307d4ec7c6a793865d8a0bee6e48109435e;p=xboard.git Suppress some XBoard warnings --- diff --git a/backend.c b/backend.c index 91a5fbb..f0289bc 100644 --- a/backend.c +++ b/backend.c @@ -63,6 +63,7 @@ int flock(int f, int code); #else +#include #define DoSleep( n ) if( (n) >= 0) sleep(n) #define SLASH '/' diff --git a/xboard.c b/xboard.c index 2bff8e4..a676d24 100644 --- a/xboard.c +++ b/xboard.c @@ -5736,8 +5736,6 @@ SendGameSelection(Widget w, Atom *selection, Atom *target, void CopySomething() { - int ret; - /* * Set both PRIMARY (the selection) and CLIPBOARD, since we don't * have a notion of a game that is selected but not copied. @@ -7746,7 +7744,7 @@ int OpenTCP(host, port, pr) struct addrinfo hints; struct addrinfo *ais, *ai; int error; - int s; + int s=0; ChildProc *cp; memset(&hints, 0, sizeof(hints)); diff --git a/xboard.h b/xboard.h index bc2a5f9..8412f53 100644 --- a/xboard.h +++ b/xboard.h @@ -134,6 +134,13 @@ typedef struct { typedef int (*FileProc) P((FILE *f, int n, char *title)); int PopDown P((int n)); +void NewTagsPopup P((char *text, char *msg)); +int AppendText P((Option *opt, char *s)); +int GenericPopUp P((Option *option, char *title, int dlgNr)); +void NewCommentPopup P((char *title, char *text, int index)); +void MarkMenu P((char *item, int dlgNr)); +void GetWidgetText P((Option *opt, char **buf)); +void ClearTextWidget P((Option *opt)); void InputBoxPopup P((void)); void CatchDeleteWindow(Widget w, String procname); void PlaySound P((char *name)); diff --git a/xgamelist.h b/xgamelist.h index 14ca2a8..6c689a5 100644 --- a/xgamelist.h +++ b/xgamelist.h @@ -29,6 +29,7 @@ void LoadSelectedProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void SetFilterProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +int SaveGameListAsText P((FILE *f)); extern Widget gameListShell; #endif /* _XGAMEL_H */ diff --git a/xhistory.c b/xhistory.c index e8dd0b4..661572d 100644 --- a/xhistory.c +++ b/xhistory.c @@ -48,6 +48,8 @@ #include "common.h" #include "frontend.h" #include "backend.h" +#include "xhistory.h" +#include "xboard.h" #include "gettext.h" #ifdef ENABLE_NLS @@ -58,19 +60,14 @@ # define N_(s) s #endif -// templates for calls into back-end +// templates for calls into back-end (= history.c; should be moved to history.h header shared with it!) void RefreshMemoContent P((void)); void MemoContentUpdated P((void)); void FindMoveByCharIndex P(( int char_index )); +void MoveHistorySet P(( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo )); -int AppendText P((Option *opt, char *s)); -int GenericPopUp P((Option *option, char *title, int dlgNr)); -void MarkMenu P((char *item, int dlgNr)); -void GetWidgetText P((Option *opt, char **buf)); - +// variables in xoptions.c extern Option historyOptions[]; -extern Widget shells[10]; -extern Boolean shellUp[10]; // ------------- low-level front-end actions called by MoveHistory back-end ----------------- @@ -89,7 +86,6 @@ void ClearHistoryMemo() // the colorNr argument says 0 = font-default, 1 = gray int AppendToHistoryMemo( char * text, int bold, int colorNr ) { - Arg args[10]; return AppendText(&historyOptions[0], text); // for now ignore bold & color stuff, as Xaw cannot handle that } @@ -170,6 +166,9 @@ HistoryShowProc(w, event, prms, nprms) } // duplicate of code in winboard.c, so an move to back-end! +void EvalGraphSet P(( int first, int last, int current, ChessProgramStats_Move * pvInfo )); +void MakeEngineOutputTitle P(()); + void HistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current ) { diff --git a/xhistory.h b/xhistory.h index 068d2a8..d845ca3 100644 --- a/xhistory.h +++ b/xhistory.h @@ -25,8 +25,6 @@ void HistoryShowProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void HistoryPopDown P((Widget w, XtPointer client_data, - XtPointer call_data)); Boolean MoveHistoryIsUp P((void)); extern Widget historyShell; diff --git a/xoptions.c b/xoptions.c index 7e7eed8..bafa8bb 100644 --- a/xoptions.c +++ b/xoptions.c @@ -673,7 +673,6 @@ void RefreshColor(int source, int n) { int col, j, r, g, b, step = 10; char *s, buf[MSG_SIZ]; // color string - Arg args[5]; GetWidgetText(¤tOption[source], &s); if(sscanf(s, "#%x", &col) != 1) return; // malformed b = col & 0xFF; g = col & 0xFF00; r = col & 0xFF0000; @@ -1423,7 +1422,6 @@ void ClearComment(int n) void NewCommentPopup(char *title, char *text, int index) { - Widget edit; Arg args[16]; if(shells[1]) { // if already exists, alter title and content @@ -1438,7 +1436,7 @@ void NewCommentPopup(char *title, char *text, int index) XtOverrideTranslations(commentOptions[0].handle, XtParseTranslationTable(commentTranslations)); } -static char *tagsText, *msgText; +static char *tagsText; int NewTagsCallback(int n) { @@ -1462,7 +1460,6 @@ Option tagsOptions[] = { void NewTagsPopup(char *text, char *msg) { - Widget edit; Arg args[16]; char *title = bookUp ? _("Edit book") : _("Tags"); @@ -1514,12 +1511,11 @@ void TypeInProc(w, event, prms, nprms) String *prms; Cardinal *nprms; { - Arg args[2]; - String val; + char *val; if(prms[0][0] == '1') { GetWidgetText(&boxOptions[0], &val); - TypeInDoneEvent((char*)val); + TypeInDoneEvent(val); } PopDown(0); } @@ -1645,7 +1641,6 @@ void SetRandom(int n) { int r = n==2 ? -1 : rand() & (1<<30)-1; char buf[MSG_SIZ]; - Arg args[2]; snprintf(buf, MSG_SIZ, "%d", r); SetWidgetText(&shuffleOptions[1], buf, 0); SetWidgetState(&shuffleOptions[0], True);