Ignore:
Timestamp:
Dec 11, 2000, 8:54:20 AM (25 years ago)
Author:
umoeller
Message:

Coupla bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/timer.c

    r14 r15  
    7171#define INCL_DOSPROCESS
    7272#define INCL_DOSSEMAPHORES
     73#define INCL_DOSMISC
    7374#define INCL_DOSERRORS
    7475#include <os2.h>
     
    190191 *      is stopped thru tmrStopTimer, which then
    191192 *      sets the thread's fExit flag to TRUE.
     193 *
     194 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime
    192195 */
    193196
     
    244247                    {
    245248                        PXTIMER pTimer = (PXTIMER)pTimerNode->pItemData;
    246                         ULONG ulTimeNow = dtGetULongTime();
     249                        ULONG ulTimeNow;
     250                        DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     251                                        &ulTimeNow, sizeof(ulTimeNow));
    247252
    248253                        if (pTimer->ulNextFire < ulTimeNow)
     
    357362 *
    358363 *      -- The caller must call LockTimers() first.
    359  *
    360  *@@added V0.9.7 (2000-12-04) [umoeller]
    361364 */
    362365
     
    385388 *
    386389 *      The timer is _not_ stopped automatically
    387  *      when the widget is destroyed.
    388  *
    389  *@@added V0.9.7 (2000-12-04) [umoeller]
     390 *      when the window is destroyed.
     391 *
     392 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime
    390393 */
    391394
     
    432435                {
    433436                    // exists already: reset only
    434                     pTimer->ulNextFire = dtGetULongTime() + ulTimeout;
     437                    ULONG ulTimeNow;
     438                    DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     439                                    &ulTimeNow, sizeof(ulTimeNow));
     440                    pTimer->ulNextFire = ulTimeNow + ulTimeout;
    435441                    usrc = pTimer->usTimerID;
    436442                }
     
    441447                    if (pTimer)
    442448                    {
     449                        ULONG ulTimeNow;
     450                        DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     451                                        &ulTimeNow, sizeof(ulTimeNow));
    443452                        pTimer->usTimerID = usTimerID;
    444453                        pTimer->hwndTarget = hwnd;
    445454                        pTimer->ulTimeout = ulTimeout;
    446                         pTimer->ulNextFire = dtGetULongTime() + ulTimeout;
     455                        pTimer->ulNextFire = ulTimeNow + ulTimeout;
    447456
    448457                        lstAppendItem(&G_llTimers,
     
    476485 *
    477486 *      Returns TRUE if the timer was stopped.
    478  *
    479  *@@added V0.9.7 (2000-12-04) [umoeller]
    480487 */
    481488
     
    523530 *      that you should call during WM_DESTROY of
    524531 *      a window that has started timers.
    525  *
    526  *@@added V0.9.7 (2000-12-04) [umoeller]
    527532 */
    528533
Note: See TracChangeset for help on using the changeset viewer.