]> Savannah Git Hosting - gnulib.git/log
gnulib.git
12 months agototalordermagl: New module.
Bruno Haible [Fri, 19 Apr 2024 00:22:16 +0000 (02:22 +0200)]
totalordermagl: New module.

* lib/math.in.h (totalordermagl): New declaration.
* lib/totalordermagl.c: New file, based on lib/totalorderl.c.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermagl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAGL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAGL,
REPLACE_TOTALORDERMAGL.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAGL,
HAVE_TOTALORDERMAGL, REPLACE_TOTALORDERMAGL.
* modules/totalordermagl: New file, based on modules/totalorderl.
* doc/posix-functions/totalordermagl.texi: Mention the new module.

12 months agototalordermagf: Add tests.
Bruno Haible [Fri, 19 Apr 2024 00:22:01 +0000 (02:22 +0200)]
totalordermagf: Add tests.

* tests/test-totalordermagf.c: New file, based on
tests/test-totalorderf.c.
* modules/totalordermagf-tests: New file, based on
modules/totalorderf-tests.

12 months agototalordermagf: New module.
Bruno Haible [Fri, 19 Apr 2024 00:21:56 +0000 (02:21 +0200)]
totalordermagf: New module.

* lib/math.in.h (totalordermagf): New declaration.
* lib/totalordermagf.c: New file, based on lib/totalorderf.c.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermagf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAGF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAGF,
REPLACE_TOTALORDERMAGF.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAGF,
HAVE_TOTALORDERMAGF, REPLACE_TOTALORDERMAGF.
* modules/totalordermagf: New file, based on modules/totalorderf.
* doc/posix-functions/totalordermagf.texi: Mention the new module.

12 months agototalordermag: Add tests.
Bruno Haible [Fri, 19 Apr 2024 00:21:34 +0000 (02:21 +0200)]
totalordermag: Add tests.

* tests/test-totalordermag.c: New file, based on
tests/test-totalorder.c.
* tests/test-totalordermag.h: New file, based on
tests/test-totalorder.h.
* modules/totalordermag-tests: New file, based on
modules/totalorder-tests.

12 months agototalordermag: New module.
Bruno Haible [Fri, 19 Apr 2024 00:21:21 +0000 (02:21 +0200)]
totalordermag: New module.

* lib/math.in.h (totalordermag): New declaration.
* lib/totalordermag.c: New file, based on lib/totalorder.c.
* m4/totalordermag.m4: New file, based on m4/totalorder.m4.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermag is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAG.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAG,
REPLACE_TOTALORDERMAG.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAG,
HAVE_TOTALORDERMAG, REPLACE_TOTALORDERMAG.
* modules/totalordermag: New file, based on modules/totalorder.
* doc/posix-functions/totalordermag.texi: Mention the new module.

12 months agosetpayloadsig*: Support newer MIPS CPUs.
Bruno Haible [Fri, 19 Apr 2024 00:14:45 +0000 (02:14 +0200)]
setpayloadsig*: Support newer MIPS CPUs.

* lib/setpayloadsig.c (setpayloadsig): On MIPS CPUs with MIPS_NAN2008_DOUBLE,
reject a zero payload.
* lib/setpayloadsigf.c (setpayloadsigf): On MIPS CPUs with MIPS_NAN2008_FLOAT,
reject a zero payload.
* lib/setpayloadsigl.c (setpayloadsigl): On MIPS CPUs with
MIPS_NAN2008_LONG_DOUBLE, reject a zero payload.

12 months agosetpayload*: Support newer MIPS CPUs.
Bruno Haible [Fri, 19 Apr 2024 00:14:41 +0000 (02:14 +0200)]
setpayload*: Support newer MIPS CPUs.

* lib/setpayload.c (setpayload): On MIPS CPUs with MIPS_NAN2008_DOUBLE,
accept a zero payload.
* lib/setpayloadf.c (setpayloadf): On MIPS CPUs with MIPS_NAN2008_FLOAT,
accept a zero payload.
* lib/setpayloadl.c (setpayloadl): On MIPS CPUs with
MIPS_NAN2008_LONG_DOUBLE, accept a zero payload.
* m4/setpayload.m4 (gl_FUNC_SETPAYLOADF, gl_FUNC_SETPAYLOAD,
gl_FUNC_SETPAYLOADL): Invoke gl_NAN_MIPS.
* modules/setpayload (Files): Add m4/nan-mips.m4.
* modules/setpayloadf (Files): Likewise.
* modules/setpayloadl (Files): Likewise.

12 months agototalorder*: Support newer MIPS CPUs.
Bruno Haible [Fri, 19 Apr 2024 00:14:37 +0000 (02:14 +0200)]
totalorder*: Support newer MIPS CPUs.

* lib/totalorder.c (totalorder): On MIPS CPUs with MIPS_NAN2008_DOUBLE,
don't invert the most significant bit of the mantissa field.
* lib/totalorderf.c (totalorderf): On MIPS CPUs with MIPS_NAN2008_FLOAT,
don't invert the most significant bit of the mantissa field.
* lib/totalorderl.c (totalorderl): On MIPS CPUs with
MIPS_NAN2008_LONG_DOUBLE, don't invert the most significant bit of the
mantissa field.
* m4/totalorder.m4 (gl_FUNC_TOTALORDERF, gl_FUNC_TOTALORDER,
gl_FUNC_TOTALORDERL): Invoke gl_NAN_MIPS.
* modules/totalorder (Files): Add m4/nan-mips.m4.
* modules/totalorderf (Files): Likewise.
* modules/totalorderl (Files): Likewise.

12 months agosnan: Add support for m68k.
Bruno Haible [Fri, 19 Apr 2024 00:13:30 +0000 (02:13 +0200)]
snan: Add support for m68k.

* lib/snan.h (construct_memory_SNaNl): Handle m68k specially.

12 months agototalorderl: Simplify on MSVC.
Bruno Haible [Thu, 18 Apr 2024 14:29:28 +0000 (16:29 +0200)]
totalorderl: Simplify on MSVC.

* lib/totalorderl.c (totalorderl): If 'long double' is the same as
'double', just invoke totalorder. Otherwise, drop the optimized code
for small 'long double' since it does not occur on any platform.
* m4/totalorder.m4 (gl_FUNC_TOTALORDERL): Require
gl_LONG_DOUBLE_VS_DOUBLE. If 'long double' is the same as 'double', use
TOTALORDER_LIBM.
* modules/totalorderl (Depends-on): Add totalorder.

12 months agosignbit: Fix typos.
Bruno Haible [Thu, 18 Apr 2024 13:11:06 +0000 (15:11 +0200)]
signbit: Fix typos.

* lib/signbitd.c: Fix typo in comment.
* lib/signbitf.c: Likewise.

12 months agognulib-tool.py: Ignore 'attribute-defined-outside-init' warnings.
Collin Funk [Wed, 17 Apr 2024 23:20:32 +0000 (16:20 -0700)]
gnulib-tool.py: Ignore 'attribute-defined-outside-init' warnings.

* pygnulib/.pylintrc: Add W0201 to the disabled warnings.
See discussion here:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00275.html>

12 months agototalorder* tests: Strengthen tests.
Bruno Haible [Wed, 17 Apr 2024 23:34:02 +0000 (01:34 +0200)]
totalorder* tests: Strengthen tests.

* tests/test-totalorder.h: Include <math.h>.
(positive_NaN_with_payload, negative_NaN_with_payload): New functions.
(main): Test quiet NaNs of each sign with different payload.
* tests/test-totalorder.c (TOTALORDER_POSITIVE_NAN,
TOTALORDER_NEGATIVE_NAN): Remove macros.
(TOTALORDER_SETPAYLOAD): New macro.
* tests/test-totalorderf.c (TOTALORDER_POSITIVE_NAN,
TOTALORDER_NEGATIVE_NAN): Remove macros.
(TOTALORDER_SETPAYLOAD): New macro.
* tests/test-totalorderl.c (TOTALORDER_POSITIVE_NAN,
TOTALORDER_NEGATIVE_NAN): Remove macros.
(TOTALORDER_SETPAYLOAD): New macro.
* modules/totalorder-tests (Depends-on): Add setpayload.
(Makefile.am): Link test-totalorder with $(SETPAYLOAD_LIBM).
* modules/totalorderf-tests (Depends-on): Add setpayloadf.
(Makefile.am): Link test-totalorderf with $(SETPAYLOADF_LIBM).
* modules/totalorderl-tests (Depends-on): Add setpayloadl.
(Makefile.am): Link test-totalorderl with $(SETPAYLOADL_LIBM).

12 months agognulib-tool.py: Use same warning style as gnulib-tool.sh.
Bruno Haible [Wed, 17 Apr 2024 22:44:19 +0000 (00:44 +0200)]
gnulib-tool.py: Use same warning style as gnulib-tool.sh.

* pygnulib/GLTestDir.py (GLTestDir.execute): Prefix the
"incompatible license" message with "gnulib-tool: warning: ".

12 months agostdio, utime-h: Fix more linkage errors when using C++.
Bruno Haible [Wed, 17 Apr 2024 22:21:18 +0000 (00:21 +0200)]
stdio, utime-h: Fix more linkage errors when using C++.

* lib/stdio.in.h (rpl_fwrite, rpl_fwrite_unlocked): Use _GL_EXTERN_C
instead of extern.
* lib/utime.in.h (_gl_utimens_windows): Likewise.

12 months agoFix linkage errors when using C++.
Bruno Haible [Wed, 17 Apr 2024 22:28:40 +0000 (00:28 +0200)]
Fix linkage errors when using C++.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00274.html>.

* lib/acl.h: Add 'extern "C" {' / '}' boilerplate.
* lib/alignalloc.h: Likewise.
* lib/aligned-malloc.h: Likewise.
* lib/allocator.h: Likewise.
* lib/arcfour.h: Likewise.
* lib/arctwo.h: Likewise.
* lib/areadlink.h: Likewise.
* lib/argv-iter.h: Likewise.
* lib/argz.in.h: Likewise.
* lib/binary-io.h: Likewise.
* lib/bitrotate.h: Likewise.
* lib/bitset.h: Likewise.
* lib/bitsetv.h: Likewise.
* lib/c-strcaseeq.h: Likewise.
* lib/canon-host.h: Likewise.
* lib/careadlinkat.h: Likewise.
* lib/chdir-long.h: Likewise.
* lib/check-version.h: Likewise.
* lib/classpath.h: Likewise.
* lib/cloexec.h: Likewise.
* lib/close-stream.h: Likewise.
* lib/crc.h: Likewise.
* lib/csharpcomp.h: Likewise.
* lib/csharpexec.h: Likewise.
* lib/cycle-check.h: Likewise.
* lib/des.h: Likewise.
* lib/dev-ino.h: Likewise.
* lib/di-set.h: Likewise.
* lib/eealloc.h: Likewise.
* lib/exclude.h: Likewise.
* lib/execinfo.in.h: Likewise.
* lib/execute.h: Likewise.
* lib/exitfail.h: Likewise.
* lib/fcntl-safer.h: Likewise.
* lib/file-set.h: Likewise.
* lib/file-type.h: Likewise.
* lib/filenamecat.h: Likewise.
* lib/filevercmp.h: Likewise.
* lib/fpending.h: Likewise.
* lib/fprintftime.h: Likewise.
* lib/fpucw.h: Likewise.
* lib/fsusage.h: Likewise.
* lib/ftoastr.h: Likewise.
* lib/full-read.h: Likewise.
* lib/gc.h: Likewise.
* lib/getndelim2.h: Likewise.
* lib/getnline.h: Likewise.
* lib/getugroups.h: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/hamt.h: Likewise.
* lib/hard-locale.h: Likewise.
* lib/hash-pjw-bare.h: Likewise.
* lib/hash-pjw.h: Likewise.
* lib/hash-triple.h: Likewise.
* lib/hmac.h: Likewise.
* lib/human.h: Likewise.
* lib/i-ring.h: Likewise.
* lib/idcache.h: Likewise.
* lib/idx.h: Likewise.
* lib/ino-map.h: Likewise.
* lib/inttostr.h: Likewise.
* lib/isapipe.h: Likewise.
* lib/javacomp.h: Likewise.
* lib/javaexec.h: Likewise.
* lib/jit/cache.h: Likewise.
* lib/linebuffer.h: Likewise.
* lib/localeinfo.h: Likewise.
* lib/long-options.h: Likewise.
* lib/mbchar.h: Likewise.
* lib/mbfile.h: Likewise.
* lib/mbiter.h: Likewise.
* lib/mbiterf.h: Likewise.
* lib/mbuiter.h: Likewise.
* lib/mbuiterf.h: Likewise.
* lib/mcel.h: Likewise.
* lib/memcasecmp.h: Likewise.
* lib/memcoll.h: Likewise.
* lib/memxor.h: Likewise.
* lib/mgetgroups.h: Likewise.
* lib/mkdir-p.h: Likewise.
* lib/modechange.h: Likewise.
* lib/mountlist.h: Likewise.
* lib/mpsort.h: Likewise.
* lib/msvc-nothrow.h: Likewise.
* lib/nan.h: Likewise.
* lib/openat-priv.h: Likewise.
* lib/openat.h: Likewise.
* lib/opendirat.h: Likewise.
* lib/pagealign_alloc.h: Likewise.
* lib/parse-datetime.h: Likewise.
* lib/parse-duration.h: Likewise.
* lib/physmem.h: Likewise.
* lib/posixtm.h: Likewise.
* lib/posixver.h: Likewise.
* lib/printf-frexp.h: Likewise.
* lib/printf-frexpl.h: Likewise.
* lib/priv-set.h: Likewise.
* lib/quote.h: Likewise.
* lib/quotearg.h: Likewise.
* lib/read-file.h: Likewise.
* lib/readline.h: Likewise.
* lib/readtokens.h: Likewise.
* lib/readtokens0.h: Likewise.
* lib/regex-quote.h: Likewise.
* lib/renameatu.h: Likewise.
* lib/rijndael-alg-fst.h: Likewise.
* lib/rijndael-api-fst.h: Likewise.
* lib/safe-alloc.h: Likewise.
* lib/safe-write.h: Likewise.
* lib/same-inode.h: Likewise.
* lib/same.h: Likewise.
* lib/save-cwd.h: Likewise.
* lib/savedir.h: Likewise.
* lib/savewd.h: Likewise.
* lib/selinux-at.h: Likewise.
* lib/signed-nan.h: Likewise.
* lib/signed-snan.h: Likewise.
* lib/snan.h: Likewise.
* lib/sockets.h: Likewise.
* lib/stdio-safer.h: Likewise.
* lib/stdlib-safer.h: Likewise.
* lib/streq.h: Likewise.
* lib/strerror-override.h: Likewise.
* lib/tmpdir.h: Likewise.
* lib/trim.h: Likewise.
* lib/u64.h: Likewise.
* lib/unicase/casefold.h: Likewise.
* lib/unicase/caseprop.h: Likewise.
* lib/unicase/invariant.h: Likewise.
* lib/unicase/special-casing.in.h: Likewise.
* lib/unicase/unicasemap.h: Likewise.
* lib/unicodeio.h: Likewise.
* lib/unilbrk/lbrktables.h: Likewise.
* lib/unilbrk/ulc-common.h: Likewise.
* lib/uninorm/decompose-internal.h: Likewise.
* lib/unistd-safer.h: Likewise.
* lib/unitypes.in.h: Likewise.
* lib/uniwbrk/wbrktable.h: Likewise.
* lib/unlinkdir.h: Likewise.
* lib/userspec.h: Likewise.
* lib/utimecmp.h: Likewise.
* lib/utimens.h: Likewise.
* lib/windows-spawn.h: Likewise.
* lib/write-any-file.h: Likewise.
* lib/xbinary-io.h: Likewise.
* lib/xgetcwd.h: Likewise.
* lib/xgetdomainname.h: Likewise.
* lib/xgethostname.h: Likewise.
* lib/xmemcoll.h: Likewise.
* lib/xprintf.h: Likewise.
* lib/xreadlink.h: Likewise.
* lib/xsize.h: Likewise.
* lib/xstrndup.h: Likewise.
* lib/xstrtod.h: Likewise.
* lib/xstrtol.h: Likewise.
* lib/yesno.h: Likewise.
* lib/isnand-nolibm.h (isnand): Declare with C linkage.
* lib/isnanf-nolibm.h (isnanf): Likewise.
* lib/isnanl-nolibm.h (isnanl): Likewise.

12 months agognulib-tool.py: Make an instance variable local to a function.
Collin Funk [Wed, 17 Apr 2024 18:47:16 +0000 (11:47 -0700)]
gnulib-tool.py: Make an instance variable local to a function.

* pygnulib/GLImport.py (GLImport.execute): Define the GLFileAssistant as
local to this function because it is unused elsewhere.

12 months agognulib-tool.py: Remove an unused instance attribute.
Collin Funk [Wed, 17 Apr 2024 18:34:07 +0000 (11:34 -0700)]
gnulib-tool.py: Remove an unused instance attribute.

* pygnulib/GLImport.py (GLImport.__init__): Remove the unused
GLFileSystem object.

12 months agognulib-tool.py: Fix a pylint 'attribute-defined-outside-init' warning.
Collin Funk [Wed, 17 Apr 2024 03:21:04 +0000 (20:21 -0700)]
gnulib-tool.py: Fix a pylint 'attribute-defined-outside-init' warning.

* pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Don't
define a 'modules' attribute since it is never used.

12 months agogetpayloadl: Add tests.
Bruno Haible [Wed, 17 Apr 2024 09:09:13 +0000 (11:09 +0200)]
getpayloadl: Add tests.

* tests/test-getpayloadl.c: New file.
* modules/getpayloadl-tests: New file.

12 months agogetpayloadl: New module.
Bruno Haible [Wed, 17 Apr 2024 09:08:40 +0000 (11:08 +0200)]
getpayloadl: New module.

* lib/math.in.h (getpayloadl): New declaration.
* lib/getpayloadl.c: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether getpayloadl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPAYLOADL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_GETPAYLOADL, REPLACE_GETPAYLOADL.
* modules/math (Makefile.am): Substitute GNULIB_GETPAYLOADL,
HAVE_GETPAYLOADL, REPLACE_GETPAYLOADL.
* modules/getpayloadl: New file.
* doc/posix-functions/getpayloadl.texi: Mention the new module and the
glibc bug.

12 months agogetpayloadf: Add tests.
Bruno Haible [Wed, 17 Apr 2024 09:03:53 +0000 (11:03 +0200)]
getpayloadf: Add tests.

* tests/test-getpayloadf.c: New file.
* modules/getpayloadf-tests: New file.

12 months agogetpayloadf: New module.
Bruno Haible [Wed, 17 Apr 2024 09:02:52 +0000 (11:02 +0200)]
getpayloadf: New module.

* lib/math.in.h (getpayloadf): New declaration.
* lib/getpayloadf.c: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether getpayloadf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPAYLOADF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_GETPAYLOADF, REPLACE_GETPAYLOADF.
* modules/math (Makefile.am): Substitute GNULIB_GETPAYLOADF,
HAVE_GETPAYLOADF, REPLACE_GETPAYLOADF.
* modules/getpayloadf: New file.
* doc/posix-functions/getpayloadf.texi: Mention the new module and the
glibc bug.

12 months agogetpayload: Add tests.
Bruno Haible [Wed, 17 Apr 2024 08:58:47 +0000 (10:58 +0200)]
getpayload: Add tests.

* tests/test-getpayload.c: New file.
* modules/getpayload-tests: New file.

12 months agogetpayload: New module.
Bruno Haible [Wed, 17 Apr 2024 08:57:05 +0000 (10:57 +0200)]
getpayload: New module.

* lib/math.in.h (getpayload): New declaration.
* lib/getpayload.c: New file.
* m4/getpayload.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether getpayload is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPAYLOAD.
(gl_MATH_H_DEFAULTS): Initialize HAVE_GETPAYLOAD, REPLACE_GETPAYLOAD.
* modules/math (Makefile.am): Substitute GNULIB_GETPAYLOAD,
HAVE_GETPAYLOAD, REPLACE_GETPAYLOAD.
* modules/getpayload: New file.
* doc/posix-functions/getpayload.texi: Mention the new module and the
glibc bug.

12 months agowchar: Fix serial number.
Sam James [Wed, 17 Apr 2024 00:47:56 +0000 (02:47 +0200)]
wchar: Fix serial number.

* m4/wchar_h.m4: Remove duplicate serial number specification and
increment serial.

Copyright-paperwork-exempt: Yes

12 months agognulib-tool.py: Make GLModule's __eq__ and __hash__ method agree.
Collin Funk [Tue, 16 Apr 2024 19:13:08 +0000 (12:13 -0700)]
gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree.

* pygnulib/GLModuleSystem.py (GLModuleTable.__hash__): Only use the
module name in hash computations.

12 months agosetpayloadsigl: Add tests.
Bruno Haible [Tue, 16 Apr 2024 19:29:16 +0000 (21:29 +0200)]
setpayloadsigl: Add tests.

* tests/test-setpayloadsigl.c: New file, based on
tests/test-setpayloadl.c.
* modules/setpayloadsigl-tests: New file.

12 months agosetpayloadsigl: New module.
Bruno Haible [Tue, 16 Apr 2024 19:28:42 +0000 (21:28 +0200)]
setpayloadsigl: New module.

* lib/math.in.h (setpayloadsigl): New declaration.
* lib/setpayloadsigl.c: New file, based on lib/setpayloadl.c.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadsigl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADSIGL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADSIGL.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADSIGL,
HAVE_SETPAYLOADSIGL.
* modules/setpayloadsigl: New file.
* doc/posix-functions/setpayloadsigl.texi: Mention the new module.

12 months agosetpayloadsigf: Add tests.
Bruno Haible [Tue, 16 Apr 2024 19:15:16 +0000 (21:15 +0200)]
setpayloadsigf: Add tests.

* tests/test-setpayloadf.c (PAYLOAD_BITS): New macro.
(main): Use it.
* tests/test-setpayloadsigf.c: New file, based on
tests/test-setpayloadf.c.
* modules/setpayloadsigf-tests: New file.

12 months agosetpayloadsigf: New module.
Bruno Haible [Tue, 16 Apr 2024 19:12:39 +0000 (21:12 +0200)]
setpayloadsigf: New module.

* lib/math.in.h (setpayloadsigf): New declaration.
* lib/setpayloadsigf.c: New file, based on lib/setpayloadf.c.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadsigf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADSIGF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADSIGF.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADSIGF,
HAVE_SETPAYLOADSIGF.
* modules/setpayloadsigf: New file.
* doc/posix-functions/setpayloadsigf.texi: Mention the new module.

12 months agosetpayloadsig: Add tests.
Bruno Haible [Tue, 16 Apr 2024 19:06:20 +0000 (21:06 +0200)]
setpayloadsig: Add tests.

* tests/test-setpayload.c (PAYLOAD_BITS): New macro.
(main): Use it.
* tests/test-setpayloadsig.c: New file, based on
tests/test-setpayload.c.
* modules/setpayloadsig-tests: New file.

12 months agosetpayloadsig: New module.
Bruno Haible [Tue, 16 Apr 2024 19:01:17 +0000 (21:01 +0200)]
setpayloadsig: New module.

* lib/math.in.h (setpayloadsig): New declaration.
* lib/setpayloadsig.c: New file, based on lib/setpayload.c.
* m4/setpayloadsig.m4: New file, based on m4/setpayload.m4.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadsig is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADSIG.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADSIG.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADSIG,
HAVE_SETPAYLOADSIG.
* modules/setpayloadsig: New file.
* doc/posix-functions/setpayloadsig.texi: Mention the new module.

12 months agosetpayloadl: Fix platform-specific bugs.
Bruno Haible [Tue, 16 Apr 2024 22:38:07 +0000 (00:38 +0200)]
setpayloadl: Fix platform-specific bugs.

* lib/setpayloadl.c (setpayloadl): On m68k, consider the actual memory
layout of a 'long double'. On platforms with quadruple-precision
'long double', store 111 bits of payload, not only 110 bits.

12 months agognulib-tool.py: Prefer 'not in' over 'not ... in'.
Collin Funk [Tue, 16 Apr 2024 15:36:55 +0000 (08:36 -0700)]
gnulib-tool.py: Prefer 'not in' over 'not ... in'.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Change conditional.
* pygnulib/GLModuleSystem.py (GLModuleTable.addConditional): Likewise.

12 months agognulib-tool.py: Make data structures more clear.
Collin Funk [Tue, 16 Apr 2024 15:21:27 +0000 (08:21 -0700)]
gnulib-tool.py: Make data structures more clear.

* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a set to
represent the unconditional modules instead of a dictionary. Remove
redundant comments.
(GLModuleTable.addUnconditional): Add the module to a set instead of
using it as a key to the dictionary.

12 months agosetpayloadl: Add tests.
Bruno Haible [Tue, 16 Apr 2024 12:58:57 +0000 (14:58 +0200)]
setpayloadl: Add tests.

* tests/test-setpayloadl.c: New file.
* modules/setpayloadl-tests: New file.

12 months agosetpayloadl: New module.
Bruno Haible [Tue, 16 Apr 2024 12:57:25 +0000 (14:57 +0200)]
setpayloadl: New module.

* lib/math.in.h (setpayloadl): New declaration.
* lib/setpayloadl.c: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADL.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADL,
HAVE_SETPAYLOADL.
* modules/setpayloadl: New file.
* doc/posix-functions/setpayloadl.texi: Mention the new module.

12 months agosetpayloadf: Add tests.
Bruno Haible [Tue, 16 Apr 2024 12:40:37 +0000 (14:40 +0200)]
setpayloadf: Add tests.

* tests/test-setpayloadf.c: New file.
* modules/setpayloadf-tests: New file.

12 months agosetpayloadf: New module.
Bruno Haible [Tue, 16 Apr 2024 12:39:16 +0000 (14:39 +0200)]
setpayloadf: New module.

* lib/math.in.h (setpayloadf): New declaration.
* lib/setpayloadf.c: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADF.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADF,
HAVE_SETPAYLOADF.
* modules/setpayloadf: New file.
* doc/posix-functions/setpayloadf.texi: Mention the new module.

12 months agosetpayload: Add tests.
Bruno Haible [Tue, 16 Apr 2024 12:29:16 +0000 (14:29 +0200)]
setpayload: Add tests.

* tests/test-setpayload.c: New file.
* modules/setpayload-tests: New file.

12 months agosetpayload: New module.
Bruno Haible [Tue, 16 Apr 2024 12:25:27 +0000 (14:25 +0200)]
setpayload: New module.

* lib/math.in.h (setpayload): New declaration.
* lib/setpayload.c: New file.
* m4/setpayload.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayload is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOAD.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOAD.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOAD,
HAVE_SETPAYLOAD.
* modules/setpayload: New file.
* doc/posix-functions/setpayload.texi: Mention the new module.

12 months agognulib-tool.py: Optimize directory creation.
Collin Funk [Mon, 15 Apr 2024 16:16:25 +0000 (09:16 -0700)]
gnulib-tool.py: Optimize directory creation.

* pygnulib/GLTestDir.py (GLTestDir.execute): Use a list of possible
subdirectories and create them upfront instead of checking every file.

12 months agogitlog-to-changelog: Revert 2024-04-12 fix and add documentation.
Simon Josefsson [Mon, 15 Apr 2024 15:47:52 +0000 (17:47 +0200)]
gitlog-to-changelog: Revert 2024-04-12 fix and add documentation.

* build-aux/gitlog-to-changelog: Use localtime.
* doc/gitlog-to-changelog.texi: Add.
* doc/gnulib.texi (Build Infrastructure Modules): Add.

12 months agognulib-tool.py: Fix incorrect type hint.
Collin Funk [Sun, 14 Apr 2024 20:41:17 +0000 (13:41 -0700)]
gnulib-tool.py: Fix incorrect type hint.

* pygnulib/constants.py (filter_filelist): Correct the type hint on the
'filelist' argument. It is a list of strings, not a string.

12 months agognulib-tool.py: Write newlines consistently.
Collin Funk [Sun, 14 Apr 2024 17:31:34 +0000 (10:31 -0700)]
gnulib-tool.py: Write newlines consistently.

* pygnulib/constants.py (NL): Remove variable.
* pygnulib/GLImport.py (GLImport.gnulib_comp): Use '\n' instead of
constants.NL.
* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Likewise.
* pygnulib/main.py (main_with_exception_handling): Likewise.

12 months agognulib-tool.py: Don't perform newline conversions.
Collin Funk [Sun, 14 Apr 2024 17:18:03 +0000 (10:18 -0700)]
gnulib-tool.py: Don't perform newline conversions.

* pygnulib/constants.py (nlconvert): Remove function. Remove unused
platform import.
* pygnulib/GLImport.py (GLImport.gnulib_cache): Remove calls to
nlconvert().
* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Likewise.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Likewise.

12 months agousers.txt: Update some more entries.
Bruno Haible [Sun, 14 Apr 2024 20:43:35 +0000 (22:43 +0200)]
users.txt: Update some more entries.

* users.txt: Remove cvsps, gpg, gtkreindeer, libvirt, mailfromd, msmtp,
OPeNDAP. Update some existing entries.

12 months agognulib-tool.py: Remove some unused variable assignments.
Collin Funk [Sun, 14 Apr 2024 16:37:17 +0000 (09:37 -0700)]
gnulib-tool.py: Remove some unused variable assignments.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Remove unused
variable.
* pygnulib/GLInfo.py (GLInfo.date, GLInfo.version): Remove assignments
to variables unconditionally set in try, except blocks.
* pygnulib/GLModuleSystem.py (GLModule.getConditionalName)
(GLModule.getShellFunc, GLModule.getShellVar): Likewise.

12 months agognulib-tool.py: Don't use mutable default arguments.
Collin Funk [Sun, 14 Apr 2024 01:51:06 +0000 (18:51 -0700)]
gnulib-tool.py: Don't use mutable default arguments.

* pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Set the default
argument for 'transformers' to None. If it is None then set it to an
empty dictionary in the body.

12 months agobootstrap: Implement phase 1 as documented in the --help output.
Bruno Haible [Sat, 13 Apr 2024 23:38:42 +0000 (01:38 +0200)]
bootstrap: Implement phase 1 as documented in the --help output.

Reported by Simon Josefsson as bug #1 in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00152.html>.

* top/bootstrap: Correct indentation.
* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Implement as
documented:
If GNULIB_SRCDIR and GNULIB_REVISION are set and there is a 'gnulib'
submodule, checkout the revision GNULIB_REVISION.
If GNULIB_SRCDIR and GNULIB_REVISION are set and --no-git is specified,
don't checkout the revision GNULIB_REVISION.

12 months agobootstrap: Simplify git submodule initialization.
Bruno Haible [Sat, 13 Apr 2024 22:08:50 +0000 (00:08 +0200)]
bootstrap: Simplify git submodule initialization.

* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Err out if git is
older than version 1.6.4. Remove fallback code for older versions.
* build-aux/bootstrap: Regenerated.

12 months agoImprove 'git diff' of Python files.
Collin Funk [Sat, 13 Apr 2024 18:16:44 +0000 (11:16 -0700)]
Improve 'git diff' of Python files.

* .gitattributes: Add a rule for *.py files.

12 months agognulib-tool.py: Fix extra arguments to function call.
Collin Funk [Sat, 13 Apr 2024 17:09:17 +0000 (10:09 -0700)]
gnulib-tool.py: Fix extra arguments to function call.

* pygnulib/GLImport.py (GLImport.execute): Add the missing joinpath call
on two file name components before calling isfile().

12 months agobootstrap: Fix --help messages.
Bruno Haible [Sat, 13 Apr 2024 15:23:48 +0000 (17:23 +0200)]
bootstrap: Fix --help messages.

Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00162.html>.

* top/bootstrap (usage): Fix the description of GNULIB_SRCDIR. Document
GNULIB_REFDIR. Use full-sentences style. Tweak wording.
* top/bootstrap-funclib.sh (autopull_usage): Clarify the phase. Don't
mention nonexistent options --gnulib-srcdir and --gnulib-refdir. Use
full-sentences style.
(autogen_usage): Clarify the phase. Use full-sentences style.
* build-aux/bootstrap: Regenerated.

12 months agognulib-tool.py: Code tweak.
Bruno Haible [Sat, 13 Apr 2024 11:30:44 +0000 (13:30 +0200)]
gnulib-tool.py: Code tweak.

* pygnulib/main.py (main): Move file contents analysis out of a 'with'
statement.

12 months agognulib-tool.py: Stop using codecs.open.
Bruno Haible [Sat, 13 Apr 2024 10:55:44 +0000 (12:55 +0200)]
gnulib-tool.py: Stop using codecs.open.

* pygnulib/*.py: To open a file, consistently use
open(..., mode='[rwa]', newline='\n', encoding='utf-8').

12 months agognulib-tool.py: Refactor directory tree removals.
Bruno Haible [Sat, 13 Apr 2024 10:06:34 +0000 (12:06 +0200)]
gnulib-tool.py: Refactor directory tree removals.

* pygnulib/constants.py (rmtree): New function.
* pygnulib/GLImport.py (GLImport.execute): Use it instead of calling
'rm -rf' directly or shutil.rmtree.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Likewise.
* pygnulib/main.py (main): Likewise.

12 months agognulib-tool.py: Update TODO list.
Bruno Haible [Sat, 13 Apr 2024 01:52:23 +0000 (03:52 +0200)]
gnulib-tool.py: Update TODO list.

12 months agognulib-tool.py: Fix --copy-file directory creation.
Collin Funk [Sat, 13 Apr 2024 01:34:49 +0000 (18:34 -0700)]
gnulib-tool.py: Fix --copy-file directory creation.

Reported by Bruno Haible in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00140.html>

* pygnulib/main.py (main): Make sure that destdir is set in the GLConfig
object before copying files.

12 months agognulib-tool.py: Implement --add-import --with-*-tests correctly.
Bruno Haible [Fri, 12 Apr 2024 23:23:11 +0000 (01:23 +0200)]
gnulib-tool.py: Implement --add-import --with-*-tests correctly.

* pygnulib/GLConfig.py (GLConfig.update): Use list-merging for the test
categories.
* pygnulib/GLImport.py (GLImport.__init__): Don't merge back those
values which were already considered by taking the union.

12 months agognulib-tool.py: Implement --add-import --avoid correctly.
Bruno Haible [Fri, 12 Apr 2024 22:53:05 +0000 (00:53 +0200)]
gnulib-tool.py: Implement --add-import --avoid correctly.

* pygnulib/GLConfig.py (GLConfig.update): Don't test for the unused key
'tests'.
(GLConfig.default): Likewise.
* pygnulib/GLImport.py (GLImport.__init__): Don't merge back those
values which were already considered by taking the union.

12 months agognulib-tool.py: Implement --add-import --avoid correctly.
Bruno Haible [Fri, 12 Apr 2024 22:49:50 +0000 (00:49 +0200)]
gnulib-tool.py: Implement --add-import --avoid correctly.

* pygnulib/GLConfig.py (GLConfig.update): Don't test for the unused key
'tests'.
* pygnulib/GLImport.py (GLImport.__init__): Don't merge back those
values which were already considered by taking the union.

12 months agognulib-tool.py: Refactor.
Bruno Haible [Fri, 12 Apr 2024 22:24:52 +0000 (00:24 +0200)]
gnulib-tool.py: Refactor.

* pygnulib/GLConfig.py (GLConfig.update, GLConfig.update_key): Improve
variable names and comments.
* pygnulib/GLImport.py (GLImport.__init__): Improve comments.

12 months agognulib-tool.py: Optimize.
Bruno Haible [Fri, 12 Apr 2024 22:10:44 +0000 (00:10 +0200)]
gnulib-tool.py: Optimize.

* pygnulib/GLConfig.py (GLConfig.update, GLConfig.update_key): Avoid
useless cloning of dictionaries.

12 months agognulib-tool.py: Update TODO list.
Bruno Haible [Fri, 12 Apr 2024 20:37:35 +0000 (22:37 +0200)]
gnulib-tool.py: Update TODO list.

12 months agognulib-tool.py: Implement --no-conditional-dependencies correctly.
Bruno Haible [Fri, 12 Apr 2024 20:36:21 +0000 (22:36 +0200)]
gnulib-tool.py: Implement --no-conditional-dependencies correctly.

* pygnulib/GLConfig.py (GLConfig.default): For 'conddeps', return None,
not False.
(GLConfig.checkCondDeps): Update result type.
(resetCondDeps): Reset to return None, not False.
* pygnulib/GLImport.py (GLImport.actioncmd): Update.

12 months agognulib-tool.py: Implement --no-conditional-dependencies correctly.
Bruno Haible [Fri, 12 Apr 2024 20:21:57 +0000 (22:21 +0200)]
gnulib-tool.py: Implement --no-conditional-dependencies correctly.

* pygnulib/GLConfig.py (GLConfig.default): For 'conddeps', return None,
not False.
(GLConfig.checkCondDeps): Update result type.
(resetCondDeps): Reset to return None, not False.
* pygnulib/GLImport.py (GLImport.actioncmd): Update.

12 months agognulib-tool.py: Implement --no-libtool option correctly.
Bruno Haible [Fri, 12 Apr 2024 20:10:54 +0000 (22:10 +0200)]
gnulib-tool.py: Implement --no-libtool option correctly.

* pygnulib/GLConfig.py (GLConfig.default): For 'libtool', return None,
not False.
(GLConfig.checkLibtool): Update result type.
(resetLibtool): Reset to return None, not False.
* pygnulib/GLImport.py (GLImport.actioncmd): Update.

12 months agognulib-tool.py: Accept conditional dependencies with tests.
Bruno Haible [Fri, 12 Apr 2024 17:10:33 +0000 (19:10 +0200)]
gnulib-tool.py: Accept conditional dependencies with tests.

* pygnulib/GLImport.py (GLImport.__init__): Don't reject the combination
of gl_CONDITIONAL_DEPENDENCIES and gl_WITH_TESTS.
* pygnulib/GLError.py (GLError.__repr__): Remove error 10.
* pygnulib/main.py (main_with_exception_handling): Likewise.

12 months agognulib-tool.py: Fix handling of --with-obsolete.
Bruno Haible [Fri, 12 Apr 2024 16:11:46 +0000 (18:11 +0200)]
gnulib-tool.py: Fix handling of --with-obsolete.

* pygnulib/constants.py (TESTS): Remove 'obsolete' category.
* pygnulib/GLConfig.py (GLConfig.__init__): Add optional incobsolete
parameter.
(GLConfig.default): Handle 'incobsolete'.
(GLConfig.checkIncObsolete, GLConfig.setIncObsolete,
GLConfig.resetIncObsolete): New methods.
* pygnulib/GLModuleSystem.py (GLModuleSystem.transitive_closure): For
incobsolete, use new GLConfig methods.
* pygnulib/GLImport.py (GLImport.__init__, GLImport.actioncmd,
GLImport.gnulib_cache): Likewise.
* pygnulib/main.py (main): Pass the incobsolete value to the GLConfig
constructor.

12 months agogitlog-to-changelog: Make output reproducible.
Simon Josefsson [Fri, 12 Apr 2024 15:25:16 +0000 (17:25 +0200)]
gitlog-to-changelog: Make output reproducible.

* build-aux/gitlog-to-changelog: Use gmtime instead of localtime.

12 months agognulib-tool.py: Fix parsing of gl_LGPL in gnulib-cache.m4.
Bruno Haible [Fri, 12 Apr 2024 15:17:12 +0000 (17:17 +0200)]
gnulib-tool.py: Fix parsing of gl_LGPL in gnulib-cache.m4.

* pygnulib/GLImport.py (GLImport.__init__): Search for gl_LGPL in
gnulib-cache.m4 more carefully.

12 months agognulib-tool.py: Fix parsing of gnulib-cache.m4.
Bruno Haible [Fri, 12 Apr 2024 14:32:37 +0000 (16:32 +0200)]
gnulib-tool.py: Fix parsing of gnulib-cache.m4.

* pygnulib/GLImport.py (GLImport.__init__): While parsing
gnulib-cache.m4, stop parsing the identifier starting with 'gl_' when
encountering a character that is not a uppercase letter, digit, or
underscore.

12 months agognulib-tool.py: Fix misspelled option in output.
Bruno Haible [Fri, 12 Apr 2024 13:51:28 +0000 (15:51 +0200)]
gnulib-tool.py: Fix misspelled option in output.

* pygnulib/GLImport.py (GLImport.actioncmd): Fix typo.

12 months agognulib-tool.py: Persist the --with-longrunning-tests option.
Bruno Haible [Fri, 12 Apr 2024 13:47:54 +0000 (15:47 +0200)]
gnulib-tool.py: Persist the --with-longrunning-tests option.

* pygnulib/GLImport.py (GLImport.gnulib_cache): Conditionally add
gl_WITH_LONGRUNNING_TESTS to gnulib-cache.m4.

12 months agognulib-tool.py: Print warnings just like gnulib-tool.sh.
Bruno Haible [Fri, 12 Apr 2024 13:26:45 +0000 (15:26 +0200)]
gnulib-tool.py: Print warnings just like gnulib-tool.sh.

* pygnulib/main.py (main): When printing a warning, print just
"gnulib-tool" instead of the absolute file name.

12 months agognulib-tool.sh: Accept conditional dependencies with tests.
Bruno Haible [Fri, 12 Apr 2024 13:14:43 +0000 (15:14 +0200)]
gnulib-tool.sh: Accept conditional dependencies with tests.

* gnulib-tool.sh (func_import): Don't reject the combination of
gl_CONDITIONAL_DEPENDENCIES and gl_WITH_TESTS.

12 months agognulib-tool.py: Optimize module set lookups.
Bruno Haible [Thu, 11 Apr 2024 19:49:45 +0000 (21:49 +0200)]
gnulib-tool.py: Optimize module set lookups.

* gnulib-tool.py (profiler_args): New variable.
* pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Turn
handledmodules into a set.
(GLModuleTable.transitive_closure_separately): For the 'in' test, use
a set variable main_modules_set.

12 months agognulib-tool.py: Remove redundant backslashes from regexps.
Collin Funk [Thu, 11 Apr 2024 18:27:34 +0000 (11:27 -0700)]
gnulib-tool.py: Remove redundant backslashes from regexps.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't backslash ']' when it
is outside of a set.
* pygnulib/GLImport.py (GLImport.__init__): Don't use a backslash when
']' is at the start of a '[...]' set. Don't backslash special characters
in a '[...]' set since they have their meaning dropped.
* pygnulib/main.py (main): Likewise.

12 months agognulib-tool.py: Simplify regular expressions.
Collin Funk [Thu, 11 Apr 2024 18:00:47 +0000 (11:00 -0700)]
gnulib-tool.py: Simplify regular expressions.

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am)
(GLEmiter.tests_Makefile_am): Change occurrences of '[A-Z][A-Z]*' to
'[A-Z]+'.

12 months agousers.txt: Correct some entries.
Bruno Haible [Thu, 11 Apr 2024 13:27:16 +0000 (15:27 +0200)]
users.txt: Correct some entries.

* users.txt: Update some existing entries.

12 months agognulib-tool.sh: Improve sort order of directories.
Bruno Haible [Thu, 11 Apr 2024 13:08:01 +0000 (15:08 +0200)]
gnulib-tool.sh: Improve sort order of directories.

* gnulib-tool.sh (func_import): In file fileset-changes, store directory
names without a trailing slash.

12 months agognulib-tool.sh: Remove './' prefix from file names to update or remove.
Bruno Haible [Thu, 11 Apr 2024 11:31:37 +0000 (13:31 +0200)]
gnulib-tool.sh: Remove './' prefix from file names to update or remove.

* gnulib-tool.sh (func_import): Don't let rewritten file names start
with './'.

12 months agognulib-tool.py: Fix sorting of the LINGUAS file.
Collin Funk [Thu, 11 Apr 2024 10:46:46 +0000 (12:46 +0200)]
gnulib-tool.py: Fix sorting of the LINGUAS file.

* pygnulib/GLImport.py (GLImport.execute): Sort the list of locales
before writing them into the LINGUAS file.

12 months agognulib-tool.sh: Handle .gitignore files that do not end in a newline.
Bruno Haible [Thu, 11 Apr 2024 00:44:03 +0000 (02:44 +0200)]
gnulib-tool.sh: Handle .gitignore files that do not end in a newline.

* gnulib-tool.sh (func_import): If the .gitignore file ends with a
character other than a newline, add a newline before adding more lines.

12 months agognulib-tool.py: Skip nonexistent modules instead of failing.
Bruno Haible [Wed, 10 Apr 2024 23:55:05 +0000 (01:55 +0200)]
gnulib-tool.py: Skip nonexistent modules instead of failing.

* pygnulib/GLModuleSystem.py (GLModuleSystem.find): Use the same warning
wording as gnulib-tool.sh.
* pygnulib/GLImport.py (GLImport.gnulib_cache): Print the specified
modules, not the base modules.
(GLImport.prepare): Don't put None elements into base_modules.

12 months agognulib-tool.py: Use function arguments instead of magic numbers.
Collin Funk [Wed, 10 Apr 2024 15:24:58 +0000 (08:24 -0700)]
gnulib-tool.py: Use function arguments instead of magic numbers.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Remove the
'verifier' integer flag argument. Add the 'module_filter' function
argument. Use it to determine if Autoconf snippets should be printed for
each module.
* pygnulib/GLImport.py (GLImport.gnulib_comp): Update call to use a
lambda function.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

12 months agognulib-tool: Fix a typo.
Collin Funk [Wed, 10 Apr 2024 12:56:34 +0000 (05:56 -0700)]
gnulib-tool: Fix a typo.

* gnulib-tool.sh: Fix a typo in comment.
* pygnulib/main.py (main): Likewise.

12 months agognulib-tool.py: Change the avoid list to a set for lookups.
Collin Funk [Tue, 9 Apr 2024 16:11:03 +0000 (09:11 -0700)]
gnulib-tool.py: Change the avoid list to a set for lookups.

* pygnulib/GLModuleSystem.py (GLModuleSystem.__init__): Store the
avoided modules in a set instead of a list. This is used only for
membership checks when computing the transitive closure of the given
modules, therefore prefer the O(1) average case over O(n).

12 months agognulib-tool.py: Remove unused setter and getter functions.
Collin Funk [Tue, 9 Apr 2024 15:55:02 +0000 (08:55 -0700)]
gnulib-tool.py: Remove unused setter and getter functions.

* pygnulib/GLModuleSystem.py (GLModuleTable.getAvoids)
(GLModuleTable.setAvoids): Remove these unused functions.

12 months agototalorder, totalorderf: Avoid miscompilation by gcc on NetBSD/i386.
Bruno Haible [Tue, 9 Apr 2024 15:47:01 +0000 (17:47 +0200)]
totalorder, totalorderf: Avoid miscompilation by gcc on NetBSD/i386.

* lib/totalorder.c (totalorder): Use the a compiler optimization barrier
also for GCC.
* lib/totalorderf.c (totalorderf): Likewise.

12 months agognulib-tool.py: Simplify use of GLModuleTable accessors.
Collin Funk [Tue, 9 Apr 2024 07:01:49 +0000 (00:01 -0700)]
gnulib-tool.py: Simplify use of GLModuleTable accessors.

* pygnulib/GLModuleSystem.py (GLModuleTable.__getitem__): Remove
function.
* pygnulib/GLImport.py (GLImport.gnulib_cache, GLImport.gnulib_comp)
(GLImport.execute): Use function calls on the GLModuleTable to access
module lists instead of using keys to emulate a dictionary.

12 months agototalorder, totalorderf: Avoid miscompilation by clang on OpenBSD/i386.
Bruno Haible [Tue, 9 Apr 2024 12:17:38 +0000 (14:17 +0200)]
totalorder, totalorderf: Avoid miscompilation by clang on OpenBSD/i386.

* lib/totalorder.c (totalorder): Insert a compiler optimization barrier.
* lib/totalorderf.c (totalorderf): Likewise.

12 months agototalorder, totalorderf: Fix handling of SNaN on i386 and x86_64 CPUs.
Bruno Haible [Tue, 9 Apr 2024 11:08:32 +0000 (13:08 +0200)]
totalorder, totalorderf: Fix handling of SNaN on i386 and x86_64 CPUs.

* lib/totalorder.c: Include <string.h>.
(totalorder): Use memcpy to copy the 'double' values into the union.
Drop 'volatile'.
* lib/totalorderf.c: Include <string.h>.
(totalorderf): Use memcpy to copy the 'float' values into the union.
Drop 'volatile'.

12 months agototalorder tests: Fix signature test.
Bruno Haible [Tue, 9 Apr 2024 10:22:54 +0000 (12:22 +0200)]
totalorder tests: Fix signature test.

* tests/test-totalorder.c: Test the signature of totalorder, not
totalorderf.

12 months agognulib-tool.py: Use single-quotes for strings, part 2.
Collin Funk [Tue, 9 Apr 2024 01:34:16 +0000 (18:34 -0700)]
gnulib-tool.py: Use single-quotes for strings, part 2.

* pygnulib/GLEmiter.py (GLEmiter.po_Makevars): Change a double-quoted
string to single-quotes missed by the previous commit.

12 months agognulib-tool.py: Use single-quotes for strings.
Collin Funk [Mon, 8 Apr 2024 23:37:48 +0000 (16:37 -0700)]
gnulib-tool.py: Use single-quotes for strings.

* pygnulib/*.py: Change double-quoted strings to use single-quotes
unless doing so would require adding backslashes.

12 months agognulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'.
Collin Funk [Mon, 8 Apr 2024 23:08:50 +0000 (16:08 -0700)]
gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'.

* pygnulib/*.py: Change occurrences '+= [item]' to use '.append(item)'
where item is a single element added to the list.
See discussion here:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00091.html>

12 months agoptsname_r: Work around ptsname_r bug on NetBSD 10.0.
Bruno Haible [Mon, 8 Apr 2024 23:16:15 +0000 (01:16 +0200)]
ptsname_r: Work around ptsname_r bug on NetBSD 10.0.

* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On NetBSD, arrange to override
ptsname_r.
* lib/ptsname_r.c (ptsname_r): Add workaround for NetBSD bug.
* doc/glibc-functions/ptsname_r.texi: Mention the NetBSD bug.