summary refs log tree commit diff
path: root/shared/nm-glib-aux/nm-time-utils.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-10-05 22:27:18 +0200
committerMichael Biebl <biebl@debian.org>2020-10-05 22:27:18 +0200
commitaafc1dbe4712c86189bbc1d4d54ad8cb4c69be7e (patch)
treea2a9bb4d007339a0b1304540388230ccedac32bd /shared/nm-glib-aux/nm-time-utils.h
parente7b44ef4c80907346ec7492a09c45277459924fc (diff)
New upstream version 1.27.90 upstream/1.27.90
Diffstat (limited to 'shared/nm-glib-aux/nm-time-utils.h')
-rw-r--r--shared/nm-glib-aux/nm-time-utils.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/shared/nm-glib-aux/nm-time-utils.h b/shared/nm-glib-aux/nm-time-utils.h
index 190d9491..77aeae5b 100644
--- a/shared/nm-glib-aux/nm-time-utils.h
+++ b/shared/nm-glib-aux/nm-time-utils.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: LGPL-2.1+
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /*
  * Copyright (C) 2018 Red Hat, Inc.
  */
@@ -9,42 +9,39 @@
 #include <time.h>
 
 static inline gint64
-nm_utils_timespec_to_nsec (const struct timespec *ts)
+nm_utils_timespec_to_nsec(const struct timespec *ts)
 {
-	return   (((gint64) ts->tv_sec) * ((gint64) NM_UTILS_NSEC_PER_SEC))
-	       +  ((gint64) ts->tv_nsec);
+    return (((gint64) ts->tv_sec) * ((gint64) NM_UTILS_NSEC_PER_SEC)) + ((gint64) ts->tv_nsec);
 }
 
 static inline gint64
-nm_utils_timespec_to_msec (const struct timespec *ts)
+nm_utils_timespec_to_msec(const struct timespec *ts)
 {
-	return   (((gint64) ts->tv_sec)  * ((gint64) 1000))
-	       + (((gint64) ts->tv_nsec) / ((gint64) NM_UTILS_NSEC_PER_SEC / 1000));
+    return (((gint64) ts->tv_sec) * ((gint64) 1000))
+           + (((gint64) ts->tv_nsec) / ((gint64) NM_UTILS_NSEC_PER_SEC / 1000));
 }
 
-gint64 nm_utils_get_monotonic_timestamp_nsec (void);
-gint64 nm_utils_get_monotonic_timestamp_usec (void);
-gint64 nm_utils_get_monotonic_timestamp_msec (void);
-gint32 nm_utils_get_monotonic_timestamp_sec (void);
+gint64 nm_utils_get_monotonic_timestamp_nsec(void);
+gint64 nm_utils_get_monotonic_timestamp_usec(void);
+gint64 nm_utils_get_monotonic_timestamp_msec(void);
+gint32 nm_utils_get_monotonic_timestamp_sec(void);
 
-gint64 nm_utils_monotonic_timestamp_as_boottime (gint64 timestamp, gint64 timestamp_ticks_per_nsec);
-gint64 nm_utils_monotonic_timestamp_from_boottime (guint64 boottime, gint64 timestamp_nsec_per_tick);
+gint64 nm_utils_monotonic_timestamp_as_boottime(gint64 timestamp, gint64 timestamp_ticks_per_nsec);
+gint64 nm_utils_monotonic_timestamp_from_boottime(guint64 boottime, gint64 timestamp_nsec_per_tick);
 
 static inline gint64
-nm_utils_get_monotonic_timestamp_nsec_cached (gint64 *cache_now)
+nm_utils_get_monotonic_timestamp_nsec_cached(gint64 *cache_now)
 {
-	return    (*cache_now)
-	       ?: (*cache_now = nm_utils_get_monotonic_timestamp_nsec ());
+    return (*cache_now) ?: (*cache_now = nm_utils_get_monotonic_timestamp_nsec());
 }
 
 static inline gint64
-nm_utils_get_monotonic_timestamp_msec_cached (gint64 *cache_now)
+nm_utils_get_monotonic_timestamp_msec_cached(gint64 *cache_now)
 {
-	return    (*cache_now)
-	       ?: (*cache_now = nm_utils_get_monotonic_timestamp_msec ());
+    return (*cache_now) ?: (*cache_now = nm_utils_get_monotonic_timestamp_msec());
 }
 
-gint64 nm_utils_clock_gettime_nsec (clockid_t clockid);
-gint64 nm_utils_clock_gettime_msec (clockid_t clockid);
+gint64 nm_utils_clock_gettime_nsec(clockid_t clockid);
+gint64 nm_utils_clock_gettime_msec(clockid_t clockid);
 
 #endif /* __NM_TIME_UTILS_H__ */