summaryrefslogtreecommitdiff
path: root/src/basic/time-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-06 15:21:22 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-09 11:11:25 +0200
commitcb3e854fedbeb13a5502487f2357d3bde9057a53 (patch)
treee24b6c58389d146d8135ff24f84334df9c87ac85 /src/basic/time-util.h
parent6c6368e938c2bf15efbb35bd80927bdf03f92616 (diff)
downloadsystemd-cb3e854fedbeb13a5502487f2357d3bde9057a53.tar.gz
basic/time-util: indentation
Diffstat (limited to 'src/basic/time-util.h')
-rw-r--r--src/basic/time-util.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/basic/time-util.h b/src/basic/time-util.h
index 2cb0ca2040..895af88299 100644
--- a/src/basic/time-util.h
+++ b/src/basic/time-util.h
@@ -167,9 +167,8 @@ usec_t jiffies_to_usec(uint32_t jiffies);
bool in_utc_timezone(void);
static inline usec_t usec_add(usec_t a, usec_t b) {
-
- /* Adds two time values, and makes sure USEC_INFINITY as input results as USEC_INFINITY in output, and doesn't
- * overflow. */
+ /* Adds two time values, and makes sure USEC_INFINITY as input results as USEC_INFINITY in output,
+ * and doesn't overflow. */
if (a > USEC_INFINITY - b) /* overflow check */
return USEC_INFINITY;
@@ -178,7 +177,6 @@ static inline usec_t usec_add(usec_t a, usec_t b) {
}
static inline usec_t usec_sub_unsigned(usec_t timestamp, usec_t delta) {
-
if (timestamp == USEC_INFINITY) /* Make sure infinity doesn't degrade */
return USEC_INFINITY;
if (timestamp < delta)
@@ -195,14 +193,14 @@ static inline usec_t usec_sub_signed(usec_t timestamp, int64_t delta) {
}
#if SIZEOF_TIME_T == 8
-/* The last second we can format is 31. Dec 9999, 1s before midnight, because otherwise we'd enter 5 digit year
- * territory. However, since we want to stay away from this in all timezones we take one day off. */
-#define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 253402214399000000)
+ /* The last second we can format is 31. Dec 9999, 1s before midnight, because otherwise we'd enter 5 digit
+ * year territory. However, since we want to stay away from this in all timezones we take one day off. */
+# define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 253402214399000000)
#elif SIZEOF_TIME_T == 4
/* With a 32bit time_t we can't go beyond 2038... */
-#define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 2147483647000000)
+# define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 2147483647000000)
#else
-#error "Yuck, time_t is neither 4 nor 8 bytes wide?"
+# error "Yuck, time_t is neither 4 nor 8 bytes wide?"
#endif
int time_change_fd(void);