712 Commits

Author SHA1 Message Date
Landon Curt Noll
077ba65285 Release v2.16.0.0
The following are the changes in this release:

    Starting with calc version 2.16.0.0, the ability to perform arithmetic
    on addresses of values in calc objects has been greatly restricted.

    Most arithmetic on of value addresses could easily cause calc to
    crash.  For example, prior to calc version 2.16.0.0, the following
    command was likely to crash calc:

        calc '*((&.)+1e9)'

    Subtracting two value addresses is permitted, however there is NO
    guarantee that the address of a value will remain consistent across
    calc runs.  Addresses of values depend on the circumstances of when
    the calc values were formed.

    The above restrictions and caveats apply to addresses of values.
    Such restrictions and caveats to NOT apply to the addresses of
    octets, NOR to the addresses within strings.  If isptr(x) == 2, then
    x is value-pointer and the above mentioned restrictions and caveats apply.

    See "help address" for more information on value address arithmetic.

    Added E_INVALID_DEREF (10610) error code to indicate the invalid
    dereferencing a non-variable.

    Added E_INVALID_ADDR_OP (10611) error code to indicate an invalid
    arithmetic address operation.

    We plan to let this most recent change settle down before performing
    the calc v2 to calc v3 fork.  Therefore, version 2.16.1.0 will form
    the basis for the calc v2 to calc v3 fork.
v2.16.0.0
2025-08-14 18:34:32 -07:00
Landon Curt Noll
f912da9427 checkpoint adding missing edit to Makefile.config 2025-08-14 18:26:47 -07:00
Landon Curt Noll
753b101e54 prep for 2.16.0.0 release with value address arithmetic restrictions 2025-08-14 18:23:07 -07:00
Landon Curt Noll
db83b7383f prep CHANGES for the next release of calc v2.15.1.2 2025-08-13 12:53:21 -07:00
Landon Curt Noll
d9245844aa removed use of have_memmv.c and HAVE_MEMMOVE, prep for version 2.15.1.2
Removed use of HAVE_MEMMOVE as well have_memmv.c.  Removed the
building and including of have_memmv.h.  Removed the memmove()
function in blkcpy.c, used when HAVE_MEMMOVE was NOT defined.
The libc memmove(3) function as defined by <string.h> is now
required to compile calc because the replacement code in
blkcpy.c q was problematic, especially when regions overlap.
The HAVE_MEMMOVE make symbol was removed from Makefile.config.
Thanks to GitHub user @skeeto for reporting this problem.
2025-08-13 12:42:45 -07:00
Landon Curt Noll
8542143463 Merge pull request #161 from skeeto/fix-missing-includes
Add includes to alloc.h for CONST and E_FUNC
2025-08-13 10:50:56 -07:00
Christopher Wellons
50cb6ec798 Add includes to alloc.h for CONST and E_FUNC 2025-08-07 20:13:18 -04:00
Landon Curt Noll
41951e2c09 Merge pull request #159 from Gusted/patch-1 2025-06-15 20:00:28 -07:00
Gusted
b9cee333b2 Update description of log2's help page 2025-06-15 21:30:01 +02:00
Landon Curt Noll
e35bb7ffa6 update CHANGES
Declare version 2.16.0.0 will form the basis for the calc v2 to calc v3 fork.
2025-04-27 20:45:54 -07:00
Landon Curt Noll
c5b64c373b Update README.md
Fix typo
2025-04-24 01:34:48 -07:00
Landon Curt Noll
4017579aeb prep CHANGES for the next release of calc prod-2.15.1.1 v2.15.1.1 2025-04-23 19:33:56 -07:00
Landon Curt Noll
88fb6a4e47 prep CHANGES for the next release of calc 2025-04-23 19:31:51 -07:00
Landon Curt Noll
7eb7e9de1f change VERSION from 2.15.1.0 to 2.15.1.1 2025-04-23 19:30:21 -07:00
Landon Curt Noll
42d5749da2 prep CHANGES for the next release of calc
Change Makefile.config to, if not using not HomeBrew, then try to
detect macports and/or using /opt/local/{lib,include}.

Changed version from 2.15.1.0 to 2.15.1.1.

Put full date range (1989-2025) of calc source into version.h.
2025-04-23 19:28:55 -07:00
Landon Curt Noll
bbcbb76369 improve security policy 2025-03-16 22:20:17 -07:00
Landon Curt Noll
232b3bddef Release v2.15.1.0
The following are the changes in this release:

    Converted all ASCII tabs to ASCII spaces using a 8 character
    tab stop, for all files, except for all Makefiles (plus rpm.mk).
    The command `git diff -w` reports no changes.  There is no
    functionality change in calc: only ASCII tabs to ASCII spaces.

    Fixed trailblank.  It was pruning . in its find search.
    Added check for ASCII tabs is non-Makefiles.

    This version will form the basis for the calc v2 to calc v3 fork.
prod-2.15.1.0 v2.15.1.0
2024-07-11 22:49:00 -07:00
Landon Curt Noll
5ac3e495b2 prep CHANGES for the next release of calc 2024-07-11 22:45:39 -07:00
Landon Curt Noll
56153d6615 fix trailblank and sort .gitignore 2024-07-11 22:42:37 -07:00
Landon Curt Noll
2a4f399593 prep CHANGES for the next release of calc 2024-07-11 22:14:31 -07:00
Landon Curt Noll
160de4bb38 prep CHANGES for the next release of calc 2024-07-11 22:12:41 -07:00
Landon Curt Noll
db77e29a23 convert ASCII TABs to ASCII SPACEs
Converted all ASCII tabs to ASCII spaces using a 8 character
tab stop, for all files, except for all Makefiles (plus rpm.mk).
The `git diff -w` reports no changes.
2024-07-11 22:03:52 -07:00
Landon Curt Noll
fe9cefe6ef fix dependabot.yml location
GitHub parses `dependabot.yml` as an action file because I put it in .github/workflows/ by mistake.
It should be `.github/dependabot.yml`.

See https://stackoverflow.com/questions/69446872/dependabot-error-githubl1-no-event-triggers-defined-in-on
2024-07-04 12:18:14 -07:00
Landon Curt Noll
ea4c50ade0 updated codeql-analysis.yml
Merged from mkiocccentry: .github/workflows/codeql.yml
2024-07-03 23:12:53 -07:00
Landon Curt Noll
7f72908b95 add regression test for ilog2 bug
Added regress test to verify the
[fix](33815f49e6)
for
[issue #148](https://github.com/lcn2/calc/issues/148).

Sorry: We forgot to include this regression test to previous update.
2024-05-31 18:23:23 -07:00
Landon Curt Noll
a547c36f0a prep CHANGES for the next release of calc prod-2.15.0.7 v2.15.0.7 2024-05-27 18:47:41 -07:00
Landon Curt Noll
1e2698b42d Merge pull request #149 from bambooleafz/master
this should fixes issue #148
2024-05-27 18:36:31 -07:00
bambooleafz
33815f49e6 Update qfunc.c
the previous `*qlog2 = utoq(log2)` may be incorrect. under that case, `qlog2` actually points to `_qone_` and causes `_qone_` changed
2024-05-27 19:40:59 +08:00
Landon Curt Noll
732279bcc3 Merge pull request #147 from fruityloops1/master 2024-05-13 11:52:00 -07:00
fruityloops1
7f4e1eb68d Fix help page typo 2024-05-13 20:43:41 +02:00
Landon Curt Noll
1232b59949 Merge pull request #144 from coreysciuto-toast/patch-1
Fix Manpage typo
2024-02-12 14:39:23 -08:00
Corey Sciuto
90feefc622 Fix Manpage typo 2024-02-12 16:59:15 -05:00
Landon Curt Noll
c97ee188ad Release v2.15.0.6
The following are the changes in this release:

     Thanks to GitHub user @ashamedbit, a long standing memory leak in
     zrandom.c has been fixed.
v2.15.0.6
2024-02-09 08:28:56 -08:00
Landon Curt Noll
ae85846839 improve useful strings produced by update_ver 2024-02-09 08:27:02 -08:00
Landon Curt Noll
e096bd9ad8 credit @ashamedbit a memory leak fix in zrandom.c 2024-02-09 08:02:50 -08:00
Landon Curt Noll
884b1bc81b Merge pull request #142 from ashamedbit/fix-memory-leak
Fix memory leak in zrandom.c
2024-02-09 07:53:47 -08:00
ashamedbit
a30a518ba7 Fix memory leak in zrandom.c 2024-02-09 03:48:11 -05:00
Landon Curt Noll
bb3b861090 Release v2.15.0.5
The following are the changes in this release:

     make clobber now removes the legacy files: have_fpos.h, help/man,
     and help/usage.  The latter 2 are now managed as help aliases
     in help.c.

     make install now removes the legacy files: ${HELPDIR}/man
     and ${HELPDIR}/usage.

     Fixed a problem where, when calc was linked with and uses GNU
     readline then for any multi-line copy-and-paste, only the first
     line is executed.  Thanks to GitHub user @malfisya for reporting
     this problem, and thanks to GitHub user @gromit1811 for doing
     the research needed to overcome deficiencies in the GNU readline
     documentation, and for supplying the work-a-round to allow
     multi-line copy-and-paste to work as expected!
prod-2.15.0.5 v2.15.0.5
2024-02-01 20:45:42 -08:00
Landon Curt Noll
0a3469125e prep CHANGES for the next release of calc 2024-02-01 20:38:19 -08:00
Landon Curt Noll
9b37e79f21 update CHANGES, fix make clobber and make install
make clobber also removes the legacy files: help/man, and help/usage.

make install now removes the legacy files: ${HELPDIR}/man and
${HELPDIR}/usage.

Document the GNU readline then for any multi-line copy-and-paste
fix in CHANGES.
2024-01-05 10:21:26 -08:00
Landon Curt Noll
18cd1f9067 Merge pull request #139 from gromit1811/master
Properly handle multi-line strings and newline returned by readline()
2024-01-05 09:51:47 -08:00
Martin Buck
43fc022dc8 Properly handle multi-line strings and newline returned by readline()
Fix for #138

According to
https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html
it's OK for readline() to return multi-line strings and/or newlines in case
of bracketed paste (enabled by default since readline 8.1) and also in other
situations even though its documentation explicitly states the opposite. So
we need to handle this properly in calc instead of just using the first line
and dropping the rest: Split the string returned by readline() into lines
and return line by line with each invocation of hist_getline(), each
possbily adding a terminating newline.
2024-01-05 10:34:25 +01:00
Landon Curt Noll
29695028cd improve make clobber
make clobber now removes the legacy file: have_fpos.h
2023-12-26 12:41:29 -08:00
Landon Curt Noll
1d37930d22 Release v2.15.0.4
The following are the changes in this release:

    Fixed bug that caused calc to fail to compile filepos2z() in file.c
    on little endian machines for the Debian apcalc package.  Thanks to
    Martin Buck (m at rtin-buck dor de) for for fix.

    Removed unused macros from zmath.h:

	SWAP_B32_IN_HASH(dest, src)
	SWAP_B16_IN_HASH(dest, src)
	SWAP_B8_IN_HASH(dest, src)
	SWAP_B32_IN_FLAG(dest, src)
	SWAP_B16_IN_FLAG(dest, src)
	SWAP_B8_IN_FLAG(dest, src)

    When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
    SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
    or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
    is an assignment such as:

	(*(dest) = *(src))

    We now case the dest and src pointers to the proper type before
    referencing and performing the assignment.

    Documented unexpected behavior when calc is running in
    "shell script mode" and the prompt builtin function is used
    without the -p flag.  Updated help/prompt, help/unexpected
    and the calc man page accordingly.

    Unless calc is given the -p command line option, calc will reopen
    stdin as /dev/null instead of just closing stdin.  This prevents
    subsequent opens grabbing the 1st file descriptor.

    Disable regress tests 4709, 4710, and 7763 because they print
    multi-byte sequences, which are just fine for calc, the awk
    used to evaluate the regression suite output in some legacy
    systems report a "multibyte conversion failure".

    Added a number of missing Makefile variables to the "make env" rule.

    The man command is used to format the calc.1 man page into calc.usage.

    The "help calc" command now prints the formatted calc man page (calc.usage).
    The "help man" command now prints the formatted calc man page (calc.usage).
    The "help usage" command now prints the formatted calc man page (calc.usage).

    The file, calc.cat1, is formed by gzipping the calc.usage
    formatted man page.  The calc.cat1 is installed as the calc
    cat section 1 man page.

    Updated the Copyright string in version.c to refer to
    the COPYING file and the "help copying" command.

    Added calc.cat1 to .gitignore.  Using "sort -d -u" to sort .gitignore content.

    Avoiding use of modern [[ and ]] in Makefile for those legacy systems
    whose shell do not support them.  Be sure to use ||'s between []'s
    to avoid problems with legacy shell such as the Bourne shell. *sigh*

    Fixed the order of "help full" to match the order of topics listed
    buy the "help help" command.

    Sorted the halias[] help topics table in help.c using sort -d -u.
prod-2.15.0.4 v2.15.0.4
2023-12-21 05:52:06 -08:00
Landon Curt Noll
60698d2130 fix Makefile for legacy shell
The top level Makefile needs to use multiple []'s between  ||'s
to not cause problems for legacy shells such as the Bourne shell.

For example:

```make
	-${Q} if [ -z "${MANDIR}" ] || [ ! -s calc.1 ]; then \
...
	-${Q} if [ -z "${CATDIR}" ] || [ ! -s calc.cat1 ]; then \
```
2023-12-21 05:44:19 -08:00
Landon Curt Noll
3e7ccfd31c Release v2.15.0.3
The following are the changes in this release:

    Fixed bug that caused calc to fail to compile filepos2z() in file.c
    on little endian machines for the Debian apcalc package.  Thanks to
    Martin Buck (m at rtin-buck dor de) for for fix.

    Removed unused macros from zmath.h:

	SWAP_B32_IN_HASH(dest, src)
	SWAP_B16_IN_HASH(dest, src)
	SWAP_B8_IN_HASH(dest, src)
	SWAP_B32_IN_FLAG(dest, src)
	SWAP_B16_IN_FLAG(dest, src)
	SWAP_B8_IN_FLAG(dest, src)

    When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
    SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
    or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
    is an assignment such as:

	(*(dest) = *(src))

    We now case the dest and src pointers to the proper type before
    referencing and performing the assignment.

    Documented unexpected behavior when calc is running in
    "shell script mode" and the prompt builtin function is used
    without the -p flag.  Updated help/prompt, help/unexpected
    and the calc man page accordingly.

    Unless calc is given the -p command line option, calc will reopen
    stdin as /dev/null instead of just closing stdin.  This prevents
    subsequent opens grabbing the 1st file descriptor.

    Disable regress tests 4709, 4710, and 7763 because they print
    multi-byte sequences, which are just fine for calc, the awk
    used to evaluate the regression suite output in some legacy
    systems report a "multibyte conversion failure".

    Added a number of missing Makefile variables to the "make env" rule.

    The man command is used to format the calc.1 man page into calc.usage.

    The "help calc" command now prints the formatted calc man page (calc.usage).
    The "help man" command now prints the formatted calc man page (calc.usage).
    The "help usage" command now prints the formatted calc man page (calc.usage).

    The file, calc.cat1, is formed by gzipping the calc.usage
    formatted man page.  The calc.cat1 is installed as the calc
    cat section 1 man page.

    Updated the Copyright string in version.c to refer to
    the COPYING file and the "help copying" command.

    Added calc.cat1 to .gitignore.  Using "sort -d -u" to sort .gitignore content.

    Avoiding use of modern [[ and ]] in Makefile for those legacy systems
    whose shell do not support them.  *sigh*

    Fixed the order of "help full" to match the order of topics listed
    buy the "help help" command.

    Sorted the halias[] help topics table in help.c using sort -d -u.
2023-12-21 05:33:43 -08:00
Landon Curt Noll
488d81b809 prep CHANGES for the next release of calc 2023-12-21 05:29:01 -08:00
Landon Curt Noll
932d27053e update help/prompt copyright date
Put back 2006 date between 1999 and 2023.
2023-12-19 03:15:20 -08:00
Landon Curt Noll
8e8d6c852a fix distlist inventory and fix make clobber 2023-12-19 01:00:25 -08:00
Landon Curt Noll
54dd89dcf7 document prompt in shell script mode, fix man formatting, legacy awk
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag.  Updated help/prompt, help/unexpected
and the calc man page accordingly.

Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin.  This prevents
subsequent opens grabbing the 1st file descriptor.

Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".

Added a number of missing Makefile variables to the "make env" rule.

The man command is used to format the calc.1 man page into calc.usage.

The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).

The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page.  The calc.cat1 is installed as the calc
cat section 1 man page.

Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.

Added calc.cat1 to .gitignore.  Using "sort -d -u" to sort .gitignore content.

Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them.  *sigh*

Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.

Sorted the halias[] help topics table in help.c using sort -d -u.
2023-12-19 00:40:10 -08:00