Scrollbar: Overflow

Phillip Ezolt ezolt at perf.zko.dec.com
Mon Feb 18 10:56:57 CST 2002


Hi,
	I've been trying to fix up the code in controls/scrollbar.c to
deal with overflow of a 32-bit int, but I've run into a problem.

In my test application, InfoPtr->MaxVal= is 0x7FFFFFFF (The largest
signed int).  InfoPtr->MinVal = 0.

However, in various places in the code "infoPtr->MaxVal-infoPtr->MinVal+1"
is calculated.

This wraps the value around and causes bad things to happen.

Does anyone know if the "+1" is necessary?

Something has to be done differently, because what is happening now
isn't right.

--Phil

Compaq:   High Performance Server Systems Quality & Performance Engineering
---------------------------------------------------------------------------
Phillip.Ezolt at compaq.com                         Performance Tools/Analysis










More information about the wine-devel mailing list