tree-wide: normalize comment style

This commit is contained in:
Yu Watanabe
2025-12-15 08:50:13 +09:00
parent 8e20b9a79d
commit 93378148d4
431 changed files with 1894 additions and 1895 deletions
+12 -12
View File
@@ -1060,31 +1060,31 @@ int parse_timestamp(const char *t, usec_t *ret) {
size_t t_len = strlen(t);
if (t_len > 2 && t[t_len - 1] == 'Z') {
/* Try to parse as RFC3339-style welded UTC: "1985-04-12T23:20:50.52Z" */
r = parse_timestamp_impl(t, t_len - 1, /* utc = */ true, /* isdst = */ -1, /* gmtoff = */ 0, ret);
r = parse_timestamp_impl(t, t_len - 1, /* utc= */ true, /* isdst= */ -1, /* gmtoff= */ 0, ret);
if (r >= 0)
return r;
}
/* RFC3339-style welded offset: "1990-12-31T15:59:60-08:00" */
if (t_len > 7 && IN_SET(t[t_len - 6], '+', '-') && t[t_len - 7] != ' ' && parse_gmtoff(&t[t_len - 6], &gmtoff) >= 0)
return parse_timestamp_impl(t, t_len - 6, /* utc = */ true, /* isdst = */ -1, gmtoff, ret);
return parse_timestamp_impl(t, t_len - 6, /* utc= */ true, /* isdst= */ -1, gmtoff, ret);
const char *tz = strrchr(t, ' ');
if (!tz)
return parse_timestamp_impl(t, /* max_len = */ SIZE_MAX, /* utc = */ false, /* isdst = */ -1, /* gmtoff = */ 0, ret);
return parse_timestamp_impl(t, /* max_len= */ SIZE_MAX, /* utc= */ false, /* isdst= */ -1, /* gmtoff= */ 0, ret);
size_t max_len = tz - t;
tz++;
/* Shortcut, parse the string as UTC. */
if (streq(tz, "UTC"))
return parse_timestamp_impl(t, max_len, /* utc = */ true, /* isdst = */ -1, /* gmtoff = */ 0, ret);
return parse_timestamp_impl(t, max_len, /* utc= */ true, /* isdst= */ -1, /* gmtoff= */ 0, ret);
/* If the timezone is compatible with RFC-822/ISO 8601 (e.g. +06, or -03:00) then parse the string as
* UTC and shift the result. Note, this must be earlier than the timezone check with tzname[], as
* tzname[] may be in the same format. */
if (parse_gmtoff(tz, &gmtoff) >= 0)
return parse_timestamp_impl(t, max_len, /* utc = */ true, /* isdst = */ -1, gmtoff, ret);
return parse_timestamp_impl(t, max_len, /* utc= */ true, /* isdst= */ -1, gmtoff, ret);
/* Check if the last word matches tzname[] of the local timezone. Note, this must be done earlier
* than the check by timezone_is_valid() below, as some short timezone specifications have their own
@@ -1096,7 +1096,7 @@ int parse_timestamp(const char *t, usec_t *ret) {
continue;
/* The specified timezone matches tzname[] of the local timezone. */
return parse_timestamp_impl(t, max_len, /* utc = */ false, /* isdst = */ j, /* gmtoff = */ 0, ret);
return parse_timestamp_impl(t, max_len, /* utc= */ false, /* isdst= */ j, /* gmtoff= */ 0, ret);
}
/* If the last word is a valid timezone file (e.g. Asia/Tokyo), then save the current timezone, apply
@@ -1104,15 +1104,15 @@ int parse_timestamp(const char *t, usec_t *ret) {
if (timezone_is_valid(tz, LOG_DEBUG)) {
SAVE_TIMEZONE;
if (setenv("TZ", tz, /* overwrite = */ true) < 0)
if (setenv("TZ", tz, /* overwrite= */ true) < 0)
return negative_errno();
return parse_timestamp_impl(t, max_len, /* utc = */ false, /* isdst = */ -1, /* gmtoff = */ 0, ret);
return parse_timestamp_impl(t, max_len, /* utc= */ false, /* isdst= */ -1, /* gmtoff= */ 0, ret);
}
/* Otherwise, assume that the last word is a part of the time and try to parse the whole string as a
* local time. */
return parse_timestamp_impl(t, SIZE_MAX, /* utc = */ false, /* isdst = */ -1, /* gmtoff = */ 0, ret);
return parse_timestamp_impl(t, SIZE_MAX, /* utc= */ false, /* isdst= */ -1, /* gmtoff= */ 0, ret);
}
static const char* extract_multiplier(const char *p, usec_t *ret) {
@@ -1172,7 +1172,7 @@ int parse_time(const char *t, usec_t *ret, usec_t default_unit) {
assert(t);
assert(default_unit > 0);
p = skip_leading_chars(t, /* bad = */ NULL);
p = skip_leading_chars(t, /* bad= */ NULL);
s = startswith(p, "infinity");
if (s) {
if (!in_charset(s, WHITESPACE))
@@ -1190,7 +1190,7 @@ int parse_time(const char *t, usec_t *ret, usec_t default_unit) {
long long l;
char *e;
p = skip_leading_chars(p, /* bad = */ NULL);
p = skip_leading_chars(p, /* bad= */ NULL);
if (*p == 0) {
if (!something)
return -EINVAL;
@@ -1628,7 +1628,7 @@ int verify_timezone(const char *name, int log_level) {
void reset_timezonep(char **p) {
assert(p);
(void) set_unset_env("TZ", *p, /* overwrite = */ true);
(void) set_unset_env("TZ", *p, /* overwrite= */ true);
tzset();
*p = mfree(*p);
}