mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 07:51:21 +03:00
basic/time-util: indentation
This commit is contained in:
parent
6c6368e938
commit
cb3e854fed
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user