]> Savannah Git Hosting - gnulib.git/log
gnulib.git
6 years agodoc: Fix documentation about container data types.
Bruno Haible [Sat, 12 Jan 2019 08:50:10 +0000 (09:50 +0100)]
doc: Fix documentation about container data types.

Reported by Werner Lemberg <wl@gnu.org>.

* doc/containers.texi (Container data types): Fix typo.

6 years agoverify: Enable _GL_HAVE_STATIC_ASSERT for recent G++ versions.
Bruno Haible [Thu, 10 Jan 2019 20:06:52 +0000 (21:06 +0100)]
verify: Enable _GL_HAVE_STATIC_ASSERT for recent G++ versions.

Reported by Reuben Thomas <rrt@sc3d.org>.

* lib/verify.h (_GL_HAVE_STATIC_ASSERT): Define for g++ versions >= 6.

6 years agogetpass: Fix include filename
Tim Rühsen [Tue, 8 Jan 2019 14:50:28 +0000 (15:50 +0100)]
getpass: Fix include filename

* modules/getpass: Fix unistd,h -> unistd.h

6 years agomaintainer-makefile: Make the configure.ac section optional.
Bruno Haible [Sun, 6 Jan 2019 21:30:13 +0000 (22:30 +0100)]
maintainer-makefile: Make the configure.ac section optional.

* top/maint.mk (GREP, SED): Define if not defined.

6 years agolocalename: Assume setlocale function.
Bruno Haible [Sun, 6 Jan 2019 20:22:38 +0000 (21:22 +0100)]
localename: Assume setlocale function.

* lib/localename.c (gl_locale_name_posix): Assume setlocale exists.
* m4/localename.m4 (gl_LOCALENAME): Don't test whether setlocale exists.

6 years agodoc: Add documentation about container data types.
Bruno Haible [Sun, 6 Jan 2019 19:53:44 +0000 (20:53 +0100)]
doc: Add documentation about container data types.

* doc/containers.texi: New file.
* doc/gnulib.texi (Particular Modules): Include it.

6 years agodoc: Update documentation about 'progname' module.
Bruno Haible [Sun, 6 Jan 2019 15:57:56 +0000 (16:57 +0100)]
doc: Update documentation about 'progname' module.

* doc/progname.texi: Rename from doc/error.texi. Change node name and
title. Rewrite.
* doc/gnulib.texi (Particular Modules): Update.

6 years agodoc: Document the xstdopen and *-safer modules.
Bruno Haible [Sun, 6 Jan 2019 14:58:46 +0000 (15:58 +0100)]
doc: Document the xstdopen and *-safer modules.

* doc/xstdopen.texi: New file.
* doc/gnulib.texi (Particular Modules): Include it.

6 years agoxstdopen: Add tests.
Bruno Haible [Sun, 6 Jan 2019 08:27:42 +0000 (09:27 +0100)]
xstdopen: Add tests.

* tests/test-xstdopen.c: New file.
* tests/test-xstdopen.sh: New file.
* modules/xstdopen-tests: New file.

6 years agoxstdopen: New module.
Bruno Haible [Sun, 6 Jan 2019 08:25:59 +0000 (09:25 +0100)]
xstdopen: New module.

* lib/xstdopen.h: New file.
* lib/xstdopen.c: New file.
* modules/xstdopen: New file.

6 years agostdopen: Fix compilation error with IRIX cc.
Bruno Haible [Sun, 6 Jan 2019 08:24:04 +0000 (09:24 +0100)]
stdopen: Fix compilation error with IRIX cc.

* lib/stdopen.c (stdopen): Do not use C99-style decl in loop.

6 years agoxfreopen need not include stdio--.h
Paul Eggert [Sun, 6 Jan 2019 02:55:19 +0000 (18:55 -0800)]
xfreopen need not include stdio--.h

* lib/xfreopen.c: Do not include stdio--.h.

6 years agoxfreopen need not depend on freopen-safer
Paul Eggert [Sun, 6 Jan 2019 02:03:10 +0000 (18:03 -0800)]
xfreopen need not depend on freopen-safer

* modules/xfreopen (Depends-on):
Depend on freopen, not freopen-safer.

6 years agostdopen: modernize and simplify
Paul Eggert [Sun, 6 Jan 2019 02:02:32 +0000 (18:02 -0800)]
stdopen: modernize and simplify

* lib/stdopen.c: Update copyright date
Do not include sys/types.h; no longer needed these days.
(stdopen): Use C99-style decl in loop.  Return int errno
value, rather than just a bool.  Do not worry about fd mismatches,
since the caller cares only if 0, 1, 2 are occupied.
* lib/stdopen.h: No need to include <stdbool.h>.
* m4/stdopen.m4: Remove.
* modules/stdopen: New file.

6 years agostdopen: copy from last use in coreutils
Paul Eggert [Sat, 5 Jan 2019 19:02:51 +0000 (11:02 -0800)]
stdopen: copy from last use in coreutils

* lib/stdopen.c, lib/stdopen.h, m4/stdopen.m4:
New files, taken from their last commit in coreutils
2007-07-23T12:35:58Z!jim@meyering.net
71aa3ea88084d17bcb4fc1031ad7b66f8647115e.

6 years agoautoupdate
Karl Berry [Sat, 5 Jan 2019 16:19:47 +0000 (08:19 -0800)]
autoupdate

6 years agoargp: Don't pass an invalid argument to dgettext().
Bruno Haible [Sat, 5 Jan 2019 16:15:29 +0000 (17:15 +0100)]
argp: Don't pass an invalid argument to dgettext().

Reported by He X <xw897002528@gmail.com>.

* lib/argp-help.c (print_header, argp_doc): Don't pass a NULL doc to
dgettext().

6 years agoargp: Don't pass an invalid argument to dgettext().
Bruno Haible [Sat, 5 Jan 2019 16:00:53 +0000 (17:00 +0100)]
argp: Don't pass an invalid argument to dgettext().

Reported by He X <xw897002528@gmail.com>.

* lib/argp.h (struct argp): Clarify that the args_doc field may be NULL.
* lib/argp-help.c (argp_args_usage): Don't pass a NULL args_doc to
dgettext().

6 years agostdioext: port to newer 32-bit Android
Paul Eggert [Sun, 23 Dec 2018 02:00:10 +0000 (18:00 -0800)]
stdioext: port to newer 32-bit Android

Problem reported by Tom Yan in:
https://lists.gnu.org/archive/html/bug-gnulib/2018-07/msg00014.html
* lib/stdio-impl.h (_gl_FILE_flags_t) [__ANDROID__]: New macro.
(fp_) [__ANDROID__]: Use it.

6 years agolock: Fix link error with --enable-threads=pth.
Bruno Haible [Sat, 5 Jan 2019 01:37:39 +0000 (02:37 +0100)]
lock: Fix link error with --enable-threads=pth.

* lib/glthread/lock.h (pth_cond_init, pth_cond_await, pth_cond_notify):
Mark as weak.

6 years agoFix link errors in unit tests.
Bruno Haible [Fri, 4 Jan 2019 19:31:18 +0000 (20:31 +0100)]
Fix link errors in unit tests.

Reported by Tom G. Christensen <tgc@jupiterrise.com>.

* modules/bitset-tests (Makefile.am): Link test-bitset against libintl.
* modules/array-map-tests (Makefile.am): Link test-array_map against
libintl.
* modules/array-set-tests (Makefile.am): Link test-array_set against
libintl.
* modules/hash-map-tests (Makefile.am): Link test-hash_map against
libintl.
* modules/hash-set-tests (Makefile.am): Link test-hash_set against
libintl.
* modules/linkedhash-map-tests (Makefile.am): Link test-linkedhash_map
against libintl.
* modules/linkedhash-set-tests (Makefile.am): Link test-linkedhash_set
against libintl.

6 years agoFix incorrect 'Link' sections.
Bruno Haible [Fri, 4 Jan 2019 19:20:24 +0000 (20:20 +0100)]
Fix incorrect 'Link' sections.

* modules/regex (Link): Mention the link requirement of module 'lock'.
* modules/regex-tests (Makefile.am): Don't use LIB_PTHREAD.

6 years agoFix some 'Link' sections.
Bruno Haible [Fri, 4 Jan 2019 19:04:57 +0000 (20:04 +0100)]
Fix some 'Link' sections.

* modules/c-stack (Link): Add link directive from the 'gettext-h'
dependency.
* modules/getaddrinfo (Link): Likewise.

6 years agoRemove redundant 'Link' sections.
Bruno Haible [Fri, 4 Jan 2019 18:59:03 +0000 (19:59 +0100)]
Remove redundant 'Link' sections.

* modules/canon-host (Link): Remove section.
* modules/timevar (Link): Likewise.

6 years agoRemove incorrect 'Link' sections.
Bruno Haible [Fri, 4 Jan 2019 18:44:39 +0000 (19:44 +0100)]
Remove incorrect 'Link' sections.

* modules/acl (Link): Remove section. Use combined 'Link' sections from
the dependencies instead.
* modules/crypto/md5 (Link): Likewise.
* modules/crypto/sha1 (Link): Likewise.
* modules/crypto/sha256 (Link): Likewise.
* modules/crypto/sha512 (Link): Likewise.
* modules/faccessat (Link): Likewise.
* modules/fdutimensat (Link): Likewise.
* modules/iconv_open-utf (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/qacl (Link): Likewise.
* modules/unicodeio (Link): Likewise.
* modules/utimecmp (Link): Likewise.
* modules/utimensat (Link): Likewise.
* modules/xstriconv (Link): Likewise.
* modules/xstriconveh (Link): Likewise.

6 years agognulib-tool: New option --extract-recursive-link-directive.
Bruno Haible [Fri, 4 Jan 2019 18:34:19 +0000 (19:34 +0100)]
gnulib-tool: New option --extract-recursive-link-directive.

* gnulib-tool (func_usage): Document the new options
--extract-recursive-dependencies, --extract-recursive-link-directive.
(func_verify_module): Document output variables.
(func_get_dependencies_recursively): New function.
(func_get_link_directive_recursively): New function.
Use them to implement the new options
--extract-recursive-dependencies, --extract-recursive-link-directive.
* doc/gnulib-tool.texi (Link-time requirements): New section.

6 years agoClarify meaning of 'Link' section in module description.
Bruno Haible [Fri, 4 Jan 2019 18:17:11 +0000 (19:17 +0100)]
Clarify meaning of 'Link' section in module description.

* doc/gnulib.texi (Module description): Clarify the meaning of the
'Link' section versus the one of the dependencies.
* NEWS: Mention the change.

6 years agopselect: Fix module description.
Bruno Haible [Fri, 4 Jan 2019 18:15:26 +0000 (19:15 +0100)]
pselect: Fix module description.

* modules/pselect (Link): Put one link option per line.

6 years agocosl: Fix module description.
Bruno Haible [Fri, 4 Jan 2019 18:10:19 +0000 (19:10 +0100)]
cosl: Fix module description.

* modules/cosl (Link): Fix typo.
* modules/mathl (configure.ac): Likewise.

6 years agoc-xvasprintf: Fix module dependencies.
Bruno Haible [Fri, 4 Jan 2019 18:06:42 +0000 (19:06 +0100)]
c-xvasprintf: Fix module dependencies.

* modules/c-xvasprintf (Depends-on): Add 'xalloc-die'.

6 years agobootstrap: die when some submodules are not initialized
Akim Demaille [Mon, 31 Dec 2018 18:20:46 +0000 (19:20 +0100)]
bootstrap: die when some submodules are not initialized

* build-aux/bootstrap: Make sure all submodules are initialized.

6 years agoautoupdate
Karl Berry [Fri, 4 Jan 2019 16:09:17 +0000 (08:09 -0800)]
autoupdate

6 years agobitsetv: Fix module dependencies.
Bruno Haible [Fri, 4 Jan 2019 11:56:22 +0000 (12:56 +0100)]
bitsetv: Fix module dependencies.

* lib/bitsetv.c: Include xalloc.h.
* modules/bitsetv (Depends-on): Add 'xalloc'.

6 years agoxmemdup0: Remove redundant code.
Bruno Haible [Fri, 4 Jan 2019 11:32:14 +0000 (12:32 +0100)]
xmemdup0: Remove redundant code.

* lib/xmemdup0.h (xalloc_die): Remove declaration.

6 years agobackupfile: Fix module dependencies.
Bruno Haible [Fri, 4 Jan 2019 11:26:44 +0000 (12:26 +0100)]
backupfile: Fix module dependencies.

* modules/backupfile (Depends-on): Add 'xalloc'.

6 years agobitset, crypto/gc: fix conflicts with Solaris 11
Paul Eggert [Fri, 4 Jan 2019 06:36:21 +0000 (22:36 -0800)]
bitset, crypto/gc: fix conflicts with Solaris 11

* lib/bitset.h (_GL_BITSET_H): Rename from _BITSET_H, to
avoid clash with Solaris 11 <sys/bitset.h>.
* lib/gc.h (_GL_GC_H): Rename from GC_H, to avoid clash
with Solaris 11 <xorg/gc.h>.

6 years agosafe-read, safe-write: Fix conflict with Illumos-Joyent <sys/limits.h>.
Bruno Haible [Fri, 4 Jan 2019 05:22:00 +0000 (06:22 +0100)]
safe-read, safe-write: Fix conflict with Illumos-Joyent <sys/limits.h>.

Reported by Andy Fiddaman <andy@omniosce.org>.

* lib/sys-limits.h: Add a '_GL' prefix to the guard symbol.

6 years agoautoupdate
Karl Berry [Thu, 3 Jan 2019 17:47:26 +0000 (09:47 -0800)]
autoupdate

6 years agomaintainer-makefile: fix typo in previous patch
Eric Blake [Thu, 3 Jan 2019 15:19:27 +0000 (09:19 -0600)]
maintainer-makefile: fix typo in previous patch

* top/maint.mk (_sc_search_regexp): Fix my accidental corruption
of Roman's work.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agomaint.mk: Replace grep with $(GREP)
Roman Bolshakov [Wed, 2 Jan 2019 20:08:00 +0000 (14:08 -0600)]
maint.mk: Replace grep with $(GREP)

A project that uses maint.mk can specify regular expressions that are
not supported in system grep. Autoconf can discover an alias for GNU
grep and set it in GREP but it takes no effect for maint.mk

The patch provides an ability to use GNU grep if it was discovered by
autoconf and by calling GNU grep we don't get the messages in syntax-check:
  prohibit_diagnostic_without_format
  grep: empty (sub)expression
  grep: empty (sub)expression
  grep: empty (sub)expression
  grep: empty (sub)expression
  grep: empty (sub)expression
  grep: empty (sub)expression

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20181213153453.38123-3-r.bolshakov@yadro.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agomaint.mk: Split long argument lists
Roman Bolshakov [Thu, 13 Dec 2018 15:34:52 +0000 (18:34 +0300)]
maint.mk: Split long argument lists

$(VC_LIST_EXCEPT) is usually expanded into arguments for a command.
When a project contains too many, some operating systems can't pass all
the arguments because they hit the limit of arguments. FreeBSD and macOS
are known to have the exec limit of 256k memory used by arguments.

More on the issue:
http://lists.gnu.org/archive/html/bug-gnulib/2015-08/msg00019.html
https://www.redhat.com/archives/libvir-list/2015-August/msg00758.html

xargs without flags can be used to limit number of arguments, coupled
with use of the shell's built-in echo which is not subject to the exec
limits.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20181213153453.38123-2-r.bolshakov@yadro.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agoautoupdate
Paul Eggert [Tue, 1 Jan 2019 02:07:08 +0000 (18:07 -0800)]
autoupdate

6 years agomaint: Run 'make update-copyright'
Paul Eggert [Mon, 31 Dec 2018 23:25:11 +0000 (00:25 +0100)]
maint: Run 'make update-copyright'

6 years agoautoupdate
Paul Eggert [Mon, 31 Dec 2018 23:19:26 +0000 (15:19 -0800)]
autoupdate

6 years agoautoupdate
Karl Berry [Mon, 31 Dec 2018 17:12:05 +0000 (09:12 -0800)]
autoupdate

6 years agoautoupdate
Karl Berry [Sat, 29 Dec 2018 17:21:41 +0000 (09:21 -0800)]
autoupdate

6 years ago* lib/mknodat.c: Remove incorrect comments.
Paul Eggert [Fri, 28 Dec 2018 06:24:14 +0000 (22:24 -0800)]
* lib/mknodat.c: Remove incorrect comments.

6 years agomkfifo: bring back HAVE_MKFIFO macro
Paul Eggert [Fri, 28 Dec 2018 06:22:41 +0000 (22:22 -0800)]
mkfifo: bring back HAVE_MKFIFO macro

* m4/mkfifo.m4 (gl_FUNC_MKFIFO): #define HAVE_MKFIFO as needed.
Problem reported by Andrew Janke in:
https://lists.gnu.org/r/bug-gnulib/2018-12/msg00147.html

6 years agoautoupdate
Paul Eggert [Thu, 27 Dec 2018 19:20:42 +0000 (11:20 -0800)]
autoupdate

6 years agoautoupdate
Karl Berry [Fri, 21 Dec 2018 16:37:23 +0000 (08:37 -0800)]
autoupdate

6 years agoAssume Autoconf >= 2.63.
Bruno Haible [Fri, 21 Dec 2018 08:34:05 +0000 (09:34 +0100)]
Assume Autoconf >= 2.63.

* modules/stdarg (configure.ac-early): Remove comment about Autoconf
versions < 2.60.

6 years agomemcmp: Mention the clang bug.
Bruno Haible [Fri, 21 Dec 2018 08:25:57 +0000 (09:25 +0100)]
memcmp: Mention the clang bug.

* tests/test-memcmp.c: Add comment about a known test failure.
* doc/posix-functions/memcmp.texi: Mention the clang bug.

6 years agorevert v0.1-2213-gae4b73e28 and part of v0.1-2281-g95cd86dd7
Jim Meyering [Fri, 21 Dec 2018 03:51:48 +0000 (19:51 -0800)]
revert v0.1-2213-gae4b73e28 and part of v0.1-2281-g95cd86dd7

v0.1-2213-gae4b73e28 caused a regression in grep-3.2 (no match):
  echo '123-x'|LC_ALL=C grep -E '.\bx'
The goal is to revert the first, but reverting it requires to restore
the function deleted in the second. I ran this to restore the deleted
function:
  git show v0.1-2281-g95cd86dd7 lib/dfa.c \
    | perl -0777 -pe 's/^@@[^\n]*dfaan.*//ms' \
    | patch -R -p1
* lib/dfa.c (charclass_context): Restore deleted function.
Reverting the primary commit removes this change:
dfa: Simplify a building state
* lib/dfa.c (build_state): Simplify a building state.

6 years agoversion-etc: allow zero authors
Paul Eggert [Fri, 21 Dec 2018 00:10:29 +0000 (16:10 -0800)]
version-etc: allow zero authors

* lib/version-etc.c (version_etc_arn): If no authors are given,
omit authorship info instead of dumping core.
No need to include stdlib.h now.

6 years agolchown tests: Be more permissive regarding errno values.
Bruno Haible [Thu, 20 Dec 2018 02:11:34 +0000 (03:11 +0100)]
lchown tests: Be more permissive regarding errno values.

Reported by Ivan Zakharyaschev <imz@altlinux.org>.

* tests/test-lchown.h (test_lchown): Recognize EOPNOTSUPP as an
alternative to ENOSYS.
* modules/lchown-tests (Depends-on): Add 'errno'.
* modules/fchownat-tests (Depends-on): Likewise.

6 years agoduplocale: Avoid test failure on AIX 7.
Bruno Haible [Tue, 18 Dec 2018 08:59:41 +0000 (09:59 +0100)]
duplocale: Avoid test failure on AIX 7.

* modules/duplocale-tests (Files): Add m4/intl-thread-locale.m4.
(configure.ac): Invoke gt_FUNC_USELOCALE.
* tests/test-duplocale.c: Test HAVE_WORKING_USELOCALE instead of
HAVE_USELOCALE. Assume that nl_langinfo_l only works when uselocale
works.

6 years agolocalename: Fix test failure on AIX 7.
Bruno Haible [Tue, 18 Dec 2018 08:49:42 +0000 (09:49 +0100)]
localename: Fix test failure on AIX 7.

Reported by Assaf Gordon in
<https://lists.gnu.org/archive/html/sed-devel/2018-12/msg00019.html>.

* m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): New macro.
(gt_INTL_THREAD_LOCALE_NAME): Invoke it. Test gt_cv_func_uselocale_works
instead of ac_cv_func_uselocale.
* lib/localename.c: Test HAVE_WORKING_USELOCALE instead of
HAVE_USELOCALE.
* lib/localename-table.h: Likewise.
* lib/localename-table.c: Likewise.
* tests/test-localename.c: Likewise.
* doc/posix-functions/uselocale.texi: Mention the AIX problem.

6 years agolocalename: Update comments regarding Cygwin.
Bruno Haible [Tue, 18 Dec 2018 07:53:49 +0000 (08:53 +0100)]
localename: Update comments regarding Cygwin.

* lib/localename.c: Update comment.
* doc/posix-functions/uselocale.texi: Update platforms list.
* doc/posix-functions/newlocale.texi: Likewise.
* doc/posix-functions/duplocale.texi: Likewise.
* doc/posix-functions/freelocale.texi: Likewise.

6 years agoc-stack: Fix for Linux/sparc.
Bruno Haible [Sun, 16 Dec 2018 22:18:36 +0000 (23:18 +0100)]
c-stack: Fix for Linux/sparc.

* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Set
ac_cv_sys_xsi_stack_overflow_heuristic to 'no' on Linux/sparc.

6 years agolocalename: Avoid test failure on some glibc systems.
Bruno Haible [Sun, 16 Dec 2018 20:31:15 +0000 (21:31 +0100)]
localename: Avoid test failure on some glibc systems.

* tests/test-localename.c (test_locale_name, test_locale_name_posix):
Unset environment variables that might disturb the first setlocale call,
and verify that this setlocale call succeeds.

6 years agoautoupdate
Paul Eggert [Sun, 16 Dec 2018 15:33:54 +0000 (07:33 -0800)]
autoupdate

6 years agorandom: Fix build error on native Windows (regression from 2018-06-21).
Assaf Gordon [Sun, 16 Dec 2018 15:24:28 +0000 (16:24 +0100)]
random: Fix build error on native Windows (regression from 2018-06-21).

* lib/random.c (__srandom, __initstate, __setstate, __random,
__srandom_r, __initstate_r, __setstate_r, __random_r) [!_LIBC]: Redirect
to the symbols without '__' prefix.

6 years agoautoupdate
Bruno Haible [Sun, 16 Dec 2018 14:58:18 +0000 (15:58 +0100)]
autoupdate

6 years agoobstack, libc-config: Support HP-UX cc in C99 mode.
Bruno Haible [Sun, 16 Dec 2018 09:46:13 +0000 (10:46 +0100)]
obstack, libc-config: Support HP-UX cc in C99 mode.

* lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER): Treat HP-UX cc as a pre-C99
compiler, even when in C99 mode.
* lib/cdefs.h (__flexarr): Likewise.
* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Update comment.

6 years agolocalename: Fix test failure on OpenBSD >= 6.2.
Bruno Haible [Sun, 16 Dec 2018 06:11:44 +0000 (07:11 +0100)]
localename: Fix test failure on OpenBSD >= 6.2.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Test for fake
locale system. Define HAVE_FAKE_LOCALES in this case.
* lib/localename.c (HAVE_GOOD_USELOCALE): New macro. Use it instead of
HAVE_USELOCALE.
* tests/test-localename.c (HAVE_GOOD_USELOCALE): New macro. Use it
instead of HAVE_NEWLOCALE && HAVE_USELOCALE.
* doc/posix-functions/uselocale.texi: Mention OpenBSD problem. Update
platforms list.
* doc/posix-functions/newlocale.texi: Likewise.
* doc/posix-functions/duplocale.texi: Update platforms list.
* doc/posix-functions/freelocale.texi: Likewise.

6 years agoduplocale tests: Re-enable the test on platforms without <monetary.h>.
Bruno Haible [Sun, 16 Dec 2018 05:45:51 +0000 (06:45 +0100)]
duplocale tests: Re-enable the test on platforms without <monetary.h>.

* tests/test-duplocale.c: Use more fine-grained #ifs to re-enable most
of the test, on platforms without <monetary.h>.

6 years agolocalename: Update comments.
Bruno Haible [Sun, 16 Dec 2018 04:40:53 +0000 (05:40 +0100)]
localename: Update comments.

* lib/localename.c (HAVE_USELOCALE): Update list of platforms.

6 years agoregex: fix indentation
Jim Meyering [Sun, 16 Dec 2018 00:40:00 +0000 (16:40 -0800)]
regex: fix indentation

* m4/regex.m4 (gl_REGEX): Indent with spaces, not TABs.

6 years agoopenat-safer tests: Avoid test failure on NetBSD 8. Part 2.
Bruno Haible [Sat, 15 Dec 2018 23:48:58 +0000 (00:48 +0100)]
openat-safer tests: Avoid test failure on NetBSD 8. Part 2.

6 years agoopenat-safer tests: Avoid test failure on NetBSD 8.
Bruno Haible [Sat, 15 Dec 2018 23:34:25 +0000 (00:34 +0100)]
openat-safer tests: Avoid test failure on NetBSD 8.

* tests/test-openat-safer.c (main): Execute a Linux specific test only
on Linux.

6 years agoregex: work around a bug in glibc-2.27 and prior
Jim Meyering [Sat, 15 Dec 2018 23:24:21 +0000 (15:24 -0800)]
regex: work around a bug in glibc-2.27 and prior

* m4/regex.m4 (gl_REGEX): Reject any system regexp that gets a failed
assertion for /0|()0|\1|0/.
* tests/test-regex.c (main): Add the same test here.

6 years agolocalename: Fix use of uninitialized shell variable.
Bruno Haible [Sat, 15 Dec 2018 22:27:49 +0000 (23:27 +0100)]
localename: Fix use of uninitialized shell variable.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Initialize
gt_cv_locale_solaris114 always before use. Remove assignment without
effect.

6 years agodfa tests: Avoid test failure on Alpine Linux.
Bruno Haible [Sat, 15 Dec 2018 21:01:27 +0000 (22:01 +0100)]
dfa tests: Avoid test failure on Alpine Linux.

* tests/dfa-match.sh (timeout_10): Accommodate the BusyBox 'timeout'
command found on Alpine Linux.

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.