From owner-svn-src-vendor@freebsd.org Tue Jul 7 07:02:39 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE771357E2B; Tue, 7 Jul 2020 07:02:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1D0H6JFWz498Q; Tue, 7 Jul 2020 07:02:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBC65BADF; Tue, 7 Jul 2020 07:02:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06772d3j025904; Tue, 7 Jul 2020 07:02:39 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06772XFl025873; Tue, 7 Jul 2020 07:02:33 GMT (envelope-from se@FreeBSD.org) Message-Id: <202007070702.06772XFl025873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Tue, 7 Jul 2020 07:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362984 - in vendor/bc/dist: . gen include locales manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests tests/bc tests/bc/errors tests/dc tests/dc/errors X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . gen include locales manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests tests/bc tests/bc/errors tests/dc tests/dc/errors X-SVN-Commit-Revision: 362984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 07:02:40 -0000 Author: se Date: Tue Jul 7 07:02:33 2020 New Revision: 362984 URL: https://svnweb.freebsd.org/changeset/base/362984 Log: Update to release 3.1.1 This release fixes a regression from traditional bc behavior in FreeBSD with regard to "-e quit" being passed on the command line and add Spanish message catalogs. Added: vendor/bc/dist/locales/es_ES.ISO8859-1.msg vendor/bc/dist/locales/es_ES.ISO8859-15.msg (contents, props changed) vendor/bc/dist/manuals/bc/ vendor/bc/dist/manuals/bc.1.md.in (contents, props changed) vendor/bc/dist/manuals/bc/A.1 (contents, props changed) vendor/bc/dist/manuals/bc/A.1.md vendor/bc/dist/manuals/bc/E.1 (contents, props changed) vendor/bc/dist/manuals/bc/E.1.md vendor/bc/dist/manuals/bc/EH.1 (contents, props changed) vendor/bc/dist/manuals/bc/EH.1.md vendor/bc/dist/manuals/bc/EHN.1 (contents, props changed) vendor/bc/dist/manuals/bc/EHN.1.md vendor/bc/dist/manuals/bc/EHNP.1 (contents, props changed) vendor/bc/dist/manuals/bc/EHNP.1.md vendor/bc/dist/manuals/bc/EHP.1 (contents, props changed) vendor/bc/dist/manuals/bc/EHP.1.md vendor/bc/dist/manuals/bc/EN.1 (contents, props changed) vendor/bc/dist/manuals/bc/EN.1.md vendor/bc/dist/manuals/bc/ENP.1 (contents, props changed) vendor/bc/dist/manuals/bc/ENP.1.md vendor/bc/dist/manuals/bc/EP.1 (contents, props changed) vendor/bc/dist/manuals/bc/EP.1.md vendor/bc/dist/manuals/bc/H.1 (contents, props changed) vendor/bc/dist/manuals/bc/H.1.md vendor/bc/dist/manuals/bc/HN.1 (contents, props changed) vendor/bc/dist/manuals/bc/HN.1.md vendor/bc/dist/manuals/bc/HNP.1 (contents, props changed) vendor/bc/dist/manuals/bc/HNP.1.md vendor/bc/dist/manuals/bc/HP.1 (contents, props changed) vendor/bc/dist/manuals/bc/HP.1.md vendor/bc/dist/manuals/bc/N.1 (contents, props changed) vendor/bc/dist/manuals/bc/N.1.md vendor/bc/dist/manuals/bc/NP.1 (contents, props changed) vendor/bc/dist/manuals/bc/NP.1.md vendor/bc/dist/manuals/bc/P.1 (contents, props changed) vendor/bc/dist/manuals/bc/P.1.md vendor/bc/dist/manuals/dc/ vendor/bc/dist/manuals/dc.1.md.in (contents, props changed) vendor/bc/dist/manuals/dc/A.1 (contents, props changed) vendor/bc/dist/manuals/dc/A.1.md vendor/bc/dist/manuals/dc/E.1 (contents, props changed) vendor/bc/dist/manuals/dc/E.1.md vendor/bc/dist/manuals/dc/EH.1 (contents, props changed) vendor/bc/dist/manuals/dc/EH.1.md vendor/bc/dist/manuals/dc/EHN.1 (contents, props changed) vendor/bc/dist/manuals/dc/EHN.1.md vendor/bc/dist/manuals/dc/EHNP.1 (contents, props changed) vendor/bc/dist/manuals/dc/EHNP.1.md vendor/bc/dist/manuals/dc/EHP.1 (contents, props changed) vendor/bc/dist/manuals/dc/EHP.1.md vendor/bc/dist/manuals/dc/EN.1 (contents, props changed) vendor/bc/dist/manuals/dc/EN.1.md vendor/bc/dist/manuals/dc/ENP.1 (contents, props changed) vendor/bc/dist/manuals/dc/ENP.1.md vendor/bc/dist/manuals/dc/EP.1 (contents, props changed) vendor/bc/dist/manuals/dc/EP.1.md vendor/bc/dist/manuals/dc/H.1 (contents, props changed) vendor/bc/dist/manuals/dc/H.1.md vendor/bc/dist/manuals/dc/HN.1 (contents, props changed) vendor/bc/dist/manuals/dc/HN.1.md vendor/bc/dist/manuals/dc/HNP.1 (contents, props changed) vendor/bc/dist/manuals/dc/HNP.1.md vendor/bc/dist/manuals/dc/HP.1 (contents, props changed) vendor/bc/dist/manuals/dc/HP.1.md vendor/bc/dist/manuals/dc/N.1 (contents, props changed) vendor/bc/dist/manuals/dc/N.1.md vendor/bc/dist/manuals/dc/NP.1 (contents, props changed) vendor/bc/dist/manuals/dc/NP.1.md vendor/bc/dist/manuals/dc/P.1 (contents, props changed) vendor/bc/dist/manuals/dc/P.1.md vendor/bc/dist/tests/bc/errors/23.txt (contents, props changed) vendor/bc/dist/tests/bc/errors/24.txt (contents, props changed) vendor/bc/dist/tests/dc/errors/25.txt (contents, props changed) vendor/bc/dist/tests/dc/errors/26.txt (contents, props changed) vendor/bc/dist/tests/dc/errors/27.txt (contents, props changed) vendor/bc/dist/tests/dc/errors/28.txt (contents, props changed) vendor/bc/dist/tests/dc/errors/29.txt (contents, props changed) Deleted: vendor/bc/dist/TODO.md vendor/bc/dist/manuals/bc.1 vendor/bc/dist/manuals/bc.1.ronn vendor/bc/dist/manuals/bc.md vendor/bc/dist/manuals/dc.1 vendor/bc/dist/manuals/dc.1.ronn vendor/bc/dist/manuals/dc.md Modified: vendor/bc/dist/.gitignore vendor/bc/dist/LICENSE.md vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/README.md vendor/bc/dist/configure.sh vendor/bc/dist/functions.sh vendor/bc/dist/gen/bc_help.txt vendor/bc/dist/gen/dc_help.txt vendor/bc/dist/gen/lib.bc vendor/bc/dist/gen/lib2.bc vendor/bc/dist/gen/strgen.c vendor/bc/dist/gen/strgen.sh vendor/bc/dist/include/args.h vendor/bc/dist/include/bc.h vendor/bc/dist/include/dc.h vendor/bc/dist/include/file.h vendor/bc/dist/include/history.h vendor/bc/dist/include/lang.h vendor/bc/dist/include/lex.h vendor/bc/dist/include/num.h vendor/bc/dist/include/opt.h vendor/bc/dist/include/parse.h vendor/bc/dist/include/program.h vendor/bc/dist/include/rand.h vendor/bc/dist/include/read.h vendor/bc/dist/include/status.h vendor/bc/dist/include/vector.h vendor/bc/dist/include/vm.h vendor/bc/dist/install.sh vendor/bc/dist/karatsuba.py vendor/bc/dist/link.sh vendor/bc/dist/locale_install.sh vendor/bc/dist/locale_uninstall.sh vendor/bc/dist/locales/de_DE.ISO8859-1.msg vendor/bc/dist/locales/de_DE.UTF-8.msg vendor/bc/dist/locales/en_US.msg vendor/bc/dist/locales/es_ES.UTF-8.msg vendor/bc/dist/locales/fr_FR.ISO8859-1.msg vendor/bc/dist/locales/fr_FR.UTF-8.msg vendor/bc/dist/locales/ja_JP.UTF-8.msg vendor/bc/dist/locales/ja_JP.eucJP.msg vendor/bc/dist/locales/nl_NL.ISO8859-1.msg vendor/bc/dist/locales/nl_NL.UTF-8.msg vendor/bc/dist/locales/pl_PL.ISO8859-2.msg vendor/bc/dist/locales/pl_PL.UTF-8.msg vendor/bc/dist/locales/pt_PT.ISO8859-1.msg vendor/bc/dist/locales/pt_PT.UTF-8.msg vendor/bc/dist/locales/ru_RU.CP1251.msg vendor/bc/dist/locales/ru_RU.CP866.msg vendor/bc/dist/locales/ru_RU.ISO8859-5.msg vendor/bc/dist/locales/ru_RU.KOI8-R.msg vendor/bc/dist/locales/ru_RU.UTF-8.msg vendor/bc/dist/locales/zh_CN.GB18030.msg vendor/bc/dist/locales/zh_CN.GB2312.msg vendor/bc/dist/locales/zh_CN.GBK.msg vendor/bc/dist/locales/zh_CN.UTF-8.msg vendor/bc/dist/locales/zh_CN.eucCN.msg vendor/bc/dist/manpage.sh vendor/bc/dist/manuals/build.md vendor/bc/dist/release.sh vendor/bc/dist/src/args.c vendor/bc/dist/src/bc/bc.c vendor/bc/dist/src/bc/lex.c vendor/bc/dist/src/bc/parse.c vendor/bc/dist/src/data.c vendor/bc/dist/src/dc/dc.c vendor/bc/dist/src/dc/lex.c vendor/bc/dist/src/dc/parse.c vendor/bc/dist/src/file.c vendor/bc/dist/src/history/history.c vendor/bc/dist/src/lang.c vendor/bc/dist/src/lex.c vendor/bc/dist/src/main.c vendor/bc/dist/src/num.c vendor/bc/dist/src/opt.c vendor/bc/dist/src/parse.c vendor/bc/dist/src/program.c vendor/bc/dist/src/rand/rand.c vendor/bc/dist/src/read.c vendor/bc/dist/src/vector.c vendor/bc/dist/src/vm.c vendor/bc/dist/tests/afl.py vendor/bc/dist/tests/all.sh vendor/bc/dist/tests/bc/misc2.txt vendor/bc/dist/tests/bc/misc2_results.txt vendor/bc/dist/tests/bc/timeconst.sh vendor/bc/dist/tests/dc/stdin.txt vendor/bc/dist/tests/dc/stdin_results.txt vendor/bc/dist/tests/errors.sh vendor/bc/dist/tests/radamsa.sh vendor/bc/dist/tests/randmath.py vendor/bc/dist/tests/read.sh vendor/bc/dist/tests/script.sh vendor/bc/dist/tests/scripts.sh vendor/bc/dist/tests/stdin.sh vendor/bc/dist/tests/test.sh Directory Properties: vendor/bc/dist/ (props changed) vendor/bc/dist/manuals/ (props changed) Modified: vendor/bc/dist/.gitignore ============================================================================== --- vendor/bc/dist/.gitignore Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/.gitignore Tue Jul 7 07:02:33 2020 (r362984) @@ -17,6 +17,12 @@ bc.old .math.txt .results.txt .ops.txt +manuals/bc.1 +manuals/bc.1.ronn +manuals/bc.1.md +manuals/dc.1 +manuals/dc.1.ronn +manuals/dc.1.md gen/strgen lib.c lib2.c Modified: vendor/bc/dist/LICENSE.md ============================================================================== --- vendor/bc/dist/LICENSE.md Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/LICENSE.md Tue Jul 7 07:02:33 2020 (r362984) @@ -2,8 +2,6 @@ Copyright (c) 2018-2020 Gavin D. Howard -All rights reserved. - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -34,8 +32,6 @@ Copyright (c) 2010-2014, Salvatore Sanfilippo
Copyright (c) 2018 rain-1
Copyright (c) 2018-2020, Gavin D. Howard - -All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/Makefile.in Tue Jul 7 07:02:33 2020 (r362984) @@ -1,8 +1,8 @@ # +# SPDX-License-Identifier: BSD-2-Clause +# # Copyright (c) 2018-2020 Gavin D. Howard and contributors. # -# All rights reserved. -# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.0.2 +VERSION = 3.1.1 SRC = %%SRC%% OBJ = %%OBJ%% @@ -105,10 +105,10 @@ DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) MANUALS = manuals BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1 BC_MANPAGE = $(MANUALS)/$(BC).1 -BC_RONN = $(BC_MANPAGE).ronn +BC_MD = $(BC_MANPAGE).md DC_MANPAGE_NAME = $(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX).1 DC_MANPAGE = $(MANUALS)/$(DC).1 -DC_RONN = $(DC_MANPAGE).ronn +DC_MD = $(DC_MANPAGE).md MANPAGE_INSTALL_ARGS = -Dm644 @@ -270,8 +270,8 @@ extra_math: @printf '%s' "$(BC_ENABLE_EXTRA_MATH)" manpages: - $(MANPAGE) $(BC_RONN) $(BC_MANPAGE) - $(MANPAGE) $(DC_RONN) $(DC_MANPAGE) + $(MANPAGE) bc + $(MANPAGE) dc clean_gen: @$(RM) -f $(GEN_EXEC) @@ -295,6 +295,8 @@ clean:%%CLEAN_PREREQS%% clean_config: clean @printf 'Cleaning config...\n' @$(RM) -f Makefile + @$(RM) -f $(BC_MD) $(DC_MD) + @$(RM) -f $(BC_MANPAGE) $(DC_MANPAGE) clean_coverage: @printf 'Cleaning coverage files...\n' Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/NEWS.md Tue Jul 7 07:02:33 2020 (r362984) @@ -1,5 +1,54 @@ # News +## 3.1.1 + +This is a production release that adds two Spanish locales. Users do ***NOT*** +need to upgrade, unless they want those locales. + +## 3.1.0 + +This is a production release that adjusts one behavior, fixes eight bugs, and +improves manpages for FreeBSD. Because this release fixes bugs, **users and +package maintainers should update to this version as soon as possible**. + +The behavior that was adjusted was how code from the `-e` and `-f` arguments +(and equivalents) were executed. They used to be executed as one big chunk, but +in this release, they are now executed line-by-line. + +The first bug fix in how output to `stdout` was handled in `SIGINT`. If a +`SIGINT` came in, the `stdout` buffer was not correctly flushed. In fact, a +clean-up function was not getting called. This release fixes that bug. + +The second bug is in how `dc` handled input from `stdin`. This affected `bc` as +well since it was a mishandling of the `stdin` buffer. + +The third fixed bug was that `bc` and `dc` could `abort()` (in debug mode) when +receiving a `SIGTERM`. This one was a race condition with pushing and popping +items onto and out of vectors. + +The fourth bug fixed was that `bc` could leave extra items on the stack and +thus, not properly clean up some memory. (The memory would still get +`free()`'ed, but it would not be `free()`'ed when it could have been.) + +The next two bugs were bugs in `bc`'s parser that caused crashes when executing +the resulting code. + +The last two bugs were crashes in `dc` that resulted from mishandling of +strings. + +The manpage improvement was done by switching from [ronn][20] to [Pandoc][21] to +generate manpages. Pandoc generates much cleaner manpages and doesn't leave +blank lines where they shouldn't be. + +## 3.0.3 + +This is a production release that adds one new feature: specific manpages. + +Before this release, `bc` and `dc` only used one manpage each that referred to +various build options. This release changes it so there is one manpage set per +relevant build type. Each manual only has information about its particular +build, and `configure.sh` selects the correct set for install. + ## 3.0.2 This is a production release that adds `utf8` locale symlinks and removes an @@ -32,8 +81,9 @@ global ones that are already installed, so it will use running tests during install. **If `bc` segfaults while running arg tests when updating, it is because the global locale files have not been replaced. Make sure to either prevent the test suite from running on update or remove the old -locale files before updating.** Once this is done, `bc` should install without -problems.* +locale files before updating.** (Removing the locale files can be done with +`make uninstall` or by running the `locale_uninstall.sh` script.) Once this is +done, `bc` should install without problems.* *Second, **the option to build without signal support has been removed**. See below for the reasons why.* @@ -811,14 +861,16 @@ not thoroughly tested. [6]: ./configure.sh [7]: https://github.com/rain-1/linenoise-mob [8]: https://github.com/antirez/linenoise -[9]: ./manuals/bc.1.ronn -[10]: ./manuals/dc.1.ronn +[9]: ./manuals/bc/A.1.md +[10]: ./manuals/dc/A.1.md [11]: https://scan.coverity.com/projects/gavinhoward-bc [12]: ./locale_install.sh [13]: ./manuals/build.md [14]: https://github.com/stesser [15]: https://github.com/bugcrazy -[16]: ./manuals/bc.1.ronn#extended-library +[16]: ./manuals/bc/A.1.md#extended-library [17]: https://github.com/skeeto/optparse [18]: https://www.deepl.com/translator [19]: ./manuals/benchmarks.md +[20]: https://github.com/apjanke/ronn-ng +[21]: https://pandoc.org/ Modified: vendor/bc/dist/README.md ============================================================================== --- vendor/bc/dist/README.md Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/README.md Tue Jul 7 07:02:33 2020 (r362984) @@ -11,7 +11,7 @@ This is an implementation of the [POSIX `bc` calculato [GNU `bc`][1] extensions, as well as the period (`.`) extension for the BSD flavor of `bc`. -For more information, see this `bc`'s [full manual][2]. +For more information, see this `bc`'s full manual. This `bc` also includes an implementation of `dc` in the same binary, accessible via a symbolic link, which implements all FreeBSD and GNU extensions. (If a @@ -19,7 +19,7 @@ standalone `dc` binary is desired, `bc` can be copied `!` command is omitted; I believe this poses security concerns and that such functionality is unnecessary. -For more information, see the `dc`'s [full manual][3]. +For more information, see the `dc`'s full manual. This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD 2-clause License. Full license text may be found in the [`LICENSE.md`][4] file. @@ -39,7 +39,7 @@ Systems that are known to work: * OpenBSD * NetBSD * Mac OSX -* Solaris +* Solaris* (as long as the Solaris version supports POSIX 2008) * AIX Please submit bug reports if this `bc` does not build out of the box on any @@ -261,6 +261,10 @@ Other projects based on this bc are: * [toybox `bc`][9]. The maintainer has also made his own changes, so bugs in the toybox `bc` should be reported there. +* [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better + to report bugs there, and the maintainers of the package will contact me if + necessary. + ## Language This `bc` is written in pure ISO C99, using POSIX 2008 APIs. @@ -293,7 +297,7 @@ Files: locale_install.sh A script to install locales, if desired. locale_uninstall.sh A script to uninstall locales. Makefile.in The Makefile template. - manpage.sh Script to generate man pages from ronn files. + manpage.sh Script to generate man pages from markdown files. NOTICE.md List of contributors and copyright owners. RELEASE.md A checklist for making a release (maintainer use only). release.sh A script to test for release (maintainer use only). @@ -309,8 +313,6 @@ Folders: tests All tests. [1]: https://www.gnu.org/software/bc/ -[2]: ./manuals/bc.md -[3]: ./manuals/dc.md [4]: ./LICENSE.md [5]: ./manuals/build.md [6]: https://pkg.musl.cc/bc/ @@ -330,3 +332,4 @@ Folders: [20]: https://git.yzena.com/gavin/bc [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ [22]: https://www.deepl.com/translator +[23]: https://github.com/freebsd/freebsd/tree/master/contrib/bc Modified: vendor/bc/dist/configure.sh ============================================================================== --- vendor/bc/dist/configure.sh Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/configure.sh Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ #! /bin/sh # +# SPDX-License-Identifier: BSD-2-Clause +# # Copyright (c) 2018-2020 Gavin D. Howard and contributors. # -# All rights reserved. -# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # @@ -808,6 +808,28 @@ else fi fi +manpage_args="" + +if [ "$extra_math" -eq 0 ]; then + manpage_args="E" +fi + +if [ "$hist" -eq 0 ]; then + manpage_args="${manpage_args}H" +fi + +if [ "$nls" -eq 0 ]; then + manpage_args="${manpage_args}N" +fi + +if [ "$prompt" -eq 0 ]; then + manpage_args="${manpage_args}P" +fi + +if [ "$manpage_args" = "" ]; then + manpage_args="A" +fi + # Print out the values; this is for debugging. if [ "$bc" -ne 0 ]; then printf 'Building bc\n' @@ -923,5 +945,10 @@ contents=$(replace "$contents" "GEN_EMU" "$GEN_EMU") printf '%s\n' "$contents" > "$scriptdir/Makefile" cd "$scriptdir" + +cp -f manuals/bc/$manpage_args.1.md manuals/bc.1.md +cp -f manuals/bc/$manpage_args.1 manuals/bc.1 +cp -f manuals/dc/$manpage_args.1.md manuals/dc.1.md +cp -f manuals/dc/$manpage_args.1 manuals/dc.1 make clean > /dev/null Modified: vendor/bc/dist/functions.sh ============================================================================== --- vendor/bc/dist/functions.sh Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/functions.sh Tue Jul 7 07:02:33 2020 (r362984) @@ -1,8 +1,8 @@ #! /bin/sh # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# SPDX-License-Identifier: BSD-2-Clause # -# All rights reserved. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/gen/bc_help.txt ============================================================================== --- vendor/bc/dist/gen/bc_help.txt Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/gen/bc_help.txt Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -58,6 +58,8 @@ This bc has three differences to the GNU bc: 3) This bc has many more extensions than the GNU bc does. For details, see the man page. +This bc also implements the dot (.) extension of the BSD bc. + Options: -e expr --expression=expr @@ -93,6 +95,9 @@ Options: l(expr) = natural log of expr e(expr) = raises e to the power of expr j(n, x) = Bessel function of integer order n of x + + This bc may load more functions with these options. See the manpage for + details. -P --no-prompt Modified: vendor/bc/dist/gen/dc_help.txt ============================================================================== --- vendor/bc/dist/gen/dc_help.txt Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/gen/dc_help.txt Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/gen/lib.bc ============================================================================== --- vendor/bc/dist/gen/lib.bc Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/gen/lib.bc Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/gen/lib2.bc ============================================================================== --- vendor/bc/dist/gen/lib2.bc Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/gen/lib2.bc Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/gen/strgen.c ============================================================================== --- vendor/bc/dist/gen/strgen.c Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/gen/strgen.c Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/gen/strgen.sh ============================================================================== --- vendor/bc/dist/gen/strgen.sh Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/gen/strgen.sh Tue Jul 7 07:02:33 2020 (r362984) @@ -1,8 +1,8 @@ #! /bin/sh # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# SPDX-License-Identifier: BSD-2-Clause # -# All rights reserved. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/include/args.h ============================================================================== --- vendor/bc/dist/include/args.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/args.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/include/bc.h ============================================================================== --- vendor/bc/dist/include/bc.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/bc.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -130,13 +130,13 @@ void bc_lex_token(BcLex *l); #define BC_PARSE_LEAF(prev, bin_last, rparen) \ (!(bin_last) && ((rparen) || bc_parse_inst_isLeaf(prev))) -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND #define BC_PARSE_INST_VAR(t) \ ((t) >= BC_INST_VAR && (t) <= BC_INST_SEED && (t) != BC_INST_ARRAY) -#else // BC_ENABLE_EXTRA_MATH +#else // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND #define BC_PARSE_INST_VAR(t) \ ((t) >= BC_INST_VAR && (t) <= BC_INST_SCALE && (t) != BC_INST_ARRAY) -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND #define BC_PARSE_PREV_PREFIX(p) \ ((p) >= BC_INST_NEG && (p) <= BC_INST_BOOL_NOT) Modified: vendor/bc/dist/include/dc.h ============================================================================== --- vendor/bc/dist/include/dc.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/dc.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -35,10 +35,6 @@ #ifndef BC_DC_H #define BC_DC_H - -#ifndef DC_ENABLE_RAND -#define DC_ENABLE_RAND (1) -#endif // DC_ENABLE_RAND #if DC_ENABLED Modified: vendor/bc/dist/include/file.h ============================================================================== --- vendor/bc/dist/include/file.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/file.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/include/history.h ============================================================================== --- vendor/bc/dist/include/history.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/history.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -46,8 +46,6 @@ * * Copyright (c) 2010-2016, Salvatore Sanfilippo * Copyright (c) 2010-2013, Pieter Noordhuis - * - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are Modified: vendor/bc/dist/include/lang.h ============================================================================== --- vendor/bc/dist/include/lang.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/lang.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -129,6 +129,7 @@ typedef enum BcInst { BC_INST_ARRAY, #endif // BC_ENABLED + BC_INST_ZERO, BC_INST_ONE, #if BC_ENABLED @@ -137,26 +138,26 @@ typedef enum BcInst { BC_INST_IBASE, BC_INST_OBASE, BC_INST_SCALE, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_SEED, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_LENGTH, BC_INST_SCALE_FUNC, BC_INST_SQRT, BC_INST_ABS, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_IRAND, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_READ, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_RAND, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_MAXIBASE, BC_INST_MAXOBASE, BC_INST_MAXSCALE, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_MAXRAND, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_INST_PRINT, BC_INST_PRINT_POP, @@ -252,9 +253,9 @@ typedef enum BcResultType { BC_RESULT_STR, - BC_RESULT_CONSTANT, BC_RESULT_TEMP, + BC_RESULT_ZERO, BC_RESULT_ONE, #if BC_ENABLED Modified: vendor/bc/dist/include/lex.h ============================================================================== --- vendor/bc/dist/include/lex.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/lex.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -46,8 +46,23 @@ #define bc_lex_err(l, e) (bc_vm_error((e), (l)->line)) #define bc_lex_verr(l, e, ...) (bc_vm_error((e), (l)->line, __VA_ARGS__)) +#if BC_ENABLED + +#if DC_ENABLED #define BC_LEX_NEG_CHAR (BC_IS_BC ? '-' : '_') #define BC_LEX_LAST_NUM_CHAR (BC_IS_BC ? 'Z' : 'F') +#else // DC_ENABLED +#define BC_LEX_NEG_CHAR ('-') +#define BC_LEX_LAST_NUM_CHAR ('Z') +#endif // DC_ENABLED + +#else // BC_ENABLED + +#define BC_LEX_NEG_CHAR ('_') +#define BC_LEX_LAST_NUM_CHAR ('F') + +#endif // BC_ENABLED + #define BC_LEX_NUM_CHAR(c, pt, int_only) \ (isdigit(c) || ((c) >= 'A' && (c) <= BC_LEX_LAST_NUM_CHAR) || \ ((c) == '.' && !(pt) && !(int_only))) @@ -142,27 +157,27 @@ typedef enum BcLexType { BC_LEX_KW_IBASE, BC_LEX_KW_OBASE, BC_LEX_KW_SCALE, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_SEED, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_LENGTH, BC_LEX_KW_PRINT, BC_LEX_KW_SQRT, BC_LEX_KW_ABS, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_IRAND, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_QUIT, BC_LEX_KW_READ, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_RAND, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_MAXIBASE, BC_LEX_KW_MAXOBASE, BC_LEX_KW_MAXSCALE, -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_MAXRAND, -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BC_LEX_KW_ELSE, #if DC_ENABLED Modified: vendor/bc/dist/include/num.h ============================================================================== --- vendor/bc/dist/include/num.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/num.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -110,8 +110,16 @@ typedef struct BcNum { } BcNum; #if BC_ENABLE_EXTRA_MATH + +#ifndef BC_ENABLE_RAND +#define BC_ENABLE_RAND (1) +#endif // BC_ENABLE_RAND + +#if BC_ENABLE_RAND // Forward declaration struct BcRNG; +#endif // BC_ENABLE_RAND + #endif // BC_ENABLE_EXTRA_MATH #define BC_NUM_MIN_BASE (BC_NUM_BIGDIG_C(2)) @@ -173,12 +181,12 @@ void bc_num_bigdig(const BcNum *restrict n, BcBigDig * void bc_num_bigdig2(const BcNum *restrict n, BcBigDig *result); void bc_num_bigdig2num(BcNum *restrict n, BcBigDig val); -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND void bc_num_irand(const BcNum *restrict a, BcNum *restrict b, struct BcRNG *restrict rng); void bc_num_rng(const BcNum *restrict n, struct BcRNG *rng); void bc_num_createFromRNG(BcNum *restrict n, struct BcRNG *rng); -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND void bc_num_add(BcNum *a, BcNum *b, BcNum *c, size_t scale); void bc_num_sub(BcNum *a, BcNum *b, BcNum *c, size_t scale); Modified: vendor/bc/dist/include/opt.h ============================================================================== --- vendor/bc/dist/include/opt.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/opt.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/include/parse.h ============================================================================== --- vendor/bc/dist/include/parse.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/parse.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -110,6 +110,7 @@ void bc_parse_updateFunc(BcParse *p, size_t fidx); void bc_parse_pushName(const BcParse* p, char *name, bool var); void bc_parse_text(BcParse *p, const char *text); +extern const char bc_parse_zero[]; extern const char bc_parse_one[]; #endif // BC_PARSE_H Modified: vendor/bc/dist/include/program.h ============================================================================== --- vendor/bc/dist/include/program.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/program.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -61,9 +61,9 @@ typedef struct BcProgram { BcBigDig globals[BC_PROG_GLOBALS_LEN]; BcVec globals_v[BC_PROG_GLOBALS_LEN]; -#if BC_ENABLE_EXTRA_MATH +#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BcRNG rng; -#endif // BC_ENABLE_EXTRA_MATH +#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND BcVec results; BcVec stack; @@ -81,12 +81,15 @@ typedef struct BcProgram { BcVec arr_map; #if DC_ENABLED + BcVec strs_v; + BcVec tail_calls; BcBigDig strm; BcNum strmb; #endif // DC_ENABLED + BcNum zero; BcNum one; #if BC_ENABLED @@ -99,6 +102,7 @@ typedef struct BcProgram { BcDig strmb_num[BC_NUM_BIGDIG_LOG10]; #endif // DC_ENABLED + BcDig zero_num[BC_PROG_ONE_CAP]; BcDig one_num[BC_PROG_ONE_CAP]; } BcProgram; Modified: vendor/bc/dist/include/rand.h ============================================================================== --- vendor/bc/dist/include/rand.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/rand.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2019 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -69,14 +69,16 @@ #ifndef BC_RAND_H #define BC_RAND_H -#if BC_ENABLE_EXTRA_MATH - #include #include #include #include +#if BC_ENABLE_EXTRA_MATH + +#if BC_ENABLE_RAND + typedef ulong (*BcRandUlong)(void*); #if BC_LONG_BIT >= 64 @@ -223,6 +225,8 @@ void bc_rand_pop(BcRNG *r, bool reset); void bc_rand_getRands(BcRNG *r, BcRand *s1, BcRand *s2, BcRand *i1, BcRand *i2); extern const BcRandState bc_rand_multiplier; + +#endif // BC_ENABLE_RAND #endif // BC_ENABLE_EXTRA_MATH Modified: vendor/bc/dist/include/read.h ============================================================================== --- vendor/bc/dist/include/read.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/read.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -33,8 +33,8 @@ * */ -#ifndef BC_IO_H -#define BC_IO_H +#ifndef BC_READ_H +#define BC_READ_H #include @@ -55,5 +55,6 @@ BcStatus bc_read_line(BcVec *vec, const char *prompt); void bc_read_file(const char *path, char **buf); BcStatus bc_read_chars(BcVec *vec, const char *prompt); +bool bc_read_buf(BcVec *vec, char *buf, size_t *buf_len); -#endif // BC_IO_H +#endif // BC_READ_H Modified: vendor/bc/dist/include/status.h ============================================================================== --- vendor/bc/dist/include/status.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/status.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/include/vector.h ============================================================================== --- vendor/bc/dist/include/vector.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/vector.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: vendor/bc/dist/include/vm.h ============================================================================== --- vendor/bc/dist/include/vm.h Tue Jul 7 06:04:21 2020 (r362983) +++ vendor/bc/dist/include/vm.h Tue Jul 7 07:02:33 2020 (r362984) @@ -1,10 +1,10 @@ /* * ***************************************************************************** * + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -91,28 +91,64 @@ #define isatty _isatty #endif // _WIN32 +#if DC_ENABLED #define DC_FLAG_X (UINTMAX_C(1)<<0) +#endif // DC_ENABLED + +#if BC_ENABLED #define BC_FLAG_W (UINTMAX_C(1)<<1) #define BC_FLAG_S (UINTMAX_C(1)<<2) -#define BC_FLAG_Q (UINTMAX_C(1)<<3) -#define BC_FLAG_L (UINTMAX_C(1)<<4) -#define BC_FLAG_I (UINTMAX_C(1)<<5) -#define BC_FLAG_G (UINTMAX_C(1)<<6) +#define BC_FLAG_L (UINTMAX_C(1)<<3) +#define BC_FLAG_G (UINTMAX_C(1)<<4) +#endif // BC_ENABLED + +#define BC_FLAG_Q (UINTMAX_C(1)<<5) +#define BC_FLAG_I (UINTMAX_C(1)<<6) #define BC_FLAG_P (UINTMAX_C(1)<<7) #define BC_FLAG_TTYIN (UINTMAX_C(1)<<8) #define BC_FLAG_TTY (UINTMAX_C(1)<<9) #define BC_TTYIN (vm.flags & BC_FLAG_TTYIN) #define BC_TTY (vm.flags & BC_FLAG_TTY) +#if BC_ENABLED + #define BC_S (BC_ENABLED && (vm.flags & BC_FLAG_S)) #define BC_W (BC_ENABLED && (vm.flags & BC_FLAG_W)) #define BC_L (BC_ENABLED && (vm.flags & BC_FLAG_L)) -#define BC_I (vm.flags & BC_FLAG_I) #define BC_G (BC_ENABLED && (vm.flags & BC_FLAG_G)) -#define DC_X (DC_ENABLED && (vm.flags & DC_FLAG_X)) + +#endif // BC_ENABLED + +#if DC_ENABLED +#define DC_X (vm.flags & DC_FLAG_X) +#endif // DC_ENABLED + +#define BC_I (vm.flags & BC_FLAG_I) #define BC_P (vm.flags & BC_FLAG_P) +#if BC_ENABLED + +#define BC_IS_POSIX (BC_S || BC_W) + +#if DC_ENABLED +#define BC_IS_BC (vm.name[0] != 'd') +#define BC_IS_DC (vm.name[0] == 'd') +#else // DC_ENABLED +#define BC_IS_BC (1) +#define BC_IS_DC (0) +#endif // DC_ENABLED + +#else // BC_ENABLED +#define BC_IS_POSIX (0) +#define BC_IS_BC (0) +#define BC_IS_DC (1) +#endif // BC_ENABLED + +#if BC_ENABLED #define BC_USE_PROMPT (!BC_P && BC_TTY && !BC_IS_POSIX) +#else // BC_ENABLED +#define BC_USE_PROMPT (!BC_P && BC_TTY) +#endif // BC_ENABLED #define BC_MAX(a, b) ((a) > (b) ? (a) : (b)) #define BC_MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -131,9 +167,6 @@ #define BC_MAX_EXP ((ulong) (BC_NUM_BIGDIG_MAX)) #define BC_MAX_VARS ((ulong) (SIZE_MAX - 1)) -#define BC_IS_BC (BC_ENABLED && (!DC_ENABLED || vm.name[0] != 'd')) -#define BC_IS_POSIX (BC_S || BC_W) - #if BC_DEBUG_CODE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue Jul 7 07:05:45 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 804EA358095; Tue, 7 Jul 2020 07:05:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1D3s2rt1z496Y; Tue, 7 Jul 2020 07:05:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 271FBB9B7; Tue, 7 Jul 2020 07:05:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06775i97026079; Tue, 7 Jul 2020 07:05:44 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06775iIN026078; Tue, 7 Jul 2020 07:05:44 GMT (envelope-from se@FreeBSD.org) Message-Id: <202007070705.06775iIN026078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Tue, 7 Jul 2020 07:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362985 - vendor/bc/3.1.1 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.1 X-SVN-Commit-Revision: 362985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 07:05:45 -0000 Author: se Date: Tue Jul 7 07:05:44 2020 New Revision: 362985 URL: https://svnweb.freebsd.org/changeset/base/362985 Log: Tag release 3.1.1 Added: vendor/bc/3.1.1/ - copied from r362984, vendor/bc/dist/ From owner-svn-src-vendor@freebsd.org Tue Jul 7 07:32:16 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6665E357EEF; Tue, 7 Jul 2020 07:32:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1DfS2RJRz4BRF; Tue, 7 Jul 2020 07:32:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36B2DBF1F; Tue, 7 Jul 2020 07:32:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0677WGoo044293; Tue, 7 Jul 2020 07:32:16 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0677WGxa044292; Tue, 7 Jul 2020 07:32:16 GMT (envelope-from se@FreeBSD.org) Message-Id: <202007070732.0677WGxa044292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Tue, 7 Jul 2020 07:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362986 - in vendor/bc: 3.0.2 3.0.2/gen 3.0.2/tests 3.0.2/tests/dc 3.0.2/tests/dc/errors 3.0.2/tests/dc/scripts 3.1.1 3.1.1/gen 3.1.1/manuals 3.1.1/manuals/bc 3.1.1/manuals/dc 3.1.1/tes... X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc: 3.0.2 3.0.2/gen 3.0.2/tests 3.0.2/tests/dc 3.0.2/tests/dc/errors 3.0.2/tests/dc/scripts 3.1.1 3.1.1/gen 3.1.1/manuals 3.1.1/manuals/bc 3.1.1/manuals/dc 3.1.1/tests 3.1.1/tests/bc/errors ... X-SVN-Commit-Revision: 362986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 07:32:16 -0000 Author: se Date: Tue Jul 7 07:32:15 2020 New Revision: 362986 URL: https://svnweb.freebsd.org/changeset/base/362986 Log: Disable keyword expansion. No actual change since there are no keywords to expand in the sources. Modified: Directory Properties: vendor/bc/3.0.2/gen/bc_help.txt (props changed) vendor/bc/3.0.2/gen/dc_help.txt (props changed) vendor/bc/3.0.2/gen/strgen.c (props changed) vendor/bc/3.0.2/gen/strgen.sh (props changed) vendor/bc/3.0.2/install.sh (props changed) vendor/bc/3.0.2/karatsuba.py (props changed) vendor/bc/3.0.2/link.sh (props changed) vendor/bc/3.0.2/tests/afl.py (props changed) vendor/bc/3.0.2/tests/dc/abs_results.txt (props changed) vendor/bc/3.0.2/tests/dc/add_results.txt (props changed) vendor/bc/3.0.2/tests/dc/decimal_results.txt (props changed) vendor/bc/3.0.2/tests/dc/divmod.txt (props changed) vendor/bc/3.0.2/tests/dc/engineering.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/01.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/02.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/03.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/04.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/05.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/06.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/07.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/08.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/09.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/10.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/11.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/12.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/13.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/14.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/15.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/16.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/17.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/18.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/20.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/21.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/22.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/23.txt (props changed) vendor/bc/3.0.2/tests/dc/errors/24.txt (props changed) vendor/bc/3.0.2/tests/dc/misc.txt (props changed) vendor/bc/3.0.2/tests/dc/modexp.txt (props changed) vendor/bc/3.0.2/tests/dc/modulus_results.txt (props changed) vendor/bc/3.0.2/tests/dc/negate_results.txt (props changed) vendor/bc/3.0.2/tests/dc/power_results.txt (props changed) vendor/bc/3.0.2/tests/dc/rand.txt (props changed) vendor/bc/3.0.2/tests/dc/scientific.txt (props changed) vendor/bc/3.0.2/tests/dc/scientific_results.txt (props changed) vendor/bc/3.0.2/tests/dc/scripts/array.txt (props changed) vendor/bc/3.0.2/tests/dc/scripts/else.txt (props changed) vendor/bc/3.0.2/tests/dc/scripts/factorial.txt (props changed) vendor/bc/3.0.2/tests/dc/scripts/loop.txt (props changed) vendor/bc/3.0.2/tests/dc/scripts/weird.txt (props changed) vendor/bc/3.0.2/tests/dc/sqrt.txt (props changed) vendor/bc/3.0.2/tests/dc/stdin.txt (props changed) vendor/bc/3.0.2/tests/dc/strings.txt (props changed) vendor/bc/3.0.2/tests/dc/subtract.txt (props changed) vendor/bc/3.0.2/tests/dc/trunc_results.txt (props changed) vendor/bc/3.0.2/tests/test.sh (props changed) vendor/bc/3.1.1/gen/bc_help.txt (props changed) vendor/bc/3.1.1/gen/dc_help.txt (props changed) vendor/bc/3.1.1/gen/strgen.c (props changed) vendor/bc/3.1.1/gen/strgen.sh (props changed) vendor/bc/3.1.1/install.sh (props changed) vendor/bc/3.1.1/karatsuba.py (props changed) vendor/bc/3.1.1/link.sh (props changed) vendor/bc/3.1.1/manuals/bc.1.md.in (props changed) vendor/bc/3.1.1/manuals/bc/A.1 (props changed) vendor/bc/3.1.1/manuals/bc/E.1 (props changed) vendor/bc/3.1.1/manuals/bc/EH.1 (props changed) vendor/bc/3.1.1/manuals/bc/EHN.1 (props changed) vendor/bc/3.1.1/manuals/bc/EHNP.1 (props changed) vendor/bc/3.1.1/manuals/bc/EHP.1 (props changed) vendor/bc/3.1.1/manuals/bc/EN.1 (props changed) vendor/bc/3.1.1/manuals/bc/ENP.1 (props changed) vendor/bc/3.1.1/manuals/bc/EP.1 (props changed) vendor/bc/3.1.1/manuals/bc/H.1 (props changed) vendor/bc/3.1.1/manuals/bc/HN.1 (props changed) vendor/bc/3.1.1/manuals/bc/HNP.1 (props changed) vendor/bc/3.1.1/manuals/bc/HP.1 (props changed) vendor/bc/3.1.1/manuals/bc/N.1 (props changed) vendor/bc/3.1.1/manuals/bc/NP.1 (props changed) vendor/bc/3.1.1/manuals/bc/P.1 (props changed) vendor/bc/3.1.1/manuals/dc.1.md.in (props changed) vendor/bc/3.1.1/manuals/dc/A.1 (props changed) vendor/bc/3.1.1/manuals/dc/E.1 (props changed) vendor/bc/3.1.1/manuals/dc/EH.1 (props changed) vendor/bc/3.1.1/manuals/dc/EHN.1 (props changed) vendor/bc/3.1.1/manuals/dc/EHNP.1 (props changed) vendor/bc/3.1.1/manuals/dc/EHP.1 (props changed) vendor/bc/3.1.1/manuals/dc/EN.1 (props changed) vendor/bc/3.1.1/manuals/dc/ENP.1 (props changed) vendor/bc/3.1.1/manuals/dc/EP.1 (props changed) vendor/bc/3.1.1/manuals/dc/H.1 (props changed) vendor/bc/3.1.1/manuals/dc/HN.1 (props changed) vendor/bc/3.1.1/manuals/dc/HNP.1 (props changed) vendor/bc/3.1.1/manuals/dc/HP.1 (props changed) vendor/bc/3.1.1/manuals/dc/N.1 (props changed) vendor/bc/3.1.1/manuals/dc/NP.1 (props changed) vendor/bc/3.1.1/manuals/dc/P.1 (props changed) vendor/bc/3.1.1/tests/afl.py (props changed) vendor/bc/3.1.1/tests/bc/errors/23.txt (props changed) vendor/bc/3.1.1/tests/bc/errors/24.txt (props changed) vendor/bc/3.1.1/tests/dc/abs_results.txt (props changed) vendor/bc/3.1.1/tests/dc/add_results.txt (props changed) vendor/bc/3.1.1/tests/dc/decimal_results.txt (props changed) vendor/bc/3.1.1/tests/dc/divmod.txt (props changed) vendor/bc/3.1.1/tests/dc/engineering.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/01.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/02.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/03.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/04.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/05.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/06.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/07.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/08.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/09.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/10.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/11.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/12.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/13.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/14.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/15.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/16.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/17.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/18.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/20.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/21.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/22.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/23.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/24.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/25.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/26.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/27.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/28.txt (props changed) vendor/bc/3.1.1/tests/dc/errors/29.txt (props changed) vendor/bc/3.1.1/tests/dc/misc.txt (props changed) vendor/bc/3.1.1/tests/dc/modexp.txt (props changed) vendor/bc/3.1.1/tests/dc/modulus_results.txt (props changed) vendor/bc/3.1.1/tests/dc/negate_results.txt (props changed) vendor/bc/3.1.1/tests/dc/power_results.txt (props changed) vendor/bc/3.1.1/tests/dc/rand.txt (props changed) vendor/bc/3.1.1/tests/dc/scientific.txt (props changed) vendor/bc/3.1.1/tests/dc/scientific_results.txt (props changed) vendor/bc/3.1.1/tests/dc/scripts/array.txt (props changed) vendor/bc/3.1.1/tests/dc/scripts/else.txt (props changed) vendor/bc/3.1.1/tests/dc/scripts/factorial.txt (props changed) vendor/bc/3.1.1/tests/dc/scripts/loop.txt (props changed) vendor/bc/3.1.1/tests/dc/scripts/weird.txt (props changed) vendor/bc/3.1.1/tests/dc/sqrt.txt (props changed) vendor/bc/3.1.1/tests/dc/stdin.txt (props changed) vendor/bc/3.1.1/tests/dc/strings.txt (props changed) vendor/bc/3.1.1/tests/dc/subtract.txt (props changed) vendor/bc/3.1.1/tests/dc/trunc_results.txt (props changed) vendor/bc/3.1.1/tests/test.sh (props changed) vendor/bc/dist/gen/bc_help.txt (props changed) vendor/bc/dist/gen/dc_help.txt (props changed) vendor/bc/dist/gen/strgen.c (props changed) vendor/bc/dist/gen/strgen.sh (props changed) vendor/bc/dist/install.sh (props changed) vendor/bc/dist/karatsuba.py (props changed) vendor/bc/dist/link.sh (props changed) vendor/bc/dist/manuals/bc.1.md.in (props changed) vendor/bc/dist/manuals/bc/A.1 (props changed) vendor/bc/dist/manuals/bc/E.1 (props changed) vendor/bc/dist/manuals/bc/EH.1 (props changed) vendor/bc/dist/manuals/bc/EHN.1 (props changed) vendor/bc/dist/manuals/bc/EHNP.1 (props changed) vendor/bc/dist/manuals/bc/EHP.1 (props changed) vendor/bc/dist/manuals/bc/EN.1 (props changed) vendor/bc/dist/manuals/bc/ENP.1 (props changed) vendor/bc/dist/manuals/bc/EP.1 (props changed) vendor/bc/dist/manuals/bc/H.1 (props changed) vendor/bc/dist/manuals/bc/HN.1 (props changed) vendor/bc/dist/manuals/bc/HNP.1 (props changed) vendor/bc/dist/manuals/bc/HP.1 (props changed) vendor/bc/dist/manuals/bc/N.1 (props changed) vendor/bc/dist/manuals/bc/NP.1 (props changed) vendor/bc/dist/manuals/bc/P.1 (props changed) vendor/bc/dist/manuals/dc.1.md.in (props changed) vendor/bc/dist/manuals/dc/A.1 (props changed) vendor/bc/dist/manuals/dc/E.1 (props changed) vendor/bc/dist/manuals/dc/EH.1 (props changed) vendor/bc/dist/manuals/dc/EHN.1 (props changed) vendor/bc/dist/manuals/dc/EHNP.1 (props changed) vendor/bc/dist/manuals/dc/EHP.1 (props changed) vendor/bc/dist/manuals/dc/EN.1 (props changed) vendor/bc/dist/manuals/dc/ENP.1 (props changed) vendor/bc/dist/manuals/dc/EP.1 (props changed) vendor/bc/dist/manuals/dc/H.1 (props changed) vendor/bc/dist/manuals/dc/HN.1 (props changed) vendor/bc/dist/manuals/dc/HNP.1 (props changed) vendor/bc/dist/manuals/dc/HP.1 (props changed) vendor/bc/dist/manuals/dc/N.1 (props changed) vendor/bc/dist/manuals/dc/NP.1 (props changed) vendor/bc/dist/manuals/dc/P.1 (props changed) vendor/bc/dist/tests/afl.py (props changed) vendor/bc/dist/tests/bc/errors/23.txt (props changed) vendor/bc/dist/tests/bc/errors/24.txt (props changed) vendor/bc/dist/tests/dc/abs_results.txt (props changed) vendor/bc/dist/tests/dc/add_results.txt (props changed) vendor/bc/dist/tests/dc/decimal_results.txt (props changed) vendor/bc/dist/tests/dc/divmod.txt (props changed) vendor/bc/dist/tests/dc/engineering.txt (props changed) vendor/bc/dist/tests/dc/errors/01.txt (props changed) vendor/bc/dist/tests/dc/errors/02.txt (props changed) vendor/bc/dist/tests/dc/errors/03.txt (props changed) vendor/bc/dist/tests/dc/errors/04.txt (props changed) vendor/bc/dist/tests/dc/errors/05.txt (props changed) vendor/bc/dist/tests/dc/errors/06.txt (props changed) vendor/bc/dist/tests/dc/errors/07.txt (props changed) vendor/bc/dist/tests/dc/errors/08.txt (props changed) vendor/bc/dist/tests/dc/errors/09.txt (props changed) vendor/bc/dist/tests/dc/errors/10.txt (props changed) vendor/bc/dist/tests/dc/errors/11.txt (props changed) vendor/bc/dist/tests/dc/errors/12.txt (props changed) vendor/bc/dist/tests/dc/errors/13.txt (props changed) vendor/bc/dist/tests/dc/errors/14.txt (props changed) vendor/bc/dist/tests/dc/errors/15.txt (props changed) vendor/bc/dist/tests/dc/errors/16.txt (props changed) vendor/bc/dist/tests/dc/errors/17.txt (props changed) vendor/bc/dist/tests/dc/errors/18.txt (props changed) vendor/bc/dist/tests/dc/errors/20.txt (props changed) vendor/bc/dist/tests/dc/errors/21.txt (props changed) vendor/bc/dist/tests/dc/errors/22.txt (props changed) vendor/bc/dist/tests/dc/errors/23.txt (props changed) vendor/bc/dist/tests/dc/errors/24.txt (props changed) vendor/bc/dist/tests/dc/errors/25.txt (props changed) vendor/bc/dist/tests/dc/errors/26.txt (props changed) vendor/bc/dist/tests/dc/errors/27.txt (props changed) vendor/bc/dist/tests/dc/errors/28.txt (props changed) vendor/bc/dist/tests/dc/errors/29.txt (props changed) vendor/bc/dist/tests/dc/misc.txt (props changed) vendor/bc/dist/tests/dc/modexp.txt (props changed) vendor/bc/dist/tests/dc/modulus_results.txt (props changed) vendor/bc/dist/tests/dc/negate_results.txt (props changed) vendor/bc/dist/tests/dc/power_results.txt (props changed) vendor/bc/dist/tests/dc/rand.txt (props changed) vendor/bc/dist/tests/dc/scientific.txt (props changed) vendor/bc/dist/tests/dc/scientific_results.txt (props changed) vendor/bc/dist/tests/dc/scripts/array.txt (props changed) vendor/bc/dist/tests/dc/scripts/else.txt (props changed) vendor/bc/dist/tests/dc/scripts/factorial.txt (props changed) vendor/bc/dist/tests/dc/scripts/loop.txt (props changed) vendor/bc/dist/tests/dc/scripts/weird.txt (props changed) vendor/bc/dist/tests/dc/sqrt.txt (props changed) vendor/bc/dist/tests/dc/stdin.txt (props changed) vendor/bc/dist/tests/dc/strings.txt (props changed) vendor/bc/dist/tests/dc/subtract.txt (props changed) vendor/bc/dist/tests/dc/trunc_results.txt (props changed) vendor/bc/dist/tests/test.sh (props changed) From owner-svn-src-vendor@freebsd.org Tue Jul 7 13:48:43 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7828936363D; Tue, 7 Jul 2020 13:48:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1P0q2w9kz4cdC; Tue, 7 Jul 2020 13:48:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45A0C104E9; Tue, 7 Jul 2020 13:48:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 067Dmh6g075189; Tue, 7 Jul 2020 13:48:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 067DmQ5Z075175; Tue, 7 Jul 2020 13:48:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007071348.067DmQ5Z075175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 7 Jul 2020 13:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362990 - in vendor/sqlite3/dist: . tea X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor/sqlite3/dist: . tea X-SVN-Commit-Revision: 362990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 13:48:43 -0000 Author: cy Date: Tue Jul 7 13:48:26 2020 New Revision: 362990 URL: https://svnweb.freebsd.org/changeset/base/362990 Log: Import sqlite 3.32.3 (3320300). Modified: vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/tea/configure vendor/sqlite3/dist/tea/configure.ac Modified: vendor/sqlite3/dist/configure ============================================================================== --- vendor/sqlite3/dist/configure Tue Jul 7 12:24:40 2020 (r362989) +++ vendor/sqlite3/dist/configure Tue Jul 7 13:48:26 2020 (r362990) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.3. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.32.2' -PACKAGE_STRING='sqlite 3.32.2' +PACKAGE_VERSION='3.32.3' +PACKAGE_STRING='sqlite 3.32.3' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.32.2:";; + short | recursive ) echo "Configuration of sqlite 3.32.3:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.32.2 +sqlite configure 3.32.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.32.2, which was +It was created by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.32.2' + VERSION='3.32.3' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.32.2, which was +This file was extended by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.32.2 +sqlite config.status 3.32.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/sqlite3/dist/configure.ac ============================================================================== --- vendor/sqlite3/dist/configure.ac Tue Jul 7 12:24:40 2020 (r362989) +++ vendor/sqlite3/dist/configure.ac Tue Jul 7 13:48:26 2020 (r362990) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.32.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.32.3, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: vendor/sqlite3/dist/sqlite3.c ============================================================================== --- vendor/sqlite3/dist/sqlite3.c Tue Jul 7 12:24:40 2020 (r362989) +++ vendor/sqlite3/dist/sqlite3.c Tue Jul 7 13:48:26 2020 (r362990) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.32.2. By combining all the individual C code files into this +** version 3.32.3. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.32.2" -#define SQLITE_VERSION_NUMBER 3032002 -#define SQLITE_SOURCE_ID "2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e86861e8c" +#define SQLITE_VERSION "3.32.3" +#define SQLITE_VERSION_NUMBER 3032003 +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -17863,11 +17863,11 @@ struct AggInfo { ExprList *pGroupBy; /* The group by clause */ struct AggInfo_col { /* For each column used in source tables */ Table *pTab; /* Source table */ + Expr *pExpr; /* The original expression */ int iTable; /* Cursor number of the source table */ - int iColumn; /* Column number within the source table */ - int iSorterColumn; /* Column number in the sorting index */ int iMem; /* Memory location that acts as accumulator */ - Expr *pExpr; /* The original expression */ + i16 iColumn; /* Column number within the source table */ + i16 iSorterColumn; /* Column number in the sorting index */ } *aCol; int nColumn; /* Number of used entries in aCol[] */ int nAccumulator; /* Number of columns that show through to the output. @@ -17880,9 +17880,18 @@ struct AggInfo { int iDistinct; /* Ephemeral table used to enforce DISTINCT */ } *aFunc; int nFunc; /* Number of entries in aFunc[] */ +#ifdef SQLITE_DEBUG + int iAggMagic; /* Magic number when valid */ +#endif + AggInfo *pNext; /* Next in list of them all */ }; /* +** Value for AggInfo.iAggMagic when the structure is valid +*/ +#define AggInfoMagic 0x2059e99e + +/* ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater ** than 32767 we have to make it 32-bit. 16-bit is preferred because @@ -18462,6 +18471,7 @@ struct Select { #define SF_WhereBegin 0x0080000 /* Really a WhereBegin() call. Debug Only */ #define SF_WinRewrite 0x0100000 /* Window function rewrite accomplished */ #define SF_View 0x0200000 /* SELECT statement is a view */ +#define SF_NoopOrderBy 0x0400000 /* ORDER BY is ignored for this query */ /* ** The results of a SELECT can be distributed in several ways, as defined @@ -18678,6 +18688,7 @@ struct Parse { Parse *pToplevel; /* Parse structure for main program (or NULL) */ Table *pTriggerTab; /* Table triggers are being coded for */ Parse *pParentParse; /* Parent parser if this parser is nested */ + AggInfo *pAggList; /* List of all AggInfo objects */ int addrCrTab; /* Address of OP_CreateBtree opcode on CREATE TABLE */ u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */ u32 oldmask; /* Mask of old.* columns referenced */ @@ -19644,6 +19655,7 @@ SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr*, Expr* SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*, int); SQLITE_PRIVATE int sqlite3ExprImpliesExpr(Parse*,Expr*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprImpliesNonNullRow(Expr*,int); +SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker*,Parse*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(Expr*, int iCur, Index *pIdx); @@ -64526,16 +64538,18 @@ static int hasSharedCacheTableLock( ** table. */ if( isIndex ){ HashElem *p; + int bSeen = 0; for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){ Index *pIdx = (Index *)sqliteHashData(p); if( pIdx->tnum==(int)iRoot ){ - if( iTab ){ + if( bSeen ){ /* Two or more indexes share the same root page. There must ** be imposter tables. So just return true. The assert is not ** useful in that case. */ return 1; } iTab = pIdx->pTable->tnum; + bSeen = 1; } } }else{ @@ -66077,7 +66091,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 i nFrag = iFreeBlk - iEnd; if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage); iEnd = iFreeBlk + get2byte(&data[iFreeBlk+2]); - if( NEVER(iEnd > pPage->pBt->usableSize) ){ + if( iEnd > pPage->pBt->usableSize ){ return SQLITE_CORRUPT_PAGE(pPage); } iSize = iEnd - iStart; @@ -87194,7 +87208,7 @@ case OP_Ge: { /* same as TK_GE, jump, in1, if( (flags1 | flags3)&MEM_Str ){ if( (flags1 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ applyNumericAffinity(pIn1,0); - assert( flags3==pIn3->flags ); + testcase( flags3==pIn3->flags ); flags3 = pIn3->flags; } if( (flags3 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ @@ -99536,7 +99550,12 @@ SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pE op = pExpr->op; if( op==TK_SELECT ){ assert( pExpr->flags&EP_xIsSelect ); - return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); + if( ALWAYS(pExpr->x.pSelect) + && pExpr->x.pSelect->pEList + && ALWAYS(pExpr->x.pSelect->pEList->a[0].pExpr) + ){ + return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); + } } if( op==TK_REGISTER ) op = pExpr->op2; #ifndef SQLITE_OMIT_CAST @@ -101527,8 +101546,10 @@ static int exprNodeIsConstant(Walker *pWalker, Expr *p /* Fall through */ case TK_IF_NULL_ROW: case TK_REGISTER: + case TK_DOT: testcase( pExpr->op==TK_REGISTER ); testcase( pExpr->op==TK_IF_NULL_ROW ); + testcase( pExpr->op==TK_DOT ); pWalker->eCode = 0; return WRC_Abort; case TK_VARIABLE: @@ -105134,11 +105155,26 @@ SQLITE_PRIVATE int sqlite3ExprCoveredByIndex( */ struct SrcCount { SrcList *pSrc; /* One particular FROM clause in a nested query */ + int iSrcInner; /* Smallest cursor number in this context */ int nThis; /* Number of references to columns in pSrcList */ int nOther; /* Number of references to columns in other FROM clauses */ }; /* +** xSelect callback for sqlite3FunctionUsesThisSrc(). If this is the first +** SELECT with a FROM clause encountered during this iteration, set +** SrcCount.iSrcInner to the cursor number of the leftmost object in +** the FROM cause. +*/ +static int selectSrcCount(Walker *pWalker, Select *pSel){ + struct SrcCount *p = pWalker->u.pSrcCount; + if( p->iSrcInner==0x7FFFFFFF && ALWAYS(pSel->pSrc) && pSel->pSrc->nSrc ){ + pWalker->u.pSrcCount->iSrcInner = pSel->pSrc->a[0].iCursor; + } + return WRC_Continue; +} + +/* ** Count the number of references to columns. */ static int exprSrcCount(Walker *pWalker, Expr *pExpr){ @@ -105158,7 +105194,7 @@ static int exprSrcCount(Walker *pWalker, Expr *pExpr){ } if( inThis++; - }else if( nSrc==0 || pExpr->iTablea[0].iCursor ){ + }else if( pExpr->iTableiSrcInner ){ /* In a well-formed parse tree (no name resolution errors), ** TK_COLUMN nodes with smaller Expr.iTable values are in an ** outer context. Those are the only ones to count as "other" */ @@ -105180,9 +105216,10 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pE assert( pExpr->op==TK_AGG_FUNCTION ); memset(&w, 0, sizeof(w)); w.xExprCallback = exprSrcCount; - w.xSelectCallback = sqlite3SelectWalkNoop; + w.xSelectCallback = selectSrcCount; w.u.pSrcCount = &cnt; cnt.pSrc = pSrcList; + cnt.iSrcInner = (pSrcList&&pSrcList->nSrc)?pSrcList->a[0].iCursor:0x7FFFFFFF; cnt.nThis = 0; cnt.nOther = 0; sqlite3WalkExprList(&w, pExpr->x.pList); @@ -105195,6 +105232,64 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pE } /* +** This is a Walker expression node callback. +** +** For Expr nodes that contain pAggInfo pointers, make sure the AggInfo +** object that is referenced does not refer directly to the Expr. If +** it does, make a copy. This is done because the pExpr argument is +** subject to change. +** +** The copy is stored on pParse->pConstExpr with a register number of 0. +** This will cause the expression to be deleted automatically when the +** Parse object is destroyed, but the zero register number means that it +** will not generate any code in the preamble. +*/ +static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){ + if( ALWAYS(!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced)) + && pExpr->pAggInfo!=0 + ){ + AggInfo *pAggInfo = pExpr->pAggInfo; + int iAgg = pExpr->iAgg; + Parse *pParse = pWalker->pParse; + sqlite3 *db = pParse->db; + assert( pExpr->op==TK_AGG_COLUMN || pExpr->op==TK_AGG_FUNCTION ); + if( pExpr->op==TK_AGG_COLUMN ){ + assert( iAgg>=0 && iAggnColumn ); + if( pAggInfo->aCol[iAgg].pExpr==pExpr ){ + pExpr = sqlite3ExprDup(db, pExpr, 0); + if( pExpr ){ + pAggInfo->aCol[iAgg].pExpr = pExpr; + pParse->pConstExpr = + sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr); + } + } + }else{ + assert( iAgg>=0 && iAggnFunc ); + if( pAggInfo->aFunc[iAgg].pExpr==pExpr ){ + pExpr = sqlite3ExprDup(db, pExpr, 0); + if( pExpr ){ + pAggInfo->aFunc[iAgg].pExpr = pExpr; + pParse->pConstExpr = + sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr); + } + } + } + } + return WRC_Continue; +} + +/* +** Initialize a Walker object so that will persist AggInfo entries referenced +** by the tree that is walked. +*/ +SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker *pWalker, Parse *pParse){ + memset(pWalker, 0, sizeof(*pWalker)); + pWalker->pParse = pParse; + pWalker->xExprCallback = agginfoPersistExprCb; + pWalker->xSelectCallback = sqlite3SelectWalkNoop; +} + +/* ** Add a new element to the pAggInfo->aCol[] array. Return the index of ** the new element. Return a negative number if malloc fails. */ @@ -105224,7 +105319,7 @@ static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo) &i ); return i; -} +} /* ** This is the xExprCallback for a tree walker. It is used to @@ -110255,12 +110350,21 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse) */ sqlite3AutoincrementBegin(pParse); - /* Code constant expressions that where factored out of inner loops */ + /* Code constant expressions that where factored out of inner loops. + ** + ** The pConstExpr list might also contain expressions that we simply + ** want to keep around until the Parse object is deleted. Such + ** expressions have iConstExprReg==0. Do not generate code for + ** those expressions, of course. + */ if( pParse->pConstExpr ){ ExprList *pEL = pParse->pConstExpr; pParse->okConstFactor = 0; for(i=0; inExpr; i++){ - sqlite3ExprCode(pParse, pEL->a[i].pExpr, pEL->a[i].u.iConstExprReg); + int iReg = pEL->a[i].u.iConstExprReg; + if( iReg>0 ){ + sqlite3ExprCode(pParse, pEL->a[i].pExpr, iReg); + } } } @@ -128435,10 +128539,25 @@ SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, S } /* +** Deallocate a single AggInfo object +*/ +static void agginfoFree(sqlite3 *db, AggInfo *p){ + sqlite3DbFree(db, p->aCol); + sqlite3DbFree(db, p->aFunc); + sqlite3DbFree(db, p); +} + +/* ** Free all memory allocations in the pParse object */ SQLITE_PRIVATE void sqlite3ParserReset(Parse *pParse){ sqlite3 *db = pParse->db; + AggInfo *pThis = pParse->pAggList; + while( pThis ){ + AggInfo *pNext = pThis->pNext; + agginfoFree(db, pThis); + pThis = pNext; + } sqlite3DbFree(db, pParse->aLabel); sqlite3ExprListDelete(db, pParse->pConstExpr); if( db ){ @@ -131553,9 +131672,7 @@ static int multiSelect( selectOpName(p->op))); rc = sqlite3Select(pParse, p, &uniondest); testcase( rc!=SQLITE_OK ); - /* Query flattening in sqlite3Select() might refill p->pOrderBy. - ** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */ - sqlite3ExprListDelete(db, p->pOrderBy); + assert( p->pOrderBy==0 ); pDelete = p->pPrior; p->pPrior = pPrior; p->pOrderBy = 0; @@ -132628,6 +132745,7 @@ static int flattenSubquery( Expr *pWhere; /* The WHERE clause */ struct SrcList_item *pSubitem; /* The subquery */ sqlite3 *db = pParse->db; + Walker w; /* Walker to persist agginfo data */ /* Check to see if flattening is permitted. Return 0 if not. */ @@ -132941,7 +133059,7 @@ static int flattenSubquery( ** We look at every expression in the outer query and every place we see ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". */ - if( pSub->pOrderBy ){ + if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){ /* At this point, any non-zero iOrderByCol values indicate that the ** ORDER BY column expression is identical to the iOrderByCol'th ** expression returned by SELECT statement pSub. Since these values @@ -132965,7 +133083,13 @@ static int flattenSubquery( if( isLeftJoin>0 ){ sqlite3SetJoinExpr(pWhere, iNewParent); } - pParent->pWhere = sqlite3ExprAnd(pParse, pWhere, pParent->pWhere); + if( pWhere ){ + if( pParent->pWhere ){ + pParent->pWhere = sqlite3PExpr(pParse, TK_AND, pWhere, pParent->pWhere); + }else{ + pParent->pWhere = pWhere; + } + } if( db->mallocFailed==0 ){ SubstContext x; x.pParse = pParse; @@ -133002,6 +133126,8 @@ static int flattenSubquery( /* Finially, delete what is left of the subquery and return ** success. */ + sqlite3AggInfoPersistWalkerInit(&w, pParse); + sqlite3WalkSelect(&w,pSub1); sqlite3SelectDelete(db, pSub1); #if SELECTTRACE_ENABLED @@ -133262,11 +133388,14 @@ static int pushDownWhereTerms( ){ Expr *pNew; int nChng = 0; + Select *pSel; if( pWhere==0 ) return 0; if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */ #ifndef SQLITE_OMIT_WINDOWFUNC - if( pSubq->pWin ) return 0; /* restriction (6) */ + for(pSel=pSubq; pSel; pSel=pSel->pPrior){ + if( pSel->pWin ) return 0; /* restriction (6) */ + } #endif #ifdef SQLITE_DEBUG @@ -133466,6 +133595,14 @@ static int convertCompoundSelectToSubquery(Walker *pWa for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} if( pX==0 ) return WRC_Continue; a = p->pOrderBy->a; +#ifndef SQLITE_OMIT_WINDOWFUNC + /* If iOrderByCol is already non-zero, then it has already been matched + ** to a result column of the SELECT statement. This occurs when the + ** SELECT is rewritten for window-functions processing and then passed + ** to sqlite3SelectPrep() and similar a second time. The rewriting done + ** by this function is not required in this case. */ + if( a[0].u.x.iOrderByCol ) return WRC_Continue; +#endif for(i=p->pOrderBy->nExpr-1; i>=0; i--){ if( a[i].pExpr->flags & EP_Collate ) break; } @@ -134586,10 +134723,10 @@ SQLITE_PRIVATE int sqlite3Select( Expr *pWhere; /* The WHERE clause. May be NULL */ ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */ Expr *pHaving; /* The HAVING clause. May be NULL */ + AggInfo *pAggInfo = 0; /* Aggregate information */ int rc = 1; /* Value to return from this function */ DistinctCtx sDistinct; /* Info on how to code the DISTINCT keyword */ SortCtx sSort; /* Info on how to code the ORDER BY clause */ - AggInfo sAggInfo; /* Information used by aggregate queries */ int iEnd; /* Address of the end of the query */ sqlite3 *db; /* The database connection */ ExprList *pMinMaxOrderBy = 0; /* Added ORDER BY for min/max queries */ @@ -134601,7 +134738,6 @@ SQLITE_PRIVATE int sqlite3Select( return 1; } if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; - memset(&sAggInfo, 0, sizeof(sAggInfo)); #if SELECTTRACE_ENABLED SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain)); if( sqlite3SelectTrace & 0x100 ){ @@ -134623,6 +134759,7 @@ SQLITE_PRIVATE int sqlite3Select( sqlite3ExprListDelete(db, p->pOrderBy); p->pOrderBy = 0; p->selFlags &= ~SF_Distinct; + p->selFlags |= SF_NoopOrderBy; } sqlite3SelectPrep(pParse, p, 0); if( pParse->nErr || db->mallocFailed ){ @@ -135191,14 +135328,20 @@ SQLITE_PRIVATE int sqlite3Select( ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ + pAggInfo = sqlite3DbMallocZero(db, sizeof(*pAggInfo) ); + if( pAggInfo==0 ){ + goto select_end; + } + pAggInfo->pNext = pParse->pAggList; + pParse->pAggList = pAggInfo; memset(&sNC, 0, sizeof(sNC)); sNC.pParse = pParse; sNC.pSrcList = pTabList; - sNC.uNC.pAggInfo = &sAggInfo; + sNC.uNC.pAggInfo = pAggInfo; VVA_ONLY( sNC.ncFlags = NC_UAggInfo; ) - sAggInfo.mnReg = pParse->nMem+1; - sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; - sAggInfo.pGroupBy = pGroupBy; + pAggInfo->mnReg = pParse->nMem+1; + pAggInfo->nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; + pAggInfo->pGroupBy = pGroupBy; sqlite3ExprAnalyzeAggList(&sNC, pEList); sqlite3ExprAnalyzeAggList(&sNC, sSort.pOrderBy); if( pHaving ){ @@ -135211,14 +135354,14 @@ SQLITE_PRIVATE int sqlite3Select( } sqlite3ExprAnalyzeAggregates(&sNC, pHaving); } - sAggInfo.nAccumulator = sAggInfo.nColumn; - if( p->pGroupBy==0 && p->pHaving==0 && sAggInfo.nFunc==1 ){ - minMaxFlag = minMaxQuery(db, sAggInfo.aFunc[0].pExpr, &pMinMaxOrderBy); + pAggInfo->nAccumulator = pAggInfo->nColumn; + if( p->pGroupBy==0 && p->pHaving==0 && pAggInfo->nFunc==1 ){ + minMaxFlag = minMaxQuery(db, pAggInfo->aFunc[0].pExpr, &pMinMaxOrderBy); }else{ minMaxFlag = WHERE_ORDERBY_NORMAL; } - for(i=0; inFunc; i++){ + Expr *pExpr = pAggInfo->aFunc[i].pExpr; assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); sNC.ncFlags |= NC_InAggFunc; sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList); @@ -135230,22 +135373,22 @@ SQLITE_PRIVATE int sqlite3Select( #endif sNC.ncFlags &= ~NC_InAggFunc; } - sAggInfo.mxReg = pParse->nMem; + pAggInfo->mxReg = pParse->nMem; if( db->mallocFailed ) goto select_end; #if SELECTTRACE_ENABLED if( sqlite3SelectTrace & 0x400 ){ int ii; - SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", &sAggInfo)); + SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo)); sqlite3TreeViewSelect(0, p, 0); - for(ii=0; iinColumn; ii++){ sqlite3DebugPrintf("agg-column[%d] iMem=%d\n", - ii, sAggInfo.aCol[ii].iMem); - sqlite3TreeViewExpr(0, sAggInfo.aCol[ii].pExpr, 0); + ii, pAggInfo->aCol[ii].iMem); + sqlite3TreeViewExpr(0, pAggInfo->aCol[ii].pExpr, 0); } - for(ii=0; iinFunc; ii++){ sqlite3DebugPrintf("agg-func[%d]: iMem=%d\n", - ii, sAggInfo.aFunc[ii].iMem); - sqlite3TreeViewExpr(0, sAggInfo.aFunc[ii].pExpr, 0); + ii, pAggInfo->aFunc[ii].iMem); + sqlite3TreeViewExpr(0, pAggInfo->aFunc[ii].pExpr, 0); } } #endif @@ -135270,10 +135413,11 @@ SQLITE_PRIVATE int sqlite3Select( ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - sAggInfo.sortingIdx = pParse->nTab++; - pKeyInfo = sqlite3KeyInfoFromExprList(pParse,pGroupBy,0,sAggInfo.nColumn); + pAggInfo->sortingIdx = pParse->nTab++; + pKeyInfo = sqlite3KeyInfoFromExprList(pParse, pGroupBy, + 0, pAggInfo->nColumn); addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, - sAggInfo.sortingIdx, sAggInfo.nSortingColumn, + pAggInfo->sortingIdx, pAggInfo->nSortingColumn, 0, (char*)pKeyInfo, P4_KEYINFO); /* Initialize memory locations used by GROUP BY aggregate processing @@ -135328,8 +135472,8 @@ SQLITE_PRIVATE int sqlite3Select( nGroupBy = pGroupBy->nExpr; nCol = nGroupBy; j = nGroupBy; - for(i=0; i=j ){ + for(i=0; inColumn; i++){ + if( pAggInfo->aCol[i].iSorterColumn>=j ){ nCol++; j++; } @@ -135337,8 +135481,8 @@ SQLITE_PRIVATE int sqlite3Select( regBase = sqlite3GetTempRange(pParse, nCol); sqlite3ExprCodeExprList(pParse, pGroupBy, regBase, 0, 0); j = nGroupBy; - for(i=0; inColumn; i++){ + struct AggInfo_col *pCol = &pAggInfo->aCol[i]; if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; sqlite3ExprCodeGetColumnOfTable(v, @@ -135348,16 +135492,16 @@ SQLITE_PRIVATE int sqlite3Select( } regRecord = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regRecord); - sqlite3VdbeAddOp2(v, OP_SorterInsert, sAggInfo.sortingIdx, regRecord); + sqlite3VdbeAddOp2(v, OP_SorterInsert, pAggInfo->sortingIdx, regRecord); sqlite3ReleaseTempReg(pParse, regRecord); sqlite3ReleaseTempRange(pParse, regBase, nCol); sqlite3WhereEnd(pWInfo); - sAggInfo.sortingIdxPTab = sortPTab = pParse->nTab++; + pAggInfo->sortingIdxPTab = sortPTab = pParse->nTab++; sortOut = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_OpenPseudo, sortPTab, sortOut, nCol); - sqlite3VdbeAddOp2(v, OP_SorterSort, sAggInfo.sortingIdx, addrEnd); + sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd); VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v); - sAggInfo.useSortingIdx = 1; + pAggInfo->useSortingIdx = 1; } /* If the index or temporary table used by the GROUP BY sort @@ -135381,14 +135525,14 @@ SQLITE_PRIVATE int sqlite3Select( */ addrTopOfLoop = sqlite3VdbeCurrentAddr(v); if( groupBySort ){ - sqlite3VdbeAddOp3(v, OP_SorterData, sAggInfo.sortingIdx, + sqlite3VdbeAddOp3(v, OP_SorterData, pAggInfo->sortingIdx, sortOut, sortPTab); } for(j=0; jnExpr; j++){ if( groupBySort ){ sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j); }else{ - sAggInfo.directMode = 1; + pAggInfo->directMode = 1; sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); } } @@ -135418,14 +135562,14 @@ SQLITE_PRIVATE int sqlite3Select( ** the current row */ sqlite3VdbeJumpHere(v, addr1); - updateAccumulator(pParse, iUseFlag, &sAggInfo); + updateAccumulator(pParse, iUseFlag, pAggInfo); sqlite3VdbeAddOp2(v, OP_Integer, 1, iUseFlag); VdbeComment((v, "indicate data in accumulator")); /* End of the loop */ if( groupBySort ){ - sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop); + sqlite3VdbeAddOp2(v, OP_SorterNext, pAggInfo->sortingIdx, addrTopOfLoop); VdbeCoverage(v); }else{ sqlite3WhereEnd(pWInfo); @@ -135458,7 +135602,7 @@ SQLITE_PRIVATE int sqlite3Select( VdbeCoverage(v); VdbeComment((v, "Groupby result generator entry point")); sqlite3VdbeAddOp1(v, OP_Return, regOutputRow); - finalizeAggFunctions(pParse, &sAggInfo); + finalizeAggFunctions(pParse, pAggInfo); sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL); selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest, @@ -135469,7 +135613,7 @@ SQLITE_PRIVATE int sqlite3Select( /* Generate a subroutine that will reset the group-by accumulator */ sqlite3VdbeResolveLabel(v, addrReset); - resetAccumulator(pParse, &sAggInfo); + resetAccumulator(pParse, pAggInfo); sqlite3VdbeAddOp2(v, OP_Integer, 0, iUseFlag); VdbeComment((v, "indicate accumulator empty")); sqlite3VdbeAddOp1(v, OP_Return, regReset); @@ -135477,7 +135621,7 @@ SQLITE_PRIVATE int sqlite3Select( } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */ else { Table *pTab; - if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){ + if( (pTab = isSimpleCount(p, pAggInfo))!=0 ){ /* If isSimpleCount() returns a pointer to a Table structure, then ** the SQL statement is of the form: ** @@ -135532,7 +135676,7 @@ SQLITE_PRIVATE int sqlite3Select( if( pKeyInfo ){ sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO); } - sqlite3VdbeAddOp2(v, OP_Count, iCsr, sAggInfo.aFunc[0].iMem); + sqlite3VdbeAddOp2(v, OP_Count, iCsr, pAggInfo->aFunc[0].iMem); sqlite3VdbeAddOp1(v, OP_Close, iCsr); explainSimpleCount(pParse, pTab, pBest); }else{ @@ -135547,12 +135691,16 @@ SQLITE_PRIVATE int sqlite3Select( ** first row visited by the aggregate, so that they are updated at ** least once even if the FILTER clause means the min() or max() ** function visits zero rows. */ - if( sAggInfo.nAccumulator ){ - for(i=0; ifuncFlags&SQLITE_FUNC_NEEDCOLL ) break; + if( pAggInfo->nAccumulator ){ + for(i=0; inFunc; i++){ + if( ExprHasProperty(pAggInfo->aFunc[i].pExpr, EP_WinFunc) ){ + continue; + } + if( pAggInfo->aFunc[i].pFunc->funcFlags&SQLITE_FUNC_NEEDCOLL ){ + break; + } } - if( i==sAggInfo.nFunc ){ + if( i==pAggInfo->nFunc ){ regAcc = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_Integer, 0, regAcc); } @@ -135563,7 +135711,7 @@ SQLITE_PRIVATE int sqlite3Select( ** of output. */ assert( p->pGroupBy==0 ); - resetAccumulator(pParse, &sAggInfo); + resetAccumulator(pParse, pAggInfo); /* If this query is a candidate for the min/max optimization, then ** minMaxFlag will have been previously set to either @@ -135579,7 +135727,7 @@ SQLITE_PRIVATE int sqlite3Select( if( pWInfo==0 ){ goto select_end; } - updateAccumulator(pParse, regAcc, &sAggInfo); + updateAccumulator(pParse, regAcc, pAggInfo); if( regAcc ) sqlite3VdbeAddOp2(v, OP_Integer, 1, regAcc); if( sqlite3WhereIsOrdered(pWInfo)>0 ){ sqlite3VdbeGoto(v, sqlite3WhereBreakLabel(pWInfo)); @@ -135587,7 +135735,7 @@ SQLITE_PRIVATE int sqlite3Select( (minMaxFlag==WHERE_ORDERBY_MIN?"min":"max"))); } sqlite3WhereEnd(pWInfo); - finalizeAggFunctions(pParse, &sAggInfo); + finalizeAggFunctions(pParse, pAggInfo); } sSort.pOrderBy = 0; @@ -135626,8 +135774,25 @@ SQLITE_PRIVATE int sqlite3Select( */ select_end: sqlite3ExprListDelete(db, pMinMaxOrderBy); - sqlite3DbFree(db, sAggInfo.aCol); - sqlite3DbFree(db, sAggInfo.aFunc); +#ifdef SQLITE_DEBUG + if( pAggInfo && !db->mallocFailed ){ + for(i=0; inColumn; i++){ + Expr *pExpr = pAggInfo->aCol[i].pExpr; + assert( pExpr!=0 || db->mallocFailed ); + if( pExpr==0 ) continue; + assert( pExpr->pAggInfo==pAggInfo ); + assert( pExpr->iAgg==i ); + } + for(i=0; inFunc; i++){ + Expr *pExpr = pAggInfo->aFunc[i].pExpr; + assert( pExpr!=0 || db->mallocFailed ); + if( pExpr==0 ) continue; + assert( pExpr->pAggInfo==pAggInfo ); + assert( pExpr->iAgg==i ); + } + } +#endif + #if SELECTTRACE_ENABLED SELECTTRACE(0x1,pParse,p,("end processing\n")); if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){ @@ -151319,12 +151484,16 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Window *pMWin = p->pWin; /* Master window object */ Window *pWin; /* Window object iterator */ Table *pTab; + Walker w; + u32 selFlags = p->selFlags; pTab = sqlite3DbMallocZero(db, sizeof(Table)); if( pTab==0 ){ return sqlite3ErrorToParser(db, SQLITE_NOMEM); } + sqlite3AggInfoPersistWalkerInit(&w, pParse); + sqlite3WalkSelect(&w, p); p->pSrc = 0; p->pWhere = 0; @@ -151405,7 +151574,6 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0); if( p->pSrc ){ Table *pTab2; - Walker w; p->pSrc->a[0].pSelect = pSub; sqlite3SrcListAssignCursors(pParse, p->pSrc); pSub->selFlags |= SF_Expanded; @@ -168302,6 +168470,9 @@ static int fts3PoslistMerge( */ fts3GetDeltaVarint(&p1, &i1); fts3GetDeltaVarint(&p2, &i2); + if( i1<2 || i2<2 ){ + break; + } do { fts3PutDeltaVarint(&p, &iPrev, (i10 ); assert( *pbEof==0 ); - assert( p || *piDocid==0 ); + assert_fts3_nc( p || *piDocid==0 ); assert( !p || (p>=aDoclist && p<=&aDoclist[nDoclist]) ); if( p==0 ){ @@ -171205,7 +171376,7 @@ static void fts3EvalInvalidatePoslist(Fts3Phrase *pPhr ** ** Parameter nNear is passed the NEAR distance of the expression (5 in ** the example above). When this function is called, *paPoslist points to -** the position list, and *pnToken is the number of phrase tokens in, the +** the position list, and *pnToken is the number of phrase tokens in the ** phrase on the other side of the NEAR operator to pPhrase. For example, ** if pPhrase refers to the "def ghi" phrase, then *paPoslist points to ** the position list associated with phrase "abc". @@ -224824,7 +224995,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e86861e8c", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd", -1, SQLITE_TRANSIENT); } /* @@ -229607,9 +229778,9 @@ SQLITE_API int sqlite3_stmt_init( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ /************** End of stmt.c ************************************************/ -#if __LINE__!=229610 +#if __LINE__!=229781 #undef SQLITE_SOURCE_ID -#define SQLITE_SOURCE_ID "2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e8686alt2" +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933calt2" #endif /* Return the source-id for this library */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } Modified: vendor/sqlite3/dist/sqlite3.h ============================================================================== --- vendor/sqlite3/dist/sqlite3.h Tue Jul 7 12:24:40 2020 (r362989) +++ vendor/sqlite3/dist/sqlite3.h Tue Jul 7 13:48:26 2020 (r362990) @@ -123,9 +123,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.32.2" -#define SQLITE_VERSION_NUMBER 3032002 -#define SQLITE_SOURCE_ID "2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e86861e8c" +#define SQLITE_VERSION "3.32.3" +#define SQLITE_VERSION_NUMBER 3032003 +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" /* ** CAPI3REF: Run-Time Library Version Numbers Modified: vendor/sqlite3/dist/tea/configure ============================================================================== --- vendor/sqlite3/dist/tea/configure Tue Jul 7 12:24:40 2020 (r362989) +++ vendor/sqlite3/dist/tea/configure Tue Jul 7 13:48:26 2020 (r362990) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.32.2' -PACKAGE_STRING='sqlite 3.32.2' +PACKAGE_VERSION='3.32.3' +PACKAGE_STRING='sqlite 3.32.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1365,7 +1365,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.32.2:";; + short | recursive ) echo "Configuration of sqlite 3.32.3:";; esac cat <<\_ACEOF @@ -1467,7 +1467,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.32.2 +sqlite configure 3.32.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1878,7 +1878,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.32.2, which was +It was created by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -9373,7 +9373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.32.2, which was +This file was extended by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9426,7 +9426,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.32.2 +sqlite config.status 3.32.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/sqlite3/dist/tea/configure.ac ============================================================================== --- vendor/sqlite3/dist/tea/configure.ac Tue Jul 7 12:24:40 2020 (r362989) +++ vendor/sqlite3/dist/tea/configure.ac Tue Jul 7 13:48:26 2020 (r362990) @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([sqlite], [3.32.2]) +AC_INIT([sqlite], [3.32.3]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From owner-svn-src-vendor@freebsd.org Tue Jul 7 13:51:17 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99CD336373A; Tue, 7 Jul 2020 13:51:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1P3n3bMZz4d0y; Tue, 7 Jul 2020 13:51:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4740C10341; Tue, 7 Jul 2020 13:51:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 067DpH7t080178; Tue, 7 Jul 2020 13:51:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 067DpHDp080161; Tue, 7 Jul 2020 13:51:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007071351.067DpHDp080161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 7 Jul 2020 13:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r362991 - vendor/sqlite3/sqlite-3320300 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/sqlite3/sqlite-3320300 X-SVN-Commit-Revision: 362991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 13:51:17 -0000 Author: cy Date: Tue Jul 7 13:51:16 2020 New Revision: 362991 URL: https://svnweb.freebsd.org/changeset/base/362991 Log: Tag sqlite 3.32.3 (3320300). Added: vendor/sqlite3/sqlite-3320300/ - copied from r362990, vendor/sqlite3/dist/ From owner-svn-src-vendor@freebsd.org Wed Jul 8 18:32:17 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0690369CB8; Wed, 8 Jul 2020 18:32:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B27FY5NQdz4Pqm; Wed, 8 Jul 2020 18:32:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BFFE2493C; Wed, 8 Jul 2020 18:32:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 068IWH5X043484; Wed, 8 Jul 2020 18:32:17 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 068IWFaf043470; Wed, 8 Jul 2020 18:32:15 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007081832.068IWFaf043470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 8 Jul 2020 18:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363018 - in vendor/NetBSD/bmake/dist: . lst.lib unit-tests X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/NetBSD/bmake/dist: . lst.lib unit-tests X-SVN-Commit-Revision: 363018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 18:32:18 -0000 Author: sjg Date: Wed Jul 8 18:32:15 2020 New Revision: 363018 URL: https://svnweb.freebsd.org/changeset/base/363018 Log: Import bmake-20200704 from ChangeLog: (most of this by rillig@) o lots of style and white-space cleanup o lots more unit tests for variable modifiers o simplified description of some functions o str.c: refactor Str_Match o var.c: debugging output for :@ constify VarModify parameter fix :hash modifier on 16-bit platforms remove unnecessary forward declarations refactor ApplyModifier_SysV to have less indentation simplify code for :E and :R clean up code for :H and :T refactor ApplyModifiers * var.c: we need stdint.h on some platforms to get uint32_t * unit-test/Makefile: we need to supress the specific error for RE substitution error in modmisc, since it varies accross different OS. Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/VERSION vendor/NetBSD/bmake/dist/arch.c vendor/NetBSD/bmake/dist/buf.c vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/cond.c vendor/NetBSD/bmake/dist/dir.c vendor/NetBSD/bmake/dist/for.c vendor/NetBSD/bmake/dist/hash.c vendor/NetBSD/bmake/dist/hash.h vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/job.h vendor/NetBSD/bmake/dist/lst.lib/lstAppend.c vendor/NetBSD/bmake/dist/lst.lib/lstAtEnd.c vendor/NetBSD/bmake/dist/lst.lib/lstAtFront.c vendor/NetBSD/bmake/dist/lst.lib/lstClose.c vendor/NetBSD/bmake/dist/lst.lib/lstConcat.c vendor/NetBSD/bmake/dist/lst.lib/lstDatum.c vendor/NetBSD/bmake/dist/lst.lib/lstDeQueue.c vendor/NetBSD/bmake/dist/lst.lib/lstDupl.c vendor/NetBSD/bmake/dist/lst.lib/lstEnQueue.c vendor/NetBSD/bmake/dist/lst.lib/lstFind.c vendor/NetBSD/bmake/dist/lst.lib/lstFindFrom.c vendor/NetBSD/bmake/dist/lst.lib/lstFirst.c vendor/NetBSD/bmake/dist/lst.lib/lstForEach.c vendor/NetBSD/bmake/dist/lst.lib/lstForEachFrom.c vendor/NetBSD/bmake/dist/lst.lib/lstInit.c vendor/NetBSD/bmake/dist/lst.lib/lstInsert.c vendor/NetBSD/bmake/dist/lst.lib/lstIsAtEnd.c vendor/NetBSD/bmake/dist/lst.lib/lstIsEmpty.c vendor/NetBSD/bmake/dist/lst.lib/lstLast.c vendor/NetBSD/bmake/dist/lst.lib/lstNext.c vendor/NetBSD/bmake/dist/lst.lib/lstOpen.c vendor/NetBSD/bmake/dist/lst.lib/lstPrev.c vendor/NetBSD/bmake/dist/lst.lib/lstRemove.c vendor/NetBSD/bmake/dist/lst.lib/lstReplace.c vendor/NetBSD/bmake/dist/lst.lib/lstSucc.c vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.c vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/make_malloc.c vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/meta.h vendor/NetBSD/bmake/dist/nonints.h vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/str.c vendor/NetBSD/bmake/dist/suff.c vendor/NetBSD/bmake/dist/targ.c vendor/NetBSD/bmake/dist/trace.c vendor/NetBSD/bmake/dist/unit-tests/Makefile vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk vendor/NetBSD/bmake/dist/unit-tests/sysv.exp vendor/NetBSD/bmake/dist/unit-tests/sysv.mk vendor/NetBSD/bmake/dist/unit-tests/varmisc.exp vendor/NetBSD/bmake/dist/unit-tests/varmisc.mk vendor/NetBSD/bmake/dist/util.c vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/ChangeLog Wed Jul 8 18:32:15 2020 (r363018) @@ -1,3 +1,42 @@ +2020-07-04 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200704 + Merge with NetBSD make, pick up + (most of this by rillig@) + o lots of style and white-space cleanup + o lots more unit tests for variable modifiers + o simplified description of some functions + o str.c: refactor Str_Match + o var.c: debugging output for :@ + constify VarModify parameter + fix :hash modifier on 16-bit platforms + remove unnecessary forward declarations + refactor ApplyModifier_SysV to have less indentation + simplify code for :E and :R + clean up code for :H and :T + refactor ApplyModifiers + + * var.c: we need stdint.h on some platforms to get uint32_t + * unit-test/Makefile: we need to supress the specific error + for RE substitution error in modmisc, since it varies accross + different OS. + +2020-07-02 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200702 + Merge with NetBSD make, pick up + o var.c: more improvements to avoiding unnecessary evaluation + use enums for flags + o remove flags arg to Var_Set which outside of var.c is always 0 + +2020-07-01 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200701 + Merge with NetBSD make, pick up + o var.c: with change to cond.c; ensure that nested variables + within a variable name are expanded. + o unit-tests/varmisc.mk: test for nested varname + 2020-06-29 Simon J Gerraty * VERSION (_MAKE_VERSION): 20200629 Modified: vendor/NetBSD/bmake/dist/VERSION ============================================================================== --- vendor/NetBSD/bmake/dist/VERSION Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/VERSION Wed Jul 8 18:32:15 2020 (r363018) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20200629 +_MAKE_VERSION=20200704 Modified: vendor/NetBSD/bmake/dist/arch.c ============================================================================== --- vendor/NetBSD/bmake/dist/arch.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/arch.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $ */ +/* $NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"); +__RCSID("$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -312,7 +312,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * free(freeIt); if (result == var_Error) { - return(FAILURE); + return FAILURE; } else { subLibName = TRUE; } @@ -354,7 +354,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * free(freeIt); if (result == var_Error) { - return(FAILURE); + return FAILURE; } else { doSubst = TRUE; } @@ -372,7 +372,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * */ if (*cp == '\0') { printf("No closing parenthesis in archive specification\n"); - return (FAILURE); + return FAILURE; } /* @@ -426,7 +426,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * if (gn == NULL) { free(buf); - return(FAILURE); + return FAILURE; } else { gn->type |= OP_ARCHV; (void)Lst_AtEnd(nodeLst, gn); @@ -437,7 +437,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * * ourselves. */ free(buf); - return(FAILURE); + return FAILURE; } /* * Free buffer and continue with our work. @@ -461,7 +461,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * gn = Targ_FindNode(nameBuf, TARG_CREATE); if (gn == NULL) { free(nameBuf); - return (FAILURE); + return FAILURE; } else { /* * We've found the node, but have to make sure the rest of @@ -483,7 +483,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * gn = Targ_FindNode(nameBuf, TARG_CREATE); free(nameBuf); if (gn == NULL) { - return (FAILURE); + return FAILURE; } else { /* * We've found the node, but have to make sure the rest of the @@ -520,7 +520,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * } while (*cp != '\0' && isspace ((unsigned char)*cp)); *linePtr = cp; - return (SUCCESS); + return SUCCESS; } /*- @@ -544,7 +544,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * static int ArchFindArchive(const void *ar, const void *archName) { - return (strcmp(archName, ((const Arch *)ar)->name)); + return strcmp(archName, ((const Arch *)ar)->name); } /*- @@ -602,7 +602,7 @@ ArchStatMember(char *archive, char *member, Boolean ha he = Hash_FindEntry(&ar->members, member); if (he != NULL) { - return ((struct ar_hdr *)Hash_GetValue(he)); + return (struct ar_hdr *)Hash_GetValue(he); } else { /* Try truncated name */ char copy[AR_MAX_NAME_LEN+1]; @@ -614,7 +614,7 @@ ArchStatMember(char *archive, char *member, Boolean ha copy[AR_MAX_NAME_LEN] = '\0'; } if ((he = Hash_FindEntry(&ar->members, copy)) != NULL) - return ((struct ar_hdr *)Hash_GetValue(he)); + return (struct ar_hdr *)Hash_GetValue(he); return NULL; } } @@ -635,7 +635,7 @@ ArchStatMember(char *archive, char *member, Boolean ha return NULL; } else { fclose(arch); - return (&sarh); + return &sarh; } } @@ -753,7 +753,7 @@ ArchStatMember(char *archive, char *member, Boolean ha he = Hash_FindEntry(&ar->members, member); if (he != NULL) { - return ((struct ar_hdr *)Hash_GetValue(he)); + return (struct ar_hdr *)Hash_GetValue(he); } else { return NULL; } @@ -962,7 +962,7 @@ ArchFindMember(char *archive, char *member, struct ar_ fclose(arch); return NULL; } - return (arch); + return arch; } } else #ifdef AR_EFMT1 @@ -996,7 +996,7 @@ ArchFindMember(char *archive, char *member, struct ar_ fclose(arch); return NULL; } - return (arch); + return arch; } if (fseek(arch, -elen, SEEK_CUR) != 0) { fclose(arch); @@ -1152,7 +1152,7 @@ Arch_MTime(GNode *gn) } gn->mtime = modTime; - return (modTime); + return modTime; } /*- @@ -1179,7 +1179,7 @@ Arch_MemMTime(GNode *gn) if (Lst_Open(gn->parents) != SUCCESS) { gn->mtime = 0; - return (0); + return 0; } while ((ln = Lst_Next(gn->parents)) != NULL) { pgn = (GNode *)Lst_Datum(ln); @@ -1211,7 +1211,7 @@ Arch_MemMTime(GNode *gn) Lst_Close(gn->parents); - return (gn->mtime); + return gn->mtime; } /*- @@ -1252,9 +1252,9 @@ Arch_FindLib(GNode *gn, Lst path) free(libName); #ifdef LIBRARIES - Var_Set(TARGET, gn->name, gn, 0); + Var_Set(TARGET, gn->name, gn); #else - Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn, 0); + Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn); #endif /* LIBRARIES */ } @@ -1337,7 +1337,7 @@ Arch_LibOODate(GNode *gn) oodate = FALSE; #endif } - return (oodate); + return oodate; } /*- Modified: vendor/NetBSD/bmake/dist/buf.c ============================================================================== --- vendor/NetBSD/bmake/dist/buf.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/buf.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $"; +static char rcsid[] = "$NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $"); +__RCSID("$NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -160,7 +160,7 @@ Buf_GetAll(Buffer *bp, int *numBytesPtr) if (numBytesPtr != NULL) *numBytesPtr = bp->count; - return (bp->buffer); + return bp->buffer; } /*- Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/compat.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $ */ +/* $NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"); +__RCSID("$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -236,7 +236,7 @@ CompatRunCommand(void *cmdp, void *gnp) silent = gn->type & OP_SILENT; errCheck = !(gn->type & OP_IGNORE); doIt = FALSE; - + cmdNode = Lst_Member(gn->commands, cmd); cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES); @@ -249,18 +249,18 @@ CompatRunCommand(void *cmdp, void *gnp) if (*cmdStart == '\0') { free(cmdStart); - return(0); + return 0; } cmd = cmdStart; Lst_Replace(cmdNode, cmdStart); if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) { (void)Lst_AtEnd(ENDNode->commands, cmdStart); - return(0); + return 0; } if (strcmp(cmdStart, "...") == 0) { gn->type |= OP_SAVE_CMDS; - return(0); + return 0; } while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) { @@ -287,7 +287,7 @@ CompatRunCommand(void *cmdp, void *gnp) * If we did not end up with a command, just skip it. */ if (!*cmd) - return (0); + return 0; #if !defined(MAKE_NATIVE) /* @@ -307,7 +307,7 @@ CompatRunCommand(void *cmdp, void *gnp) * go to the shell. Therefore treat '=' and ':' like shell * meta characters as documented in make(1). */ - + useShell = needshell(cmd, FALSE); #endif @@ -325,7 +325,7 @@ CompatRunCommand(void *cmdp, void *gnp) * we go... */ if (!doIt && NoExecute(gn)) { - return (0); + return 0; } if (DEBUG(JOB)) fprintf(debug_file, "Execute: '%s'\n", cmd); @@ -377,7 +377,7 @@ again: meta_compat_start(); } #endif - + /* * Fork and execute the single command. If the fork fails, we abort. */ @@ -499,8 +499,8 @@ again: bmake_signal(compatSigno, SIG_DFL); kill(myPid, compatSigno); } - - return (status); + + return status; } /*- @@ -550,7 +550,7 @@ Compat_Make(void *gnp, void *pgnp) if (Lst_Member(gn->iParents, pgn) != NULL) { char *p1; - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); + Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn); free(p1); } @@ -654,7 +654,7 @@ Compat_Make(void *gnp, void *pgnp) } else { if (Lst_Member(gn->iParents, pgn) != NULL) { char *p1; - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); + Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn); free(p1); } switch(gn->made) { @@ -681,7 +681,7 @@ Compat_Make(void *gnp, void *pgnp) cohorts: Lst_ForEach(gn->cohorts, Compat_Make, pgnp); - return (0); + return 0; } /*- Modified: vendor/NetBSD/bmake/dist/cond.c ============================================================================== --- vendor/NetBSD/bmake/dist/cond.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/cond.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $"); +__RCSID("$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -186,7 +186,7 @@ static unsigned int cond_min_depth = 0; /* depth at * Indicate when we should be strict about lhs of comparisons. * TRUE when Cond_EvalExpression is called from Cond_Eval (.if etc) * FALSE when Cond_EvalExpression is called from var.c:ApplyModifiers - * since lhs is already expanded and we cannot tell if + * since lhs is already expanded and we cannot tell if * it was a variable reference or not. */ static Boolean lhsStrict; @@ -256,7 +256,7 @@ CondGetArg(Boolean doEval, char **linePtr, char **argP * the word 'make' or 'defined' at the beginning of a symbol... */ *argPtr = NULL; - return (0); + return 0; } while (*cp == ' ' || *cp == '\t') { @@ -314,11 +314,11 @@ CondGetArg(Boolean doEval, char **linePtr, char **argP if (func != NULL && *cp++ != ')') { Parse_Error(PARSE_WARNING, "Missing closing parenthesis for %s()", func); - return (0); + return 0; } *linePtr = cp; - return (argLen); + return argLen; } /*- @@ -347,7 +347,7 @@ CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char } free(p1); - return (result); + return result; } /*- @@ -367,7 +367,7 @@ CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char static int CondStrMatch(const void *string, const void *pattern) { - return(!Str_Match(string, pattern)); + return !Str_Match(string, pattern); } /*- @@ -412,14 +412,14 @@ CondDoExists(int argLen MAKE_ATTR_UNUSED, const char * if (DEBUG(COND)) { fprintf(debug_file, "exists(%s) result is \"%s\"\n", arg, path ? path : ""); - } + } if (path != NULL) { result = TRUE; free(path); } else { result = FALSE; } - return (result); + return result; } /*- @@ -441,7 +441,7 @@ CondDoTarget(int argLen MAKE_ATTR_UNUSED, const char * GNode *gn; gn = Targ_FindNode(arg, TARG_NOCREATE); - return (gn != NULL) && !OP_NOP(gn->type); + return gn != NULL && !OP_NOP(gn->type); } /*- @@ -465,7 +465,7 @@ CondDoCommands(int argLen MAKE_ATTR_UNUSED, const char GNode *gn; gn = Targ_FindNode(arg, TARG_NOCREATE); - return (gn != NULL) && !OP_NOP(gn->type) && !Lst_IsEmpty(gn->commands); + return gn != NULL && !OP_NOP(gn->type) && !Lst_IsEmpty(gn->commands); } /*- @@ -666,7 +666,7 @@ compare_expression(Boolean doEval) rhs = NULL; lhsFree = rhsFree = FALSE; lhsQuoted = rhsQuoted = FALSE; - + /* * Parse the variable spec and skip over it, saving its * value in lhs. @@ -709,7 +709,7 @@ compare_expression(Boolean doEval) goto done; } /* For .ifxxx compare against zero */ - if (CondCvtArg(lhs, &left)) { + if (CondCvtArg(lhs, &left)) { t = left != 0.0; goto done; } @@ -762,7 +762,7 @@ do_string_compare: * rhs is either a float or an integer. Convert both the * lhs and the rhs to a double and compare the two. */ - + if (!CondCvtArg(lhs, &left) || !CondCvtArg(rhs, &right)) goto do_string_compare; @@ -1038,7 +1038,7 @@ CondT(Boolean doEval) t = TOK_TRUE; } } - return (t); + return t; } /*- @@ -1084,7 +1084,7 @@ CondF(Boolean doEval) CondPushBack(o); } } - return (l); + return l; } /*- @@ -1131,7 +1131,7 @@ CondE(Boolean doEval) CondPushBack(o); } } - return (l); + return l; } /*- Modified: vendor/NetBSD/bmake/dist/dir.c ============================================================================== --- vendor/NetBSD/bmake/dist/dir.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/dir.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg Exp $ */ +/* $NetBSD: dir.c,v 1.76 2020/07/03 08:13:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.76 2020/07/03 08:13:23 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg Exp $"); +__RCSID("$NetBSD: dir.c,v 1.76 2020/07/03 08:13:23 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -112,7 +112,7 @@ __RCSID("$NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg * Dir_FindHereOrAbove Search for a path in the current directory and * then all the directories above it in turn until * the path is found or we reach the root ("/"). - * + * * Dir_MTime Return the modification time of a node. The file * is searched for along the default search path. * The path and mtime fields of the node are filled @@ -377,7 +377,7 @@ void Dir_InitCur(const char *cdname) { Path *p; - + if (cdname != NULL) { /* * Our build directory is not the same as our source directory. @@ -480,7 +480,7 @@ Dir_SetPATH(void) Boolean hasLastDot = FALSE; /* true we should search dot last */ Var_Delete(".PATH", VAR_GLOBAL); - + if (Lst_Open(dirSearchPath) == SUCCESS) { if ((ln = Lst_First(dirSearchPath)) != NULL) { p = (Path *)Lst_Datum(ln); @@ -537,7 +537,7 @@ Dir_SetPATH(void) static int DirFindName(const void *p, const void *dname) { - return (strcmp(((const Path *)p)->name, dname)); + return strcmp(((const Path *)p)->name, dname); } /*- @@ -545,7 +545,7 @@ DirFindName(const void *p, const void *dname) * Dir_HasWildcards -- * see if the given name has any wildcard characters in it * be careful not to expand unmatching brackets or braces. - * XXX: This code is not 100% correct. ([^]] fails etc.) + * XXX: This code is not 100% correct. ([^]] fails etc.) * I really don't think that make(1) should be expanding * patterns, because then you have to set a mechanism for * escaping the expansion! @@ -644,7 +644,7 @@ DirMatchFiles(const char *pattern, Path *p, Lst expans STR_ADDSLASH))); } } - return (0); + return 0; } /*- @@ -947,7 +947,7 @@ Dir_Expand(const char *word, Lst path, Lst expansions) *----------------------------------------------------------------------- */ static char * -DirLookup(Path *p, const char *name MAKE_ATTR_UNUSED, const char *cp, +DirLookup(Path *p, const char *name MAKE_ATTR_UNUSED, const char *cp, Boolean hasSlash MAKE_ATTR_UNUSED) { char *file; /* the current filename to check */ @@ -1004,7 +1004,7 @@ DirLookupSubdir(Path *p, const char *name) if (cached_stat(file, &stb) == 0) { nearmisses += 1; - return (file); + return file; } free(file); return NULL; @@ -1061,7 +1061,7 @@ DirLookupAbs(Path *p, const char *name, const char *cp if (DEBUG(DIR)) { fprintf(debug_file, " returning %s\n", name); } - return (bmake_strdup(name)); + return bmake_strdup(name); } /*- @@ -1087,7 +1087,7 @@ DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const ch } hits += 1; dot->hits += 1; - return (bmake_strdup(name)); + return bmake_strdup(name); } if (cur && Hash_FindEntry(&cur->files, cp) != NULL) { @@ -1185,7 +1185,7 @@ Dir_FindFile(const char *name, Lst path) * is found, we concatenate the directory name and the final * component and return the resulting string. If we don't find any * such thing, we go on to phase two... - * + * * No matter what, we always look for the file in the current * directory before anywhere else (unless we found the magic * DOTLAST path, in which case we search it last) and we *do not* @@ -1384,7 +1384,7 @@ Dir_FindFile(const char *name, Lst path) } if (Hash_FindEntry(&p->files, cp) != NULL) { - return (bmake_strdup(name)); + return bmake_strdup(name); } else { return NULL; } @@ -1395,7 +1395,7 @@ Dir_FindFile(const char *name, Lst path) bigmisses += 1; if (cached_stat(name, &stb) == 0) { - return (bmake_strdup(name)); + return bmake_strdup(name); } if (DEBUG(DIR)) { @@ -1409,14 +1409,14 @@ Dir_FindFile(const char *name, Lst path) /*- *----------------------------------------------------------------------- * Dir_FindHereOrAbove -- - * search for a path starting at a given directory and then working + * search for a path starting at a given directory and then working * our way up towards the root. * * Input: * here starting directory * search_path the path we are looking for * result the result of a successful search is placed here - * rlen the length of the result buffer + * rlen the length of the result buffer * (typically MAXPATHLEN + 1) * * Results: @@ -1426,7 +1426,7 @@ Dir_FindFile(const char *name, Lst path) * Side Effects: *----------------------------------------------------------------------- */ -int +int Dir_FindHereOrAbove(char *here, char *search_path, char *result, int rlen) { struct stat st; @@ -1451,7 +1451,7 @@ Dir_FindHereOrAbove(char *here, char *search_path, cha try_end = try + strlen(try); while (try_end > try && *try_end != '/') try_end--; - if (try_end > try) + if (try_end > try) *try_end = 0; /* chop! */ } @@ -1459,10 +1459,10 @@ Dir_FindHereOrAbove(char *here, char *search_path, cha * done! */ snprintf(result, rlen, "%s", try); - return(1); + return 1; } - /* + /* * nope, we didn't find it. if we used up dirbase we've * reached the root and failed. */ @@ -1479,9 +1479,9 @@ Dir_FindHereOrAbove(char *here, char *search_path, cha } /* while (1) */ /* - * we failed... + * we failed... */ - return(0); + return 0; } /*- @@ -1529,7 +1529,7 @@ Dir_MTime(GNode *gn, Boolean recheck) * see if we can find it via the current .PATH */ cp++; - + fullName = Dir_FindFile(cp, Suff_FindPath(gn)); if (fullName) { /* @@ -1572,7 +1572,7 @@ Dir_MTime(GNode *gn, Boolean recheck) } gn->mtime = stb.st_mtime; - return (gn->mtime); + return gn->mtime; } /*- @@ -1677,7 +1677,7 @@ Dir_CopyDir(void *p) { ((Path *)p)->refCount += 1; - return (p); + return p; } /*- @@ -1722,7 +1722,7 @@ Dir_MakeFlags(const char *flag, Lst path) Lst_Close(path); } - return (str); + return str; } /*- Modified: vendor/NetBSD/bmake/dist/for.c ============================================================================== --- vendor/NetBSD/bmake/dist/for.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/for.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $ */ +/* $NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $ */ /* * Copyright (c) 1992, The Regents of the University of California. @@ -30,14 +30,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $"; +static char rcsid[] = "$NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $"); +__RCSID("$NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -224,7 +224,7 @@ For_Eval(char *line) words = brk_string(sub, &nwords, FALSE, &word_buf); free(sub); - + if (words != NULL) { for (n = 0; n < nwords; n++) { ptr = words[n]; @@ -480,9 +480,9 @@ For_Iterate(void *v_arg, size_t *ret_len) void For_Run(int lineno) -{ +{ For *arg; - + arg = accumFor; accumFor = NULL; @@ -491,6 +491,6 @@ For_Run(int lineno) For_Free(arg); return; } - + Parse_SetInput(NULL, lineno, -1, For_Iterate, arg); } Modified: vendor/NetBSD/bmake/dist/hash.c ============================================================================== --- vendor/NetBSD/bmake/dist/hash.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/hash.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $ */ +/* $NetBSD: hash.c,v 1.22 2020/07/03 17:03:09 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $"; +static char rcsid[] = "$NetBSD: hash.c,v 1.22 2020/07/03 17:03:09 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $"); +__RCSID("$NetBSD: hash.c,v 1.22 2020/07/03 17:03:09 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -229,7 +229,7 @@ Hash_FindEntry(Hash_Table *t, const char *key) p = key; for (e = t->bucketPtr[h & t->mask]; e != NULL; e = e->next) if (e->namehash == h && strcmp(e->name, p) == 0) - return (e); + return e; return NULL; } @@ -279,7 +279,7 @@ Hash_CreateEntry(Hash_Table *t, const char *key, Boole if (e->namehash == h && strcmp(e->name, p) == 0) { if (newPtr != NULL) *newPtr = FALSE; - return (e); + return e; } } @@ -301,7 +301,7 @@ Hash_CreateEntry(Hash_Table *t, const char *key, Boole if (newPtr != NULL) *newPtr = TRUE; - return (e); + return e; } /* @@ -418,7 +418,7 @@ Hash_EnumNext(Hash_Search *searchPtr) e = t->bucketPtr[searchPtr->nextIndex++]; } searchPtr->hashEntryPtr = e; - return (e); + return e; } /* @@ -463,4 +463,15 @@ RebuildTable(Hash_Table *t) } } free(oldhp); +} + +void Hash_ForEach(Hash_Table *t, void (*action)(void *, void *), void *data) +{ + Hash_Search search; + Hash_Entry *e; + + for (e = Hash_EnumFirst(t, &search); + e != NULL; + e = Hash_EnumNext(&search)) + action(Hash_GetValue(e), data); } Modified: vendor/NetBSD/bmake/dist/hash.h ============================================================================== --- vendor/NetBSD/bmake/dist/hash.h Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/hash.h Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.12 2017/05/31 21:07:03 maya Exp $ */ +/* $NetBSD: hash.h,v 1.13 2020/07/03 17:03:09 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -145,5 +145,6 @@ Hash_Entry *Hash_CreateEntry(Hash_Table *, const char void Hash_DeleteEntry(Hash_Table *, Hash_Entry *); Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *); Hash_Entry *Hash_EnumNext(Hash_Search *); +void Hash_ForEach(Hash_Table *, void (*)(void *, void *), void *); #endif /* _HASH_H */ Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Wed Jul 8 18:29:06 2020 (r363017) +++ vendor/NetBSD/bmake/dist/job.c Wed Jul 8 18:32:15 2020 (r363018) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $ */ +/* $NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -274,7 +274,7 @@ static Shell shells[] = { "", }, /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Jul 8 18:32:28 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4333C369BD0; Wed, 8 Jul 2020 18:32:28 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B27Fl1NdKz4Pj5; Wed, 8 Jul 2020 18:32:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE24424990; Wed, 8 Jul 2020 18:32:25 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 068IWPgi043535; Wed, 8 Jul 2020 18:32:25 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 068IWP4C043534; Wed, 8 Jul 2020 18:32:25 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007081832.068IWP4C043534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 8 Jul 2020 18:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363019 - vendor/NetBSD/bmake/20200704 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/20200704 X-SVN-Commit-Revision: 363019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 18:32:28 -0000 Author: sjg Date: Wed Jul 8 18:32:25 2020 New Revision: 363019 URL: https://svnweb.freebsd.org/changeset/base/363019 Log: tag bmake-20200704 Added: vendor/NetBSD/bmake/20200704/ - copied from r363018, vendor/NetBSD/bmake/dist/ From owner-svn-src-vendor@freebsd.org Fri Jul 10 11:00:43 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E213F3662D0; Fri, 10 Jul 2020 11:00:43 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B397b5jTXz4SWN; Fri, 10 Jul 2020 11:00:43 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CC7D21008; Fri, 10 Jul 2020 11:00:43 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06AB0hPL068056; Fri, 10 Jul 2020 11:00:43 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06AB0f8s068046; Fri, 10 Jul 2020 11:00:41 GMT (envelope-from se@FreeBSD.org) Message-Id: <202007101100.06AB0f8s068046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 10 Jul 2020 11:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363074 - in vendor/bc/dist: . include manuals src tests tests/bc X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . include manuals src tests tests/bc X-SVN-Commit-Revision: 363074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 11:00:43 -0000 Author: se Date: Fri Jul 10 11:00:40 2020 New Revision: 363074 URL: https://svnweb.freebsd.org/changeset/base/363074 Log: Upgrade to version 3.1.3 This version fixes an incompatibility with GNU bc. Modified: vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/configure.sh vendor/bc/dist/include/vm.h vendor/bc/dist/locale_install.sh vendor/bc/dist/locale_uninstall.sh vendor/bc/dist/manuals/build.md vendor/bc/dist/src/vm.c vendor/bc/dist/tests/bc/stdin.txt vendor/bc/dist/tests/bc/stdin_results.txt vendor/bc/dist/tests/stdin.sh Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/Makefile.in Fri Jul 10 11:00:40 2020 (r363074) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.1 +VERSION = 3.1.3 SRC = %%SRC%% OBJ = %%OBJ%% @@ -335,7 +335,7 @@ clean_tests: clean clean_config clean_coverage @$(RM) -f bc.old install_locales: - $(LOCALE_INSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) + %%INSTALL_LOCALES%% install_bc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME) Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/NEWS.md Fri Jul 10 11:00:40 2020 (r363074) @@ -1,5 +1,25 @@ # News +## 3.1.3 + +This is a production release that fixes one minor bug: if `bc` was invoked like +the following, it would error: + +``` +echo "if (1 < 3) 1" | bc +``` + +Unless users run into this bug, they do not need to upgrade, but it is suggested +that they do. + +## 3.1.2 + +This is a production release that adds a way to install *all* locales. Users do +***NOT*** need to upgrade. + +For package maintainers wishing to make use of the change, just pass `-l` to +`configure.sh`. + ## 3.1.1 This is a production release that adds two Spanish locales. Users do ***NOT*** Modified: vendor/bc/dist/configure.sh ============================================================================== --- vendor/bc/dist/configure.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/configure.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -47,12 +47,12 @@ usage() { printf 'usage: %s -h\n' "$script" printf ' %s --help\n' "$script" - printf ' %s [-bD|-dB|-c] [-EfgGHMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" printf ' %s \\\n' "$script" printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' printf ' [--debug --disable-extra-math --disable-generated-tests] \\\n' printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' @@ -98,6 +98,10 @@ usage() { printf ' -k KARATSUBA_LEN, --karatsuba-len KARATSUBA_LEN\n' printf ' Set the karatsuba length to KARATSUBA_LEN (default is 64).\n' printf ' It is an error if KARATSUBA_LEN is not a number or is less than 16.\n' + printf ' -l, --install-all-locales\n' + printf ' Installs all locales, regardless of how many are on the system. This\n' + printf ' option is useful for package maintainers who want to make sure that\n' + printf ' a package contains all of the locales that end users might need.\n' printf ' -M, --disable-man-pages\n' printf ' Disable installing manpages.\n' printf ' -N, --disable-nls\n' @@ -319,8 +323,9 @@ nls=1 prompt=1 force=0 strip_bin=1 +all_locales=0 -while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do +while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in b) bc_only=1 ;; @@ -335,6 +340,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do h) usage ;; H) hist=0 ;; k) karatsuba_len="$OPTARG" ;; + l) all_locales=1 ;; M) install_manpages=0 ;; N) nls=0 ;; O) optimization="$OPTARG" ;; @@ -423,6 +429,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do disable-nls) nls=0 ;; disable-prompt) prompt=0 ;; disable-strip) strip_bin=0 ;; + install-all-locales) all_locales=1 ;; help* | bc-only* | dc-only* | coverage* | debug*) usage "No arg allowed for --$arg option" ;; disable-bc* | disable-dc* | disable-extra-math*) @@ -431,6 +438,8 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do usage "No arg allowed for --$arg option" ;; disable-man-pages* | disable-nls* | disable-strip*) usage "No arg allowed for --$arg option" ;; + install-all-locales*) + usage "No arg allowed for --$arg option" ;; '') break ;; # "--" terminates argument processing * ) usage "Invalid option $LONG_OPTARG" ;; esac @@ -751,8 +760,15 @@ if [ "$nls" -ne 0 ]; then else install_locales_prereqs="" uninstall_locales_prereqs="" + all_locales=0 fi +if [ "$nls" -ne 0 ] && [ "$all_locales" -ne 0 ]; then + install_locales="\$(LOCALE_INSTALL) -l \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)" +else + install_locales="\$(LOCALE_INSTALL) \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)" +fi + if [ "$hist" -eq 1 ]; then set +e @@ -911,6 +927,7 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC") contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT") contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS") contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs") +contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales") contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs") contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") Modified: vendor/bc/dist/include/vm.h ============================================================================== --- vendor/bc/dist/include/vm.h Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/include/vm.h Fri Jul 10 11:00:40 2020 (r363074) @@ -112,10 +112,10 @@ #if BC_ENABLED -#define BC_S (BC_ENABLED && (vm.flags & BC_FLAG_S)) -#define BC_W (BC_ENABLED && (vm.flags & BC_FLAG_W)) -#define BC_L (BC_ENABLED && (vm.flags & BC_FLAG_L)) -#define BC_G (BC_ENABLED && (vm.flags & BC_FLAG_G)) +#define BC_S (vm.flags & BC_FLAG_S) +#define BC_W (vm.flags & BC_FLAG_W) +#define BC_L (vm.flags & BC_FLAG_L) +#define BC_G (vm.flags & BC_FLAG_G) #endif // BC_ENABLED Modified: vendor/bc/dist/locale_install.sh ============================================================================== --- vendor/bc/dist/locale_install.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/locale_install.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -28,6 +28,9 @@ # usage() { + if [ $# -eq 1 ]; then + printf '%s\n' "$1" + fi printf "usage: %s NLSPATH main_exec [DESTDIR]\n" "$0" 1>&2 exit 1 } @@ -150,6 +153,17 @@ scriptdir=$(dirname "$script") . "$scriptdir/functions.sh" +all_locales=0 + +while getopts "l" opt; do + + case "$opt" in + l) all_locales=1 ; shift ;; + ?) usage "Invalid option $opt" ;; + esac + +done + test "$#" -ge 2 || usage nlspath="$1" @@ -180,19 +194,23 @@ fi for file in $locales_dir/*.msg; do locale=$(basename "$file" ".msg") - loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") - localeexists "$locales" "$locale" "$destdir" - err="$?" + if [ "$all_locales" -eq 0 ]; then - if [ "$err" -eq 0 ]; then - continue + localeexists "$locales" "$locale" "$destdir" + err="$?" + + if [ "$err" -eq 0 ]; then + continue + fi fi if [ -L "$file" ]; then continue fi + loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") + gencatfile "$loc" "$file" done @@ -200,14 +218,18 @@ done for file in $locales_dir/*.msg; do locale=$(basename "$file" ".msg") - loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") - localeexists "$locales" "$locale" "$destdir" - err="$?" + if [ "$all_locales" -eq 0 ]; then - if [ "$err" -eq 0 ]; then - continue + localeexists "$locales" "$locale" "$destdir" + err="$?" + + if [ "$err" -eq 0 ]; then + continue + fi fi + + loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") mkdir -p $(dirname "$loc") Modified: vendor/bc/dist/locale_uninstall.sh ============================================================================== --- vendor/bc/dist/locale_uninstall.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/locale_uninstall.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -59,6 +59,7 @@ fi # This way, we can delete catalogs for locales that we had to install # because they are symlinks. locales=$(gen_nlspath "$destdir/$nlspath" "*" "$main_exec") +locales=$(ls $locales 2> /dev/null) for l in $locales; do rm -f "$l" Modified: vendor/bc/dist/manuals/build.md ============================================================================== --- vendor/bc/dist/manuals/build.md Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/manuals/build.md Fri Jul 10 11:00:40 2020 (r363074) @@ -366,18 +366,18 @@ can be disabled permanently in the build by passing th Both commands are equivalent. -### Long Options +### Locales -By default, `bc` and `dc` support long options like `--mathlib` and -`--interactive`. However, support for these options requires `getopt_long()` -which is not in the POSIX standard. For those platforms that do *not* have -`getopt_long()` it will be disabled automatically, or if you wish to disable -them regardless, you can pass the `-L` flag or the `--disable-long-options` -option to `configure.sh`, as follows: +By default, `bc` and `dc` do not install all locales, but only the enabled +locales. If `DESTDIR` exists and is not empty, then they will install all of +the locales that exist on the system. The `-l` flag or `--install-all-locales` +option skips all of that and just installs all of the locales that `bc` and `dc` +have, regardless. To enable that behavior, you can pass the `-l` flag or the +`--install-all-locales` option to `configure.sh`, as follows: ``` -./configure.sh -L -./configure.sh --disable-long-options +./configure.sh -l +./configure.sh --install-all-locales ``` Both commands are equivalent. Modified: vendor/bc/dist/src/vm.c ============================================================================== --- vendor/bc/dist/src/vm.c Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/src/vm.c Fri Jul 10 11:00:40 2020 (r363074) @@ -602,8 +602,21 @@ restart: else if (BC_ERR(string)) bc_parse_err(&vm.prs, BC_ERROR_PARSE_STRING); #if BC_ENABLED - else if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs))) - bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK); + else if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs))) { + + size_t i; + bool good = true; + + for (i = 0; good && i < vm.prs.flags.len; ++i) { + uint16_t flag = *((uint16_t*) bc_vec_item(&vm.prs.flags, i)); + good = ((flag & BC_PARSE_FLAG_BRACE) != BC_PARSE_FLAG_BRACE); + } + + if (good) { + while (BC_PARSE_IF_END(&vm.prs)) bc_vm_process("else {}", true); + } + else bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK); + } #endif // BC_ENABLED } Modified: vendor/bc/dist/tests/bc/stdin.txt ============================================================================== --- vendor/bc/dist/tests/bc/stdin.txt Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/tests/bc/stdin.txt Fri Jul 10 11:00:40 2020 (r363074) @@ -13,3 +13,4 @@ i = 4 read() i *= 5 +if (1 < 3) 1 Modified: vendor/bc/dist/tests/bc/stdin_results.txt ============================================================================== --- vendor/bc/dist/tests/bc/stdin_results.txt Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/tests/bc/stdin_results.txt Fri Jul 10 11:00:40 2020 (r363074) @@ -4,3 +4,4 @@ String /* with partial commentString /* with full comm 7 String with a # hash comment3 20 +1 Modified: vendor/bc/dist/tests/stdin.sh ============================================================================== --- vendor/bc/dist/tests/stdin.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/tests/stdin.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -65,8 +65,16 @@ rm -f "$out" printf 'Running %s stdin tests...' "$d" cat "$testdir/$d/stdin.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null - diff "$testdir/$d/stdin_results.txt" "$out" + +if [ "$d" = "bc" ]; then + + cat "$testdir/$d/stdin1.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null + diff "$testdir/$d/stdin1_results.txt" "$out" + + cat "$testdir/$d/stdin2.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null + diff "$testdir/$d/stdin2_results.txt" "$out" +fi rm -f "$out1" From owner-svn-src-vendor@freebsd.org Fri Jul 10 11:01:06 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 875E9366A0C; Fri, 10 Jul 2020 11:01:06 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B39821z7sz4Srt; Fri, 10 Jul 2020 11:01:06 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EBB520B79; Fri, 10 Jul 2020 11:01:06 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06AB15Y3069091; Fri, 10 Jul 2020 11:01:05 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06AB15Mp069090; Fri, 10 Jul 2020 11:01:05 GMT (envelope-from se@FreeBSD.org) Message-Id: <202007101101.06AB15Mp069090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 10 Jul 2020 11:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363075 - vendor/bc/3.1.3 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.3 X-SVN-Commit-Revision: 363075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 11:01:06 -0000 Author: se Date: Fri Jul 10 11:01:05 2020 New Revision: 363075 URL: https://svnweb.freebsd.org/changeset/base/363075 Log: Tag version 3.1.3 Added: vendor/bc/3.1.3/ - copied from r363074, vendor/bc/dist/ From owner-svn-src-vendor@freebsd.org Sat Jul 11 22:45:09 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00F48373149; Sat, 11 Jul 2020 22:45:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B44jw6LyRz3TPF; Sat, 11 Jul 2020 22:45:08 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCE8A1A9A6; Sat, 11 Jul 2020 22:45:08 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06BMj8Z5016962; Sat, 11 Jul 2020 22:45:08 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06BMj5uU016947; Sat, 11 Jul 2020 22:45:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007112245.06BMj5uU016947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 11 Jul 2020 22:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363115 - in vendor/NetBSD/bmake/dist: . filemon mk unit-tests X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/NetBSD/bmake/dist: . filemon mk unit-tests X-SVN-Commit-Revision: 363115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2020 22:45:09 -0000 Author: sjg Date: Sat Jul 11 22:45:05 2020 New Revision: 363115 URL: https://svnweb.freebsd.org/changeset/base/363115 Log: Import bmake-20200710 from ChangeLog: o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall o meta.c: target flagged .META is out-of-date if meta file missing o cond.c: fix for compare_expression when doEval=0 o unit-tests/Makefile: rework o filemon/filemon_dev.c: ensure filemon fd is closed on exec. Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/VERSION vendor/NetBSD/bmake/dist/cond.c vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/filemon/filemon_dev.c vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/host-target.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/unit-tests/Makefile vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/ChangeLog Sat Jul 11 22:45:05 2020 (r363115) @@ -1,3 +1,20 @@ +2020-07-10 Simon J Gerraty + + * configure.in: use AC_INCLUDES_DEFAULT rather than AC_HEADER_STDC + + * VERSION (_MAKE_VERSION): 20200710 + Merge with NetBSD make, pick up + o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall + o meta.c: target flagged .META is out-of-date if meta file missing + +2020-07-09 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200709 + Merge with NetBSD make, pick up + o cond.c: fix for compare_expression when doEval=0 + o unit-tests/Makefile: rework + o filemon/filemon_dev.c: ensure filemon fd is closed on exec. + 2020-07-04 Simon J Gerraty * VERSION (_MAKE_VERSION): 20200704 Modified: vendor/NetBSD/bmake/dist/VERSION ============================================================================== --- vendor/NetBSD/bmake/dist/VERSION Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/VERSION Sat Jul 11 22:45:05 2020 (r363115) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20200704 +_MAKE_VERSION=20200710 Modified: vendor/NetBSD/bmake/dist/cond.c ============================================================================== --- vendor/NetBSD/bmake/dist/cond.c Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/cond.c Sat Jul 11 22:45:05 2020 (r363115) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $"); +__RCSID("$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -735,6 +735,11 @@ compare_expression(Boolean doEval) rhs = CondGetString(doEval, &rhsQuoted, &rhsFree, FALSE); if (!rhs) goto done; + + if (!doEval) { + t = TOK_FALSE; + goto done; + } if (rhsQuoted || lhsQuoted) { do_string_compare: Modified: vendor/NetBSD/bmake/dist/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/NetBSD/bmake/dist/configure.in ============================================================================== --- vendor/NetBSD/bmake/dist/configure.in Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/configure.in Sat Jul 11 22:45:05 2020 (r363115) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.65 2020/05/25 01:11:40 sjg Exp $ +dnl $Id: configure.in,v 1.66 2020/07/10 16:34:38 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20200524], [sjg@NetBSD.org]) +AC_INIT([bmake], [20200710], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -128,7 +128,7 @@ dnl AC_C_CROSS dnl dnl Checks for header files. -AC_HEADER_STDC +AC_INCLUDES_DEFAULT AC_HEADER_SYS_WAIT AC_HEADER_DIRENT dnl Keep this list sorted @@ -149,13 +149,11 @@ AC_CHECK_HEADERS( \ paths.h \ poll.h \ ranlib.h \ - string.h \ sys/mman.h \ sys/select.h \ sys/socket.h \ sys/time.h \ sys/uio.h \ - unistd.h \ utime.h \ ) Modified: vendor/NetBSD/bmake/dist/filemon/filemon_dev.c ============================================================================== --- vendor/NetBSD/bmake/dist/filemon/filemon_dev.c Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/filemon/filemon_dev.c Sat Jul 11 22:45:05 2020 (r363115) @@ -1,4 +1,4 @@ -/* $NetBSD: filemon_dev.c,v 1.1 2020/01/19 19:49:37 riastradh Exp $ */ +/* $NetBSD: filemon_dev.c,v 1.3 2020/07/10 15:53:30 sjg Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ filemon_open(void) return NULL; /* Try opening /dev/filemon, up to six times (cargo cult!). */ - for (i = 0; (F->fd = open(_PATH_FILEMON, O_RDWR)) == -1; i++) { + for (i = 0; (F->fd = open(_PATH_FILEMON, O_RDWR|O_CLOEXEC)) == -1; i++) { if (i == 5) { error = errno; goto fail0; Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/meta.c Sat Jul 11 22:45:05 2020 (r363115) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.85 2020/07/03 08:13:23 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.86 2020/07/11 00:39:53 sjg Exp $ */ /* * Implement 'meta' mode. @@ -1610,7 +1610,7 @@ meta_oodate(GNode *gn, Boolean oodate) oodate = TRUE; } } else { - if (writeMeta && metaMissing) { + if (writeMeta && (metaMissing || (gn->type & OP_META))) { cp = NULL; /* if target is in .CURDIR we do not need a meta file */ Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Sat Jul 11 22:45:05 2020 (r363115) @@ -1,3 +1,7 @@ +2020-07-10 Simon J Gerraty + + * dirdeps.mk: optimize content of dirdeps.cache + 2020-06-28 Simon J Gerraty * sys/*.mk: make it easier for local*sys.mk to customize by Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Sat Jul 11 22:45:05 2020 (r363115) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.104 2020/05/16 23:21:48 sjg Exp $ +# $Id: dirdeps.mk,v 1.106 2020/07/11 16:25:17 sjg Exp $ # Copyright (c) 2010-2020, Simon J. Gerraty # Copyright (c) 2010-2018, Juniper Networks, Inc. @@ -507,7 +507,7 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP # we want to capture the dirdeps count in the cache .END: _count_dirdeps _count_dirdeps: .NOMETA - @echo '.info $${.newline}$${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]}' >&3 + @{ echo; echo '.info $${.newline}$${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]}'; } >&3 .endif .elif !make(dirdeps) && !target(_count_dirdeps) @@ -644,19 +644,19 @@ _build_all_dirs := ${_build_all_dirs:O:u} .if ${.MAKEFLAGS:M-V${_V_READ_DIRDEPS}} == "" .if !empty(_build_all_dirs) .if ${BUILD_DIRDEPS_CACHE} == "yes" -# guard against _build_all_dirs being too big for a single command line -# first get list of dirs that need _DIRDEP_USE -# then export that and _build_all_dirs +x!= echo; { echo; echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; } >&3 +# guard against _new_dirdeps being too big for a single command line _new_dirdeps := ${_build_all_dirs:@x@${target($x):?:$x}@} -.export _new_dirdeps _build_all_dirs -x!= echo; { echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \ - echo "dirdeps: \\"; \ - for x in $$_build_all_dirs; do echo " $$x \\"; done; echo; \ - for x in $$_new_dirdeps; do echo "$$x: _DIRDEP_USE"; done; echo; } >&3 +.if !empty(_new_dirdeps) +.export _new_dirdeps +x!= echo; { echo; echo "dirdeps: \\"; \ + for x in $$_new_dirdeps; do echo " $$x \\"; done; echo; \ + for x in $$_new_dirdeps; do echo "$$x: _DIRDEP_USE"; done; } >&3 +.endif .if !empty(DEP_EXPORT_VARS) # Discouraged, but there are always exceptions. # Handle it here rather than explain how. -x!= { echo; ${DEP_EXPORT_VARS:@v@echo '$v=${$v}';@} echo '.export ${DEP_EXPORT_VARS}'; echo; } >&3; echo +x!= echo; { echo; ${DEP_EXPORT_VARS:@v@echo '$v=${$v}';@} echo '.export ${DEP_EXPORT_VARS}'; echo; } >&3 .endif .else # this makes it all happen @@ -675,6 +675,9 @@ DEP_EXPORT_VARS= # this builds the dependency graph .for m in ${_machines} +.if ${BUILD_DIRDEPS_CACHE} == "yes" && !empty(_build_dirs) +x!= echo; { echo; echo "${_this_dir}.$m: \\"; } >&3 +.endif # it would be nice to do :N${.TARGET} .if !empty(__qual_depdirs) .for q in ${__qual_depdirs:${M_dep_qual_fixes:ts:}:E:O:u:N$m} @@ -683,9 +686,10 @@ DEP_EXPORT_VARS= .endif .if ${BUILD_DIRDEPS_CACHE} == "yes" _cache_deps := ${_build_dirs:M*.$q} +.if !empty(_cache_deps) .export _cache_deps -x!= echo; { echo "${_this_dir}.$m: \\"; \ - for x in $$_cache_deps; do echo " $$x \\"; done; echo; } >&3 +x!= echo; for x in $$_cache_deps; do echo " $$x \\"; done >&3 +.endif .else ${_this_dir}.$m: ${_build_dirs:M*.$q} .endif @@ -696,9 +700,10 @@ ${_this_dir}.$m: ${_build_dirs:M*.$q} .endif .if ${BUILD_DIRDEPS_CACHE} == "yes" _cache_deps := ${_build_dirs:M*.$m:N${_this_dir}.$m} +.if !empty(_cache_deps) .export _cache_deps -x!= echo; { echo "${_this_dir}.$m: \\"; \ - for x in $$_cache_deps; do echo " $$x \\"; done; echo; } >&3 +x!= echo; for x in $$_cache_deps; do echo " $$x \\"; done >&3 +.endif .else ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m} .endif Modified: vendor/NetBSD/bmake/dist/mk/host-target.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/host-target.mk Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/mk/host-target.mk Sat Jul 11 22:45:05 2020 (r363115) @@ -1,5 +1,5 @@ # RCSid: -# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $ +# $Id: host-target.mk,v 1.12 2020/07/08 23:35:29 sjg Exp $ # Host platform information; may be overridden .if !defined(_HOST_OSNAME) @@ -37,6 +37,11 @@ HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C HOST_OS := ${_HOST_OSNAME} host_os := ${_HOST_OSNAME:tl} HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH} +# sometimes we want HOST_TARGET32 +MACHINE32.amd64 = i386 +MACHINE32.x86_64 = i386 +_HOST_ARCH32 := ${MACHINE32.${_HOST_ARCH}:U${_HOST_ARCH:S,64$,,}} +HOST_TARGET32 := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH32} # tr is insanely non-portable, accommodate the lowest common denominator TR ?= tr Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/mk/install-mk Sat Jul 11 22:45:05 2020 (r363115) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.173 2020/06/23 04:16:35 sjg Exp $ +# $Id: install-mk,v 1.174 2020/07/10 21:50:14 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20200622 +MK_VERSION=20200710 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/unit-tests/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/Makefile Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/unit-tests/Makefile Sat Jul 11 22:45:05 2020 (r363115) @@ -1,87 +1,105 @@ -# $Id: Makefile,v 1.58 2020/07/04 22:33:00 sjg Exp $ +# $Id: Makefile,v 1.60 2020/07/10 00:48:32 sjg Exp $ # -# $NetBSD: Makefile,v 1.59 2020/06/28 09:42:40 rillig Exp $ +# $NetBSD: Makefile,v 1.63 2020/07/09 22:40:14 sjg Exp $ # # Unit tests for make(1) +# # The main targets are: -# -# all: run all the tests -# test: run 'all', and compare to expected results -# accept: move generated output to expected results # -# Adding a test case. +# all: +# run all the tests +# test: +# run 'all', and compare to expected results +# accept: +# move generated output to expected results +# +# Settable variables +# +# TEST_MAKE +# The make program to be tested. +# +# +# Adding a test case +# # Each feature should get its own set of tests in its own suitably # named makefile (*.mk), with its own set of expected results (*.exp), -# and it should be added to the TESTNAMES list. -# +# and it should be added to the TESTS list. +# +# Any added files must also be added to src/distrib/sets/lists/tests/mi. +# Makefiles that are not added to TESTS must be ignored in +# src/tests/usr.bin/make/t_make.sh (example: include-sub). +# -.MAIN: all +# Each test is in a sub-makefile. +# Keep the list sorted. +TESTS+= comment +TESTS+= cond-late +TESTS+= cond-short +TESTS+= cond1 +TESTS+= cond2 +TESTS+= dollar +TESTS+= doterror +TESTS+= dotwait +TESTS+= error +TESTS+= # escape # broken by reverting POSIX changes +TESTS+= export +TESTS+= export-all +TESTS+= export-env +TESTS+= forloop +TESTS+= forsubst +TESTS+= hash +TESTS+= # impsrc # broken by reverting POSIX changes +TESTS+= include-main +TESTS+= misc +TESTS+= moderrs +TESTS+= modmatch +TESTS+= modmisc +TESTS+= modorder +TESTS+= modts +TESTS+= modword +TESTS+= order +TESTS+= # phony-end # broken by reverting POSIX changes +TESTS+= posix +TESTS+= # posix1 # broken by reverting POSIX changes +TESTS+= qequals +TESTS+= # suffixes # broken by reverting POSIX changes +TESTS+= sunshcmd +TESTS+= sysv +TESTS+= ternary +TESTS+= unexport +TESTS+= unexport-env +TESTS+= varcmd +TESTS+= varmisc +TESTS+= varmod-edge +TESTS+= varquote +TESTS+= varshell -.-include "Makefile.config" +# Override make flags for certain tests; default is -k. +FLAGS.doterror= # none +FLAGS.order= -j1 -UNIT_TESTS:= ${.PARSEDIR} -.PATH: ${UNIT_TESTS} +# Some tests need extra post-processing. +SED_CMDS.modmisc+= -e 's,\(substitution error:\).*,\1 (details omitted),' +SED_CMDS.varshell+= -e 's,^[a-z]*sh: ,,' +SED_CMDS.varshell+= -e '/command/s,No such.*,not found,' -# Each test is in a sub-makefile. -# Keep the list sorted. -TESTNAMES= \ - comment \ - cond-late \ - cond-short \ - cond1 \ - cond2 \ - dollar \ - doterror \ - dotwait \ - error \ - export \ - export-all \ - export-env \ - forloop \ - forsubst \ - hash \ - include-main \ - misc \ - moderrs \ - modmatch \ - modmisc \ - modorder \ - modts \ - modword \ - order \ - posix \ - qequals \ - sunshcmd \ - sysv \ - ternary \ - unexport \ - unexport-env \ - varcmd \ - varmisc \ - varmod-edge \ - varquote \ - varshell +# End of the configuration section. -# these tests were broken by referting POSIX chanegs -STRICT_POSIX_TESTS = \ - escape \ - impsrc \ - phony-end \ - posix1 \ - suffixes +.MAIN: all -# Override make flags for certain tests -flags.doterror= -flags.order=-j1 +.-include "Makefile.config" -OUTFILES= ${TESTNAMES:S/$/.out/} +UNIT_TESTS:= ${.PARSEDIR} +.PATH: ${UNIT_TESTS} +OUTFILES= ${TESTS:=.out} + all: ${OUTFILES} -CLEANFILES += *.rawout *.out *.status *.tmp *.core *.tmp -CLEANFILES += obj*.[och] lib*.a # posix1.mk -CLEANFILES += issue* .[ab]* # suffixes.mk -CLEANRECURSIVE += dir dummy # posix1.mk +CLEANFILES+= *.rawout *.out *.status *.tmp *.core *.tmp +CLEANFILES+= obj*.[och] lib*.a # posix1.mk +CLEANFILES+= issue* .[ab]* # suffixes.mk +CLEANRECURSIVE+= dir dummy # posix1.mk clean: rm -f ${CLEANFILES} @@ -89,45 +107,42 @@ clean: rm -rf ${CLEANRECURSIVE} .endif -TEST_MAKE?= ${.MAKE} -TOOL_SED?= sed -TOOL_TR?= tr -TOOL_DIFF?= diff +TEST_MAKE?= ${.MAKE} +TOOL_SED?= sed +TOOL_TR?= tr +TOOL_DIFF?= diff +DIFF_FLAGS?= -u .if defined(.PARSEDIR) # ensure consistent results from sort(1) -LC_ALL= C -LANG= C +LC_ALL= C +LANG= C .export LANG LC_ALL .endif -# some tests need extra post-processing -SED_CMDS.varshell = -e 's,^[a-z]*sh: ,,' \ - -e '/command/s,No such.*,not found,' - -# the detailed error message can vary across systems -SED_CMDS.modmisc = -e 's,\(substitution error:\).*,\1 details omitted,' - # the tests are actually done with sub-makes. .SUFFIXES: .mk .rawout .out .mk.rawout: - @echo ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} + @echo ${TEST_MAKE} ${FLAGS.${.TARGET:R}:U-k} -f ${.IMPSRC} -@cd ${.OBJDIR} && \ - { ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} \ + { ${TEST_MAKE} ${FLAGS.${.TARGET:R}:U-k} -f ${.IMPSRC} \ 2>&1 ; echo $$? >${.TARGET:R}.status ; } > ${.TARGET}.tmp @mv ${.TARGET}.tmp ${.TARGET} -# We always pretend .MAKE was called 'make' -# and strip ${.CURDIR}/ from the output -# and replace anything after 'stopped in' with unit-tests -# so the results can be compared. +# Post-process the test output so that the results can be compared. +# +# always pretend .MAKE was called 'make' +_SED_CMDS+= -e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,' +_SED_CMDS+= -e 's,${TEST_MAKE:S,.,\\.,g},make,' +# replace anything after 'stopped in' with unit-tests +_SED_CMDS+= -e '/stopped/s, /.*, unit-tests,' +# strip ${.CURDIR}/ from the output +_SED_CMDS+= -e 's,${.CURDIR:S,.,\\.,g}/,,g' +_SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g' + .rawout.out: @echo postprocess ${.TARGET} - @${TOOL_SED} -e 's,^${TEST_MAKE:T:C/\./\\\./g}[][0-9]*:,make:,' \ - -e 's,${TEST_MAKE:C/\./\\\./g},make,' \ - -e '/stopped/s, /.*, unit-tests,' \ - -e 's,${.CURDIR:C/\./\\\./g}/,,g' \ - -e 's,${UNIT_TESTS:C/\./\\\./g}/,,g' ${SED_CMDS.${.TARGET:T:R}} \ + @${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.TARGET:R}} \ < ${.IMPSRC} > ${.TARGET}.tmp @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp @mv ${.TARGET}.tmp ${.TARGET} @@ -135,7 +150,7 @@ SED_CMDS.modmisc = -e 's,\(substitution error:\).*,\1 # Compare all output files test: ${OUTFILES} .PHONY @failed= ; \ - for test in ${TESTNAMES}; do \ + for test in ${TESTS}; do \ ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \ || failed="$${failed}$${failed:+ }$${test}" ; \ done ; \ @@ -146,14 +161,14 @@ test: ${OUTFILES} .PHONY fi accept: - @for test in ${TESTNAMES}; do \ + @for test in ${TESTS}; do \ cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \ || { echo "Replacing $${test}.exp" ; \ cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ done .if exists(${TEST_MAKE}) -${TESTNAMES:S/$/.rawout/}: ${TEST_MAKE} +${TESTS:=.rawout}: ${TEST_MAKE} .endif .-include Modified: vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/unit-tests/cond-short.exp Sat Jul 11 22:45:05 2020 (r363115) @@ -7,4 +7,10 @@ expected M pattern expected or expected or exists expected or empty +defined(V42) && 42 > 0: Ok +defined(V66) && ( "" < 42 ): Ok +1 || 42 < 42: Ok +1 || < 42: Ok +0 || 42 <= 42: Ok +0 || < 42: Ok exit status 0 Modified: vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/unit-tests/cond-short.mk Sat Jul 11 22:45:05 2020 (r363115) @@ -1,4 +1,4 @@ -# $NetBSD: cond-short.mk,v 1.6 2020/07/02 16:37:56 rillig Exp $ +# $NetBSD: cond-short.mk,v 1.7 2020/07/09 22:34:09 sjg Exp $ # # Demonstrates that in conditions, the right-hand side of an && or || # is only evaluated if it can actually influence the result. @@ -96,6 +96,58 @@ VAR= # empty again, for the following tests .if 1 .elif ${echo "unexpected nested or" 1>&2 :L:sh} .endif + +# make sure these do not cause complaint +#.MAKEFLAGS: -dc + +V42 = 42 +iV1 = ${V42} +iV2 = ${V66} + +.if defined(V42) && ${V42} > 0 +x=Ok +.else +x=Fail +.endif +x!= echo 'defined(V42) && ${V42} > 0: $x' >&2; echo +# this one throws both String comparison operator and +# Malformed conditional with cond.c 1.78 +# indirect iV2 would expand to "" and treated as 0 +.if defined(V66) && ( ${iV2} < ${V42} ) +x=Fail +.else +x=Ok +.endif +x!= echo 'defined(V66) && ( "${iV2}" < ${V42} ): $x' >&2; echo +# next two thow String comparison operator with cond.c 1.78 +# indirect iV1 would expand to 42 +.if 1 || ${iV1} < ${V42} +x=Ok +.else +x=Fail +.endif +x!= echo '1 || ${iV1} < ${V42}: $x' >&2; echo +.if 1 || ${iV2:U2} < ${V42} +x=Ok +.else +x=Fail +.endif +x!= echo '1 || ${iV2:U2} < ${V42}: $x' >&2; echo +# the same expressions are fine when the lhs is expanded +# ${iV1} expands to 42 +.if 0 || ${iV1} <= ${V42} +x=Ok +.else +x=Fail +.endif +x!= echo '0 || ${iV1} <= ${V42}: $x' >&2; echo +# ${iV2:U2} expands to 2 +.if 0 || ${iV2:U2} < ${V42} +x=Ok +.else +x=Fail +.endif +x!= echo '0 || ${iV2:U2} < ${V42}: $x' >&2; echo all: @:;: Modified: vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp Sat Jul 11 22:45:05 2020 (r363115) @@ -25,11 +25,27 @@ C:empty :a b b c: :a b b c: : b c: -make: RE substitution error: details omitted +make: RE substitution error: (details omitted) make: Unclosed substitution for (, missing) :C,word,____,:Q}: :a c: :x__ 3 x__ 3: :+one+ +two+ +three+: mod-at-resolve:w1d2d3w w2i3w w1i2d3 2i${RES3}w w1d2d3 2i${RES3} 1i${RES2}w: +mod-subst-dollar:$1: +mod-subst-dollar:$2: +mod-subst-dollar:$3: +mod-subst-dollar:$4: +mod-subst-dollar:$5: +mod-subst-dollar:$6: +mod-subst-dollar:$7: +mod-subst-dollar:$8: +mod-subst-dollar:U8: +mod-subst-dollar:$$$$: +mod-loop-dollar:1: +mod-loop-dollar:${word}: +mod-loop-dollar:$3$: +mod-loop-dollar:$${word}$: +mod-loop-dollar:$$5$$: +mod-loop-dollar:$$${word}$$: exit status 0 Modified: vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk Sat Jul 11 22:14:44 2020 (r363114) +++ vendor/NetBSD/bmake/dist/unit-tests/modmisc.mk Sat Jul 11 22:45:05 2020 (r363115) @@ -1,4 +1,4 @@ -# $Id: modmisc.mk,v 1.1.1.2 2020/07/04 17:52:46 sjg Exp $ +# $Id: modmisc.mk,v 1.1.1.3 2020/07/09 22:35:19 sjg Exp $ # # miscellaneous modifier tests @@ -17,6 +17,7 @@ MOD_SEP=S,:, ,g all: modvar modvarloop modsysv mod-HTE emptyvar undefvar all: mod-S mod-C mod-at-varname mod-at-resolve +all: mod-subst-dollar mod-loop-dollar modsysv: @echo "The answer is ${libfoo.a:L:libfoo.a=42}" @@ -93,3 +94,34 @@ RES3= 3 mod-at-resolve: @echo $@:${RESOLVE:@v@w${v}w@:Q}: + +# No matter how many dollar characters there are, they all get merged +# into a single dollar by the :S modifier. +mod-subst-dollar: + @echo $@:${:U1:S,^,$,:Q}: + @echo $@:${:U2:S,^,$$,:Q}: + @echo $@:${:U3:S,^,$$$,:Q}: + @echo $@:${:U4:S,^,$$$$,:Q}: + @echo $@:${:U5:S,^,$$$$$,:Q}: + @echo $@:${:U6:S,^,$$$$$$,:Q}: + @echo $@:${:U7:S,^,$$$$$$$,:Q}: + @echo $@:${:U8:S,^,$$$$$$$$,:Q}: +# This generates no dollar at all: + @echo $@:${:UU8:S,^,${:U$$$$$$$$},:Q}: +# Here is an alternative way to generate dollar characters. +# It's unexpectedly complicated though. + @echo $@:${:U:range=5:ts\x24:C,[0-9],,g:Q}: + +# Demonstrate that it is possible to generate dollar characters using the +# :@ modifier. +# +# These are edge cases that could have resulted in a parse error as well +# since the $@ at the end could have been interpreted as a variable, which +# would mean a missing closing @ delimiter. +mod-loop-dollar: + @echo $@:${:U1:@word@${word}$@:Q}: + @echo $@:${:U2:@word@$${word}$$@:Q}: + @echo $@:${:U3:@word@$$${word}$$$@:Q}: + @echo $@:${:U4:@word@$$$${word}$$$$@:Q}: + @echo $@:${:U5:@word@$$$$${word}$$$$$@:Q}: + @echo $@:${:U6:@word@$$$$$${word}$$$$$$@:Q}: From owner-svn-src-vendor@freebsd.org Sat Jul 11 22:45:37 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A1743734CA; Sat, 11 Jul 2020 22:45:37 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B44kT2cd6z3T4j; Sat, 11 Jul 2020 22:45:37 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23A821A945; Sat, 11 Jul 2020 22:45:37 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06BMjbqs017023; Sat, 11 Jul 2020 22:45:37 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06BMjbfx017022; Sat, 11 Jul 2020 22:45:37 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007112245.06BMjbfx017022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 11 Jul 2020 22:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363116 - vendor/NetBSD/bmake/20200710 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/20200710 X-SVN-Commit-Revision: 363116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2020 22:45:37 -0000 Author: sjg Date: Sat Jul 11 22:45:36 2020 New Revision: 363116 URL: https://svnweb.freebsd.org/changeset/base/363116 Log: tag bmake-20200710 Added: vendor/NetBSD/bmake/20200710/ - copied from r363115, vendor/NetBSD/bmake/dist/