Ben Pfaff [Wed, 15 Aug 2007 03:37:54 +0000 (03:37 +0000)]
* lib/count-one-bits.h: Add comments. (From Bruno Haible.)
* lib/count-one-bits.h: Don't include <limits.h>; no longer needed
given the changes below.
(COUNT_ONE_BITS): Use 'verify' rather than 'verify_true'. Work
even on hosts that have padding bits beyond the supported 64.
(From Paul Eggert.)
Paul Eggert [Fri, 10 Aug 2007 19:02:31 +0000 (19:02 +0000)]
* NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
* lib/xstrtol.h: Don't include exitfail.h; that's now internal to
xstrtol.c. Include getopt.h, since xstrtol_fatal's signature
depends on it.
(xstrtol_error): Remove.
(xstrtol_fatal): New decl, replacing the functionality of xstrtol_error
but with a different signature.
(ATTRIBUTE_NORETURN, __attribute__): New macros.
* lib/xstrtol-error.c: Include exitfail.h.
(xstrtol_fatal): New function, with a different signature from the
old xstrtol_error, so that the caller need not worry about passing
in an exit status, or about storage management of the option argument.
(xstrtol_error): Now a static function. Redo signature to
implement xstrtol_fatal. Output the correct number of hyphens in
front of the option so that the caller need not worry about
storage management.
(N_): New macro.
(_): Remove; not used now.
* modules/xstrtol: Depend on getopt.
* tests/test-xstrtol.c (main): Use new xstrtol_error function instead
of old STRTOL_FATAL_ERROR macro.
* tests/test-xstrtol.sh (t-xstrtol.xo): Adjust to match new behavior
of test program.
Eric Blake [Wed, 8 Aug 2007 12:45:54 +0000 (12:45 +0000)]
Move xstrtol messages into gnulib domain, when --pobase is used.
* lib/xstrtol.h (_STRTOL_ERROR): Move messages out of macro...
* lib/xstrtol-error.c (xstrtol_error): ...into new file.
* modules/xstrtol (Files): Distribute new file.
* m4/xstrtol.m4 (gl_XSTRTOL): Build new file.
* lib/xstrtol.c (TESTING_XSTRTO): Move tests...
* tests/test-xstrtol.c: ...into new file.
* tests/test-xstrtoul.c: Also test xstrtoul.
* tests/test-xstrtoimax.c: Also test xstrtoimax.
* tests/test-xstrtoumax.c: Also test xstrtoumax.
* tests/test-xstrtol.sh: Drive the tests.
* tests/test-xstrtoimax.sh: Likewise.
* tests/test-xstrtoumax.sh: Likewise.
* modules/xstrtol-tests: New module.
* modules/xstrtoimax-tests: Likewise.
* modules/xstrtoumax-tests: Likewise.
Jim Meyering [Wed, 8 Aug 2007 06:43:35 +0000 (06:43 +0000)]
New function: mfile_name_concat.
* lib/filenamecat.c (mfile_name_concat): New function, just like
file_name_concat, but return NULL upon failure rather than exiting
with a diagnostic.
* lib/filenamecat.h: Declare it.
Paul Eggert [Mon, 6 Aug 2007 16:44:24 +0000 (16:44 +0000)]
* NEWS: Describe interface changes to human, xstrtol.
* lib/human.h: Include <xstrtol.h>.
(human_options): Return enum strtol_error, not int. Remove
bool arg; take int * instead.
* lib/human.c: Don't include "gettext.h".
(_): Remove; no longer used.
Don't include <xstrtol.h>, since human.h does it.
(human_options): Adjust to abovementioned interface changes.
Do not report error to stderr; that's now the caller's
responsibility.
* lib/xstrtol.c (main) [defined TESTING_XSTRTO]: Adjust to
interface change.
* lib/xstrtol.h (_STRTOL_ERROR): Take Option, Arg rather than
Str, Argument_type_string. All uses changed. Put " argument"
in diagnostics to make them clearer. Change wording of suffix
message for clarity.
(STRTOL_FATAL_ERROR): Take Option, Arg rather than Str,
Argument_type_string.
(STRTOL_FATAL_WARN): Remove; no longer used.
* modules/human (Depends-on): Remove gettext-h.
Jim Meyering [Mon, 30 Jul 2007 12:16:34 +0000 (12:16 +0000)]
* lib/fts.c (fts_read): Upon failure to chdir into a subdirectory,
set fts_info to FTS_DNR, not to FTS_ERR, so that the caller knows
it has valid stat data. This bug would cause du not to count the
sizes of inaccessible directories.
Patch by Jose Maria Plans, reported in http://bugzilla.redhat.com/250077
Bruno Haible [Wed, 25 Jul 2007 22:42:36 +0000 (22:42 +0000)]
2007-07-25 Jim Meyering <jim@meyering.net>
Bruno Haible <bruno@clisp.org>
* lib/xstrtol.h (_STRTOL_ERROR): Change third argument from a
localized noun to an option name.
(STRTOL_FATAL_ERROR, STRTOL_FAIL_WARN): Likewise.
* lib/human.h (human_options): Insert a third argument.
* lib/human.h (human_options): Likewise. Pass it to STRTOL_FATAL_ERROR.
Ben Pfaff [Tue, 24 Jul 2007 02:35:09 +0000 (02:35 +0000)]
(popcount32): Reduce size of constants, to allow better code
generation, and add U to large constants to avoid warnings, in non-GCC
case.
Suggested by Bruno Haible.
Ben Pfaff [Mon, 23 Jul 2007 00:21:20 +0000 (00:21 +0000)]
New module: popcount.
* MODULES.html.sh: Add popcount.
* modules/popcount: New file.
* modules/popcount-tests: New file.
* tests/test-popcount.c: New file.
* lib/popcount.h: New file.
* m4/popcount.m4: New file.
Jim Meyering [Fri, 13 Jul 2007 14:39:43 +0000 (14:39 +0000)]
df: Don't fail for Tru64's "file-on-file mount".
* m4/fsusage.m4 (gl_FSUSAGE): Reject Tru64's buggy statvfs,
so we fall through and use statfs instead. Details here:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10878>
Reported by Albert Chin.
(func_import): Avoid duplication of --avoid statements
(func_dest_tmpfilename,func_create_testdir): Translate `-' in file
names to `_' in variable names.
Paul Eggert [Fri, 6 Jul 2007 16:42:06 +0000 (16:42 +0000)]
* lib/sys_time_.h: Use a recursion-safe inclusion guard rather than
a split double-inclusion guard. Needed for cygwin, where <sys/time.h>
includes <cygwin/sys_time.h> which includes <sys/select.h> which
include <sys/time.h>.
Reported by Eric Blake.
Eric Blake [Fri, 6 Jul 2007 14:22:21 +0000 (14:22 +0000)]
Fix testing canonicalize on cygwin.
* modules/canonicalize-lgpl-tests (test_canonicalize_lgpl_LDADD):
Revert patch from 2007-06-19.
* tests/test-canonicalize-lgpl.c (main): Instead, skip test when
canonicalize module is also in use.
* tests/test-canonicalize.c: New file.
* tests/test-canonicalize.sh: Likewise.
* modules/canonicalize-tests: Likewise.