* src/system.h: Include "inttostr.h".
(timetostr): New function, factored out of...
* src/date.c (show_date): Use timetostr.
* src/du.c (show_date): Likewise.
* src/ls.c (print_long_format): Likewise.
* src/pinky.c (time_string): Likewise.
* src/stat.c (human_time): Likewise.
* src/*.c: Don't include inttostr.h, since system.h does.
* src/c99-to-c89.diff: Adjust offsets.
diff -upr src/shred.c src/shred.c
--- src/shred.c 1970-01-01 00:00:00.000000000 +0000
+++ src/shred.c 1970-01-01 00:00:00.000000000 +0000
-@@ -469,7 +469,7 @@ dopass (int fd, char const *qname, off_t
+@@ -468,7 +468,7 @@ dopass (int fd, char const *qname, off_t
out. Thus, it shouldn't give up on bad blocks. This
code works because lim is always a multiple of
SECTOR_SIZE, except at the end. */
#include "system.h"
#include "chown-core.h"
#include "error.h"
-#include "inttostr.h"
#include "quote.h"
#include "root-dev-ino.h"
#include "xfts.h"
# include <getopt.h>
# include "long-options.h"
# include "error.h"
-# include "inttostr.h"
/* Number of bytes to read at once. */
# define BUFLEN (1 << 16)
#include "error.h"
#include "fd-reopen.h"
-#include "inttostr.h"
#include "quote.h"
#include "safe-read.h"
#include "stdio--.h"
#include "argmatch.h"
#include "error.h"
#include "getdate.h"
-#include "inttostr.h"
#include "posixtm.h"
#include "quote.h"
#include "stat-time.h"
if (! tm)
{
char buf[INT_BUFSIZE_BOUND (intmax_t)];
- error (0, 0, _("time %s is out of range"),
- (TYPE_SIGNED (time_t)
- ? imaxtostr (when.tv_sec, buf)
- : umaxtostr (when.tv_sec, buf)));
+ error (0, 0, _("time %s is out of range"), timetostr (when.tv_sec, buf));
return false;
}
#include "error.h"
#include "fsusage.h"
#include "human.h"
-#include "inttostr.h"
#include "mountlist.h"
#include "quote.h"
#include "save-cwd.h"
#include "fprintftime.h"
#include "hash.h"
#include "human.h"
-#include "inttostr.h"
#include "quote.h"
#include "quotearg.h"
#include "readtokens0.h"
if (! tm)
{
char buf[INT_BUFSIZE_BOUND (intmax_t)];
- error (0, 0, _("time %s is out of range"),
- (TYPE_SIGNED (time_t)
- ? imaxtostr (when.tv_sec, buf)
- : umaxtostr (when.tv_sec, buf)));
+ error (0, 0, _("time %s is out of range"), timetostr (when.tv_sec, buf));
fputs (buf, stdout);
return;
}
#include <regex.h>
#include "long-options.h"
#include "error.h"
-#include "inttostr.h"
#include "quotearg.h"
#include "strnumcmp.h"
#include "xstrtol.h"
#include "system.h"
#include "error.h"
-#include "inttostr.h"
#include "long-options.h"
#include "quote.h"
#include "readtokens.h"
#include "error.h"
#include "full-write.h"
#include "full-read.h"
-#include "inttostr.h"
#include "quote.h"
#include "safe-read.h"
#include "xstrtol.h"
#include "human.h"
#include "filemode.h"
#include "idcache.h"
-#include "inttostr.h"
#include "ls.h"
#include "lstat.h"
#include "mbswidth.h"
sprintf (p, "%*s ", long_time_expected_width (),
(! f->stat_ok
? "?"
- : (TYPE_SIGNED (time_t)
- ? imaxtostr (when_timespec.tv_sec, hbuf)
- : umaxtostr (when_timespec.tv_sec, hbuf))));
+ : timetostr (when_timespec.tv_sec, hbuf)));
/* FIXME: (maybe) We discarded when_timespec.tv_nsec. */
p += strlen (p);
}
#include "canon-host.h"
#include "error.h"
#include "hard-locale.h"
-#include "inttostr.h"
#include "readutmp.h"
/* The official name of this program (e.g., no `g' prefix). */
return buf;
}
else
- return TYPE_SIGNED (time_t) ? imaxtostr (t, buf) : umaxtostr (t, buf);
+ return timetostr (t, buf);
}
/* Display a line of information about UTMP_ENT. */
#include "error.h"
#include "fcntl--.h"
#include "human.h"
-#include "inttostr.h"
#include "quotearg.h" /* For quotearg_colon */
#include "randint.h"
#include "randread.h"
#include "error.h"
#include "hard-locale.h"
#include "hash.h"
-#include "inttostr.h"
#include "md5.h"
#include "physmem.h"
#include "posixver.h"
#include "fcntl--.h"
#include "full-read.h"
#include "full-write.h"
-#include "inttostr.h"
#include "quote.h"
#include "safe-read.h"
#include "xstrtol.h"
#include "file-type.h"
#include "fs.h"
#include "getopt.h"
-#include "inttostr.h"
#include "quote.h"
#include "quotearg.h"
#include "stat-time.h"
+ sizeof "-MM-DD HH:MM:SS.NNNNNNNNN +ZZZZ"))];
struct tm const *tm = localtime (&t.tv_sec);
if (tm == NULL)
- return (TYPE_SIGNED (time_t)
- ? imaxtostr (t.tv_sec, str)
- : umaxtostr (t.tv_sec, str));
+ return timetostr (t.tv_sec, str);
nstrftime (str, sizeof str, "%Y-%m-%d %H:%M:%S.%N %z", tm, 0, t.tv_nsec);
return str;
}
bugs (typically your translation team's web or email address). */
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
}
+
+#include "inttostr.h"
+
+static inline char *
+timetostr (time_t t, char *buf)
+{
+ return (TYPE_SIGNED (time_t)
+ ? imaxtostr (t, buf)
+ : umaxtostr (t, buf));
+}
#include "c-strtod.h"
#include "error.h"
#include "fcntl--.h"
-#include "inttostr.h"
#include "isapipe.h"
#include "posixver.h"
#include "quote.h"
#include "system.h"
#include "euidaccess.h"
-#include "inttostr.h"
#include "quote.h"
#include "stat-time.h"
#include "strnumcmp.h"
#include "system.h"
#include "error.h"
-#include "inttostr.h"
#include "mbchar.h"
#include "quote.h"
#include "quotearg.h"
#include "readutmp.h"
#include "error.h"
#include "hard-locale.h"
-#include "inttostr.h"
#include "quote.h"
/* The official name of this program (e.g., no `g' prefix). */
return buf;
}
else
- return TYPE_SIGNED (time_t) ? imaxtostr (t, buf) : umaxtostr (t, buf);
+ return timetostr (t, buf);
}
/* Print formatted output line. Uses mostly arbitrary field sizes, probably