From owner-dev-commits-src-all@freebsd.org Mon Oct 4 08:06:45 2021 Return-Path: Delivered-To: dev-commits-src-all@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 8E204679464; Mon, 4 Oct 2021 08:06:45 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNCwj3WGVz3rZy; Mon, 4 Oct 2021 08:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59C1815D28; Mon, 4 Oct 2021 08:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19486jeT054619; Mon, 4 Oct 2021 08:06:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19486jVT054618; Mon, 4 Oct 2021 08:06:45 GMT (envelope-from git) Date: Mon, 4 Oct 2021 08:06:45 GMT Message-Id: <202110040806.19486jVT054618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: ea31d1a5c490 - main - contrib/bc: remove files ommitted from the release MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea31d1a5c490193348e0b71fdda6d08a2c80a2eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 08:06:45 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=ea31d1a5c490193348e0b71fdda6d08a2c80a2eb commit ea31d1a5c490193348e0b71fdda6d08a2c80a2eb Author: Stefan Eßer AuthorDate: 2021-10-04 07:41:06 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 07:41:06 +0000 contrib/bc: remove files ommitted from the release A number of files have been removed from the release distribution of this bc implementation. They were mostly relevant for pre release testing and benchmarking to identify regressions. The Markdown sources of the man pages are only relevant for combinations of build options not used in FreeBSD and need non-default conversion tools (available as ports in FreeBSD). All the omitted files can be found in the upstream git repository, and they are fetched when building this software as a port. But they have never been used in the FreeBSD base system. --- contrib/bc/benchmarks/bc/add.bc | 21 - contrib/bc/benchmarks/bc/arrays.bc | 34 - contrib/bc/benchmarks/bc/arrays_and_constants.bc | 35 - contrib/bc/benchmarks/bc/bitfuncs.bc | 18 - contrib/bc/benchmarks/bc/constants.bc | 41 - contrib/bc/benchmarks/bc/divide.bc | 26 - contrib/bc/benchmarks/bc/functions.bc | 34 - contrib/bc/benchmarks/bc/irand_long.bc | 9 - contrib/bc/benchmarks/bc/irand_short.bc | 5 - contrib/bc/benchmarks/bc/lib.bc | 7 - contrib/bc/benchmarks/bc/multiply.bc | 23 - contrib/bc/benchmarks/bc/postfix_incdec.bc | 7 - contrib/bc/benchmarks/bc/power.bc | 2 - contrib/bc/benchmarks/bc/strings.bc | 36 - contrib/bc/benchmarks/bc/subtract.bc | 22 - contrib/bc/benchmarks/dc/modexp.dc | 42 - contrib/bc/manuals/development.md | 4950 ---------------------- contrib/bc/manuals/release.md | 72 - contrib/bc/scripts/afl.py | 245 -- contrib/bc/scripts/alloc.sh | 84 - contrib/bc/scripts/benchmark.sh | 159 - contrib/bc/scripts/bitgen.c | 101 - contrib/bc/scripts/fuzz_prep.sh | 81 - contrib/bc/scripts/manpage.sh | 175 - contrib/bc/scripts/ministat.c | 670 --- contrib/bc/scripts/package.sh | 173 - contrib/bc/scripts/radamsa.sh | 133 - contrib/bc/scripts/radamsa.txt | 17 - contrib/bc/scripts/randmath.py | 421 -- contrib/bc/scripts/release.sh | 779 ---- contrib/bc/scripts/release_settings.txt | 16 - contrib/bc/scripts/test_settings.sh | 77 - contrib/bc/scripts/test_settings.txt | 93 - contrib/bc/tests/fuzzing/bc_afl.yaml | 125 - contrib/bc/tests/fuzzing/bc_afl_continue.yaml | 122 - contrib/bc/tests/fuzzing/bc_inputs1/strings.txt | 14 - contrib/bc/tests/fuzzing/dc_inputs/stack_len.txt | 1 - 37 files changed, 8870 deletions(-) diff --git a/contrib/bc/benchmarks/bc/add.bc b/contrib/bc/benchmarks/bc/add.bc deleted file mode 100644 index 90a83e4758d9..000000000000 --- a/contrib/bc/benchmarks/bc/add.bc +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 / scale\n" -print "len = length(x) + 1 + scale\n" -print "len *= 2\n" - -scale = 20 -x = 1234567890 / scale -len = length(x) + 1 + scale -len *= 2 - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[", i, "] + a[", j, "]\n" - } -} diff --git a/contrib/bc/benchmarks/bc/arrays.bc b/contrib/bc/benchmarks/bc/arrays.bc deleted file mode 100644 index e3c463187d78..000000000000 --- a/contrib/bc/benchmarks/bc/arrays.bc +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 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: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "a", i, "[0] = ", i, "\n" -} diff --git a/contrib/bc/benchmarks/bc/arrays_and_constants.bc b/contrib/bc/benchmarks/bc/arrays_and_constants.bc deleted file mode 100644 index 93c5594bec20..000000000000 --- a/contrib/bc/benchmarks/bc/arrays_and_constants.bc +++ /dev/null @@ -1,35 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 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: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "b", i, "[100] = ", i, "\n" -} - diff --git a/contrib/bc/benchmarks/bc/bitfuncs.bc b/contrib/bc/benchmarks/bc/bitfuncs.bc deleted file mode 100644 index 1c2a6529d04b..000000000000 --- a/contrib/bc/benchmarks/bc/bitfuncs.bc +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/bin/bc -lq - -scale = 0 -max = 10000 - -print "scale = 0\n" - -for (i = 0; i < max; ++i) { - - a = rand() - b = rand() - - print "band(", a, ", ", b, ")\n" - print "bor(", a, ", ", b, ")\n" - print "bxor(", a, ", ", b, ")\n" - print "blshift(", a, ", ", b % 32, ")\n" - print "brshift(", a, ", ", b % 32, ")\n" -} diff --git a/contrib/bc/benchmarks/bc/constants.bc b/contrib/bc/benchmarks/bc/constants.bc deleted file mode 100644 index 1f7b92d47566..000000000000 --- a/contrib/bc/benchmarks/bc/constants.bc +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 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: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -max = 1000 -max2 = 1000 - -for (i = 0; i < max; ++i) { - - print "c = ", i, "\n" - print "e = 0.", i, "\n" - - for (j = 0; j < max2; ++j) { - print "d = ", i, ".", j, "\n" - } -} diff --git a/contrib/bc/benchmarks/bc/divide.bc b/contrib/bc/benchmarks/bc/divide.bc deleted file mode 100644 index 227794badbcb..000000000000 --- a/contrib/bc/benchmarks/bc/divide.bc +++ /dev/null @@ -1,26 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 * 10^(-scale)\n" -print "len = 1 + 2 * scale\n" -print "scale += 10\n" - -scale = 20 -x = 1234567890 * 10^(-scale) -len = 1 + 2 * scale - -scale += 10 - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[0] / a[", j, "]\n" - print "v = a[", i, "] / a[", j, "]\n" - print "v = (a[0] * ", i, ") / a[", j, "]\n" - print "v = a[0] / (a[", j, "] * ", i, ")\n" - print "v = (a[0] * ", i, ") / (a[", j, "] * ", i, ")\n" - } -} diff --git a/contrib/bc/benchmarks/bc/functions.bc b/contrib/bc/benchmarks/bc/functions.bc deleted file mode 100644 index dc6ae8d6edc5..000000000000 --- a/contrib/bc/benchmarks/bc/functions.bc +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 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: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "define etsna", i, "(n) {\n\tn\n}\n" -} diff --git a/contrib/bc/benchmarks/bc/irand_long.bc b/contrib/bc/benchmarks/bc/irand_long.bc deleted file mode 100644 index 9274f8953b60..000000000000 --- a/contrib/bc/benchmarks/bc/irand_long.bc +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/bc -lq - -start = 2^256 -end = start + 10000000 - -for (i = start; i < end; ++i) { - print "irand(", i, ")\n" -} - diff --git a/contrib/bc/benchmarks/bc/irand_short.bc b/contrib/bc/benchmarks/bc/irand_short.bc deleted file mode 100644 index 16ae863f2e2b..000000000000 --- a/contrib/bc/benchmarks/bc/irand_short.bc +++ /dev/null @@ -1,5 +0,0 @@ -#! /usr/bin/bc -lq - -for (i = 2; i < 10000000; ++i) { - print "irand(", i, ")\n" -} diff --git a/contrib/bc/benchmarks/bc/lib.bc b/contrib/bc/benchmarks/bc/lib.bc deleted file mode 100644 index 87b5f9168458..000000000000 --- a/contrib/bc/benchmarks/bc/lib.bc +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/bc -lq - -print "for (i = 100; i < 1000; ++i) {\n" -print " v = pi(i)\n" -print " v = e(v)\n" -print " v = l(v)\n" -print "}\n" diff --git a/contrib/bc/benchmarks/bc/multiply.bc b/contrib/bc/benchmarks/bc/multiply.bc deleted file mode 100644 index d4ed08e055c8..000000000000 --- a/contrib/bc/benchmarks/bc/multiply.bc +++ /dev/null @@ -1,23 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 / scale\n" -print "len = length(x) + 1 + scale\n" - -scale = 20 -x = 1234567890 / scale -len = length(x) + 1 + scale - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[0] * a[", j, "]\n" - print "v = a[", i, "] * a[", j, "]\n" - print "v = (a[0] * ", i, ") * a[", j, "]\n" - print "v = a[0] * (a[", j, "] * ", i, ")\n" - print "v = (a[0] * ", i, ") * (a[", j, "] * ", i, ")\n" - } -} diff --git a/contrib/bc/benchmarks/bc/postfix_incdec.bc b/contrib/bc/benchmarks/bc/postfix_incdec.bc deleted file mode 100644 index 922a065a8172..000000000000 --- a/contrib/bc/benchmarks/bc/postfix_incdec.bc +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/bc -lq - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "i++\ni--\n" -} diff --git a/contrib/bc/benchmarks/bc/power.bc b/contrib/bc/benchmarks/bc/power.bc deleted file mode 100644 index b067aa732d10..000000000000 --- a/contrib/bc/benchmarks/bc/power.bc +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/bc -lq - diff --git a/contrib/bc/benchmarks/bc/strings.bc b/contrib/bc/benchmarks/bc/strings.bc deleted file mode 100644 index 13cf200cdb89..000000000000 --- a/contrib/bc/benchmarks/bc/strings.bc +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 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: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -max = 1000000 - -print "\qasotehnuasnotehustnaoheusntaoheustnaoheusntaoehunsatoheuastoehuaosnetuhaosetnuhaosentuahoesntuahoeuhstoeunhatoehusanotehusatnoheus\q\n" - -for (i = 0; i < max; ++i) { - print "\qabc", i, " = ", i, "\\n\q\n" -} diff --git a/contrib/bc/benchmarks/bc/subtract.bc b/contrib/bc/benchmarks/bc/subtract.bc deleted file mode 100644 index b88bd60e935c..000000000000 --- a/contrib/bc/benchmarks/bc/subtract.bc +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 / scale\n" -print "len = length(x) + 1 + scale\n" -print "len *= 2\n" - -scale = 20 -x = 1234567890 / scale -len = length(x) + 1 + scale -len *= 2 - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[", i, "] - a[", j, "]\n" - } -} - diff --git a/contrib/bc/benchmarks/dc/modexp.dc b/contrib/bc/benchmarks/dc/modexp.dc deleted file mode 100644 index 48f304cb92da..000000000000 --- a/contrib/bc/benchmarks/dc/modexp.dc +++ /dev/null @@ -1,42 +0,0 @@ -#! /usr/bin/dc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 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: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -[ ]ss -[|]so -100sm 0si -[ - li1+si 0sj - [ - lj1+sj 0sk - [ - lk1+sk lin lsn ljn lsn lkn lsn lon 10P lk lm !scale)scale=l - t=irand(t)/t - scale=s - return t -} -define ifbrand(i,b,p){return irand(abs(i)$)+fbrand(b,p)} -``` - -This allows me to use `bc` as part of my `bash` prompt. - -## Code Style - -The code style for `bc` is...weird, and that comes from historical accident. - -In [History][23], I mentioned how I got my `bc` in [toybox][16]. Well, in order -to do that, my `bc` originally had toybox style. Eventually, I changed to using -tabs, and assuming they were 4 spaces wide, but other than that, I basically -kept the same style, with some exceptions that are more or less dependent on my -taste. - -The code style is as follows: - -* Tabs are 4 spaces. -* Tabs are used at the beginning of lines for indent. -* Spaces are used for alignment. -* Lines are limited to 80 characters, period. -* Pointer asterisk (`*`) goes with the variable (on the right), not the type, - unless it is for a pointer type returned from a function. -* The opening brace is put on the same line as the header for the function, - loop, or `if` statement. -* Unless the header is more than one line, in which case the opening brace is - put on its own line. -* If the opening brace is put on its own line, there is no blank line after it. -* If the opening brace is *not* put on its own line, there *is* a blank line - after it, *unless* the block is only one or two lines long. -* Code lines are grouped into what I call "paragraphs." Basically, lines that - seem like they should go together are grouped together. This one comes down - to judgment. -* Bodies of `if` statements, `else` statements, and loops that are one line - long are put on the same line as the statement, unless the header is more than - one line long, and/or, the header and body cannot fit into 80 characters with - a space inbetween them. -* If single-line bodies are on a separate line from their headers, and the - headers are only a single line, then no braces are used. -* However, braces are *always* used if they contain another `if` statement or - loop. -* Loops with empty bodies are ended with a semicolon. -* Expressions that return a boolean value are surrounded by paretheses. -* Macro backslashes are aligned as far to the left as possible. -* Binary operators have spaces on both sides. -* If a line with binary operators overflows 80 characters, a newline is inserted - *after* binary operators. -* Function modifiers and return types are on the same line as the function name. -* With one exception, `goto`'s are only used to jump to the end of a function - for cleanup. -* All structs, enums, and unions are `typedef`'ed. -* All constant data is in one file: [`src/data.c`][131], but the corresponding - `extern` declarations are in the appropriate header file. -* All local variables are declared at the beginning of the scope where they - appear. They may be initialized at that point, if it does not invoke UB or - otherwise cause bugs. -* All precondition `assert()`'s (see [Asserts][135]) come *after* local variable - declarations. -* Besides short `if` statements and loops, there should *never* be more than one - statement per line. - -### ClangFormat - -I attempted three times to use [ClangFormat][24] to impose a standard, -machine-useful style on `bc`. All three failed. Otherwise, the style in this -repo would be more consistent. - -## Repo Structure - -Functions are documented with Doxygen-style doc comments. Functions that appear -in headers are documented in the headers, while static functions are documented -where they are defined. - -### `bcl.sln` - -A Visual Studio solution file for [`bcl`][156]. This, along with -[`bcl.vcxproj`][63] and [`bcl.vcxproj.filters`][64] is what makes it possible to -build [`bcl`][156] on Windows. - -### `bcl.vcxproj` - -A Visual Studio project file for [`bcl`][156]. This, along with [`bcl.sln`][65] -and [`bcl.vcxproj.filters`][64] is what makes it possible to build [`bcl`][156] -on Windows. - -### `bcl.vcxproj.filters` - -A Visual Studio filters file for [`bcl`][156]. This, along with [`bcl.sln`][65] -and [`bcl.vcxproj`][63] is what makes it possible to build [`bcl`][156] on -Windows. - -### `bc.sln` - -A Visual Studio solution file for `bc`. This, along with [`bc.vcxproj`][66] -and [`bc.vcxproj.filters`][67] is what makes it possible to build `bc` on -Windows. - -### `bc.vcxproj` - -A Visual Studio project file for `bc`. This, along with [`bc.sln`][68] and -[`bc.vcxproj.filters`][67] is what makes it possible to build `bc` on Windows. - -### `bc.vcxproj.filters` - -A Visual Studio filters file for `bc`. This, along with [`bc.sln`][68] and -[`bc.vcxproj`][66] is what makes it possible to build `bc` on Windows. - -### `configure` - -A symlink to [`configure.sh`][69]. - -### `configure.sh` - -This is the script to configure `bc` and [`bcl`][156] for building. - -This `bc` has a custom build system. The reason for this is because of -[*portability*][136]. - -If `bc` used an outside build system, that build system would be an external -dependency. Thus, I had to write a build system for `bc` that used nothing but -C99 and POSIX utilities. - -One of those utilities is POSIX `sh`, which technically implements a -Turing-complete programming language. It's a terrible one, but it works. - *** 8168 LINES SKIPPED ***