Problem: 1616218
Title: (TDispatcher -GetWaitTicks) Return very large value
Received: Jan 2 1997 11:46AM
compositeTicks = MinMax(0L, iter->NextIdle() - ::TickCount(), compositeTicks);Since TickCount is declared that it returns UInt32, this expression fails if NextIdle returned `past' time.
"iter->NextIdle() - (long)::TickCount()" works.
MacApp's calculation of idle times would sometimes cause overflow of the signed value that was being used in their calculation. MacApp now uses unsigned longs for the intermediate calculations. Files affected: UDispatcher.cp/.h UEventHandler.cp/.h
The following variables need to be unsign long.
long fLastUpTime; // time of last mouse up event long fNextSpaceMessage; // time when next low space message should // be displayedA few temporary variables in TDispatcher::GetWaitTicks() need to be unsigned long.
Corrected UDispatcher/UEventHandler.cp/.h and also corrected UODDispatcher.cp/.h. For the record, TickCount used to be a signed long value, but somewhere along the way the headers started defining it as unsigned and we had not percolated the changes thoughout macapp.