From e7017237c9d842b4cebdcfb13526cd71a2b2836a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Sat, 28 Jan 2023 21:02:27 +0100 Subject: [PATCH] vendor/bc: import version 6.2.0 This is a production release with a new feature and a few bug fixes. The bug fixes include: - A crash when bc and dc are built using editline, but history is not activated. - A missing local in the uint*() family of functions in the extended math library. - A failure to clear the tail call list in dc on error. - A crash when attempting to swap characters in command-line history when no characters exist. - SIGWINCH was activated even when history was not. The new feature is that stack traces are now given for runtime errors. In debug mode, the C source file and line of errors are given as well. --- LICENSE.md | 6 +- MEMORY_BUGS.md | 2 +- Makefile.in | 2 +- NEWS.md | 23 ++++++++ NOTICE.md | 2 +- README.md | 57 +++++++++++++++++- TODO.md | 3 - configure.sh | 13 +---- gen/bc_help.txt | 2 +- gen/dc_help.txt | 2 +- gen/lib.bc | 2 +- gen/lib2.bc | 15 ++--- gen/strgen.c | 4 +- gen/strgen.sh | 4 +- include/args.h | 2 +- include/bc.h | 2 +- include/bcl.h | 2 +- include/dc.h | 2 +- include/file.h | 2 +- include/history.h | 2 +- include/lang.h | 2 +- include/lex.h | 26 ++++++++- include/library.h | 2 +- include/num.h | 2 +- include/opt.h | 2 +- include/parse.h | 16 ++++- include/program.h | 9 ++- include/rand.h | 2 +- include/read.h | 2 +- include/status.h | 32 ++++++++-- include/vector.h | 2 +- include/version.h | 4 +- include/vm.h | 40 +++++++++---- locales/de_DE.ISO8859-1.msg | 17 ++---- locales/de_DE.UTF-8.msg | 17 ++---- locales/en_US.msg | 17 ++---- locales/es_ES.ISO8859-1.msg | 17 ++---- locales/es_ES.UTF-8.msg | 17 ++---- locales/fr_FR.ISO8859-1.msg | 17 ++---- locales/fr_FR.UTF-8.msg | 17 ++---- locales/ja_JP.UTF-8.msg | 17 ++---- locales/ja_JP.eucJP.msg | 17 ++---- locales/nl_NL.ISO8859-1.msg | 17 ++---- locales/nl_NL.UTF-8.msg | 17 ++---- locales/pl_PL.ISO8859-2.msg | 17 ++---- locales/pl_PL.UTF-8.msg | 17 ++---- locales/pt_PT.ISO8859-1.msg | 17 ++---- locales/pt_PT.UTF-8.msg | 17 ++---- locales/ru_RU.CP1251.msg | 17 ++---- locales/ru_RU.CP866.msg | 17 ++---- locales/ru_RU.ISO8859-5.msg | 17 ++---- locales/ru_RU.KOI8-R.msg | 17 ++---- locales/ru_RU.UTF-8.msg | 17 ++---- locales/zh_CN.GB18030.msg | 17 ++---- locales/zh_CN.GB2312.msg | 17 ++---- locales/zh_CN.GBK.msg | 17 ++---- locales/zh_CN.UTF-8.msg | 17 ++---- locales/zh_CN.eucCN.msg | 17 ++---- manuals/bc/A.1 | 2 +- manuals/bc/A.1.md | 2 +- manuals/bc/E.1 | 2 +- manuals/bc/E.1.md | 2 +- manuals/bc/EH.1 | 2 +- manuals/bc/EH.1.md | 2 +- manuals/bc/EHN.1 | 2 +- manuals/bc/EHN.1.md | 2 +- manuals/bc/EN.1 | 2 +- manuals/bc/EN.1.md | 2 +- manuals/bc/H.1 | 2 +- manuals/bc/H.1.md | 2 +- manuals/bc/HN.1 | 2 +- manuals/bc/HN.1.md | 2 +- manuals/bc/N.1 | 2 +- manuals/bc/N.1.md | 2 +- manuals/bcl.3 | 2 +- manuals/bcl.3.md | 2 +- manuals/build.md | 17 +++--- manuals/dc/A.1 | 2 +- manuals/dc/A.1.md | 2 +- manuals/dc/E.1 | 2 +- manuals/dc/E.1.md | 2 +- manuals/dc/EH.1 | 2 +- manuals/dc/EH.1.md | 2 +- manuals/dc/EHN.1 | 2 +- manuals/dc/EHN.1.md | 2 +- manuals/dc/EN.1 | 2 +- manuals/dc/EN.1.md | 2 +- manuals/dc/H.1 | 2 +- manuals/dc/H.1.md | 2 +- manuals/dc/HN.1 | 2 +- manuals/dc/HN.1.md | 2 +- manuals/dc/N.1 | 2 +- manuals/dc/N.1.md | 2 +- scripts/exec-install.sh | 2 +- scripts/format.sh | 2 +- scripts/functions.sh | 2 +- scripts/karatsuba.py | 2 +- scripts/link.sh | 2 +- scripts/lint.sh | 2 +- scripts/locale_install.sh | 2 +- scripts/locale_uninstall.sh | 2 +- src/args.c | 2 +- src/bc.c | 2 +- src/bc_lex.c | 2 +- src/bc_parse.c | 4 +- src/data.c | 10 +--- src/dc.c | 2 +- src/dc_lex.c | 2 +- src/dc_parse.c | 2 +- src/file.c | 6 +- src/history.c | 21 ++++++- src/lang.c | 2 +- src/lex.c | 2 +- src/library.c | 2 +- src/main.c | 2 +- src/num.c | 2 +- src/opt.c | 2 +- src/parse.c | 2 +- src/program.c | 76 ++++++++++++++++++++++-- src/rand.c | 2 +- src/read.c | 26 +++++++-- src/vector.c | 4 +- src/vm.c | 113 +++++++++++++++++++++++------------- tests/all.sh | 2 +- tests/bc/timeconst.sh | 2 +- tests/bcl.c | 2 +- tests/error.sh | 2 +- tests/errors.sh | 2 +- tests/history.py | 2 +- tests/history.sh | 2 +- tests/other.sh | 2 +- tests/read.sh | 2 +- tests/script.sh | 2 +- tests/scripts.sh | 2 +- tests/stdin.sh | 2 +- tests/test.sh | 2 +- 136 files changed, 633 insertions(+), 497 deletions(-) delete mode 100644 TODO.md diff --git a/LICENSE.md b/LICENSE.md index 8ab2e606988..8e6b7e0b905 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2021 Gavin D. Howard +Copyright (c) 2018-2023 Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo
Copyright (c) 2010-2013, Pieter Noordhuis
Copyright (c) 2018 rain-1
-Copyright (c) 2018-2021, Gavin D. Howard +Copyright (c) 2018-2023, Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -60,7 +60,7 @@ The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors -Copyright (c) 2018-2021 Gavin D. Howard +Copyright (c) 2018-2023 Gavin D. Howard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/MEMORY_BUGS.md b/MEMORY_BUGS.md index 894593f8492..1acf80a0297 100644 --- a/MEMORY_BUGS.md +++ b/MEMORY_BUGS.md @@ -38,7 +38,7 @@ existed in. The first version without this bug is `6.1.0`. -* In version `6.0.0` of `bcl`, there is several use of initialized data that +* In version `6.0.0` of `bcl`, there are several uses of initialized data that have the same root cause: I forgot to call `memset()` on the per-thread global data. This is because the data used to be *actually* global, which meant that it was initialized to zero by the system. This happened because I thought I diff --git a/Makefile.in b/Makefile.in index 9f187cbc61e..83417a33382 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/NEWS.md b/NEWS.md index cde55831a8d..d02436c1d8a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,28 @@ # News +## 6.2.0 + +This is a production release with a new feature and a few bug fixes. + +The bug fixes include: + +* A crash when `bc` and `dc` are built using editline, but history is not + activated. +* A missing local in the `uint*()` family of functions in the extended math + library. +* A failure to clear the tail call list in `dc` on error. +* A crash when attempting to swap characters in command-line history when no + characters exist. +* `SIGWINCH` was activated even when history was not. + +The new feature is that stack traces are now given for runtime errors. In debug +mode, the C source file and line of errors are given as well. + +## 6.1.1 + +This is a production release that fixes a build issue with predefined builds and +generated tests. + ## 6.1.0 This is a production release that fixes a discrepancy from the `bc` standard, diff --git a/NOTICE.md b/NOTICE.md index 56d2935ab4b..c0d3ded5797 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1,6 +1,6 @@ # Notice -Copyright 2018-2021 Gavin D. Howard and contributors. +Copyright 2018-2023 Gavin D. Howard and contributors. ## Contributors diff --git a/README.md b/README.md index b1e0d7557de..438cab0d169 100644 --- a/README.md +++ b/README.md @@ -318,7 +318,8 @@ may prove useful to any serious users. This `bc` compares favorably to GNU `bc`. * This `bc` builds natively on Windows. -* It has more extensions, which make this `bc` more useful for scripting. +* It has more extensions, which make this `bc` more useful for scripting. (See + [Extensions](#extensions).) * This `bc` is a bit more POSIX compliant. * It has a much less buggy parser. The GNU `bc` will give parse errors for what is actually valid `bc` code, or should be. For example, putting an `else` on @@ -341,6 +342,58 @@ There is one instance where this `bc` is slower: if scripts are light on math. This is because this `bc`'s intepreter is slightly slower than GNU `bc`, but that is because it is more robust. See the [benchmarks][19]. +### Extensions + +Below is a non-comprehensive list of extensions that this `bc` and `dc` have +that all others do not. + +* An extended math library. (See [here][30] for more information.) +* A command-line prompt. +* Turning on and off digit clamping. (Digit clamping is about how to treat + "invalid" digits for a particular base. GNU `bc` uses it, and the BSD `bc` + does not. Mine does both.) +* A pseudo-random number generator. This includes the ability to set the seed + and get reproducible streams of random numbers. +* The ability to use stacks for the globals `scale`, `ibase`, and `obase` + instead of needing to restore them in *every* function. +* The ability to *not* use non-standard keywords. For example, `abs` is a + keyword (a built-in function), but if some script actually defines a function + called that, it's possible to tell my `bc` to not treat it as a keyword, which + will make the script parses correctly. +* The ability to turn on and off printing leading zeroes on numbers greater than + `-1` and less than `1`. +* Outputting in scientific and engineering notation. +* Accepting input in scientific and engineering notation. +* Passing strings and arrays to the `length()` built-in function. (In `dc`, the + `Y` command will do this for arrays, and the `Z` command will do this for both + numbers and strings.) +* The `abs()` built-in function. (This is the `b` command in `dc`.) +* The `is_number()` and `is_string()` built-in functions. (These tell whether a + variable is holding a string or a number, for runtime type checking. The + commands are `u` and `t` in `dc`.) +* For `bc` only, the `divmod()` built-in function for computing a quotient and + remainder at the same time. +* For `bc` only, the `asciify()` built-in function for converting an array to a + string. +* The `$` truncation operator. (It's the same in `bc` and `dc`.) +* The `@` "set scale" operator. (It's the same in `bc` and `dc`.) +* The decimal shift operators. (`<<` and `>>` in `bc`, `H` and `h` in `dc`.) +* Built-in functions or commands to get the max of `scale`, `ibase`, and + `obase`. +* The ability to put strings into variables in `bc`. (This always existed in + `dc`.) +* The `'` command in `dc` for the depth of the execution stack. +* The `y` command in `dc` for the depth of register stacks. +* Built-in functions or commands to get the value of certain environment + variables that might affect execution. +* The `stream` keyword to do the same thing as the `P` command in `dc`. +* Defined order of evaluation. +* Defined exit statuses. +* All environment variables other than `POSIXLY_CORRECT`, `BC_ENV_ARGS`, and + `BC_LINE_LENGTH`. +* The ability for users to define their own defaults for various options during + build. (See [here][31] for more information.) + ## Algorithms To see what algorithms this `bc` uses, see the [algorithms manual][7]. @@ -441,3 +494,5 @@ Folders: [27]: https://en.wikipedia.org/wiki/Bus_factor [28]: ./manuals/development.md [29]: https://github.com/gavinhoward/bc +[30]: ./manuals/bc/A.1.md#extended-library +[31]: ./manuals/build.md#settings diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 9152548085b..00000000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -# TODO - -* Implement the more efficient factorial. diff --git a/configure.sh b/configure.sh index fb22ccab299..3ada5298e9e 100755 --- a/configure.sh +++ b/configure.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: @@ -714,7 +714,7 @@ predefined_build() { hist=1 hist_impl="editline" extra_math=1 - generate_tests=0 + generate_tests=$generate_tests install_manpages=0 nls=1 force=0 @@ -747,7 +747,7 @@ predefined_build() { hist=1 hist_impl="internal" extra_math=1 - generate_tests=1 + generate_tests=$generate_tests install_manpages=1 nls=1 force=0 @@ -1019,13 +1019,6 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do fi MAN3DIR="$2" shift ;; - localedir=?*) LOCALEDIR="$LONG_OPTARG" ;; - localedir) - if [ "$#" -lt 2 ]; then - usage "No argument given for '--$arg' option" - fi - LOCALEDIR="$2" - shift ;; karatsuba-len=?*) karatsuba_len="$LONG_OPTARG" ;; karatsuba-len) if [ "$#" -lt 2 ]; then diff --git a/gen/bc_help.txt b/gen/bc_help.txt index db34e6daef9..f78ba9e71dd 100644 --- a/gen/bc_help.txt +++ b/gen/bc_help.txt @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/gen/dc_help.txt b/gen/dc_help.txt index 633ddf71f22..8b313f8d9e0 100644 --- a/gen/dc_help.txt +++ b/gen/dc_help.txt @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/gen/lib.bc b/gen/lib.bc index 8e6118e8060..b12b2317679 100644 --- a/gen/lib.bc +++ b/gen/lib.bc @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/gen/lib2.bc b/gen/lib2.bc index 23cbec104d0..826f8a430ce 100644 --- a/gen/lib2.bc +++ b/gen/lib2.bc @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -250,8 +250,7 @@ define ubytes(x){ define sbytes(x){ auto p,n,z z=(x<0) - x=abs(x) - x=x$ + x=abs(x)$ n=ubytes(x) p=2^(n*8-1) if(x>p||(!z&&x==p))n*=2 @@ -311,21 +310,19 @@ define void pnlznl(x){ print"\n" } define void output_byte(x,i){ - auto j,p,y,b - j=ibase - ibase=A + auto j,p,y,b,s s=scale scale=0 x=abs(x)$ b=x/(2^(i*8)) - b%=256 - y=log(256,obase) + j=2^8 + b%=j + y=log(j,obase) if(b>1)p=log(b,obase)+1 else p=b for(i=y-p;i>0;--i)print 0 if(b)print b scale=s - ibase=j } define void output_uint(x,n){ auto i diff --git a/gen/strgen.c b/gen/strgen.c index 5bc29333cec..dbea0212f61 100644 --- a/gen/strgen.c +++ b/gen/strgen.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -68,7 +68,7 @@ static const char* const bc_gen_ex_end = "{{ end }}"; // This is exactly what it looks like. It just slaps a simple license header on // the generated C source file. static const char* const bc_gen_header = - "// Copyright (c) 2018-2021 Gavin D. Howard and contributors.\n" + "// Copyright (c) 2018-2023 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; // clang-format on diff --git a/gen/strgen.sh b/gen/strgen.sh index 005395aa2a6..5ef66fb2d8c 100755 --- a/gen/strgen.sh +++ b/gen/strgen.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: @@ -82,7 +82,7 @@ if [ -n "$remove_tabs" ]; then fi cat< #include -// Two convencience macros for throwing errors in lex code. They take care of -// plumbing like passing in the current line the lexer is on. +/** + * A convenience macro for throwing errors in lex code. This takes care of + * plumbing like passing in the current line the lexer is on. + * @param l The lexer. + * @param e The error. + */ +#ifndef NDEBUG +#define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line)) +#else // NDEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) +#endif // NDEBUG + +/** + * A convenience macro for throwing errors in lex code. This takes care of + * plumbing like passing in the current line the lexer is on. + * @param l The lexer. + * @param e The error. + */ +#ifndef NDEBUG +#define bc_lex_verr(l, e, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__)) +#else // NDEBUG #define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) +#endif // NDEBUG // BC_LEX_NEG_CHAR returns the char that corresponds to negative for the // current calculator. diff --git a/include/library.h b/include/library.h index 2984de29d20..76df91392da 100644 --- a/include/library.h +++ b/include/library.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/include/num.h b/include/num.h index 835dd8e9747..8078809250f 100644 --- a/include/num.h +++ b/include/num.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/include/opt.h b/include/opt.h index 3c465c80fbf..28d9d99a785 100644 --- a/include/opt.h +++ b/include/opt.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/include/parse.h b/include/parse.h index ebf234c5f7f..2527aeb824f 100644 --- a/include/parse.h +++ b/include/parse.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -105,22 +105,32 @@ #define bc_parse_pushIndex(p, idx) (bc_vec_pushIndex(&(p)->func->code, (idx))) /** - * A convenience macro for throwing errors in parse code. They take care of + * A convenience macro for throwing errors in parse code. This takes care of * plumbing like passing in the current line the lexer is on. * @param p The parser. * @param e The error. */ +#ifndef NDEBUG +#define bc_parse_err(p, e) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line)) +#else // NDEBUG #define bc_parse_err(p, e) (bc_vm_handleError((e), (p)->l.line)) +#endif // NDEBUG /** - * A convenience macro for throwing errors in parse code. They take care of + * A convenience macro for throwing errors in parse code. This takes care of * plumbing like passing in the current line the lexer is on. * @param p The parser. * @param e The error. * @param ... The varags that are needed. */ +#ifndef NDEBUG +#define bc_parse_verr(p, e, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line, __VA_ARGS__)) +#else // NDEBUG #define bc_parse_verr(p, e, ...) \ (bc_vm_handleError((e), (p)->l.line, __VA_ARGS__)) +#endif // NDEBUG // Forward declarations. struct BcParse; diff --git a/include/program.h b/include/program.h index 62e867eb7fb..3acd5157b12 100644 --- a/include/program.h +++ b/include/program.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -320,6 +320,13 @@ bc_program_free(BcProgram* p); #endif // NDEBUG +/** + * Prints a stack trace of the bc functions or dc strings currently executing. + * @param p The program. + */ +void +bc_program_printStackTrace(BcProgram* p); + #if BC_DEBUG_CODE #if BC_ENABLED && DC_ENABLED diff --git a/include/rand.h b/include/rand.h index 7546891dbd6..7db0ee90af1 100644 --- a/include/rand.h +++ b/include/rand.h @@ -13,7 +13,7 @@ * This code is under the following license: * * Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/include/read.h b/include/read.h index 0e824d941b5..867dcd7433a 100644 --- a/include/read.h +++ b/include/read.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/include/status.h b/include/status.h index ce6251ab0c1..9962d58d0be 100644 --- a/include/status.h +++ b/include/status.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -687,11 +687,18 @@ typedef enum BcMode /// Returns true if an exception is in flight, false otherwise. #define BC_SIG_EXC(vm) \ - BC_UNLIKELY(vm->status != (sig_atomic_t) BC_STATUS_SUCCESS || vm->sig) + BC_UNLIKELY((vm)->status != (sig_atomic_t) BC_STATUS_SUCCESS || (vm)->sig) /// Returns true if there is *no* exception in flight, false otherwise. #define BC_NO_SIG_EXC(vm) \ - BC_LIKELY(vm->status == (sig_atomic_t) BC_STATUS_SUCCESS && !vm->sig) + BC_LIKELY((vm)->status == (sig_atomic_t) BC_STATUS_SUCCESS && !(vm)->sig) + +#ifndef _WIN32 +#define BC_SIG_INTERRUPT(vm) \ + BC_UNLIKELY((vm)->sig != 0 && (vm)->sig != SIGWINCH) +#else // _WIN32 +#define BC_SIG_INTERRUPT(vm) BC_UNLIKELY((vm)->sig != 0) +#endif // _WIN32 #ifndef NDEBUG @@ -773,7 +780,7 @@ typedef enum BcMode } \ while (0) -/* +/** * Locks signals, but stores the old lock state, to be restored later by * BC_SIG_TRYUNLOCK. * @param v The variable to store the old lock state to. @@ -786,7 +793,8 @@ typedef enum BcMode } \ while (0) -/* Restores the previous state of a signal lock, and if it is now unlocked, +/** + * Restores the previous state of a signal lock, and if it is now unlocked, * initiates an exception/jump. * @param v The old lock state. */ @@ -949,19 +957,33 @@ typedef enum BcMode * @param l The line of the script that the error happened. * @param ... Extra arguments for error messages as necessary. */ +#ifndef NDEBUG +#define bc_error(e, l, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (l), __VA_ARGS__)) +#else // NDEBUG #define bc_error(e, l, ...) (bc_vm_handleError((e), (l), __VA_ARGS__)) +#endif // NDEBUG /** * Call bc's error handling routine. * @param e The error. */ +#ifndef NDEBUG +#define bc_err(e) (bc_vm_handleError((e), __FILE__, __LINE__, 0)) +#else // NDEBUG #define bc_err(e) (bc_vm_handleError((e), 0)) +#endif // NDEBUG /** * Call bc's error handling routine. * @param e The error. */ +#ifndef NDEBUG +#define bc_verr(e, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, 0, __VA_ARGS__)) +#else // NDEBUG #define bc_verr(e, ...) (bc_vm_handleError((e), 0, __VA_ARGS__)) +#endif // NDEBUG #endif // BC_ENABLE_LIBRARY diff --git a/include/vector.h b/include/vector.h index bf79d30c36d..51c5e8b9529 100644 --- a/include/vector.h +++ b/include/vector.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/include/version.h b/include/version.h index 2a3e6aa0f34..d7f8ef5bcc1 100644 --- a/include/version.h +++ b/include/version.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.1.0 +#define VERSION 6.2.0 #endif // BC_VERSION_H diff --git a/include/vm.h b/include/vm.h index 44212eb0359..1c303add2de 100644 --- a/include/vm.h +++ b/include/vm.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -668,9 +668,6 @@ typedef struct BcVm /// The function to call to parse expressions. BcParseExpr expr; - /// The text to display to label functions in error messages. - const char* func_header; - /// The names of the categories of errors. const char* err_ids[BC_ERR_IDX_NELEMS + BC_ENABLED]; @@ -957,6 +954,7 @@ bc_vm_getenvFree(char* val); */ void bc_vm_jmp(const char* f); + #else // BC_DEBUG_CODE /** @@ -993,16 +991,42 @@ bc_vm_atexit(void); #else // BC_ENABLE_LIBRARY +/** + * Calculates the number of decimal digits in the argument. + * @param val The value to calculate the number of decimal digits in. + * @return The number of decimal digits in @a val. + */ +size_t +bc_vm_numDigits(size_t val); + +#ifndef NDEBUG + +/** + * Handle an error. This is the true error handler. It will start a jump series + * if an error occurred. POSIX errors will not cause jumps when warnings are on + * or no POSIX errors are enabled. + * @param e The error. + * @param file The source file where the error occurred. + * @param fline The line in the source file where the error occurred. + * @param line The bc source line where the error occurred. + */ +void +bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...); + +#else // NDEBUG + /** * Handle an error. This is the true error handler. It will start a jump series * if an error occurred. POSIX errors will not cause jumps when warnings are on * or no POSIX errors are enabled. * @param e The error. - * @param line The source line where the error occurred. + * @param line The bc source line where the error occurred. */ void bc_vm_handleError(BcErr e, size_t line, ...); +#endif // NDEBUG + /** * Handle a fatal error. * @param e The error. @@ -1024,12 +1048,6 @@ bc_vm_atexit(int status); /// A reference to the copyright header. extern const char bc_copyright[]; -/// A reference to the format string for source code line printing. -extern const char* const bc_err_line; - -/// A reference to the format string for source code function printing. -extern const char* const bc_err_func_header; - /// A reference to the array of default error category names. extern const char* bc_errs[]; diff --git a/locales/de_DE.ISO8859-1.msg b/locales/de_DE.ISO8859-1.msg index dc7545e3ed7..858a3946e8f 100644 --- a/locales/de_DE.ISO8859-1.msg +++ b/locales/de_DE.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Headers for printing errors/warnings. -$set 1 - -1 "Funktion:" - $ Error types. -$set 2 +$set 1 1 "Rechenfehler:" 2 "Analysefehler:" @@ -43,7 +38,7 @@ $set 2 5 "Warnung:" $ Math errors. -$set 3 +$set 2 1 "negative Zahl" 2 "Nicht-Ganzzahl-Wert" @@ -51,7 +46,7 @@ $set 3 4 "Division durch 0" $ Parse errors. -$set 4 +$set 3 1 "Ende der Datei" 2 "ungltiges Zeichen: '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX erlaubt keine Zuweisung von Strings an Variablen oder Arrays" $ Runtime errors. -$set 5 +$set 4 1 "ungltige \"ibase\": muss im Intervall [%lu, %lu] liegen" 2 "ungltige \"obase\": muss im Intervall [%lu, %lu] liegen" @@ -100,7 +95,7 @@ $set 5 11 "kann keinen ungltigen Wert in einem Ausdruck verwenden" $ Fatal errors. -$set 6 +$set 5 1 "Speicherzuweisung fehlgeschlagen" 2 "Ein-Ausgabe-Fehler" diff --git a/locales/de_DE.UTF-8.msg b/locales/de_DE.UTF-8.msg index 7956615e849..25be4fd79cb 100644 --- a/locales/de_DE.UTF-8.msg +++ b/locales/de_DE.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Headers for printing errors/warnings. -$set 1 - -1 "Funktion:" - $ Error types. -$set 2 +$set 1 1 "Rechenfehler:" 2 "Analysefehler:" @@ -43,7 +38,7 @@ $set 2 5 "Warnung:" $ Math errors. -$set 3 +$set 2 1 "negative Zahl" 2 "Nicht-Ganzzahl-Wert" @@ -51,7 +46,7 @@ $set 3 4 "Division durch 0" $ Parse errors. -$set 4 +$set 3 1 "Ende der Datei" 2 "ungültiges Zeichen: '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX erlaubt keine Zuweisung von Strings an Variablen oder Arrays" $ Runtime errors. -$set 5 +$set 4 1 "ungültige \"ibase\": muss im Intervall [%lu, %lu] liegen" 2 "ungültige \"obase\": muss im Intervall [%lu, %lu] liegen" @@ -100,7 +95,7 @@ $set 5 11 "kann keinen ungültigen Wert in einem Ausdruck verwenden" $ Fatal errors. -$set 6 +$set 5 1 "Speicherzuweisung fehlgeschlagen" 2 "Ein-Ausgabe-Fehler" diff --git a/locales/en_US.msg b/locales/en_US.msg index c6bfe6dc3f6..5610496d6e7 100644 --- a/locales/en_US.msg +++ b/locales/en_US.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Function:" - $ Error types. -$set 2 +$set 1 1 "Math error:" 2 "Parse error:" @@ -43,7 +38,7 @@ $set 2 5 "Warning:" $ Math errors. -$set 3 +$set 2 1 "negative number" 2 "non-integer number" @@ -51,7 +46,7 @@ $set 3 4 "divide by 0" $ Parse errors. -$set 4 +$set 3 1 "end of file" 2 "invalid character '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX does not allow strings to be assigned to variables or arrays" $ Runtime errors. -$set 5 +$set 4 1 "invalid ibase: must be [%lu, %lu]" 2 "invalid obase: must be [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "cannot use a void value in an expression" $ Fatal errors. -$set 6 +$set 5 1 "memory allocation failed" 2 "I/O error" diff --git a/locales/es_ES.ISO8859-1.msg b/locales/es_ES.ISO8859-1.msg index 30c965111de..3bf70753559 100644 --- a/locales/es_ES.ISO8859-1.msg +++ b/locales/es_ES.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Funcin:" - $ Error types. -$set 2 +$set 1 1 "Error de matemtica:" 2 "Error de syntaxis:" @@ -43,7 +38,7 @@ $set 2 5 "Advertencia:" $ Math errors. -$set 3 +$set 2 1 "nmero negativo" 2 "nmero no es entero" @@ -51,7 +46,7 @@ $set 3 4 "divisin por cero" $ Parse errors. -$set 4 +$set 3 1 "fin de archivo" 2 "no vlido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX no permite asignar cadenas a variables o matrices" $ Runtime errors. -$set 5 +$set 4 1 "\"ibase\" no es vlido: debe ser [%lu, %lu]" 2 "\"obase\" no es vlido: debe ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "no puede utilizar un valor vaco en una expresin" $ Fatal errors. -$set 6 +$set 5 1 "error en la asignacin de memoria" 2 "error de I/O" diff --git a/locales/es_ES.UTF-8.msg b/locales/es_ES.UTF-8.msg index 1721dd3d8f2..0a5cf26d162 100644 --- a/locales/es_ES.UTF-8.msg +++ b/locales/es_ES.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Función:" - $ Error types. -$set 2 +$set 1 1 "Error de matemática:" 2 "Error de syntaxis:" @@ -43,7 +38,7 @@ $set 2 5 "Advertencia:" $ Math errors. -$set 3 +$set 2 1 "número negativo" 2 "número no es entero" @@ -51,7 +46,7 @@ $set 3 4 "división por cero" $ Parse errors. -$set 4 +$set 3 1 "fin de archivo" 2 "no válido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX no permite asignar cadenas a variables o matrices" $ Runtime errors. -$set 5 +$set 4 1 "\"ibase\" no es válido: debe ser [%lu, %lu]" 2 "\"obase\" no es válido: debe ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "no puede utilizar un valor vacío en una expresión" $ Fatal errors. -$set 6 +$set 5 1 "error en la asignación de memoria" 2 "error de I/O" diff --git a/locales/fr_FR.ISO8859-1.msg b/locales/fr_FR.ISO8859-1.msg index 5d772abcc4e..f2e07e02b2d 100644 --- a/locales/fr_FR.ISO8859-1.msg +++ b/locales/fr_FR.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Fonction :" - $ Error types. -$set 2 +$set 1 1 "Erreur de calcul :" 2 "Erreur d'analyse syntaxique :" @@ -43,7 +38,7 @@ $set 2 5 "Avertissement :" $ Math errors. -$set 3 +$set 2 1 "nombre strictement négatif" 2 "nombre non entier" @@ -51,7 +46,7 @@ $set 3 4 "division par 0" $ Parse errors. -$set 4 +$set 3 1 "fin de fichier" 2 "caractère invalide '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX interdit pas d'assigner des chaînes de caractères à des variables ou à des tableaux" $ Runtime errors. -$set 5 +$set 4 1 "ibase invalide : doit être [%lu, %lu]" 2 "obase invalide : doit être [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "une valeur 'void' est inutilisable dans une expression" $ Fatal errors. -$set 6 +$set 5 1 "échec d'allocation mémoire" 2 "erreur d'entrée-sortie" diff --git a/locales/fr_FR.UTF-8.msg b/locales/fr_FR.UTF-8.msg index 6393ab0e5f7..1e9e900746a 100644 --- a/locales/fr_FR.UTF-8.msg +++ b/locales/fr_FR.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Fonction :" - $ Error types. -$set 2 +$set 1 1 "Erreur de calcul :" 2 "Erreur d'analyse syntaxique :" @@ -43,7 +38,7 @@ $set 2 5 "Avertissement :" $ Math errors. -$set 3 +$set 2 1 "nombre strictement négatif" 2 "nombre non entier" @@ -51,7 +46,7 @@ $set 3 4 "division par 0" $ Parse errors. -$set 4 +$set 3 1 "fin de fichier" 2 "caractère invalide '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX interdit pas d'assigner des chaînes de caractères à des variables ou à des tableaux" $ Runtime errors. -$set 5 +$set 4 1 "ibase invalide : doit être [%lu, %lu]" 2 "obase invalide : doit être [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "une valeur 'void' est inutilisable dans une expression" $ Fatal errors. -$set 6 +$set 5 1 "échec d'allocation mémoire" 2 "erreur d'entrée-sortie" diff --git a/locales/ja_JP.UTF-8.msg b/locales/ja_JP.UTF-8.msg index 3c51aca8194..d871e9bf6ad 100644 --- a/locales/ja_JP.UTF-8.msg +++ b/locales/ja_JP.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ その他のメッセージ。 -$set 1 - -1 "関数:" - $ エラーの種類。 -$set 2 +$set 1 1 "数学のエラー:" 2 "パースエラー:" @@ -43,7 +38,7 @@ $set 2 5 "警告:" $ 数学のエラーです。 -$set 3 +$set 2 1 "負の数" 2 "非整数" @@ -51,7 +46,7 @@ $set 3 4 "0で割る" $ 構文解析のエラー。 -$set 4 +$set 3 1 "ファイルの終了" 2 "無効な文字 '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXでは、変数や配列に文字列を割り当てることはできません。" $ ランタイムエラー。 -$set 5 +$set 4 1 "無効なibase:は[%lu、%lu]でなければなりません" 2 "無効なobase:は[%lu、%lu]でなければなりません" @@ -100,7 +95,7 @@ $set 5 11 "式では void 値を使用できません" $ 致命的なエラーが発生しました。 -$set 6 +$set 5 1 "メモリの割り当てに失敗しました" 2 "I/Oエラー" diff --git a/locales/ja_JP.eucJP.msg b/locales/ja_JP.eucJP.msg index 74bd09c27fd..e8baef5b498 100644 --- a/locales/ja_JP.eucJP.msg +++ b/locales/ja_JP.eucJP.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ ¾Υå -$set 1 - -1 "ؿ" - $ 顼μࡣ -$set 2 +$set 1 1 "ؤΥ顼" 2 "ѡ顼" @@ -43,7 +38,7 @@ $set 2 5 "ٹ" $ ؤΥ顼Ǥ -$set 3 +$set 2 1 "ο" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0dz" $ ʸϤΥ顼 -$set 4 +$set 3 1 "եνλ" 2 "̵ʸ '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXǤϡѿʸƤ뤳ȤϤǤޤ" $ 󥿥२顼 -$set 5 +$set 4 1 "̵ibase[%lu%lu]ǤʤФʤޤ" 2 "̵obase[%lu%lu]ǤʤФʤޤ" @@ -100,7 +95,7 @@ $set 5 11 "Ǥ void ͤѤǤޤ" $ ̿Ūʥ顼ȯޤ -$set 6 +$set 5 1 "γƤ˼Ԥޤ" 2 "I/O顼" diff --git a/locales/nl_NL.ISO8859-1.msg b/locales/nl_NL.ISO8859-1.msg index 2f60de23cca..cca79a04091 100644 --- a/locales/nl_NL.ISO8859-1.msg +++ b/locales/nl_NL.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Diversen berichten. -$set 1 - -1 "Functie:" - $ Fouttypes. -$set 2 +$set 1 1 "Rekenfout:" 2 "Parse error:" @@ -43,7 +38,7 @@ $set 2 5 "Waarschuwing:" $ Math error. -$set 3 +$set 2 1 "negatief getal" 2 "niet-integraal getal" @@ -51,7 +46,7 @@ $set 3 4 "delen door 0" $ Parsefouten. -$set 4 +$set 3 1 "einde van het file" 2 "ongeldig teken '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX staat niet toe dat strings worden toegewezen aan variabelen of arrays" $ Runtime fouten. -$set 5 +$set 4 1 "ongeldige ibase: moet [%lu, %lu] zijn" 2 "ongeldige obase: moet [%lu, %lu] zijn" @@ -100,7 +95,7 @@ $set 5 11 "kan geen nietige waarde in een uitdrukking gebruiken" $ Fatale fouten. -$set 6 +$set 5 1 "geheugentoewijzing mislukt" 2 "I/O-fout" diff --git a/locales/nl_NL.UTF-8.msg b/locales/nl_NL.UTF-8.msg index 599628a6cc5..7becb1b880f 100644 --- a/locales/nl_NL.UTF-8.msg +++ b/locales/nl_NL.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Diversen berichten. -$set 1 - -1 "Functie:" - $ Fouttypes. -$set 2 +$set 1 1 "Rekenfout:" 2 "Parse error:" @@ -43,7 +38,7 @@ $set 2 5 "Waarschuwing:" $ Math error. -$set 3 +$set 2 1 "negatief getal" 2 "niet-integraal getal" @@ -51,7 +46,7 @@ $set 3 4 "delen door 0" $ Parsefouten. -$set 4 +$set 3 1 "einde van het file" 2 "ongeldig teken '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX staat niet toe dat strings worden toegewezen aan variabelen of arrays" $ Runtime fouten. -$set 5 +$set 4 1 "ongeldige ibase: moet [%lu, %lu] zijn" 2 "ongeldige obase: moet [%lu, %lu] zijn" @@ -100,7 +95,7 @@ $set 5 11 "kan geen nietige waarde in een uitdrukking gebruiken" $ Fatale fouten. -$set 6 +$set 5 1 "geheugentoewijzing mislukt" 2 "I/O-fout" diff --git a/locales/pl_PL.ISO8859-2.msg b/locales/pl_PL.ISO8859-2.msg index a36d5fe8beb..e3bd25a59a1 100644 --- a/locales/pl_PL.ISO8859-2.msg +++ b/locales/pl_PL.ISO8859-2.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Rne wiadomoci. -$set 1 - -1 "Funkcja:" - $ Typy bdw. -$set 2 +$set 1 1 "Bd matematyczny:" 2 "Bd parse'a:" @@ -43,7 +38,7 @@ $set 2 5 "Ostrzeenie:" $ Bdy matematyczne. -$set 3 +$set 2 1 "liczba ujemna" 2 "numer nieintegracyjny" @@ -51,7 +46,7 @@ $set 3 4 "dzielenie przez 0" $ Bdy Parse'a. -$set 4 +$set 3 1 "koniec akt" 2 "niewany znak '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX nie pozwala na przypisywanie cigw znakw do zmiennych lub tablic" $ Bdy Runtime'u. -$set 5 +$set 4 1 "nieprawidowa ibase: musi by [%lu, %lu]" 2 "nieprawidowa obase: musi by [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "nie moe uy wartoci pustej w wyraeniu" $ Fatalne bdy. -$set 6 +$set 5 1 "Alokacja pamici nie powioda si" 2 "Bd we/wy" diff --git a/locales/pl_PL.UTF-8.msg b/locales/pl_PL.UTF-8.msg index ee297161a89..c6766e2f4e9 100644 --- a/locales/pl_PL.UTF-8.msg +++ b/locales/pl_PL.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Różne wiadomości. -$set 1 - -1 "Funkcja:" - $ Typy błędów. -$set 2 +$set 1 1 "Błąd matematyczny:" 2 "Błąd parse'a:" @@ -43,7 +38,7 @@ $set 2 5 "Ostrzeżenie:" $ Błędy matematyczne. -$set 3 +$set 2 1 "liczba ujemna" 2 "numer nieintegracyjny" @@ -51,7 +46,7 @@ $set 3 4 "dzielenie przez 0" $ Błędy Parse'a. -$set 4 +$set 3 1 "koniec akt" 2 "nieważny znak '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX nie pozwala na przypisywanie ciągów znaków do zmiennych lub tablic" $ Błędy Runtime'u. -$set 5 +$set 4 1 "nieprawidłowa ibase: musi być [%lu, %lu]" 2 "nieprawidłowa obase: musi być [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "nie może użyć wartości pustej w wyrażeniu" $ Fatalne błędy. -$set 6 +$set 5 1 "Alokacja pamięci nie powiodła się" 2 "Błąd we/wy" diff --git a/locales/pt_PT.ISO8859-1.msg b/locales/pt_PT.ISO8859-1.msg index 6197a73d0fe..0a02064248c 100644 --- a/locales/pt_PT.ISO8859-1.msg +++ b/locales/pt_PT.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Funo:" - $ Error types. -$set 2 +$set 1 1 "Erro de clculo:" 2 "Erro de anlise de sintaxe:" @@ -43,7 +38,7 @@ $set 2 5 "Aviso:" $ Math errors. -$set 3 +$set 2 1 "nmero negativo" 2 "nmero no inteiro" @@ -51,7 +46,7 @@ $set 3 4 "dividir por 0" $ Parse errors. -$set 4 +$set 3 1 "fim do arquivo" 2 "caractere invlido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX no permite a atribuio de cadeias de caracteres a variveis ou matrizes" $ Runtime errors. -$set 5 +$set 4 1 "ibase invlido: deve ser [%lu, %lu]" 2 "obase invlido: deve ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "um valor 'void' no pode ser usado em uma expresso" $ Fatal errors. -$set 6 +$set 5 1 "falha na alocao de memria" 2 "erro de entrada-sada" diff --git a/locales/pt_PT.UTF-8.msg b/locales/pt_PT.UTF-8.msg index 768f8807ebf..36c3b692129 100644 --- a/locales/pt_PT.UTF-8.msg +++ b/locales/pt_PT.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Função:" - $ Error types. -$set 2 +$set 1 1 "Erro de cálculo:" 2 "Erro de análise de sintaxe:" @@ -43,7 +38,7 @@ $set 2 5 "Aviso:" $ Math errors. -$set 3 +$set 2 1 "número negativo" 2 "número não inteiro" @@ -51,7 +46,7 @@ $set 3 4 "dividir por 0" $ Parse errors. -$set 4 +$set 3 1 "fim do arquivo" 2 "caractere inválido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX não permite a atribuição de cadeias de caracteres a variáveis ou matrizes" $ Runtime errors. -$set 5 +$set 4 1 "ibase inválido: deve ser [%lu, %lu]" 2 "obase inválido: deve ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "um valor 'void' não pode ser usado em uma expressão" $ Fatal errors. -$set 6 +$set 5 1 "falha na alocação de memória" 2 "erro de entrada-saída" diff --git a/locales/ru_RU.CP1251.msg b/locales/ru_RU.CP1251.msg index a094e08e4af..644470eb657 100644 --- a/locales/ru_RU.CP1251.msg +++ b/locales/ru_RU.CP1251.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ . -$set 1 - -1 ":" - $ . -$set 2 +$set 1 1 " :" 2 " :" @@ -43,7 +38,7 @@ $set 2 5 ":" $ . -$set 3 +$set 2 1 " " 2 " " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ . -$set 4 +$set 3 1 " " 2 " '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX " $ . -$set 5 +$set 4 1 " ibase: [%lu, %lu]" 2 " obase: [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 " " $ . -$set 6 +$set 5 1 " " 2 " /" diff --git a/locales/ru_RU.CP866.msg b/locales/ru_RU.CP866.msg index 79070cda2e0..ee49a2a4542 100644 --- a/locales/ru_RU.CP866.msg +++ b/locales/ru_RU.CP866.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ ᮮ饭. -$set 1 - -1 "㭪:" - $ 訡. -$set 2 +$set 1 1 "⥬᪠ 訡:" 2 "訡 ࠧ:" @@ -43,7 +38,7 @@ $set 2 5 "।०:" $ ⥬᪨ 訡. -$set 3 +$set 2 1 "⥫쭮 ᫮" 2 "⥣஢ ᫮" @@ -51,7 +46,7 @@ $set 3 4 " 0" $ 訡 ࠧ. -$set 4 +$set 3 1 " 䠩" 2 "⨬ ᨬ '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX ᢠ ப ६ ᨢ" $ 訡 믮. -$set 5 +$set 4 1 "⢨⥫ ibase: [%lu, %lu]" 2 "⢨⥫ obase: [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 " ᯮ짮 ⮥ 祭 ࠦ" $ ⠫ 訡. -$set 6 +$set 5 1 " 㤠 뤥 " 2 "訡 /뢮" diff --git a/locales/ru_RU.ISO8859-5.msg b/locales/ru_RU.ISO8859-5.msg index 4c544e94f84..a2921a0465e 100644 --- a/locales/ru_RU.ISO8859-5.msg +++ b/locales/ru_RU.ISO8859-5.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ . -$set 1 - -1 ":" - $ . -$set 2 +$set 1 1 " :" 2 " :" @@ -43,7 +38,7 @@ $set 2 5 ":" $ . -$set 3 +$set 2 1 " " 2 " " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ . -$set 4 +$set 3 1 " " 2 " '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX " $ . -$set 5 +$set 4 1 " ibase: [%lu, %lu]" 2 " obase: [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 " " $ . -$set 6 +$set 5 1 " " 2 " /" diff --git a/locales/ru_RU.KOI8-R.msg b/locales/ru_RU.KOI8-R.msg index 50c716b5ca2..a5ee84751f1 100644 --- a/locales/ru_RU.KOI8-R.msg +++ b/locales/ru_RU.KOI8-R.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ . -$set 1 - -1 ":" - $ . -$set 2 +$set 1 1 " :" 2 " :" @@ -43,7 +38,7 @@ $set 2 5 ":" $ . -$set 3 +$set 2 1 " " 2 " " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ . -$set 4 +$set 3 1 " " 2 " '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX " $ . -$set 5 +$set 4 1 " ibase: [%lu, %lu]" 2 " obase: [%lu, %lu]" @@ -99,7 +94,7 @@ $set 5 10 " " $ . -$set 6 +$set 5 1 " " 2 " /" diff --git a/locales/ru_RU.UTF-8.msg b/locales/ru_RU.UTF-8.msg index e37bb2182ca..cd95ad24e66 100644 --- a/locales/ru_RU.UTF-8.msg +++ b/locales/ru_RU.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Разные сообщения. -$set 1 - -1 "Функция:" - $ Типы ошибок. -$set 2 +$set 1 1 "Математическая ошибка:" 2 "Ошибка при разборе:" @@ -43,7 +38,7 @@ $set 2 5 "Предупреждение:" $ Математические ошибки. -$set 3 +$set 2 1 "отрицательное число" 2 "неинтегрированное число" @@ -51,7 +46,7 @@ $set 3 4 "делить на 0" $ Ошибки при разборе. -$set 4 +$set 3 1 "конец файла" 2 "недопустимый символ '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX не позволяет присваивать строки переменным или массивам" $ Ошибки выполнения. -$set 5 +$set 4 1 "Недействительный ibase: должен быть [%lu, %lu]" 2 "Недействительный obase: должен быть [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "не может использовать пустое значение в выражении" $ Фатальные ошибки. -$set 6 +$set 5 1 "Не удалось выделить память" 2 "Ошибка ввода/вывода" diff --git a/locales/zh_CN.GB18030.msg b/locales/zh_CN.GB18030.msg index a2210b19ed2..0ec91394c92 100644 --- a/locales/zh_CN.GB18030.msg +++ b/locales/zh_CN.GB18030.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/locales/zh_CN.GB2312.msg b/locales/zh_CN.GB2312.msg index a2210b19ed2..0ec91394c92 100644 --- a/locales/zh_CN.GB2312.msg +++ b/locales/zh_CN.GB2312.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/locales/zh_CN.GBK.msg b/locales/zh_CN.GBK.msg index a2210b19ed2..0ec91394c92 100644 --- a/locales/zh_CN.GBK.msg +++ b/locales/zh_CN.GBK.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/locales/zh_CN.UTF-8.msg b/locales/zh_CN.UTF-8.msg index 92d1bb767cb..1fbb16d1cfd 100644 --- a/locales/zh_CN.UTF-8.msg +++ b/locales/zh_CN.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ 杂项信息。 -$set 1 - -1 "函数:" - $ 错误类型。 -$set 2 +$set 1 1 "数学错误:" 2 "解析错误:" @@ -43,7 +38,7 @@ $set 2 5 "警告:" $ 数学错误。 -$set 3 +$set 2 1 "负数" 2 "非整数" @@ -51,7 +46,7 @@ $set 3 4 "除以0" $ 解析错误。 -$set 4 +$set 3 1 "文件结束" 2 "无效字符'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX不允许将字符串分配给变量或数组" $ 运行时错误。 -$set 5 +$set 4 1 "无效的ibase: 必须是[%lu, %lu]" 2 "无效的obase:必须是[%lu,%lu]" @@ -100,7 +95,7 @@ $set 5 11 “不能在表达式中使用空值” $ 致命错误。 -$set 6 +$set 5 1 "内存分配失败" 2 "I/O错误" diff --git a/locales/zh_CN.eucCN.msg b/locales/zh_CN.eucCN.msg index a2210b19ed2..0ec91394c92 100644 --- a/locales/zh_CN.eucCN.msg +++ b/locales/zh_CN.eucCN.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 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: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/manuals/bc/A.1 b/manuals/bc/A.1 index e8b8bd0892a..629cc32c4c6 100644 --- a/manuals/bc/A.1 +++ b/manuals/bc/A.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/A.1.md b/manuals/bc/A.1.md index 754ceda1adb..40cfa5fcdad 100644 --- a/manuals/bc/A.1.md +++ b/manuals/bc/A.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/E.1 b/manuals/bc/E.1 index f9e8c8b2d02..89f95ef81cf 100644 --- a/manuals/bc/E.1 +++ b/manuals/bc/E.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/E.1.md b/manuals/bc/E.1.md index cf52f5a2035..30451dabd64 100644 --- a/manuals/bc/E.1.md +++ b/manuals/bc/E.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/EH.1 b/manuals/bc/EH.1 index 5c556c049f1..e006a5c41c8 100644 --- a/manuals/bc/EH.1 +++ b/manuals/bc/EH.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/EH.1.md b/manuals/bc/EH.1.md index bb905be37f9..28f874c36eb 100644 --- a/manuals/bc/EH.1.md +++ b/manuals/bc/EH.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/EHN.1 b/manuals/bc/EHN.1 index d5fafaf4d1d..e7714871025 100644 --- a/manuals/bc/EHN.1 +++ b/manuals/bc/EHN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/EHN.1.md b/manuals/bc/EHN.1.md index 0ea13df66b7..09288c577a5 100644 --- a/manuals/bc/EHN.1.md +++ b/manuals/bc/EHN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/EN.1 b/manuals/bc/EN.1 index 895b2105140..99ecfd2056e 100644 --- a/manuals/bc/EN.1 +++ b/manuals/bc/EN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/EN.1.md b/manuals/bc/EN.1.md index 6fb521188cc..52bacfa5df6 100644 --- a/manuals/bc/EN.1.md +++ b/manuals/bc/EN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/H.1 b/manuals/bc/H.1 index 72d561fdea0..856d2c604de 100644 --- a/manuals/bc/H.1 +++ b/manuals/bc/H.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/H.1.md b/manuals/bc/H.1.md index 669aa1b1bf3..4a1278dbec8 100644 --- a/manuals/bc/H.1.md +++ b/manuals/bc/H.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/HN.1 b/manuals/bc/HN.1 index b90c88fb59b..5356950aa68 100644 --- a/manuals/bc/HN.1 +++ b/manuals/bc/HN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/HN.1.md b/manuals/bc/HN.1.md index cf4a9d4024f..8dd0674512a 100644 --- a/manuals/bc/HN.1.md +++ b/manuals/bc/HN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bc/N.1 b/manuals/bc/N.1 index 378094edeaf..517e403aa6c 100644 --- a/manuals/bc/N.1 +++ b/manuals/bc/N.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bc/N.1.md b/manuals/bc/N.1.md index 5ed9ed67767..2c85180f670 100644 --- a/manuals/bc/N.1.md +++ b/manuals/bc/N.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/bcl.3 b/manuals/bcl.3 index b81d001ce3e..e066103d02f 100644 --- a/manuals/bcl.3 +++ b/manuals/bcl.3 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/bcl.3.md b/manuals/bcl.3.md index 22c863b955d..e2d92866ddb 100644 --- a/manuals/bcl.3.md +++ b/manuals/bcl.3.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/build.md b/manuals/build.md index 14c1fb55798..5cec45f596b 100644 --- a/manuals/build.md +++ b/manuals/build.md @@ -132,7 +132,7 @@ the environment variable `GEN_EMU`. This `bc` supports `CC`, `HOSTCC`, `HOST_CC`, `CFLAGS`, `HOSTCFLAGS`, `HOST_CFLAGS`, `CPPFLAGS`, `LDFLAGS`, `LDLIBS`, `PREFIX`, `DESTDIR`, `BINDIR`, -`DATAROOTDIR`, `DATADIR`, `MANDIR`, `MAN1DIR`, `LOCALEDIR` `EXECSUFFIX`, +`DATAROOTDIR`, `DATADIR`, `MANDIR`, `MAN1DIR`, `MAN3DIR`, `EXECSUFFIX`, `EXECPREFIX`, `LONG_BIT`, `GEN_HOST`, and `GEN_EMU` environment variables in `configure.sh`. Any values of those variables given to `configure.sh` will be put into the generated Makefile. @@ -276,13 +276,13 @@ Can be overridden by passing the `--man1dir` option to `configure.sh`. Defaults to `$MANDIR/man1`. -#### `LOCALEDIR` +#### `MAN3DIR` -The directory to install locales in. +The directory to install Section 3 manpages in. -Can be overridden by passing the `--localedir` option to `configure.sh`. +Can be overridden by passing the `--man3dir` option to `configure.sh`. -Defaults to `$DATAROOTDIR/locale`. +Defaults to `$MANDIR/man3`. #### `EXECSUFFIX` @@ -709,19 +709,18 @@ The relevant `autotools`-style install options are supported in `configure.sh`: * `--datadir` * `--mandir` * `--man1dir` -* `--localedir` +* `--man3dir` An example is: ``` -./configure.sh --prefix=/usr --localedir /usr/share/nls +./configure.sh --prefix=/usr make make install ``` They correspond to the environment variables `$PREFIX`, `$BINDIR`, -`$DATAROOTDIR`, `$DATADIR`, `$MANDIR`, `$MAN1DIR`, and `$LOCALEDIR`, -respectively. +`$DATAROOTDIR`, `$DATADIR`, `$MANDIR`, `$MAN1DIR`, `$MAN3DIR`, and respectively. ***WARNING***: Locales ignore the prefix because they *must* be installed at a fixed location to work at all. If you do not want that to happen, you must diff --git a/manuals/dc/A.1 b/manuals/dc/A.1 index a625564b769..6500bf9129e 100644 --- a/manuals/dc/A.1 +++ b/manuals/dc/A.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/A.1.md b/manuals/dc/A.1.md index d2de6a187ab..4c40e38dcee 100644 --- a/manuals/dc/A.1.md +++ b/manuals/dc/A.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/E.1 b/manuals/dc/E.1 index e89e1a8544c..7f2477f1077 100644 --- a/manuals/dc/E.1 +++ b/manuals/dc/E.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/E.1.md b/manuals/dc/E.1.md index eadf99cb792..437fc645937 100644 --- a/manuals/dc/E.1.md +++ b/manuals/dc/E.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/EH.1 b/manuals/dc/EH.1 index 59cfb2894c3..ba4e6750702 100644 --- a/manuals/dc/EH.1 +++ b/manuals/dc/EH.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/EH.1.md b/manuals/dc/EH.1.md index 06c2af44ac1..6d1dd78985b 100644 --- a/manuals/dc/EH.1.md +++ b/manuals/dc/EH.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/EHN.1 b/manuals/dc/EHN.1 index a2bc6cab0ea..5f454d01cc2 100644 --- a/manuals/dc/EHN.1 +++ b/manuals/dc/EHN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/EHN.1.md b/manuals/dc/EHN.1.md index 96ee28904ee..e3786886a03 100644 --- a/manuals/dc/EHN.1.md +++ b/manuals/dc/EHN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/EN.1 b/manuals/dc/EN.1 index 980f0d50c13..6f08fc8d3c0 100644 --- a/manuals/dc/EN.1 +++ b/manuals/dc/EN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/EN.1.md b/manuals/dc/EN.1.md index 713cc2fcc82..b97e121e222 100644 --- a/manuals/dc/EN.1.md +++ b/manuals/dc/EN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/H.1 b/manuals/dc/H.1 index e9934a85d4a..cc2f156205e 100644 --- a/manuals/dc/H.1 +++ b/manuals/dc/H.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/H.1.md b/manuals/dc/H.1.md index 55cc7cbe300..b8ad29b28a8 100644 --- a/manuals/dc/H.1.md +++ b/manuals/dc/H.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/HN.1 b/manuals/dc/HN.1 index d22b159db06..8d16b10a23d 100644 --- a/manuals/dc/HN.1 +++ b/manuals/dc/HN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/HN.1.md b/manuals/dc/HN.1.md index c9c98099623..d658409b836 100644 --- a/manuals/dc/HN.1.md +++ b/manuals/dc/HN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/manuals/dc/N.1 b/manuals/dc/N.1 index 9988fe06375..54fbadeed09 100644 --- a/manuals/dc/N.1 +++ b/manuals/dc/N.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 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: diff --git a/manuals/dc/N.1.md b/manuals/dc/N.1.md index 52ffa0b23cf..35573c49da9 100644 --- a/manuals/dc/N.1.md +++ b/manuals/dc/N.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 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: diff --git a/scripts/exec-install.sh b/scripts/exec-install.sh index f36caa37e6f..3b9375af383 100755 --- a/scripts/exec-install.sh +++ b/scripts/exec-install.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/format.sh b/scripts/format.sh index 74ca9dc3543..efb90ef1f32 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/functions.sh b/scripts/functions.sh index f2c5b0b50ea..98cb5cf7aae 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/karatsuba.py b/scripts/karatsuba.py index 9aa1c2a5457..9c94ffe448f 100755 --- a/scripts/karatsuba.py +++ b/scripts/karatsuba.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/link.sh b/scripts/link.sh index f1c403d50dd..4a472828f3e 100755 --- a/scripts/link.sh +++ b/scripts/link.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/lint.sh b/scripts/lint.sh index 65f81c5f651..78260dff2da 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/locale_install.sh b/scripts/locale_install.sh index a67e6aa5297..a2d9ccda7ad 100755 --- a/scripts/locale_install.sh +++ b/scripts/locale_install.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/scripts/locale_uninstall.sh b/scripts/locale_uninstall.sh index 3e79e083b80..dfa3899db26 100755 --- a/scripts/locale_uninstall.sh +++ b/scripts/locale_uninstall.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/src/args.c b/src/args.c index 8e3b2ea1449..60a82ac1b86 100644 --- a/src/args.c +++ b/src/args.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/bc.c b/src/bc.c index bffb096183c..385c18b7701 100644 --- a/src/bc.c +++ b/src/bc.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/bc_lex.c b/src/bc_lex.c index a4641be0b65..5c9d2c536ea 100644 --- a/src/bc_lex.c +++ b/src/bc_lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/bc_parse.c b/src/bc_parse.c index 1617384cd59..c64c194863f 100644 --- a/src/bc_parse.c +++ b/src/bc_parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -1973,7 +1973,7 @@ bc_parse_parse(BcParse* p) exit: // We need to reset on error. - if (BC_ERR(((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig))) + if (BC_ERR(((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig != 0))) { bc_parse_reset(p); } diff --git a/src/data.c b/src/data.c index 5e578778d0f..1694bb68471 100644 --- a/src/data.c +++ b/src/data.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -70,7 +70,7 @@ const uchar dc_sig_msg_len = (uchar) (sizeof(dc_sig_msg) - 1); /// The copyright banner. const char bc_copyright[] = - "Copyright (c) 2018-2022 Gavin D. Howard and contributors\n" + "Copyright (c) 2018-2023 Gavin D. Howard and contributors\n" "Report bugs at: https://git.yzena.com/gavin/bc\n\n" "This is free software with ABSOLUTELY NO WARRANTY.\n"; @@ -174,12 +174,6 @@ const BcOptLong bc_args_lopt[] = { }; -/// The function header for error messages. -const char* const bc_err_func_header = "Function:"; - -/// The line format string for error messages. -const char* const bc_err_line = ":%zu"; - // clang-format off /// The default error category strings. diff --git a/src/dc.c b/src/dc.c index 838f6537791..255bf2e6dcc 100644 --- a/src/dc.c +++ b/src/dc.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/dc_lex.c b/src/dc_lex.c index 4ca01981894..cf737ea3c80 100644 --- a/src/dc_lex.c +++ b/src/dc_lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/dc_parse.c b/src/dc_parse.c index ef95e22f357..638ccfb769c 100644 --- a/src/dc_parse.c +++ b/src/dc_parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/file.c b/src/file.c index 24ca8976564..aeee9f97aa9 100644 --- a/src/file.c +++ b/src/file.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -336,7 +336,7 @@ bc_file_vprintf(BcFile* restrict f, const char* fmt, va_list args) bc_file_puts(f, bc_flush_none, s); } -#if BC_DEBUG_CODE +#ifndef NDEBUG // We only print signed integers in debug code. else if (c == 'd') { @@ -357,7 +357,7 @@ bc_file_vprintf(BcFile* restrict f, const char* fmt, va_list args) bc_file_puts(f, bc_flush_none, buf); } } -#endif // BC_DEBUG_CODE +#endif // NDEBUG else { unsigned long long ull; diff --git a/src/history.c b/src/history.c index bc15da5b8f1..b289cf73a24 100644 --- a/src/history.c +++ b/src/history.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -159,12 +159,14 @@ volatile sig_atomic_t bc_history_inlinelib; static char* bc_history_prompt; static char bc_history_no_prompt[] = ""; static HistEvent bc_history_event; +static bool bc_history_use_prompt; static char* bc_history_promptFunc(EditLine* el) { BC_UNUSED(el); - return BC_PROMPT ? bc_history_prompt : bc_history_no_prompt; + return BC_PROMPT && bc_history_use_prompt ? bc_history_prompt : + bc_history_no_prompt; } void @@ -255,8 +257,18 @@ bc_history_line(BcHistory* h, BcVec* vec, const char* prompt) else bc_history_prompt = bc_vm_strdup(prompt); } + bc_history_use_prompt = true; + + line = NULL; + len = -1; + errno = EINTR; + // Get the line. - line = el_gets(h->el, &len); + while (line == NULL && len == -1 && errno == EINTR) + { + line = el_gets(h->el, &len); + bc_history_use_prompt = false; + } // If there is no line... if (BC_ERR(line == NULL)) @@ -1455,6 +1467,9 @@ bc_history_swap(BcHistory* h) BC_SIG_ASSERT_LOCKED; + // If there are no characters, skip. + if (!h->pos) return; + // Get the length of the previous and next characters. pcl = bc_history_prevLen(h->buf.v, h->pos); ncl = bc_history_nextLen(h->buf.v, BC_HIST_BUF_LEN(h), h->pos, NULL); diff --git a/src/lang.c b/src/lang.c index 20295c26e3d..cb928ba31f7 100644 --- a/src/lang.c +++ b/src/lang.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/lex.c b/src/lex.c index 142ffaa22ae..7dc1fb03bd3 100644 --- a/src/lex.c +++ b/src/lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/library.c b/src/library.c index 6286afcc73c..223fe4a208f 100644 --- a/src/library.c +++ b/src/library.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/main.c b/src/main.c index 92d85797bd4..7809925dcf7 100644 --- a/src/main.c +++ b/src/main.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/num.c b/src/num.c index be9ee2e6d6e..58beb1dbad8 100644 --- a/src/num.c +++ b/src/num.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/opt.c b/src/opt.c index 14ef989f154..dada7442ec0 100644 --- a/src/opt.c +++ b/src/opt.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/parse.c b/src/parse.c index 984e5a14daa..1834bde2883 100644 --- a/src/parse.c +++ b/src/parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/src/program.c b/src/program.c index e63949bb49e..5424b715a29 100644 --- a/src/program.c +++ b/src/program.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -2933,6 +2933,41 @@ bc_program_init(BcProgram* p) bc_map_init(&p->str_map); } +void +bc_program_printStackTrace(BcProgram* p) +{ + size_t i, max_digits; + + max_digits = bc_vm_numDigits(p->stack.len - 1); + + for (i = 0; i < p->stack.len; ++i) + { + BcInstPtr* ip = bc_vec_item_rev(&p->stack, i); + BcFunc* f = bc_vec_item(&p->fns, ip->func); + size_t j, digits; + + digits = bc_vm_numDigits(i); + + bc_file_puts(&vm->ferr, bc_flush_none, " "); + + for (j = 0; j < max_digits - digits; ++j) + { + bc_file_putchar(&vm->ferr, bc_flush_none, ' '); + } + + bc_file_printf(&vm->ferr, "%zu: %s", i, f->name); + +#if BC_ENABLED + if (BC_IS_BC && ip->func != BC_PROG_MAIN && ip->func != BC_PROG_READ) + { + bc_file_puts(&vm->ferr, bc_flush_none, "()"); + } +#endif // BC_ENABLED + + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + } +} + void bc_program_reset(BcProgram* p) { @@ -2945,6 +2980,11 @@ bc_program_reset(BcProgram* p) bc_vec_npop(&p->stack, p->stack.len - 1); bc_vec_popAll(&p->results); +#if DC_ENABLED + // We need to pop tail calls too. + if (BC_IS_DC) bc_vec_npop(&p->tail_calls, p->tail_calls.len - 1); +#endif // DC_ENABLED + #if BC_ENABLED // Clear the globals' stacks. if (BC_G) bc_program_popGlobals(p, true); @@ -2959,13 +2999,15 @@ bc_program_reset(BcProgram* p) // NOLINTNEXTLINE memset(ip, 0, sizeof(BcInstPtr)); - // Write the ready message for a signal, and clear the signal. - if (vm->sig) + if (BC_SIG_INTERRUPT(vm)) { + // Write the ready message for a signal. bc_file_printf(&vm->fout, "%s", bc_program_ready_msg); bc_file_flush(&vm->fout, bc_flush_err); - vm->sig = 0; } + + // Clear the signal. + vm->sig = 0; } void @@ -3015,6 +3057,8 @@ bc_program_exec(BcProgram* p) bc_vec_pushByte(&func->code, BC_INST_INVALID); #endif // BC_HAS_COMPUTED_GOTO + BC_SETJMP(vm, end); + ip = bc_vec_top(&p->stack); func = (BcFunc*) bc_vec_item(&p->fns, ip->func); code = func->code.v; @@ -3642,7 +3686,7 @@ bc_program_exec(BcProgram* p) BC_PROG_LBL(BC_INST_INVALID): // clang-format on { - return; + goto end; } #else // BC_HAS_COMPUTED_GOTO default: @@ -3676,6 +3720,28 @@ bc_program_exec(BcProgram* p) #endif // BC_HAS_COMPUTED_GOTO } + +end: + BC_SIG_MAYLOCK; + + // This is here just to print a stack trace on interrupts. This is for + // finding infinite loops. + if (BC_SIG_INTERRUPT(vm)) + { + BcStatus s; + + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + + bc_program_printStackTrace(p); + + s = bc_file_flushErr(&vm->ferr, bc_flush_err); + if (BC_ERR(s != BC_STATUS_SUCCESS && vm->status == BC_STATUS_SUCCESS)) + { + vm->status = (sig_atomic_t) s; + } + } + + BC_LONGJMP_CONT(vm); } #if BC_DEBUG_CODE diff --git a/src/rand.c b/src/rand.c index c762f1f3602..11c22cd507c 100644 --- a/src/rand.c +++ b/src/rand.c @@ -13,7 +13,7 @@ * This code is under the following license: * * Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/read.c b/src/read.c index d6b0deb7814..d5af9e1ba27 100644 --- a/src/read.c +++ b/src/read.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -171,20 +171,34 @@ bc_read_chars(BcVec* vec, const char* prompt) // If interupted... if (errno == EINTR) { + int sig; + // Jump out if we are supposed to quit, which certain signals // will require. if (vm->status == (sig_atomic_t) BC_STATUS_QUIT) BC_JMP; - assert(vm->sig); + assert(vm->sig != 0); + + sig = (int) vm->sig; // Clear the signal and status. vm->sig = 0; vm->status = (sig_atomic_t) BC_STATUS_SUCCESS; - // Print the ready message and prompt again. - bc_file_puts(&vm->fout, bc_flush_none, bc_program_ready_msg); - if (BC_PROMPT) bc_file_puts(&vm->fout, bc_flush_none, prompt); - bc_file_flush(&vm->fout, bc_flush_none); +#ifndef _WIN32 + // We don't want to print anything on a SIGWINCH. + if (sig != SIGWINCH) +#endif // _WIN32 + { + // Print the ready message and prompt again. + bc_file_puts(&vm->fout, bc_flush_none, + bc_program_ready_msg); + if (BC_PROMPT) + { + bc_file_puts(&vm->fout, bc_flush_none, prompt); + } + bc_file_flush(&vm->fout, bc_flush_none); + } BC_SIG_UNLOCK; diff --git a/src/vector.c b/src/vector.c index c8b99b71b83..5995dc7d302 100644 --- a/src/vector.c +++ b/src/vector.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -418,7 +418,7 @@ bc_map_find(const BcVec* restrict v, const char* name) while (low < high) { - size_t mid = (low + high) / 2; + size_t mid = low + (high - low) / 2; const BcId* id = bc_vec_item(v, mid); int result = strcmp(name, id->name); diff --git a/src/vm.c b/src/vm.c index 069b43e6f4d..0296d0f4b9c 100644 --- a/src/vm.c +++ b/src/vm.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: @@ -68,10 +68,12 @@ #endif // BC_ENABLE_LIBRARY #if !BC_ENABLE_LIBRARY + // The actual globals. char output_bufs[BC_VM_BUF_SIZE]; BcVm vm_data; BcVm* vm = &vm_data; + #endif // !BC_ENABLE_LIBRARY #if BC_DEBUG_CODE @@ -119,21 +121,36 @@ bc_vm_jmp(void) static void bc_vm_sig(int sig) { - // There is already a signal in flight. - if (vm->status == (sig_atomic_t) BC_STATUS_QUIT || vm->sig) +#if BC_ENABLE_EDITLINE + // Editline needs this to resize the terminal. This also needs to come first + // because a resize always needs to happen. + if (sig == SIGWINCH) + { + if (BC_TTY) + { + el_resize(vm->history.el); + + // If the signal was a SIGWINCH, clear it because we don't need to + // print a stack trace in that case. + if (vm->sig == SIGWINCH) + { + vm->sig = 0; + } + } + + return; + } +#endif // BC_ENABLE_EDITLINE + + // There is already a signal in flight if this is true. + if (vm->status == (sig_atomic_t) BC_STATUS_QUIT || vm->sig != 0) { if (!BC_I || sig != SIGINT) vm->status = BC_STATUS_QUIT; return; } -#if BC_ENABLE_EDITLINE - // Editline needs this to resize the terminal. - if (sig == SIGWINCH) - { - el_resize(vm->history.el); - return; - } -#endif // BC_ENABLE_EDITLINE + // We always want to set this because a stack trace can be printed if we do. + vm->sig = sig; // Only reset under these conditions; otherwise, quit. if (sig == SIGINT && BC_SIGINT && BC_I) @@ -154,7 +171,6 @@ bc_vm_sig(int sig) { vm->status = BC_STATUS_ERROR_FATAL; } - else vm->sig = 1; errno = err; } @@ -198,7 +214,7 @@ bc_vm_sigaction(void) struct sigaction sa; sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NODEFER; + sa.sa_flags = 0; // This mess is to silence a warning on Clang with regards to glibc's // sigaction handler, which activates the warning here. @@ -216,7 +232,7 @@ bc_vm_sigaction(void) #if BC_ENABLE_EDITLINE // Editline needs this to resize the terminal. - sigaction(SIGWINCH, &sa, NULL); + if (BC_TTY) sigaction(SIGWINCH, &sa, NULL); #endif // BC_ENABLE_EDITLINE #if BC_ENABLE_HISTORY @@ -333,8 +349,13 @@ bc_vm_handleError(BcErr e) BC_JMP; } #else // BC_ENABLE_LIBRARY +#ifndef NDEBUG +void +bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...) +#else // NDEBUG void bc_vm_handleError(BcErr e, size_t line, ...) +#endif // NDEBUG { BcStatus s; va_list args; @@ -388,29 +409,25 @@ bc_vm_handleError(BcErr e, size_t line, ...) { bc_file_puts(&vm->ferr, bc_flush_none, "\n "); bc_file_puts(&vm->ferr, bc_flush_none, vm->file); - bc_file_printf(&vm->ferr, bc_err_line, line); + bc_file_printf(&vm->ferr, ":%zu\n", line); } else { - BcInstPtr* ip = bc_vec_item_rev(&vm->prog.stack, 0); - BcFunc* f = bc_vec_item(&vm->prog.fns, ip->func); - - bc_file_puts(&vm->ferr, bc_flush_none, "\n "); - bc_file_puts(&vm->ferr, bc_flush_none, vm->func_header); - bc_file_putchar(&vm->ferr, bc_flush_none, ' '); - bc_file_puts(&vm->ferr, bc_flush_none, f->name); - -#if BC_ENABLED - if (BC_IS_BC && ip->func != BC_PROG_MAIN && - ip->func != BC_PROG_READ) - { - bc_file_puts(&vm->ferr, bc_flush_none, "()"); - } -#endif // BC_ENABLED + // Print a stack trace. + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + bc_program_printStackTrace(&vm->prog); } } + else + { + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + } - bc_file_puts(&vm->ferr, bc_flush_none, "\n\n"); +#ifndef NDEBUG + bc_file_printf(&vm->ferr, "\n %s:%d\n", file, fline); +#endif // NDEBUG + + bc_file_puts(&vm->ferr, bc_flush_none, "\n"); s = bc_file_flushErr(&vm->ferr, bc_flush_err); @@ -732,6 +749,25 @@ bc_vm_freeTemps(void) vm->temps_len = 0; } +#if !BC_ENABLE_LIBRARY + +size_t +bc_vm_numDigits(size_t val) +{ + size_t digits = 0; + + do + { + digits += 1; + val /= 10; + } + while (val != 0); + + return digits; +} + +#endif // !BC_ENABLE_LIBRARY + inline size_t bc_vm_arraySize(size_t n, size_t size) { @@ -929,7 +965,7 @@ bc_vm_clean(void) BcVec* fns = &vm->prog.fns; BcFunc* f = bc_vec_item(fns, BC_PROG_MAIN); BcInstPtr* ip = bc_vec_item(&vm->prog.stack, 0); - bool good = ((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig); + bool good = ((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig != 0); BC_SIG_ASSERT_LOCKED; @@ -1331,8 +1367,6 @@ bc_vm_defaultMsgs(void) { size_t i; - vm->func_header = bc_err_func_header; - // Load the error categories. for (i = 0; i < BC_ERR_IDX_NELEMS + BC_ENABLED; ++i) { @@ -1355,7 +1389,7 @@ bc_vm_gettext(void) { #if BC_ENABLE_NLS uchar id = 0; - int set = 1, msg = 1; + int set, msg = 1; size_t i; // If no locale, load the defaults. @@ -1375,11 +1409,8 @@ bc_vm_gettext(void) return; } - // Load the function header. - vm->func_header = catgets(vm->catalog, set, msg, bc_err_func_header); - // Load the error categories. - for (set += 1; msg <= BC_ERR_IDX_NELEMS + BC_ENABLED; ++msg) + for (set = 1; msg <= BC_ERR_IDX_NELEMS + BC_ENABLED; ++msg) { vm->err_ids[msg - 1] = catgets(vm->catalog, set, msg, bc_errs[msg - 1]); } @@ -1389,13 +1420,13 @@ bc_vm_gettext(void) // Load the error messages. In order to understand this loop, you must know // the order of messages and categories in the enum and in the locale files. - for (set = id + 3, msg = 1; i < BC_ERR_NELEMS; ++i, ++msg) + for (set = id + 2, msg = 1; i < BC_ERR_NELEMS; ++i, ++msg) { if (id != bc_err_ids[i]) { msg = 1; id = bc_err_ids[i]; - set = id + 3; + set = id + 2; } vm->err_msgs[i] = catgets(vm->catalog, set, msg, bc_err_msgs[i]); diff --git a/tests/all.sh b/tests/all.sh index 76f2ac10ba1..0ef8ae6cb49 100755 --- a/tests/all.sh +++ b/tests/all.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/bc/timeconst.sh b/tests/bc/timeconst.sh index 8b6e1ec596f..3751700077f 100755 --- a/tests/bc/timeconst.sh +++ b/tests/bc/timeconst.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/bcl.c b/tests/bcl.c index 2de7d74c06f..cea63f457cd 100644 --- a/tests/bcl.c +++ b/tests/bcl.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 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: diff --git a/tests/error.sh b/tests/error.sh index b9c5bbe3be6..35a6af0edf3 100755 --- a/tests/error.sh +++ b/tests/error.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/errors.sh b/tests/errors.sh index 4acc978b9e5..5005f3e9aeb 100755 --- a/tests/errors.sh +++ b/tests/errors.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/history.py b/tests/history.py index f1787a27e86..b9acf73cb58 100755 --- a/tests/history.py +++ b/tests/history.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/history.sh b/tests/history.sh index 1898ae5499d..ff4ffa562ca 100755 --- a/tests/history.sh +++ b/tests/history.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/other.sh b/tests/other.sh index c71189b9b32..fe228eec331 100755 --- a/tests/other.sh +++ b/tests/other.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/read.sh b/tests/read.sh index a1915eb271a..a5c66d9d4fe 100755 --- a/tests/read.sh +++ b/tests/read.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/script.sh b/tests/script.sh index f59daf34333..d720878fafa 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/scripts.sh b/tests/scripts.sh index 46aa7e76117..ee21b2a9be6 100755 --- a/tests/scripts.sh +++ b/tests/scripts.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/stdin.sh b/tests/stdin.sh index 69e6f2cabf3..d8585052bf0 100755 --- a/tests/stdin.sh +++ b/tests/stdin.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: diff --git a/tests/test.sh b/tests/test.sh index 8e292a52435..95606ded4f9 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 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: