X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=ngamelist.c;h=32fdf33f9ae5c7321c47875bd9fc369efe0afc87;hb=0a3919ff10a347a8d840f75fd2c816efe52e5098;hp=3c0ed894401a4e6d767b01e55f1491608a45d7ef;hpb=24027336f2789abd43dc83274a6ed705d0a3c2f3;p=xboard.git diff --git a/ngamelist.c b/ngamelist.c index 3c0ed89..32fdf33 100644 --- a/ngamelist.c +++ b/ngamelist.c @@ -96,7 +96,7 @@ static Option gamesOptions[] = { static void GL_Button (int n) { - int index, j; + int index; n = gamesOptions[n].value; // use marker in option rather than n itself, for more easy adding/deletng of buttons if (n == 6) { // close PopDown(GameListDlg); @@ -205,7 +205,7 @@ static void GameListReplace (int page) { // filter: put in separate routine, to make callable from call-back - char buf[MSG_SIZ], *p, **st=list; + char buf[MSG_SIZ], **st=list; int i; if(page) *st++ = _("previous page"); else if(listLength > 1000) *st++ = ""; @@ -214,7 +214,7 @@ GameListReplace (int page) if(page + 1000 <= listLength) *st++ = _("next page"); *st = NULL; - LoadListBox(&gamesOptions[0], _("no games matched your request")); + LoadListBox(&gamesOptions[0], _("no games matched your request"), -1, -1); HighlightWithScroll(&gamesOptions[0], listEnd > 1000, listEnd); snprintf(buf, MSG_SIZ, _("%s - %d/%d games (%d-%d-%d)"), glc->filename, listLength, ((ListGame *) gameList.tailPred)->number, wins, losses, draws); SetDialogTitle(GameListDlg, buf); @@ -223,8 +223,6 @@ GameListReplace (int page) void GameListPopUp (FILE *fp, char *filename) { - char **st; - if (glc == NULL) { glc = (GameListClosure *) calloc(1, sizeof(GameListClosure)); glc->x = glc->y = -1; @@ -266,9 +264,6 @@ GameListDestroy () void ShowGameListProc () { - Arg args[16]; - int j; - if (glc == NULL) { DisplayError(_("There is no game list"), 0); return; @@ -287,11 +282,11 @@ GameListClicks (int direction) { int index; - if (glc == NULL || listLength == 0) return 0; + if (glc == NULL || listLength == 0) return 1; if(direction == 100) { FocusOnWidget(&gamesOptions[0], GameListDlg); return 1; } index = SelectedListBoxItem(&gamesOptions[0]); - if (index < 0) return; + if (index < 0) return 1; if(page && (index == 0 && direction < 1 || direction == -4)) { page -= 1000; if(page < 0) page = 0; // safety @@ -310,7 +305,7 @@ GameListClicks (int direction) index += direction; if(direction < -1) index = 0; if(direction > 1) index = listEnd-1; - if(index < 0 || index >= listEnd) return; + if(index < 0 || index >= listEnd) return 1; HighlightWithScroll(&gamesOptions[0], index, listEnd); if(!doLoad) return 1; }