[PROPOSED 1/2] Pacify GCC 15ish -Wleading-whitespace=blanks
Normalize indentation in a few source files to pacify gcc -Wleading-whitespace=blanks (in the forthcoming GCC 15). --- localtime.c | 2 +- private.h | 2 +- zdump.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/localtime.c b/localtime.c index ea2a6fb8..e6d79d05 100644 --- a/localtime.c +++ b/localtime.c @@ -1770,7 +1770,7 @@ timesub(const time_t *timep, int_fast32_t offset, dayoff = offset / SECSPERDAY - corr / SECSPERDAY + rem / SECSPERDAY - 3; rem %= SECSPERDAY; /* y = (EPOCH_YEAR - + floor((tdays + dayoff) / DAYSPERREPEAT) * YEARSPERREPEAT), + + floor((tdays + dayoff) / DAYSPERREPEAT) * YEARSPERREPEAT), sans overflow. But calculate against 1570 (EPOCH_YEAR - YEARSPERREPEAT) instead of against 1970 so that things work for localtime values before 1970 when time_t is unsigned. */ diff --git a/private.h b/private.h index bdd00013..fc0b8755 100644 --- a/private.h +++ b/private.h @@ -897,7 +897,7 @@ ATTRIBUTE_PURE time_t time2posix_z(timezone_t, time_t); default: TIME_T_MAX_NO_PADDING) \ : (time_t) -1) enum { SIGNED_PADDING_CHECK_NEEDED - = _Generic((time_t) 0, + = _Generic((time_t) 0, signed char: false, short: false, int: false, long: false, long long: false, default: true) }; diff --git a/zdump.c b/zdump.c index b668022d..2c6725e5 100644 --- a/zdump.c +++ b/zdump.c @@ -687,7 +687,7 @@ yeartot(intmax_t y) return absolute_max_time; seconds = diff400 * SECSPER400YEARS; years = diff400 * 400; - } else { + } else { seconds = isleap(myy) ? SECSPERLYEAR : SECSPERNYEAR; years = 1; } -- 2.43.0
* zic.c (inzsub, rulesub): Don’t use 0 as a null pointer constant. --- zic.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/zic.c b/zic.c index 6da35270..36199934 100644 --- a/zic.c +++ b/zic.c @@ -1950,7 +1950,8 @@ inzsub(char **fields, int nfields, bool iscont) z.z_filenum = filenum; z.z_linenum = linenum; z.z_stdoff = gethms(fields[i_stdoff], _("invalid UT offset")); - if ((cp = strchr(fields[i_format], '%')) != 0) { + cp = strchr(fields[i_format], '%'); + if (cp) { if ((*++cp != 's' && *cp != 'z') || strchr(cp, '%') || strchr(fields[i_format], '/')) { error(_("invalid abbreviation format")); @@ -2238,13 +2239,17 @@ rulesub(struct rule *rp, const char *loyearp, const char *hiyearp, rp->r_wday = lp->l_value; rp->r_dayofmonth = len_months[1][rp->r_month]; } else { - if ((ep = strchr(dp, '<')) != 0) - rp->r_dycode = DC_DOWLEQ; - else if ((ep = strchr(dp, '>')) != 0) - rp->r_dycode = DC_DOWGEQ; + ep = strchr(dp, '<'); + if (ep) + rp->r_dycode = DC_DOWLEQ; else { + ep = strchr(dp, '>'); + if (ep) + rp->r_dycode = DC_DOWGEQ; + else { ep = dp; rp->r_dycode = DC_DOM; + } } if (rp->r_dycode != DC_DOM) { *ep++ = 0; -- 2.43.0
participants (1)
-
Paul Eggert