OSDN Git Service

Force calculations involving time to be done as 64-bits
authorGlenn Kasten <gkasten@google.com>
Mon, 26 Feb 2018 20:04:15 +0000 (12:04 -0800)
committerGlenn Kasten <gkasten@google.com>
Mon, 26 Feb 2018 20:04:15 +0000 (12:04 -0800)
Bug: 73619529
Test: builds OK, no further regressions
Change-Id: I5e56e7143c139c6b56f47f7ebfda8b71152b2421

audio_utils/include/audio_utils/clock.h

index 3067353..b3298e7 100644 (file)
 
 // These are declared as macros for compatbility with existing uses.
 // TODO Spell out the words in full.
-#define MICROS_PER_SECOND      1000000
-#define MILLIS_PER_SECOND         1000
-#define NANOS_PER_MICROSECOND     1000
-#define NANOS_PER_MILLISECOND  1000000
-#define NANOS_PER_SECOND    1000000000
+#define MICROS_PER_SECOND      1000000LL
+#define MILLIS_PER_SECOND         1000LL
+#define NANOS_PER_MICROSECOND     1000LL
+#define NANOS_PER_MILLISECOND  1000000LL
+#define NANOS_PER_SECOND    1000000000LL
 
 /**
  * \brief Converts time in ns to a time string, with format similar to logcat.