~ubuntu-branches/ubuntu/trusty/librep/trusty

« back to all changes in this revision

Viewing changes to src/timers.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2007-01-25 11:09:23 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070125110923-2owlh6jsptg68pn5
Tags: 0.17+svn20070119-2ubuntu1
* Re-sync with Debian.  Following change kept:
  - Still building with --with-stack-direction=-1 for ppc/ia64.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* timers.c -- call a function after a period of time has passed
2
2
   Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
3
 
   $Id: timers.c,v 1.15 2002/03/02 05:22:53 jsh Exp $
 
3
   $Id: timers.c 2903 2007-01-01 23:38:58Z jsh $
4
4
 
5
5
   This file is part of librep.
6
6
 
128
128
        *msecs += 1000;
129
129
        (*secs)--;
130
130
    }
131
 
    while (*msecs > 1000)
 
131
    while (*msecs >= 1000)
132
132
    {
133
133
        *msecs -= 1000;
134
134
        (*secs)++;
252
252
    t->function = fun;
253
253
    t->secs = rep_get_long_int (secs);
254
254
    t->msecs = rep_get_long_int (msecs);
 
255
    fix_time (&t->secs, &t->msecs);
255
256
    t->next_alloc = allocated_timers;
256
257
    allocated_timers = t;
257
258
    insert_timer (t);
290
291
    {
291
292
        TIMER(timer)->secs = rep_get_long_int (secs);
292
293
        TIMER(timer)->msecs = rep_get_long_int (msecs);
 
294
        fix_time (&TIMER (timer)->secs, &TIMER (timer)->msecs);
293
295
    }
294
296
    insert_timer (TIMER(timer));
295
297
    return timer;