cleanup: remove duplicated NSEC_PER_SEC macros

This switches everything to using a single 64-bit constant for NSEC_PER_SEC
that ensure we're doing 64-bit math everywhere.
This commit is contained in:
Christian Hergert
2019-07-18 10:22:46 -07:00
parent 991e03ba67
commit c2728b8ada
9 changed files with 42 additions and 53 deletions

View File

@ -67,6 +67,8 @@ typedef gint SysprofClock;
typedef gint64 SysprofTimeStamp;
typedef gint32 SysprofTimeSysprofan;
#define SYSPROF_NSEC_PER_SEC G_GINT64_CONSTANT(1000000000)
SYSPROF_AVAILABLE_IN_ALL
SysprofClock sysprof_clock;
@ -80,7 +82,7 @@ sysprof_clock_get_current_time (void)
clock = CLOCK_MONOTONIC;
clock_gettime (clock, &ts);
return (ts.tv_sec * G_GINT64_CONSTANT (1000000000)) + ts.tv_nsec;
return (ts.tv_sec * SYSPROF_NSEC_PER_SEC) + ts.tv_nsec;
}
static inline SysprofTimeSysprofan