Bugzilla – Bug 132848
mgdiff-1.0-1071 : local variable used before set
Last modified: 2005-11-10 11:22:27 UTC
I just tried to compile package mgdiff-1.0-1071 with the Intel C compiler. It said mgdiff.c(1888): warning #592: variable "newcbs" is used before its value is set The source code is if (newcbs.value > (maximum - slidersize)) { I agree with the compiler. Suggest code rework. BTW, the email address [ dan@sass.com ] of the author of this package appears to be broken.
FIXED
(In reply to comment #1) > FIXED Excellent news. Would you be willing to give us a clue about which version has this fix ?
Next SuSE LINUX 10.1 or openSuSE
(In reply to comment #3) > Next SuSE LINUX 10.1 or openSuSE No surprises there then ;-> Which version *of the mgdiff package* has this fix, please ? Is there a new and working email address for the author ?
AFAIK there is no working email address for Dan Williams. I've added a patch from the debians people. The changes are done by Erik de Castro Lopo <erikd@mega-nerd.com>. The patch its self is simple: @@ -1921,19 +1928,20 @@ value = (b->sline >= lines_of_context) ? (b->sline - lines_of_context) : b->sline; XtVaGetValues (sb, XmNmaximum, &maximum, XmNsliderSize, &slidersize, NULL); - if (value > (maximum - slidersize)) - value = maximum - slidersize; if ((w == sbl) || (w == sbr)) { int side = (w == sbl) ? LEFT : RIGHT; - if (newcbs.value > (maximum - slidersize)) { - newcbs.value = maximum - slidersize; - XtVaSetValues (w, XmNvalue, newcbs.value - b->sline + b->arr[side].fline, NULL); + if (value > (maximum - slidersize)) { + value = maximum - slidersize; + XtVaSetValues (w, XmNvalue, value - b->sline + b->arr[side].fline, NULL); return; } } + if (value > (maximum - slidersize)) + value = maximum - slidersize; + newcbs.reason = XmCR_VALUE_CHANGED; newcbs.event = NULL; newcbs.value = value;