diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-11-29 20:07:30 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-11-29 20:07:30 +0000 |
commit | 4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874 (patch) | |
tree | 34b4061c6b9da94a200eb143769791e4cb9cd57c | |
parent | c646a6f4e596f64ab388863122fa02636db96148 (diff) | |
download | libnsutils-4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874.tar.gz libnsutils-4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874.tar.bz2 |
Change tabs to spaces, and assert that ITimer is not NULL.
-rw-r--r-- | src/time.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -25,6 +25,7 @@ #include <mach/clock.h> #include <mach/mach_time.h> #elif defined(__amigaos4__) +#include <assert.h> #include <proto/timer.h> #else #include <sys/time.h> @@ -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! */ |