diff options
author | Michael G. Schwern <schwern@pobox.com> | 2020-12-28 18:04:52 -0800 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-01-17 09:18:15 -0700 |
commit | 1604cfb0273418ed479719f39def5ee559bffda2 (patch) | |
tree | 166a5ab935a029ab86cf6295d6f3cb77da22e559 /Porting/timecheck.c | |
parent | 557ff1b2a4ecd18fe9229e7e0eb8fa123adc5670 (diff) | |
download | perl-1604cfb0273418ed479719f39def5ee559bffda2.tar.gz |
style: Detabify indentation of the C code maintained by the core.
This just detabifies to get rid of the mixed tab/space indentation.
Applying consistent indentation and dealing with other tabs are another issue.
Done with `expand -i`.
* vutil.* left alone, it's part of version.
* Left regen managed files alone for now.
Diffstat (limited to 'Porting/timecheck.c')
-rw-r--r-- | Porting/timecheck.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/Porting/timecheck.c b/Porting/timecheck.c index 87a252d631..9d977ca9f3 100644 --- a/Porting/timecheck.c +++ b/Porting/timecheck.c @@ -17,9 +17,9 @@ static char hexbuf[80]; char *hex (time_t t) { if ((long long)t < 0) - sprintf (hexbuf, " -0x%016lx", -t); + sprintf (hexbuf, " -0x%016lx", -t); else - sprintf (hexbuf, " 0x%016lx", t); + sprintf (hexbuf, " 0x%016lx", t); return (hexbuf); } /* hex */ @@ -27,19 +27,19 @@ void gm_check (time_t t, int min_year, int max_year) { tmp = gmtime (&t); if ( tmp == NULL || - /* Check tm_year overflow */ - tmp->tm_year < min_year || tmp->tm_year > max_year) { - if (opt_v) - fprintf (stderr, "gmtime (%ld) failed with errno %d\n", t, errno); - } + /* Check tm_year overflow */ + tmp->tm_year < min_year || tmp->tm_year > max_year) { + if (opt_v) + fprintf (stderr, "gmtime (%ld) failed with errno %d\n", t, errno); + } else { - if (opt_v) - fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n", - i, hex (t), - (long)(tmp->tm_year) + 1900, tmp->tm_mon + 1, tmp->tm_mday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); - pt = t; - } + if (opt_v) + fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n", + i, hex (t), + (long)(tmp->tm_year) + 1900, tmp->tm_mon + 1, tmp->tm_mday, + tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + pt = t; + } } /* gm_check */ int check_gm_max () @@ -47,12 +47,12 @@ int check_gm_max () tmp = NULL; pt = 0; if (tmp == NULL || tmp->tm_year < 0) { - for (i = 63; i >= 0; i--) { - time_t x = pt | ((time_t)1 << i); - if (x < 0 || x < pt) continue; - gm_check (x, 69, 0x7fffffff); - } - } + for (i = 63; i >= 0; i--) { + time_t x = pt | ((time_t)1 << i); + if (x < 0 || x < pt) continue; + gm_check (x, 69, 0x7fffffff); + } + } pt_max = pt; return (0); } /* check_gm_max */ @@ -62,12 +62,12 @@ int check_gm_min () tmp = NULL; pt = 0; if (tmp == NULL) { - for (i = 36; i >= 0; i--) { - time_t x = pt - ((time_t)1 << i); - if (x > 0) continue; - gm_check (x, -1900, 70); - } - } + for (i = 36; i >= 0; i--) { + time_t x = pt - ((time_t)1 << i); + if (x > 0) continue; + gm_check (x, -1900, 70); + } + } pt_min = pt; return (0); } /* check_gm_min */ @@ -75,23 +75,23 @@ int check_gm_min () void lt_check (time_t t, int min_year, int max_year) { if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL) - tmp = NULL; + tmp = NULL; else - tmp = localtime (&t); + tmp = localtime (&t); if ( tmp == NULL || - /* Check tm_year overflow */ - tmp->tm_year < min_year || tmp->tm_year > max_year) { - if (opt_v) - fprintf (stderr, "localtime (%ld) failed with errno %d\n", t, errno); - } + /* Check tm_year overflow */ + tmp->tm_year < min_year || tmp->tm_year > max_year) { + if (opt_v) + fprintf (stderr, "localtime (%ld) failed with errno %d\n", t, errno); + } else { - if (opt_v) - fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n", - i, hex (t), - (long)(tmp->tm_year) + 1900, tmp->tm_mon + 1, tmp->tm_mday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); - pt = t; - } + if (opt_v) + fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n", + i, hex (t), + (long)(tmp->tm_year) + 1900, tmp->tm_mon + 1, tmp->tm_mday, + tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + pt = t; + } } /* lt_check */ int check_lt_max () @@ -99,12 +99,12 @@ int check_lt_max () tmp = NULL; pt = 0; if (tmp == NULL || tmp->tm_year < 0) { - for (i = 63; i >= 0; i--) { - time_t x = pt | ((time_t)1 << i); - if (x < 0 || x < pt) continue; - lt_check (x, 69, 0x7fffffff); - } - } + for (i = 63; i >= 0; i--) { + time_t x = pt | ((time_t)1 << i); + if (x < 0 || x < pt) continue; + lt_check (x, 69, 0x7fffffff); + } + } pt_max = pt; return (0); } /* check_lt_max */ @@ -114,12 +114,12 @@ int check_lt_min () tmp = NULL; pt = 0; if (tmp == NULL) { - for (i = 36; i >= 0; i--) { - time_t x = pt - ((time_t)1 << i); - if (x > 0) continue; - lt_check (x, -1900, 70); - } - } + for (i = 36; i >= 0; i--) { + time_t x = pt - ((time_t)1 << i); + if (x > 0) continue; + lt_check (x, -1900, 70); + } + } pt_min = pt; return (0); } /* check_lt_min */ |