From 4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 29 Nov 2014 20:07:30 +0000 Subject: Change tabs to spaces, and assert that ITimer is not NULL. --- src/time.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/time.c b/src/time.c index 46a0be2..4a5b8f2 100644 --- a/src/time.c +++ b/src/time.c @@ -25,6 +25,7 @@ #include #include #elif defined(__amigaos4__) +#include #include #else #include @@ -57,17 +58,15 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out) current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000); #elif defined(__amigaos4__) - struct TimeVal tv; + struct TimeVal tv; - /* NB: The calling task must already have opened timer.device - * and obtained the interface. - */ - if (ITimer != NULL) { - ITimer->GetUpTime(&tv); - current = (tv.Seconds * 1000) + (tv.Microseconds / 1000); - } else { - current = 0; /* \todo should we be opening timer.device, or printing a warning? */ - } + /* NB: The calling task must already have opened timer.device + * and obtained the interface. + */ + assert(ITimer != NULL); + + ITimer->GetUpTime(&tv); + current = (tv.Seconds * 1000) + (tv.Microseconds / 1000); #else #warning "Using dodgy gettimeofday() fallback" /** \todo Implement this properly! */ -- cgit v1.2.3