Fixed side-effects bugs.
FossilOrigin-Name: 6b939062f9b8cd4d1a3833a77297033bd2a6cd30ef8ea6fa5fb5e83f400d378f
This commit is contained in:
parent
0f2c02b32a
commit
e47db3deb6
@ -46,14 +46,14 @@ typedef time_t cw_timer_t;
|
|||||||
* }
|
* }
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
#define cw_timer_start(t) (time(NULL)+t)
|
#define cw_timer_start(t) (time(NULL)+(t))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a timer is expired.
|
* Check if a timer is expired.
|
||||||
* @param t a variable of type #cw_timer_t intialized by #cw_timer_start
|
* @param t a variable of type #cw_timer_t intialized by #cw_timer_start
|
||||||
* @return 0=timer is not expired\n 1=timer is expired.
|
* @return 0=timer is not expired\n 1=timer is expired.
|
||||||
*/
|
*/
|
||||||
#define cw_timer_timeout(t) (time(NULL)>t ? 1 : 0)
|
#define cw_timer_timeout(t) (time(NULL)>(t) ? 1 : 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of nano seconds from a timeval.
|
* Get the number of nano seconds from a timeval.
|
||||||
|
Loading…
Reference in New Issue
Block a user