]> Savannah Git Hosting - gnulib.git/log
gnulib.git
6 years agodfa: avoid new warnings from gcc
Jim Meyering [Sat, 15 Dec 2018 18:09:35 +0000 (10:09 -0800)]
dfa: avoid new warnings from gcc

These would prevent building with -Werror and a Dec snapshot of gcc.
* lib/dfa.c (dfaanalyze): Avoid shadowing warnings for "pos".
Rename each inner instance to "p".
(charclass_context): Remove unused static function.

6 years agomkdir-p: improve diagnostic for FUSE mounts
Paul Eggert [Sat, 15 Dec 2018 00:25:13 +0000 (16:25 -0800)]
mkdir-p: improve diagnostic for FUSE mounts

Problem reported by Niklas Hambüchen in:
https://lists.gnu.org/r/bug-gnulib/2018-12/msg00074.html
* lib/mkdir-p.c (make_dir_parents): In diagnostic, prefer stat
errno to mkdir errno if the stat errno is likely more interesting.

6 years agohash-map: Add tests.
Bruno Haible [Fri, 14 Dec 2018 22:08:10 +0000 (23:08 +0100)]
hash-map: Add tests.

* tests/test-hash_map.c: New file.
* modules/hash-map-tests: New file.

6 years agolinkedhash-map: Add tests.
Bruno Haible [Fri, 14 Dec 2018 22:08:06 +0000 (23:08 +0100)]
linkedhash-map: Add tests.

* tests/test-linkedhash_map.c: New file.
* modules/linkedhash-map-tests: New file.

6 years agoarray-map: Add tests.
Bruno Haible [Fri, 14 Dec 2018 22:08:02 +0000 (23:08 +0100)]
array-map: Add tests.

* tests/test-array_map.c: New file.
* modules/array-map-tests: New file.

6 years agoxmap: New module.
Bruno Haible [Fri, 14 Dec 2018 22:07:58 +0000 (23:07 +0100)]
xmap: New module.

* lib/gl_xmap.h: New file.
* lib/gl_xmap.c: New file.
* modules/xmap: New file.

6 years agohash-map: New module.
Bruno Haible [Fri, 14 Dec 2018 22:07:53 +0000 (23:07 +0100)]
hash-map: New module.

* lib/gl_hash_map.h: New file.
* lib/gl_hash_map.c: New file.
* modules/hash-map: New file.

6 years agolinkedhash-map: New module.
Bruno Haible [Fri, 14 Dec 2018 22:07:49 +0000 (23:07 +0100)]
linkedhash-map: New module.

* lib/gl_linkedhash_map.h: New file.
* lib/gl_linkedhash_map.c: New file.
* lib/gl_anyhash1.h: Update comments.
* lib/gl_anyhash2.h: Likewise.
* modules/linkedhash-map: New file.

6 years agoarray-map: New module.
Bruno Haible [Fri, 14 Dec 2018 22:07:43 +0000 (23:07 +0100)]
array-map: New module.

* lib/gl_array_map.h: New file.
* lib/gl_array_map.c: New file.
* modules/array-map: New file.

6 years agomap: New module.
Bruno Haible [Fri, 14 Dec 2018 22:07:39 +0000 (23:07 +0100)]
map: New module.

* lib/gl_map.h: New file.
* lib/gl_map.c: New file.
* lib/gl_omap.h (gl_mapkey_dispose_fn, gl_mapvalue_dispose_fn): Avoid
conflict with gl_map.h.
* modules/map: New file.

6 years agoselect tests: Avoid test failure on Cygwin.
Bruno Haible [Thu, 13 Dec 2018 21:17:50 +0000 (22:17 +0100)]
select tests: Avoid test failure on Cygwin.

* tests/test-select.h (test_bad_fd): Use an fd < FD_SETSIZE.

6 years agolocaltime-buffer: Avoid endless recursion in localtime and gmtime.
Bruno Haible [Thu, 13 Dec 2018 11:00:22 +0000 (12:00 +0100)]
localtime-buffer: Avoid endless recursion in localtime and gmtime.

* lib/localtime-buffer.c: Undefine localtime and gmtime before use.

6 years agolocaleconv tests: Avoid test failure on Cygwin.
Bruno Haible [Thu, 13 Dec 2018 10:28:32 +0000 (11:28 +0100)]
localeconv tests: Avoid test failure on Cygwin.

* tests/test-localeconv.c (main): On Cygwin, skip the 'grouping' and
'mon_grouping' tests.

6 years agoomap: Don't dispose the old value when the function returns it.
Bruno Haible [Wed, 12 Dec 2018 00:14:34 +0000 (01:14 +0100)]
omap: Don't dispose the old value when the function returns it.

* lib/gl_array_omap.c (gl_array_remove_at): Don't invoke the vdispose_fn
here.
* lib/gl_avltree_omap.c (NODE_PAYLOAD_DISPOSE): Likewise.
* lib/gl_rbtree_omap.c (NODE_PAYLOAD_DISPOSE): Likewise.
* lib/gl_omap.h (gl_omap_nx_put, gl_omap_remove): Invoke the vdispose_fn
here.

6 years agoarray-omap, avltree-omap, rbtree-omap: Tweak style.
Bruno Haible [Wed, 12 Dec 2018 00:03:13 +0000 (01:03 +0100)]
array-omap, avltree-omap, rbtree-omap: Tweak style.

* lib/gl_anytree_omap.h (gl_tree_nx_getput): Return 1 or 0, not true or
false.
* lib/gl_array_omap.c (gl_array_nx_getput): Likewise.

6 years agorbtree-omap: Add tests.
Bruno Haible [Tue, 11 Dec 2018 19:56:37 +0000 (20:56 +0100)]
rbtree-omap: Add tests.

* tests/test-rbtree_omap.c: New file.
* modules/rbtree-omap-tests: New file.

6 years agoavltree-omap: Add tests.
Bruno Haible [Tue, 11 Dec 2018 19:56:35 +0000 (20:56 +0100)]
avltree-omap: Add tests.

* tests/test-avltree_omap.c: New file.
* modules/avltree-omap-tests: New file.

6 years agoarray-omap: Add tests.
Bruno Haible [Tue, 11 Dec 2018 19:56:33 +0000 (20:56 +0100)]
array-omap: Add tests.

* tests/test-array_omap.c: New file.
* modules/array-omap-tests: New file.

6 years agoxomap: New module.
Bruno Haible [Tue, 11 Dec 2018 19:56:30 +0000 (20:56 +0100)]
xomap: New module.

* lib/gl_xomap.h: New file.
* lib/gl_xomap.c: New file.
* modules/xomap: New file.

6 years agorbtree-omap: New module.
Bruno Haible [Tue, 11 Dec 2018 19:56:27 +0000 (20:56 +0100)]
rbtree-omap: New module.

* lib/gl_rbtree_omap.h: New file.
* lib/gl_rbtree_omap.c: New file.
* lib/gl_rbtree_ordered.h: Code moved to here from lib/gl_rbtree_oset.c.
Parameterize.
* lib/gl_rbtree_oset.c: Include gl_rbtree_ordered.h.
* modules/rbtree-omap: New file.
* modules/rbtree-oset (Files): Add lib/gl_rbtree_ordered.h.
(Makefile.am): Add gl_rbtree_ordered.h to lib_SOURCES.

6 years agoavltree-omap: New module.
Bruno Haible [Tue, 11 Dec 2018 19:56:25 +0000 (20:56 +0100)]
avltree-omap: New module.

* lib/gl_avltree_omap.h: New file.
* lib/gl_avltree_omap.c: New file.
* lib/gl_avltree_ordered.h: Code moved to here from
lib/gl_avltree_oset.c. Parameterize.
* lib/gl_avltree_oset.c: Include gl_avltree_ordered.h.
* lib/gl_anytree_omap.h: New file.
* modules/avltree-omap: New file.
* modules/avltree-oset (Files): Add lib/gl_avltree_ordered.h.
(Makefile.am): Add gl_avltree_ordered.h to lib_SOURCES.

6 years agoarray-omap: New module.
Bruno Haible [Tue, 11 Dec 2018 19:56:22 +0000 (20:56 +0100)]
array-omap: New module.

* lib/gl_array_omap.h: New file.
* lib/gl_array_omap.c: New file.
* modules/array-omap: New file.

6 years agoomap: New module.
Bruno Haible [Tue, 11 Dec 2018 19:56:20 +0000 (20:56 +0100)]
omap: New module.

* lib/gl_omap.h: New file.
* lib/gl_omap.c: New file.
* modules/omap: New file.

6 years agohash-set, linkedhash-set: Reduce code duplication.
Bruno Haible [Tue, 11 Dec 2018 19:44:55 +0000 (20:44 +0100)]
hash-set, linkedhash-set: Reduce code duplication.

* lib/gl_anyhash1.h: Rename from lib/gl_anyhash_list1.h and
lib/gl_anyhash_set1.h.
* lib/gl_anyhash2.h: Rename from lib/gl_anyhash_list2.h and
lib/gl_anyhash_set2.h. Parameterize.
(hash_resize_after_add): New function, from lib/gl_anyhash_set2.h.
* lib/gl_anytreehash_list1.h (hash_resize_after_add): Remove function.
* lib/gl_avltreehash_list.c: Include gl_anyhash1.h instead of
gl_anyhash_list1.h. Include gl_anyhash2.h instead of gl_anyhash_list2.h.
* lib/gl_rbtreehash_list.c: Likewise.
* lib/gl_linkedhash_list.c: Likewise.
(hash_resize_after_add): Remove function.
* lib/gl_linkedhash_set.c: Include gl_anyhash1.h instead of
gl_anyhash_set1.h. Include gl_anyhash2.h instead of gl_anyhash_set2.h.
* gl_hash_set.c: Likewise.
* modules/avltreehash-list (Files, Makefile.am): Update file list.
* modules/rbtreehash-list (Files, Makefile.am): Likewise.
* modules/linkedhash-list (Files, Makefile.am): Likewise.
* modules/linkedhash-set (Files, Makefile.am): Likewise.
* modules/hash-set (Files, Makefile.am): Likewise.

6 years agoarray-set: Optimize.
Bruno Haible [Tue, 11 Dec 2018 19:43:22 +0000 (20:43 +0100)]
array-set: Optimize.

* lib/gl_array_set.c (gl_array_search, gl_array_remove): Test equals_fn
outside the loop, not inside the loop.

6 years agotimes: Fix tests.
Bruno Haible [Tue, 11 Dec 2018 19:21:52 +0000 (20:21 +0100)]
times: Fix tests.

* tests/test-times.c (doublecmp): Implement a total order.

6 years agoarray-set, linkedhash-set, hash-set: Fix tests.
Bruno Haible [Tue, 11 Dec 2018 19:36:35 +0000 (20:36 +0100)]
array-set, linkedhash-set, hash-set: Fix tests.

* tests/test-array_set.c (cmp_objects_in_array): New function.
(check_equals): Use it.
* tests/test-hash_set.c: Likewise.
* tests/test-linkedhash_set.c: Likewise.

6 years agoFix comments.
Bruno Haible [Sat, 8 Dec 2018 14:25:51 +0000 (15:25 +0100)]
Fix comments.

* lib/gl_list.h (gl_list_free): Clarify what it does.
* lib/gl_oset.h (gl_oset_free): Likewise.
* lib/gl_set.h (gl_set_free): Likewise.
* lib/gl_anytree_oset.h (gl_tree_search_atleast): Fix typo in comment.
* lib/gl_array_oset.c (gl_array_search_atleast): Likewise.
* lib/gl_anyavltree_list1.h (MAXHEIGHT): Likewise.
* lib/gl_avltree_oset.c (MAXHEIGHT): Likewise.

6 years agohash-set: Add tests.
Bruno Haible [Mon, 3 Dec 2018 23:57:58 +0000 (00:57 +0100)]
hash-set: Add tests.

* tests/test-hash_set.c: New file.
* modules/hash-set-tests: New file.

6 years agolinkedhash-set: Add tests.
Bruno Haible [Mon, 3 Dec 2018 23:57:19 +0000 (00:57 +0100)]
linkedhash-set: Add tests.

* tests/test-linkedhash_set.c: New file.
* modules/linkedhash-set-tests: New file.

6 years agoarray-set: Add tests.
Bruno Haible [Mon, 3 Dec 2018 23:56:31 +0000 (00:56 +0100)]
array-set: Add tests.

* tests/test-array_set.c: New file.
* modules/array-set-tests: New file.

6 years agoxset: New module.
Bruno Haible [Mon, 3 Dec 2018 23:55:34 +0000 (00:55 +0100)]
xset: New module.

* lib/gl_xset.h: New file.
* lib/gl_xset.c: New file.
* modules/xset: New file.

6 years agohash-set: New module.
Bruno Haible [Mon, 3 Dec 2018 23:54:30 +0000 (00:54 +0100)]
hash-set: New module.

* lib/gl_hash_set.h: New file.
* lib/gl_hash_set.c: New file.
* modules/hash-set: New file.

6 years agolinkedhash-set: New module.
Bruno Haible [Mon, 3 Dec 2018 23:53:12 +0000 (00:53 +0100)]
linkedhash-set: New module.

* lib/gl_linkedhash_set.h: New file.
* lib/gl_linkedhash_set.c: New file.
* lib/gl_anyhash_set1.h: New file, based on lib/gl_anyhash_list1.h.
* lib/gl_anyhash_set2.h: New file, based on lib/gl_anyhash_list2.h.
* lib/gl_anyhash_primes.h: New file, extracted from
lib/gl_anyhash_list2.h.
* lib/gl_anyhash_list2.h: Include it.
(primes, next_prime): Remove definitions.
* modules/linkedhash-set: New file.
* modules/avltreehash-list (Files): Add lib/gl_anyhash_primes.h.
(Makefile.am): Add gl_anyhash_primes.h to lib_SOURCES.
* modules/linkedhash-list (Files): Add lib/gl_anyhash_primes.h.
(Makefile.am): Add gl_anyhash_primes.h to lib_SOURCES.
* modules/rbtreehash-list (Files): Add lib/gl_anyhash_primes.h.
(Makefile.am): Add gl_anyhash_primes.h to lib_SOURCES.

6 years agoarray-set: New module.
Bruno Haible [Mon, 3 Dec 2018 23:43:22 +0000 (00:43 +0100)]
array-set: New module.

* lib/gl_array_set.h: New file.
* lib/gl_array_set.c: New file.
* modules/array-set: New file.

6 years agoset: New module.
Bruno Haible [Mon, 3 Dec 2018 23:41:24 +0000 (00:41 +0100)]
set: New module.

* lib/gl_set.h: New file.
* lib/gl_set.c: New file.
* lib/gl_oset.h (gl_setelement_dispose_fn): Avoid conflict with
gl_set.h.
* modules/set: New file.

6 years agobison: don't force the Yacc mode
Akim Demaille [Fri, 7 Dec 2018 05:26:08 +0000 (06:26 +0100)]
bison: don't force the Yacc mode

Passing -y forces Bison into POSIX YACC mode.  This includes reporting
errors when Bison features are used in the grammar file.  Some of
these features (such as %expect) were flagged non-yacc recently.  Most
of the time, -y is actually used to please Automake's ylwrap which
expects the output to be y.tab.c.

* m4/bison.m4 (gl_BISON): Use `-o y.tab.c` rather than `-y`.

6 years agoautoupdate
Karl Berry [Fri, 7 Dec 2018 16:10:15 +0000 (08:10 -0800)]
autoupdate

6 years agoautoupdate
Karl Berry [Thu, 6 Dec 2018 16:29:09 +0000 (08:29 -0800)]
autoupdate

6 years agoautoupdate
Karl Berry [Tue, 4 Dec 2018 16:22:59 +0000 (08:22 -0800)]
autoupdate

6 years agognupload: Document short options.
Bruno Haible [Sat, 1 Dec 2018 15:28:17 +0000 (16:28 +0100)]
gnupload: Document short options.

* build-aux/gnupload (usage): Document the short options.

6 years agognupload: Support option -h as alias of --help.
Ben Elliston [Wed, 28 Nov 2018 07:00:51 +0000 (18:00 +1100)]
gnupload: Support option -h as alias of --help.

The first time I ran gnupload, I used -h and got an error. ;-) This
patch adds -h as an alias for --help.

* build-aux/gnupload: Support -h.

6 years agomemrchr: port better to clang
Paul Eggert [Sat, 1 Dec 2018 00:25:38 +0000 (16:25 -0800)]
memrchr: port better to clang

* lib/memrchr.c (__memrchr): Cast to void * instead of to
longword *, to pacify clang -Wcast-align (Bug#33544).

6 years agodocs: mention printf %m considerations
Eric Blake [Thu, 29 Nov 2018 19:33:28 +0000 (13:33 -0600)]
docs: mention printf %m considerations

gcc -Wformat does NOT flag printf("%m") on a BSD system, even though
it prints only "m" instead of the desired GNU/Linux behavior of the
current errno value (you have to use -Wpedantic to flag it, but that's
a rather heavy hammer).  Still, it's easy enough (even if verbose)
to write out strerror() usage directly, to the point that gnulib will
probably never provide a module to guarantee %m everywhere.
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270

* doc/glibc-functions/asprintf.texi (asprintf): Document that %m
is not portable, and is easy enough to work around.
* doc/glibc-functions/obstack_printf.texi (obstack_printf): Likewise.
* doc/glibc-functions/obstack_vprintf.texi (obstack_vprintf): Likewise.
* doc/glibc-functions/vasprintf.texi (vasprintf): Likewise.
* doc/posix-functions/dprintf.texi (dprintf): Likewise.
* doc/posix-functions/fprintf.texi (fprintf): Likewise.
* doc/posix-functions/fwprintf.texi (fwprintf): Likewise.
* doc/posix-functions/printf.texi (printf): Likewise.
* doc/posix-functions/snprintf.texi (snprintf): Likewise.
* doc/posix-functions/sprintf.texi (sprintf): Likewise.
* doc/posix-functions/swprintf.texi (swprintf): Likewise.
* doc/posix-functions/vdprintf.texi (vdprintf): Likewise.
* doc/posix-functions/vfprintf.texi (vfprintf): Likewise.
* doc/posix-functions/vfwprintf.texi (vfwprintf): Likewise.
* doc/posix-functions/vprintf.texi (vprintf): Likewise.
* doc/posix-functions/vsnprintf.texi (vsnprintf): Likewise.
* doc/posix-functions/vsprintf.texi (vsprintf): Likewise.
* doc/posix-functions/vswprintf.texi (vswprintf): Likewise.
* doc/posix-functions/vwprintf.texi (vwprintf): Likewise.
* doc/posix-functions/wprintf.texi (wprintf): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agoautoupdate
Karl Berry [Thu, 29 Nov 2018 16:26:00 +0000 (08:26 -0800)]
autoupdate

6 years agobitset: rename ebitset/expandable.* as tbitset/table.*
Akim Demaille [Thu, 29 Nov 2018 04:44:58 +0000 (05:44 +0100)]
bitset: rename ebitset/expandable.* as tbitset/table.*

See
https://lists.gnu.org/archive/html/bug-gnulib/2018-11/msg00096.html.

* lib/bitset/expandable.h, lib/bitset/expandable.c: Rename as...
* lib/bitset/table.h, lib/bitset/table.c: these.
Rename all the ebitset* symbols as tbitset*.
Adjust dependencies.

6 years agobitset: check the operations
Akim Demaille [Wed, 28 Nov 2018 04:56:21 +0000 (05:56 +0100)]
bitset: check the operations

* tests/test-bitset.c (bitset_random): New.
Use it.
* lib/bitset/expandable.c (ebitset_not): Fix typo.

6 years agobitset: properly use false/true instead of 0/1 for Booleans
Akim Demaille [Wed, 28 Nov 2018 20:55:00 +0000 (21:55 +0100)]
bitset: properly use false/true instead of 0/1 for Booleans

* lib/bitset/expandable.c, lib/bitset/vector.c: Use false/true, not
0/1, as Booleans.

6 years agobitset: rename BITSET_VARRAY as BITSET_VECTOR
Akim Demaille [Wed, 28 Nov 2018 06:24:29 +0000 (07:24 +0100)]
bitset: rename BITSET_VARRAY as BITSET_VECTOR

For consistency with the name of the file.

* doc/bitset.texi, lib/bitset.c, lib/bitset/base.h,
* lib/bitset/stats.c, lib/bitset/vector.c
(BITSET_VARRAY): Rename as...
(BITSET_VECTOR): this.

6 years agostrerror_r-posix: memmove, not memcpy
Paul Eggert [Thu, 29 Nov 2018 00:10:03 +0000 (16:10 -0800)]
strerror_r-posix: memmove, not memcpy

* lib/strerror_r.c (safe_copy): Use memmove, not memcpy,
since the source and destination might overlap in the call
‘safe_copy (buf, buflen, strerror_r (errnum, buf, buflen))’.
Simplify.

6 years agoautoupdate
Karl Berry [Tue, 27 Nov 2018 16:25:10 +0000 (08:25 -0800)]
autoupdate

6 years agobitsetv: new module
Akim Demaille [Sun, 25 Nov 2018 17:55:32 +0000 (18:55 +0100)]
bitsetv: new module

* lib/bitsetv.c, lib/bitsetv.h, modules/bitsetv: New.

6 years agobitset: add tests and doc
Akim Demaille [Sun, 25 Nov 2018 08:49:09 +0000 (09:49 +0100)]
bitset: add tests and doc

First stabs at providing a documentation and test for the bitset
module.

* doc/bitset.texi, modules/test-bitset, tests/bitset-tests.c: New.

6 years agobitset: new module
Akim Demaille [Sun, 28 Oct 2018 16:32:15 +0000 (17:32 +0100)]
bitset: new module

* lib/bitset.c, lib/bitset.h, lib/bitset/array.c,
* lib/bitset/array.h, lib/bitset/base.h, lib/bitset/expandable.c,
* lib/bitset/expandable.h, lib/bitset/list.c, lib/bitset/list.h,
* lib/bitset/stats.c, lib/bitset/stats.h, lib/bitset/vector.c,
* lib/bitset/vector.h, modules/bitset:
New.

6 years agolocalename: Fix gettext test failures on mingw.
Bruno Haible [Sat, 24 Nov 2018 01:02:30 +0000 (02:02 +0100)]
localename: Fix gettext test failures on mingw.

* lib/localename.c (gl_locale_name_posix): Convert the result of
gl_locale_name_environ to XPG syntax.

6 years agono more sync of gettext source files
Karl Berry [Fri, 23 Nov 2018 17:23:27 +0000 (09:23 -0800)]
no more sync of gettext source files

6 years agoautoupdate
Karl Berry [Fri, 23 Nov 2018 16:46:40 +0000 (08:46 -0800)]
autoupdate

6 years agoautoupdate
Karl Berry [Wed, 21 Nov 2018 18:11:57 +0000 (10:11 -0800)]
autoupdate

6 years agomktime: add libc-config dependency
Paul Eggert [Wed, 21 Nov 2018 17:12:33 +0000 (09:12 -0800)]
mktime: add libc-config dependency

I missed this when we synced from glibc.
* modules/mktime (Depends-on): Add libc-config.

6 years agoautoupdate
Paul Eggert [Fri, 16 Nov 2018 16:13:39 +0000 (08:13 -0800)]
autoupdate

6 years agolonglong: fix comment typo
Paul Eggert [Tue, 13 Nov 2018 19:04:58 +0000 (11:04 -0800)]
longlong: fix comment typo

* m4/longlong.m4 (AC_TYPE_LONG_LONG_INT): Fix typo.

6 years agohavelib: Remove the need to include asm-underscore.m4.
Bruno Haible [Sun, 11 Nov 2018 11:45:44 +0000 (12:45 +0100)]
havelib: Remove the need to include asm-underscore.m4.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI_32BIT): New macro.
* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Use it instead of
gl_HOST_CPU_C_ABI.
* modules/havelib (Files): Add host-cpu-c-abi.m4.
(Depends-on): Remove host-cpu-c-abi.

6 years agoparse-datetime: simplify test for mktime failure
Paul Eggert [Sun, 4 Nov 2018 06:31:33 +0000 (23:31 -0700)]
parse-datetime: simplify test for mktime failure

* lib/parse-datetime.y (mktime_ok): Simplify.
Remove args TZ and T; no longer needed.  Callers changed.

6 years agoposixtm: simplify test for mktime failure
Paul Eggert [Sun, 4 Nov 2018 06:04:44 +0000 (23:04 -0700)]
posixtm: simplify test for mktime failure

* lib/posixtm.c (posixtime): Simplify.

6 years agonstrftime: simplify test for mktime failure
Paul Eggert [Sun, 4 Nov 2018 04:51:33 +0000 (21:51 -0700)]
nstrftime: simplify test for mktime failure

* lib/nstrftime.c (__strftime_internal): Simplify.

6 years agognulib-common.m4: port _Noreturn to C++
Paul Eggert [Fri, 2 Nov 2018 21:09:35 +0000 (14:09 -0700)]
gnulib-common.m4: port _Noreturn to C++

Problem reported by Akim Demaille in:
https://lists.gnu.org/r/bug-bison/2018-10/msg00067.html
* m4/gnulib-common.m4 (gl_COMMON_BODY): If C++, use [[noreturn]].
Merge adjustments from _Noreturn.h and from glibc into the non-C++
version.
* lib/_Noreturn.h: Match gnulib-common.

6 years agognu-make: Fix for NetBSD 8 'make'.
Bruno Haible [Tue, 30 Oct 2018 11:56:42 +0000 (12:56 +0100)]
gnu-make: Fix for NetBSD 8 'make'.

Reported by Reuben Thomas in
<https://lists.gnu.org/archive/html/bug-gnulib/2018-10/msg00135.html>.

* m4/gnu-make.m4 (gl_GNU_MAKE): Use a heuristic based on the --version
output, ignoring exit codes.

6 years agomaintainer-makefile: fix syntax-check rule for "same.h"
Bernhard Voelker [Sun, 28 Oct 2018 12:06:30 +0000 (13:06 +0100)]
maintainer-makefile: fix syntax-check rule for "same.h"

* top/maint.mk (sc_prohibit_same_without_use): Adjust regex to check
for 'same_nameat', too.

6 years agodfa: Simplify a building state
Norihiro Tanaka [Mon, 22 Oct 2018 15:02:16 +0000 (00:02 +0900)]
dfa: Simplify a building state

dfa.c (build_state): Simplify a building state.

6 years agodfa: reorder tokens before execution
Norihiro Tanaka [Mon, 22 Oct 2018 15:01:08 +0000 (00:01 +0900)]
dfa: reorder tokens before execution

Reorder tokens before execution.  It improves efficiency to access
memory in building states. For example, A(BCD|E(F|G)|HI) are reorderda
as following.

(Before reorder)
A:1 - B:2 - C:3 - D:4
    ` E:5 - F:6
          ` G:7
    ` H:8 - I:9

(After reorder)
A:1 - B:2 - C:5 - D:6
    ` E:3 - F:7
          ` G:8
    ` H:4 - I:9

dfa.c (compare, reorder_tokens): New function.
(reorder_tokens): Call them.

6 years agodfa: a state has a set of current positions.
Norihiro Tanaka [Mon, 22 Oct 2018 14:51:20 +0000 (23:51 +0900)]
dfa: a state has a set of current positions.

Up to now, a state had a set of follow-on positions.  It is replaced a
set of current positions.  This change will save memory space.

dfa.c (leaf_set): Remove it.
(struct dfa): Add new member constraints and separates.
(append): New function.
(state_index): Bring constraint from pre-calculated.
(state_separate_contexts): Bring separate contexts from pre-calculated.
Change argument, update callers.
(merge_nfa_state): Pre-calculate constraints for END. and remove END.
No longer END is not used after here.
(dfaoptimize): Initialize added member constraints.
(dfaanalyze): Pre-calculate seprate contexts.
(build_state): Change for this update.
(dfassbuild): Initialize new members .
(dfafree): Free memory for new members.

6 years agodfa: simplify dfa optimization
Norihiro Tanaka [Mon, 22 Oct 2018 14:35:50 +0000 (23:35 +0900)]
dfa: simplify dfa optimization

dfa.c (merge_nfa_state, dfaoptimize): Simplify dfa optimization.

6 years agodfa: position set sorts increasing order
Norihiro Tanaka [Mon, 22 Oct 2018 14:31:26 +0000 (23:31 +0900)]
dfa: position set sorts increasing order

Change the order of position set from decreasing to increaing, then even
after dfa is optimized, it is guaranteed that the number of a position
is smaller than the subsequent one's number.

dfa.c (insert, merged_constrained, delete): Reverse the direction of an
inequality sign.
(dfaanalyze): Position set sorts increasing order.

6 years agodfa: remove unneeded code
Norihiro Tanaka [Mon, 22 Oct 2018 14:22:40 +0000 (23:22 +0900)]
dfa: remove unneeded code

By the addition of beg, a code for the initial state is unnecessary, so
remove it.

dfa.c (epsclosure): Remove a code for the initial state.
(dfaanalyze): Print follows for BEG in debug mode.

6 years agoautoupdate
Karl Berry [Fri, 26 Oct 2018 16:46:25 +0000 (09:46 -0700)]
autoupdate

6 years agohavelib: fix nested ‘configure’ chatter
Paul Eggert [Thu, 25 Oct 2018 15:33:59 +0000 (08:33 -0700)]
havelib: fix nested ‘configure’ chatter

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Don’t nest
AC_CACHE_CHECK calls, which resulted in confusing output like
“checking for the common suffixes of directories in the library
search path... checking for 64-bit host... no lib,lib”.

6 years agobackupfile: tweak for better code
Paul Eggert [Thu, 25 Oct 2018 15:25:41 +0000 (08:25 -0700)]
backupfile: tweak for better code

* lib/backupfile.c: Sort include directives, and remove
unnecessary <limits.h> include.
(FALLTHROUGH): New macro, copied from other modules.
(backupfile_internal): Use it to avoid code duplication.
This lets GCC 8.2.1 generate better code by inlining the
call to check_extension.

6 years agoautoupdate
Karl Berry [Wed, 24 Oct 2018 14:26:20 +0000 (07:26 -0700)]
autoupdate

6 years agobackupfile: new dir_fd args
Paul Eggert [Wed, 24 Oct 2018 02:10:21 +0000 (19:10 -0700)]
backupfile: new dir_fd args

New module opendirat with code taken from fts.
Use this module to let backupfile use a directory file descriptor.
* NEWS: Document the incompatible change.
* lib/backup-find.c (find_backup_file_name):
* lib/backup-rename.c (backup_file_rename):
New arg DIR_FD.
* lib/backupfile.c: Include stdint.h, for SIZE_MAX.
(SIZE_MAX): Remove.
Include opendirat.h rather than dirent--.h.
(check_extension): New args DIR_FD and BASE_MAX.  All callers changed.
(numbered_backup): New args DIR_FD and PNEW_FD.  All callers changed.
(backupfile_internal): New arg DIR_FD.  All callers changed.
* lib/fts.c: Include opendirat.h.
(opendirat): Move to opendirat.c.
* lib/opendirat.c, lib/opendirat.h, modules/opendirat: New files.
* modules/backupfile (Depends-on): Remove dirfd, opendir.
Add opendirat.
* modules/fts (Depends-on): Remove fdopendir, openat-safer.
Add opendirat.

6 years agolocalename: Simplify support for per-thread locales on Solaris 11.4.
Bruno Haible [Tue, 23 Oct 2018 20:18:24 +0000 (22:18 +0200)]
localename: Simplify support for per-thread locales on Solaris 11.4.

* m4/intl-thread-locale.m4: Renamed from m4/intlsolaris.m4.
(gt_INTL_THREAD_LOCALE_NAME): Renamed from gt_INTL_SOLARIS. Define
HAVE_SOLARIS114_LOCALES instead of HAVE_NAMELESS_LOCALES.
* lib/localename.c: Handle HAVE_SOLARIS114_LOCALES through Solaris
specific code.
* lib/localename-table.h: Update comments.
* lib/localename-table.c: Update comments.
* m4/localename.m4 (gl_LOCALENAME): Require gt_INTL_THREAD_LOCALE_NAME.
Test for 'uselocale'. Don't invoke gt_INTL_SOLARIS.
* m4/intl.m4 (AM_INTL_SUBDIR): Require gt_INTL_THREAD_LOCALE_NAME. Test
for 'uselocale'. Set HAVE_NAMELESS_LOCALES.
(gt_INTL_SUBDIR_CORE): Don't invoke gt_INTL_SOLARIS. Don't set
HAVE_NAMELESS_LOCALES here.
* modules/localename (Files): Add m4/intl-thread-locale.m4. Remove
m4/intlsolaris.m4.
* modules/gettext (Files): Likewise.

6 years agoMention changed minimum requirements for Automake and Autoconf.
Bruno Haible [Mon, 22 Oct 2018 23:08:10 +0000 (01:08 +0200)]
Mention changed minimum requirements for Automake and Autoconf.

* NEWS: Mention the new minimum requirements.

6 years agostd-gnu11: Support Autoconf versions < 2.64.
Bruno Haible [Mon, 22 Oct 2018 22:12:11 +0000 (00:12 +0200)]
std-gnu11: Support Autoconf versions < 2.64.

* m4/std-gnu11.m4 (AC_PROG_CC, AC_PROG_CXX): Use _AC_DO as fallback
when _AC_DO_LIMIT does not exist.

6 years agoAssume Autoconf >= 2.63.
Bruno Haible [Mon, 22 Oct 2018 22:06:52 +0000 (00:06 +0200)]
Assume Autoconf >= 2.63.

* DEPENDENCIES: Mention the requirement.

* gnulib-tool (DEFAULT_AUTOCONF_MINVERSION): Bump to 2.63.
(func_get_filelist): Don't list m4/onceonly.m4 any more.
* pygnulib/GLModuleSystem.py (getFiles): Likewise.
* m4/onceonly.m4: Remove file.

* m4/openmp.m4: Remove file.
* modules/openmp (Files): Remove m4/openmp.m4.

* m4/configmake.m4 (gl_CONFIGMAKE_PREP): Don't set datarootdir, docdir,
htmldir, dvidir, pdfdir, psdir, localedir.
* m4/po.m4 (AM_PO_SUBDIRS): Don't set localedir.

* m4/gnulib-common.m4 (m4_foreach_w): Remove fallback for
Autoconf < 2.60.
(AC_PROG_MKDIR_P): Remove definition for Autoconf < 2.62.
(AC_PROG_SED): Remove fallback for Autoconf < 2.60.

* m4/errno_h.m4 (AC_COMPUTE_INT): Remove fallback for Autoconf < 2.61.
* m4/size_max.m4 (AC_COMPUTE_INT): Likewise.
* m4/stdint.m4 (AC_COMPUTE_INT): Likewise.

* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Assume AC_USE_SYSTEM_EXTENSIONS
exists.
* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Likewise,

* m4/lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Remove workaround for
Autoconf < 2.61.

* m4/lib-prefix.m4 (AC_LIB_ARG_WITH): Remove macro.
(AC_LIB_PREFIX): Use AC_ARG_WITH, assuming semantics of
Autoconf >= 2.52.

* m4/longlong.m4: Require Autoconf >= 2.62. Update comments.
* m4/ls-mntd-fs.m4: Require Autoconf >= 2.60. Update comments.
* m4/gettext.m4 (AM_GNU_GETTEXT): Update comment.

6 years agoAssume Automake >= 1.11.
Bruno Haible [Mon, 22 Oct 2018 22:06:46 +0000 (00:06 +0200)]
Assume Automake >= 1.11.

* m4/configmake.m4: Update comments.
* m4/lib-link.m4 (AC_LIB_RPATH): Assume AC_REQUIRE_AUX_FILE exists.
* m4/po.m4 (AM_PO_SUBDIRS, AM_POSTPROCESS_PO_MAKEFILE): Eliminate uses
of 'eval'.
* gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am,
func_create_testdir, func_create_megatestdir): Emit a Makefile.am that
requires Automake >= 1.11.

6 years agolocalename: Fix typo in comment.
Bruno Haible [Mon, 22 Oct 2018 22:05:27 +0000 (00:05 +0200)]
localename: Fix typo in comment.

* tests/test-locale-c++.cc (newlocale): Fix typo in comment.

6 years agoFix failure of 'gnulib-tool --create-testdir' with all modules.
Bruno Haible [Mon, 22 Oct 2018 18:32:41 +0000 (20:32 +0200)]
Fix failure of 'gnulib-tool --create-testdir' with all modules.

* gnulib-tool (func_create_testdir): Exclude 'timevar' module.

6 years agolocale: Ease integration with GNU libintl.
Bruno Haible [Mon, 22 Oct 2018 00:58:30 +0000 (02:58 +0200)]
locale: Ease integration with GNU libintl.

* lib/locale.in.h (GNULIB_defined_newlocale, GNULIB_defined_duplocale,
GNULIB_defined_freelocale): New macros.

6 years agolocalename: Fine-tune support for per-thread locales on Solaris 11.4.
Bruno Haible [Mon, 22 Oct 2018 00:49:56 +0000 (02:49 +0200)]
localename: Fine-tune support for per-thread locales on Solaris 11.4.

6 years agolocalename: Fine-tune support for per-thread locales on Solaris 11.4.
Bruno Haible [Mon, 22 Oct 2018 00:38:39 +0000 (02:38 +0200)]
localename: Fine-tune support for per-thread locales on Solaris 11.4.

* lib/localename-table.h: New file, extracted from lib/localename.c.
* lib/localename-table.c: Likewise.
* lib/localename.c: Include localename-table.h.
(get_locale_t_name, newlocale, duplocale, freelocale): Invoke
locale_hash_function instead of pointer_hash.
* modules/localename (Files): Add lib/localename-table.h,
lib/localename-table.c.
(lib_SOURCES): Add localename-table.c.
* m4/intlsolaris.m4 (gt_INTL_SOLARIS): Require AC_CANONICAL_HOST. Test
for Solaris 11.4 locale system only on Solaris. Test for it
independently whether getlocalename_l exists.
* m4/intl.m4 (gt_INTL_SUBDIR_CORE): Don't test for 'uselocale' and
'getlocalename_l'. Instead, invoke gt_INTL_SOLARIS. Set
HAVE_NAMELESS_LOCALES.
* modules/gettext (Files): Add m4/intlsolaris.m4.

6 years agoSmall update from gettext.
Bruno Haible [Mon, 22 Oct 2018 00:34:07 +0000 (02:34 +0200)]
Small update from gettext.

* m4/intl.m4: Update from gettext:
- 2018-01-02: Fix 'ar' invocation when cross-compiling and in 64-bit
mode on AIX.
- 2018-01-02: Don't use -lc explicitly when linking with libtool.
- 2017-05-19: (AM_INTL_SUBDIR): Require AC_C_FLEXIBLE_ARRAY_MEMBER.

6 years agoautoupdate
Karl Berry [Sun, 21 Oct 2018 16:02:59 +0000 (09:02 -0700)]
autoupdate

6 years agomountlist: Remove support for Cray with UNICOS 9.
Bruno Haible [Tue, 16 Oct 2018 19:27:45 +0000 (21:27 +0200)]
mountlist: Remove support for Cray with UNICOS 9.

* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Don't define
MOUNTED_LISTMNTENT.
* lib/mountlist.c: Remove MOUNTED_LISTMNTENT case.

6 years agofsusage, mountlist, getloadavg, getgroups: Remove support for Ultrix.
Bruno Haible [Tue, 16 Oct 2018 19:25:00 +0000 (21:25 +0200)]
fsusage, mountlist, getloadavg, getgroups: Remove support for Ultrix.

* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Don't define
STAT_STATFS2_FS_DATA.
* lib/fsusage.c: Remove STAT_STATFS2_FS_DATA case.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Don't define
MOUNTED_GETMNT.
* lib/mountlist.c: Remove MOUNTED_GETMNT case.
* lib/getloadavg.c (decstation): Remove definition and case.
* m4/getgroups.m4 (AC_FUNC_GETGROUPS): Mention NeXTstep, not Ultrix.
* lib/getgroups.c: Likewise.
* doc/posix-functions/getgroups.texi: Likewise.
* lib/time.in.h: Update comments.

6 years agogetloadavg: Remove support for ConvexOS.
Bruno Haible [Tue, 16 Oct 2018 19:09:51 +0000 (21:09 +0200)]
getloadavg: Remove support for ConvexOS.

* lib/getloadavg.c: Remove convex case.

6 years agogetloadavg: Remove support for Sony NEWS.
Bruno Haible [Tue, 16 Oct 2018 19:05:02 +0000 (21:05 +0200)]
getloadavg: Remove support for Sony NEWS.

* lib/getloadavg.c: Remove sony_news case.

6 years agofsusage, mountlist, getloadavg: Remove support for Dynix/ptx.
Bruno Haible [Tue, 16 Oct 2018 19:02:51 +0000 (21:02 +0200)]
fsusage, mountlist, getloadavg: Remove support for Dynix/ptx.

* lib/fsusage.c: Remove _SEQUENT_ case.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Update comments.
* lib/mountlist.c: Don't test for MNTTABNAME.
* m4/ls-mntd-fs.m4 (AC_FUNC_GETMNTENT): Don't test for libseq.
(gl_LIST_MOUNTED_FILE_SYSTEMS): Don't test for MNTTABNAME.
* lib/getloadavg.c: Remove _SEQUENT_ and sequent cases.
* lib/stat-size.h: Don't mention the Sequent bug.
* doc/posix-functions/utime.texi: Don't mention the Dynix bug.

6 years agofsusage: Remove support for AIX 3.
Bruno Haible [Tue, 16 Oct 2018 18:47:03 +0000 (20:47 +0200)]
fsusage: Remove support for AIX 3.

* lib/fsusage.c: Remove code for AIX 3.
* m4/fsusage.m4 (gl_PREREQ_FSUSAGE_EXTRA): Update comments.

6 years agofsusage, stat-size, getloadavg: Remove support for AIX PS/2.
Bruno Haible [Tue, 16 Oct 2018 18:43:03 +0000 (20:43 +0200)]
fsusage, stat-size, getloadavg: Remove support for AIX PS/2.

* m4/fsusage.m4 (gl_PREREQ_FSUSAGE_EXTRA): Don't check for dustat.h.
* lib/fsusage.c: Remove code for AIX PS/2.
* lib/stat-size.h (ST_NBLOCKSIZE): Likewise.
* lib/getloadavg.c: Likewise.

6 years agogetloadavg: Remove support for HP-UX on m68k.
Bruno Haible [Tue, 16 Oct 2018 18:21:30 +0000 (20:21 +0200)]
getloadavg: Remove support for HP-UX on m68k.

* lib/getloadavg.c: Remove hp9000s300 case.

6 years agofsusage, mountlist: Remove support for DolphinOS (an SVR3 variant).
Bruno Haible [Tue, 16 Oct 2018 16:59:25 +0000 (18:59 +0200)]
fsusage, mountlist: Remove support for DolphinOS (an SVR3 variant).

* lib/fsusage.c: Remove DOLPHIN case.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Update comments.
* lib/mountlist.c: Remove MOUNTED_GETMNTTBL case.