diff --git a/libtransmission/trevent.c b/libtransmission/trevent.c index becd0156f..c4e21fb24 100644 --- a/libtransmission/trevent.c +++ b/libtransmission/trevent.c @@ -132,12 +132,12 @@ typedef int timer_func ( void* ); struct tr_timer { - struct event event; - struct timeval tv; + unsigned int inCallback : 1; timer_func * func; void * user_data; struct tr_event_handle * eh; - uint8_t inCallback; + struct timeval tv; + struct event event; }; struct tr_run_data diff --git a/libtransmission/utils.c b/libtransmission/utils.c index d8a945fd8..2917e7af5 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -407,6 +407,7 @@ void tr_timevalMsec( uint64_t milliseconds, struct timeval * setme ) { const uint64_t microseconds = milliseconds * 1000; + assert( setme != NULL ); setme->tv_sec = microseconds / 1000000; setme->tv_usec = microseconds % 1000000; }