Fixed a warning (missing type cast)
[tangerine.git] / rom / timer / cmptime.c
blob14d3d42c0a3112482e605b9b5a1ec735dfb0f3d2
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CmpTime() - compare two time values.
6 Lang: english
7 */
8 #include "timer_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <devices/timer.h>
14 #include <proto/timer.h>
16 AROS_LH2(LONG, CmpTime,
18 /* SYNOPSIS */
19 AROS_LHA(struct timeval *, dest, A0),
20 AROS_LHA(struct timeval *, src, A1),
22 /* LOCATION */
23 struct Device *, TimerBase, 9, Timer)
25 /* FUNCTION
26 CmpTime() will compare two timeval's for magnitude, and return
27 which is the larger.
29 INPUTS
30 dest - Destination timeval
31 src - Source timeval
33 RESULT
34 < 0 if dest has more time than src (ie dest > src)
35 = 0 if dest and src are the same (ie dest == src)
36 > 0 if dest has less time than src (ie dest < src)
38 NOTES
39 This function is safe to call from interrupts.
41 EXAMPLE
43 BUGS
44 The registers A0 and A1 may not be preserved.
46 SEE ALSO
47 AddTime(), SubTime()
49 INTERNALS
51 HISTORY
52 18-02-1997 iaint Implemented.
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
57 AROS_LIBBASE_EXT_DECL(struct Device *,TimerBase)
59 if(dest->tv_secs == src->tv_secs)
60 return (src->tv_micro - dest->tv_micro);
61 else
62 return (src->tv_secs - dest->tv_secs);
64 AROS_LIBFUNC_EXIT
65 } /* CmpTime */