X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=55a3935f39f93ed5dc58a3b87898282eb0681e32;hb=a61f78756889e18aa279dc273bd99b9af60468d7;hp=7d0c86458b4de0dd03b8a84e23e22464c864cfff;hpb=12f5e5903b89d405f10521788b900d8added456f;p=xboard.git diff --git a/xoptions.c b/xoptions.c index 7d0c864..55a3935 100644 --- a/xoptions.c +++ b/xoptions.c @@ -239,12 +239,12 @@ HighlightWithScroll (Option *opt, int sel, int max) float top, bottom, f, g; HighlightListBoxItem(opt, sel); if(!ReadScroll(opt, &top, &bottom)) return; // no scroll bar - bottom = bottom*max - 1.; + bottom = bottom*max - 1.f; f = g = top; top *= max; - if(sel > (top + 3*bottom)/4) f = (sel - 0.75*(bottom-top))/max; else - if(sel < (3*top + bottom)/4) f = (sel - 0.25*(bottom-top))/max; - if(f < 0.) f = 0.; if(f + 1./max > 1.) f = 1. - 1./max; + if(sel > (top + 3*bottom)/4) f = (sel - 0.75f*(bottom-top))/max; else + if(sel < (3*top + bottom)/4) f = (sel - 0.25f*(bottom-top))/max; + if(f < 0.f) f = 0.; if(f + 1.f/max > 1.f) f = 1. - 1./max; if(f != g) SetScroll(opt, f); } @@ -359,7 +359,7 @@ CreateMenuItem (Widget menu, char *msg, XtCallbackProc CB, int n) static Widget CreateComboPopup (Widget parent, Option *opt, int n, int fromList, int def) { // fromList determines if the item texts are taken from a list of strings, or from a menu table - int i, j; + int i; Widget menu, entry; Arg arg; MenuItem *mb = (MenuItem *) opt->choice; @@ -370,7 +370,7 @@ CreateComboPopup (Widget parent, Option *opt, int n, int fromList, int def) for (i=0; 1; i++) { - char *msg = fromList ? list[i] : mb[i].string, *msg2; + char *msg = fromList ? list[i] : mb[i].string; if(!msg) break; entry = CreateMenuItem(menu, opt->min & NO_GETTEXT ? msg : _(msg), (XtCallbackProc) ComboSelect, (n<<16)+i); if(!fromList) mb[i].handle = (void*) entry; // save item ID, for enabling / checkmarking @@ -628,7 +628,7 @@ WheelProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) int j=0, n = atoi(prms[0]); static char *params[3] = { "", "Continuous", "Proportional" }; Arg args[16]; - float f, h, top; + float h, top; Widget v; if(!n) { // transient dialogs also use this for list-selection callback n = prms[1][0]-'0'; @@ -641,7 +641,7 @@ WheelProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) XtSetArg(args[j], XtNshown, &h); j++; XtSetArg(args[j], XtNtopOfThumb, &top); j++; XtGetValues(v, args, j); - top += 0.1*h*n; if(top < 0.) top = 0.; + top += 0.1f*h*n; if(top < 0.f) top = 0.; XtCallActionProc(v, "StartScroll", event, params+1, 1); XawScrollbarSetThumb(v, top, -1.0); XtCallActionProc(v, "NotifyThumb", event, params, 0); @@ -660,7 +660,7 @@ static char scrollTranslations[] = static void SqueezeIntoBox (Option *opt, int nr, int width) { // size buttons in bar to fit, clipping button names where necessary - int i, j, wtot = 0; + int i, wtot = 0; Dimension widths[20], oldWidths[20]; Arg arg; for(i=1; i