summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2014-11-29 20:07:30 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2014-11-29 20:07:30 (GMT)
commit4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874 (patch)
tree34b4061c6b9da94a200eb143769791e4cb9cd57c
parentc646a6f4e596f64ab388863122fa02636db96148 (diff)
downloadlibnsutils-4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874.tar.gz
libnsutils-4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874.tar.bz2
Change tabs to spaces, and assert that ITimer is not NULL.
-rw-r--r--src/time.c19
1 files changed, 9 insertions, 10 deletions
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 <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! */