X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=src%2Fui%2Flwlib%2Fxlwgauge.c;h=4e1e5ecc412000f5a1c149386412bf1c0433110f;hb=HEAD;hp=c308e9edb3d5d0f65fe1c3410907aee21dc37872;hpb=a2e176a2d2f133af3bf89c38ab29d9dfa08bcdc1;p=sxemacs diff --git a/src/ui/lwlib/xlwgauge.c b/src/ui/lwlib/xlwgauge.c index c308e9e..4e1e5ec 100644 --- a/src/ui/lwlib/xlwgauge.c +++ b/src/ui/lwlib/xlwgauge.c @@ -380,6 +380,8 @@ static void GaugeExpose(Widget w, XEvent * event, Region region) hgt = gw->core.width; } + SXE_SET_UNUSED(hgt); + /* if the gauge is selected, signify by drawing the background * in a contrasting color. */ @@ -457,14 +459,14 @@ static void GaugeExpose(Widget w, XEvent * event, Region region) if (gw->gauge.labels == NULL) { n = snprintf(label, sizeof(label), "%d", - v0 + i * (v1 - v0) / - (gw->gauge.nlabels - 1)); + v0 + i * (v1 - v0) / + (gw->gauge.nlabels - 1)); assert(n >= 0 && (size_t)n < sizeof(label)); } else s = gw->gauge.labels[i]; if (s != NULL) { - x = e0 + i * (e1 - e0 - 1) / + x = e0 + i * (e1 - e0 - 1) / (gw->gauge.nlabels - 1); xlen = strlen(s); if (gw->gauge.orientation == XtorientHorizontal) { @@ -897,7 +899,7 @@ static void MaxLabel(GaugeWidget gw, Dimension * wid, /* max label width */ w = 0; for (i = 0; i < gw->gauge.nlabels; ++i) { if (gw->gauge.labels == NULL) { /* numeric labels */ - int sz = snprintf(lbl = lstr, sizeof(lstr), + int sz = snprintf(lbl = lstr, sizeof(lstr), "%d", v0 + i * dv / n); assert(sz >= 0 && (size_t)sz < sizeof(lstr)); } else