diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-06-22 06:14:28 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-06-22 06:14:28 +0000 |
commit | 53fa1be9b65f01469eafcc7c57499d73e35715a7 (patch) | |
tree | 52bc4fdd56c82dcd254136e04f4cb09402f978bd /lib | |
parent | 49113b5fbf40e65bb5b154ce2a11b9ec0b19be35 (diff) | |
download | paxutils-53fa1be9b65f01469eafcc7c57499d73e35715a7.tar.gz |
Improve support for time stamps and other wide integers.
* gnulib.modules: Add inttostr, quote, quotearg.
* lib/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
(INT_STRLEN_BOUND): Remove.
Include "intprops.h" instead.
(UINTMAX_STRSIZE_BOUND): Define in terms of INT_BUFSIZE_BOUND,
not INT_STRLEN_BOUND.
[HAVE_UTIME_H]: Don't include utime.h.
* paxlib/DISTFILES: Remove convert.c.
* paxlib/convert.c: Remove.
* paxlib/error.c: Include quote.h, quotearg.h.
* paxlib/paxlib.h: Include inttostr.h.
(STRINGIFY_BIGINT): Define in terms of umaxtostr.
(stringify_uintmax_t_backwards): Remove decl.
* tests/genfile.c: Include <utimens.h> instead of rolling our own.
(exec_checkpoint): Use utimens instead of rolling our own.
Don't pass extra args to error.
(main): Wrap message inside _().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.h | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/lib/system.h b/lib/system.h index 83afa11..f9e399e 100644 --- a/lib/system.h +++ b/lib/system.h @@ -1,7 +1,7 @@ /* System dependent definitions for GNU tar. Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -453,24 +453,9 @@ char *getenv (); # include <inttypes.h> #endif -/* These macros work even on ones'-complement hosts (!). - The extra casts work around common compiler bugs. */ -#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -#define TYPE_MINIMUM(t) (TYPE_SIGNED (t) \ - ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ - : (t) 0) -#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) - -/* Bound on length of the string representing an integer value of type t. - Subtract one for the sign bit if t is signed; - 302 / 1000 is log10 (2) rounded up; - add one for integer division truncation; - add one more for a minus sign if t is signed. */ -#define INT_STRLEN_BOUND(t) \ - ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \ - + 1 + TYPE_SIGNED (t)) - -#define UINTMAX_STRSIZE_BOUND (INT_STRLEN_BOUND (uintmax_t) + 1) +#include <intprops.h> + +#define UINTMAX_STRSIZE_BOUND INT_BUFSIZE_BOUND (uintmax_t) /* Prototypes for external functions. */ @@ -489,10 +474,6 @@ char *getenv (); time_t time (); #endif -#ifdef HAVE_UTIME_H -# include <utime.h> -#endif - /* Library modules. */ #include <dirname.h> |