Commit Graph

200 Commits

Author SHA1 Message Date
Landon Curt Noll
b03e71f0ce Release v2.14.2.2
The following are the changes in this release:

    Removed references to obsolete Email addresses.

    macOS Darwin defaults LCC to "cc".
2023-07-28 21:33:59 -07:00
Landon Curt Noll
80e841eded Release v2.14.2.1
The following are the changes in this release:

    Added cal/fnv_tool.cal, a calc resource file defining:

	find_fnv_prime(bits)
	deprecated_fnv0(bits,fnv_prime,string)
	fnv_offset_basis(bits,fnv_prime)
	fnv1a_style_hash(bits,fnv_prime,prev_hash,string)

    Fixed sorted order of cal/README.
2023-07-25 23:09:39 -07:00
Landon Curt Noll
3ec7b39366 Release v2.14.2.0
The following are the changes in this release:

    Ported calc to the s390x IBM Mainframe running RHEL9.1.

    Added cal/splitbits.cal:

	splitbits(x, b)

	Given an integer x, split the value into a list of integers,
	each of which is at most b bits long.

	The value b must be an integer > 0.

	The number of elements in the returned list is:

	    ceil((highbit(x) + 1) / b)

	If x == 0, then a list of 1 element containing 0 is returned.

	If x < 0, then the two's compliment of abs(x) is returned.
	Even though calc represents negative integers as positive values
	with sign bit, the bits returned by this function are as if
	the integer converted as if the integer was a two's compliment value.

	See also the help command:

	    ; help resource
2023-07-21 23:22:20 -07:00
Landon Curt Noll
bd64a6cc36 Release v2.14.1.6
The following are the changes in this release:

    Fixed version numbers in two cases in CHANGES that referred
    to the 2.14.2.x instead of 2.14.1.x.

    Rename MINGW Makefile variable (a holdover from MINGW32_NT-5.0)
    to OSNAME.

    Fixed FUNCPTR typedef in hist.c to fix deprecated compiler warnings.

    Fixed when USE_READLINE, READLINE_LIB, READLINE_EXTRAS, and
    READLINE_INCLUDE are set to empty (disable use of the GNU-readline
    facility).

    Fix cases of spaces before tabs in Makefile and Makefile.simple.

    Fixed obsolete references to the atoz() in LIBRARY to use the
    correct internal function name of str2z().

    Fixed obsolete references to the atoq() in LIBRARY to use the
    correct internal function name of str2q().

    Document in help/unexpected that * operator has has a higher
    precedence than << in calc, which differs from C.  Thanks
    goes to GitHub user @inguin for pointing put this difference.
2023-05-31 18:55:56 -07:00
Landon Curt Noll
5fa732b869 Release v2.14.1.5
The following are the changes in this release:

    Fixed version numbers in two cases in CHANGES that referred
    to the 2.14.2.x instead of 2.14.1.x.

    Rename MINGW Makefile variable (a holdover from MINGW32_NT-5.0)
    to OSNAME.

    Fixed FUNCPTR typedef in hist.c to fix deprecated compiler warnings.

    Fixed when USE_READLINE, READLINE_LIB, READLINE_EXTRAS, and
    READLINE_INCLUDE are set to empty (disable use of the GNU-readline
    facility).

    Fix cases of spaces before tabs in Makefile and Makefile.simple.
2023-03-12 20:52:45 -07:00
Landon Curt Noll
d89ea78104 prep for calc version 2.14.1.4
Updated COPYING file to indicate that these files are now
covered under "The Unlicense" (see https://unlicense.org):

	sha1.c
	sha1.h
	cal/dotest.cal
	cal/screen.cal

Updated help/credit to match the above changes to COPYING.

Updated CONTRIB-CODE and calc.man to refer to using GitHub pull requests
for contributing to calc (instead of using Email).

Updated BUGS and calc.man to refer to using GitHub issues
for reporting calc bugs (instead of using Email).

Updated QUESTIONS and calc.man to refer to using GitHub issues
for asking calc questions (instead of using Email).

Fixed Makefile.local command example to refer to overriding the
Makefile variable DEBUG (instead of CDEBUG).

Fixed all make chk ASAN warnings under macOS 13.2.1 when calc is compiled
with the following uncommented lines in Makefile.local:

    DEBUG:= -O0 -g
    CFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
    LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
    CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1

Improved how pointers to functions are declared for the builtins
array in func.c to avoid function declarations without a prototype
that is now deprecated in C.

Improved how pointers to functions are declared for the opcodes
array in opcodes.c to avoid function declarations without a prototype

Replaced use of egrep with grep -E in Makefiles.

Fixed cases where variables were set but not used in symbol.c, calc.c,
and the main function in func.c as used by funclist.c.

Added rule name to "DO NOT EDIT -- generated by the Makefile" lines
in constructed files.

Test if <sys/vfs.h> exists and set HAVE_SYS_VFS_H accordingly
in have_sys_vfs.h.  Added HAVE_SYS_VFS_H to allow one to force
this value.

Test if <sys/param.h> exists and set HAVE_SYS_PARAM_H accordingly
in have_sys_param.h.  Added HAVE_SYS_PARAM_H to allow one to force
this value.

Test if <sys/mount.h> exists and set HAVE_SYS_MOUNT_H accordingly
in have_sys_mount.h.  Added HAVE_SYS_MOUNT_H to allow one to force
this value.

Test if the system as the statfs() system call and set HAVE_STATFS
accordingly in have_statfs.h.  Added HAVE_STATFS to allow one
to force this value.

The pseudo_seed() function will also try to call statfs() if
possible and permitted by the HAVE_STATFS value.
2023-03-06 02:17:40 -08:00
Landon Curt Noll
774060944b prep for calc version 2.14.1.3
Change calc version from 2.14.1.2 to 2.14.2.3 as part of a test to
build calc RPMs on a reference RHEL8.7 platform (formerly a RHEL7.9
platform).
2023-02-14 15:39:11 -08:00
Landon Curt Noll
def203f273 Release calc v2.14.1.2 2022-11-29 12:59:36 -08:00
Landon Curt Noll
3b3bfb3f74 Proposed changes for v2.14.1.1
Added a few remarks on calc version numbers to version.c.

Fixed how fposval.h is built.  On a number of systems, the fposval.c
file failed to compile incorrectly.  This caused problems for systems in
which fposval.h.def was not correct.

Fixed how have_memmv.h is built.  On a number of systems, the have_memmv.c
file failed to compile incorrectly, producing a potentially incorrect
have_memmv.h file for such systems.

Fixed how align32.h is built.  On a number of systems, the align32.c
file failed to compile incorrectly, producing a potentially incorrect
align32.h file for such systems.

Fixed how have_newstr.h is built.  On a number of systems, the have_newstr.c
failed to compile incorrectly, producing a potentially incorrect
have_newstr.h file for such systems.

Fixed how have_strdup.h is built.  On a number of systems, the have_strdup.c
file failed to compile incorrectly, producing a potentially incorrect
have_strdup.h file for such systems.

Fixed how have_strlcat.h is built.  On a number of systems, the have_strlcat.c
file failed to compile incorrectly, producing a potentially incorrect
have_strlcat.h file for such systems.

Fixed how have_strlcpy.h is built.  On a number of systems, the have_strlcpy.c
file failed to compile incorrectly, producing a potentially incorrect
have_strlcpy.h file for such systems.

Fixed how have_uid_t.h is built.  On a number of systems, the have_uid_t.c
file failed to compile incorrectly, producing a potentially incorrect
have_uid_t.h file for such systems.

Fixed how have_uid_t.h is built.  On a number of systems, the have_uid_t.c
file failed to compile incorrectly, producing a potentially incorrect
have_uid_t.h file for such systems.
2022-11-27 13:28:32 -08:00
Landon Curt Noll
741ea46853 Release v2.14.1.0
The following are the changes from calc version 2.14.1.0 to date:

    Fixed alignment of show item section of help command.

    Bug fix: While 0^0 == 1, now for y > 0, 0^y == 0.
    Adjusted cal/test8900.cal to reflect this bug fix.
    Added tests to cal/regress.cal to help verify bug fix is fixed.
2022-04-08 00:02:44 -07:00
Landon Curt Noll
ee70c12481 Release v2.14.0.14
The following are the changes in this release:

    Fixed typo in Makefile.local comment.

    Established a tagging procedure for a production release.
    Production git tags will be of the form:

	prod-2.x.y.z
2021-12-27 19:10:56 -08:00
Landon Curt Noll
b3c015d338 Release v2.14.0.13
We apologize for the calc v2.14.0.12 source tarball that was missing
critical files.  While the executable was well tested, our release
process was deficient.

We are improved our release process and added tests during the release
procedure to help verify that we are not regressing in to the "v2.14.0.12
source tarball" issue, among other things.

Depending on how things do, you might is several releases come out over
a short period of time.  The core of calc isn't changing, so the calc
executable will be the same as we focus on the Makefiles, our release
procedure, and related documentation / help files.

=-=

The following are the changes in this release:

    Minor tweak to seed() builtin.  Updated help/srand and help/srandom.

    Moved Makefile.ship into Makefile.

    Removed custom/Makefile.head and custom/Makefile.tail.

    The custom/Makefile is now part of source and includes Makefile.
    In particular, custom/Makefile makes use of the 'middle' of
    the new top level Makefile where calc's top level Makefile
    variables are defined.

    Makefile.simple and custom/Makefile.simple are now part of the source
    and are constructed from Makefile and custom/Makefile respectively.
    The Makefile.simple and custom/Makefile.simple avoid using GNU
    conditionals. They may be used with older/classic make commands.

    Makefile.local will include comments about how to better use
    it. Between releases, Makefile.local at the top of the master branch
    will contain how we typically build calc and test calc (FYI: we
    normally enable things such as -Werror -Wextra -pedantic).  When we
    push out a release, Makefile.local will be stripped of non-comment
    lines.  Thus, releases of calc, and, released "calc*.src.rpm"
    files and the source tarballs, will have a Makefile.local with
    only comments.

    The "README.*" files and "HOWTO.INSTALL" file have been updated.

    By default, compiler warnings have been turned up.  The Makefile
    variable ${CCWARN} now defaults to:

	CCWARN= -Wall -Wextra -pedantic

    The previous level of compiler warnings can be easily restored by
    adding to Makefile.local:

	CCWARN:= -Wall

    The readline, history and ncurses libraries are now default.
    The Makefile variables ${USE_READLINE}, ${READLINE_LIB}, and
    ${READLINE_EXTRAS} now default to:

	USE_READLINE= -DUSE_READLINE
	READLINE_LIB= -lreadline
	READLINE_EXTRAS= -lhistory -lncurses

    The previous mode where readline, history and ncurses libraries
    were not compiled in by default can be easily restored by
    adding to Makefile.local:

	USE_READLINE:=
	READLINE_LIB:=
	READLINE_EXTRAS:=

    We have renamed "stable" as "production".
    We have renamed "unstable" as "tested".

    On the web site:

	http://www.isthe.com/chongo/src/calc/

    these files has been renamed:

	2.x.y.z_IS_LATEST_STABLE   ==> 2.x.y.z_IS_LATEST_PRODUCTION
	2.x.y.z_IS_LATEST_UNSTABLE ==> 2.x.y.z_IS_LATEST_TESTED

    The terms 'stable' and 'unstable' were both misleading and
    inaccurate.  For details see the new documention file:

	README.RELEASE

    See also the help command:

	; help release

    Fixed bug impacting how have_ustat.h was formed.

    Updated help/archive to reflect GitHub use.
2021-12-13 14:23:47 -08:00
Landon Curt Noll
39c0cba1ca Release v2.14.0.12
The following are the changes in this release:

    Fixed a number of typos.

    Drop support for SunOS, IRIX and MINGW32_NT-5.0 targets.
    Drop support for CLOCK_SGI_CYCLE.  Drop testing for __MSDOS__.

    Minor improvement of various help files.  Made format of help
    files more consistent.

    Corrected a few comments in zrandom.c, including a case where
    the comment referred to 1007 when it should have used 2^32.

    Improved seed() generation.  Improved some comments in seed.c.
    Added have_environ.c to build have_environ.h in order to
    determine if:

	extern char **environ;	/* user environment */

    is an valid external symbol.

    Fixed documentation that referred to the old additive 55
    generator.  We have been using the subtractive 100 in place
    of the additive 55 generator for a while now.

    Fixed depend rule for custom/Makefile.

    Fixed how Makefile variable SHELL is set on macOS vs. Linux.
    Using /bin/sh on macOS due to how zsh treats globs by default.

    Added charbit.h to define CALC_CHARBIT which is either CHAR_BIT
    from <limits.h> or 8 or a value set by the Makefile variable
    CALC_CHARBIT.  Added have_limits.h to determine if <limits.h>
    is a system include file.

    Compiling now tests for _WIN64 as well when testing for _WIN32.

    Now assuming that <stdio.h> is available under _WIN32 and _WIN64.

    Added some preliminary notes about attempts to compile calc
    under Windows 11.

	BTW: While we are unable to use Windows 11, we welcome
	     Windows 11 developers to try compiling calc natively
	     (instead of via a Linux virtual machine).  If you are
	     able to compile Windows 11 natively, we would welcome
	     GitHub pull requests showing any needed modifications:

		https://github.com/lcn2/calc/pulls

	     Please also add notes to the 'Compiling calc under Windows 11'
	     section in README.WINDOWS file.

    We added Makefile.simple as part of the master branch source
    to help those who may be using a make tool that does not support
    GNU Make-like features such as "ifeq" and ":=".

    Fixed incorrect ustat_dev member ref in seed() builtin that
    was part of the unreleased calc v2.12.0.11.
2021-12-08 15:52:34 -08:00
Landon Curt Noll
e213cc5072 Release v2.14.0.11
The following are the changes in this release:

    Fixed a number of typos.

    Drop support for SunOS, IRIX and MINGW32_NT-5.0 targets.
    Drop support for CLOCK_SGI_CYCLE.  Drop testing for __MSDOS__.

    Minor improvement of various help files.  Made format of help
    files more consistent.

    Corrected a few comments in zrandom.c, including a case where
    the comment referred to 1007 when it should have used 2^32.

    Improved seed() generation.  Improved some comments in seed.c.
    Added have_environ.c to build have_environ.h in order to
    determine if:

	extern char **environ;	/* user environment */

    is an valid external symbol.

    Fixed documentation that referred to the old additive 55
    generator.  We have been using the subtractive 100 in place
    of the additive 55 generator for a while now.

    Fixed depend rule for custom/Makefile.

    Fixed how Makefile variable SHELL is set on macOS vs. Linux.
    Using /bin/sh on macOS due to how zsh treats globs by default.

    Added charbit.h to define CALC_CHARBIT which is either CHAR_BIT
    from <limits.h> or 8 or a value set by the Makefile variable
    CALC_CHARBIT.  Added have_limits.h to determine if <limits.h>
    is a system include file.

    Compiling now tests for _WIN64 as well when testing for _WIN32.

    Now assuming that <stdio.h> is available under _WIN32 and _WIN64.

    Added some preliminary notes about attempts to compile calc
    under Windows 11.

	BTW: While we are unable to use Windows 11, we welcome
	     Windows 11 developers to try compiling calc natively
	     (instead of via a Linux virtual machine).  If you are
	     able to compile Windows 11 natively, we would welcome
	     GitHub pull requests showing any needed modifications:

		https://github.com/lcn2/calc/pulls

	     Please also add notes to the 'Compiling calc under Windows 11'
	     section in README.WINDOWS file.

    We added Makefile.simple as part of the master branch source
    to help those who may be using a make tool that does not support
    GNU Make-like features such as "ifeq" and ":=".
2021-12-08 15:30:08 -08:00
Landon Curt Noll
769ac51f8c Release v2.14.0.10 2021-12-01 23:38:56 -08:00
Landon Curt Noll
fde724aa2d Release v2.14.0.9
The following are the changes in this release:

    Due to issues with clang and Apple Silicon, ARCH_CFLAGS is now,
    by default, empty:

	ARCH_CFLAGS=

    If you want to use, say, -march=native, then either change
    the Makefile or make with:

	make all ARCH_CFLAGS='-march=native'

    Added arch and hardware as GNU Makefile computed values.
    As with ${target}, ${arch} and ${hardware} is computed by uname:

	target: uname -a
	arch: uname -p
	hardware: uname -m

    Fixed compiling calc on Apple Silicon with homebrew.  On Apple
    Silicon, HomeBrew installs on into a different location.  The
    Makefile checks if ${hardware} is arm64 and adjusts the location
    of libraries such as readline and history accordingly.
2021-11-24 01:35:01 -08:00
Landon Curt Noll
08fe6f13f4 Release v2.14.0.8
The following are the changes in this release:

    Identical to v2.14.0.7: now declared a stable release.
2021-11-23 00:04:09 -08:00
Landon Curt Noll
e11d159c81 Release v2.14.0.7
The following are the changes in this release:

    Fizzbin is a better word. :-)

    The help and man builtin commands now return an error when a
    help file cannot be opened, such as when there is no help file.

    Added palindrome.cal resource file.  For example, to find the
    largest (highly probable) prime palindrome under 280 decimal
    digits (text tweet limit):

	prevprimepal(1e280)
2021-11-07 20:36:07 -08:00
Landon Curt Noll
27f977b545 Remove unnecessary leading line whitespace before a tab 2021-11-07 20:14:28 -08:00
Landon Curt Noll
e0cd9bb3db Release v2.14.0.6
The following are the changes in this release:

    Fixed typo in cal/statistics.cal thanks to a report by <GitHub user
    dennisaldea>.

    Fixed an old Windoz pun in README.WINDOWS as requested by <GitHub
    user marcodegio>.

    Fixed a really obscure bug in the internal initconstants()
    function of const.c that has been sitting for over 31 years!

	We are amazed that nobody has encountered this bug before
	now.  Nevertheless, our very extensive regression and
	multi-architecture testing found the bug.  Now, after all
	those years, it is fixed.

    Fixed issues identied by the default CodeUL GitHub security code scan:

	Wrong type of arguments to printf in have_fpos_pos.c
	Multiplication result converted to larger type in zfunc.c
2021-10-22 03:36:40 -07:00
Landon Curt Noll
f0f6171354 Release v2.14.0.5
Fixed a really obscure bug in the internal initconstants()
function of const.c that has been sitting for over 31 years!

    We are amazed that nobody has encountered this bug before
    now.  Nevertheless, our very extensive regression and
    multi-architecture testing found the bug.  Now, after all
    those years, it is fixed.

Fixed issues identied by the default CodeUL GitHub security code
scan:

    Wrong type of arguments to printf in have_fpos_pos.c
    Multiplication result converted to larger type in zfunc.c
2021-10-22 03:20:58 -07:00
Landon Curt Noll
8aa5f140bf Release v2.12.0.4 2021-10-22 01:26:25 -07:00
Landon Curt Noll
459c07b121 Release v2.14.0.3
The following are the changes in this release:

    Added builtin functions to convert between degrees and
    degrees, minutes and seconds under the config("mod")
    round rules:

	d2dms(degs, d, m, s [,rnd]) - given degs, compute d, m, s
	d2dm(degs, d, m [,rnd]) - given degs, compute d, m

	See help/d2dms and help/d2dm.

    Example:

	; print d2dms(360.321,deg=,min=,sec=), deg, min, sec;
	0.321 0 19 15.6

	; print d2dm(360.321,deg=,min=), deg, min;
	0.321 0 19.26

    Added builtin functions to convert between gradians and
    gradians, minutes and seconds under the config("mod")
    round rules:

	g2gms(grads, g, m, s [,rnd]) - given grads, compute g, m, s
	g2gm(grads, g, m [,rnd]) - given grads, compute g, m

	See help/g2gms and help/g2gm.

    Example:

	; print g2gms(400.321,grad=,min=,sec=), grad, min, sec;
	0.321 0 19 15.6

	; print g2gm(400.321,grad=,min=), grad, min;
	0.321 0 19.26

    Added builtin functions to convert between hours and
    hours, minutes and seconds under the config("mod")
    round rules:

	h2hms(hours, h, m, s [,rnd]) - given hours, compute h, m, s
	h2hm(hours, h, m [,rnd]) - given hours, compute h, m

	See help/h2hms and help/h2hm.

    Example:

	; print h2hms(24.321,hour=,min=,sec=), hour, min, sec;
	0.321 0 19 15.6

	; print h2hm(24.321,hour=,min=), hour, min;
	0.321 0 19.26

    Renumbered regression tests 3408 thru 3437, to 9102 thru 9131.

    Updated Added hms.cal resource file to use h2hms() builtin.
    Updated Added dms.cal resource file to use d2dms() builtin.

    Fix minor typo in help/mod SYNOPSIS.
    Fix minor typo in help/quo SYNOPSIS.

    Added a few more examples to help/strcmp.

    Added builtin functions to convert between degrees, minutes and
    seconds and degrees under the config("mod") round rules:

	dms2d(d, m, s [,rnd]) - convert deg, min, and secs to deg
	dm2d(d, m [,rnd]) - convert deg, min to deg

	See help/dms2d and help/dm2d.

    Example:

	; print dms2d(12, 20, 44.16);
	12.3456

	; print dm2d(3601, -25.5594);
	0.57401

    Added builtin functions to convert between gradians, minutes and
    seconds and gradians under the config("mod") round rules:

	gms2g(g, m, s [,rnd]) - convert grad, min, and secs to grad
	gm2g(g, m [,rnd]) - convert grad and min to grad

	See help/g2gms and help/g2gm.

    Example:

	; print gms2g(12, 20, 44.16);
	12.3456

	; print gm2g(4001, -25.5594);
	0.57401

    Added builtin functions to convert between hours, minutes and
    seconds and hours under the config("mod") round rules:

	hms2h(h, m, s [,rnd]) - convert hours, min, and secs to hours
	hm2h(h, m [,rnd]) - convert hours, min to hours

	See help/hms2h and help/hm2h.

    Example:

	; print hms2h(12, 20, 44.16);
	12.3456

	; print hm2h(241, -25.5594);
	0.57401
2021-09-27 02:49:06 -07:00
Landon Curt Noll
abf39b34b6 Release v2.14.0.2
The clean and clobber makefile rules no longer list custom/Makefile
as a dependency.

Unfortunately due to the complex dependency issues between
Makefile, Makefile.ship and custom/Makefile, parallel GNU make
is NOT recommended.  Sorry (tm Canada) :)

Fixed a few typos in CHANGES.

As a side note: We stayed v2.13.x was kept for only a short time.
The move to 2.14.x was motivated by non-compatible changes due to
the default order of CALCRC, plus some new builtin functions.

More changes are likely, so we might see another v2.14.0.x release
before things are declared "recommended stable".

Not that we wan to discourage people from trying v2.14.0, you should
try it.  We just want things to become stable and well field tested
before we reach the "recommended stable" release state.
2021-09-08 14:38:20 -07:00
Landon Curt Noll
cd736fdbd4 Release v2.14.0.0
The :-separated default CALCRC value has been reversed.
The default CALCRC was:

    ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit

The default CALCRC is now:

    ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup

See "help environment" for details.

Added engineering mode as per a GitHub pull request from
<GitHub user heitzmann>.  Thank you!  For example:

    ; config("mode","eng"),
    ; 10^41
	    100e39

or for example:

    ; base(1000),
    ; 2^23209-1
	    ~402.87411577898877818187e6984

For more information see:

    help base

Added regression test code for engineering mode.  Improved and
expanded regression test code related to the base() and base2()
builtin functions.

Fixed a critical bug in the above mentioned pull request where
a call to base2(1000) would make calc unstable and likely to
dump core.
2021-09-06 23:30:06 -07:00
Landon Curt Noll
ebf065dcb8 Prepare for calc version 2.13.0.1
Replaced /usr/local with the use of ${PREFIX} in calc Makefiles.

    The ${PREFIX} is not the same as ${T}.  The ${T} specifies
    a top level directory under which calc installs things.
    While usally ${T} is empty, it can be specific path
    as if calc where "chrooted" during an install.
    The ${PREFIX} value, during install, is a path between
    the top level ${T} install directory and the object
    such as an include file.

    Corrected a few more typos in Makefile comments.
2021-04-09 12:40:51 -07:00
Landon Curt Noll
04861939fc Release v2.13.0.0
The following are the changes in this release:

    Fixed typo (missing quotes) in the env rule.

    Fixed intendation problem in CHANGES.

    Combined 2.12.9.1 changes into the 2.12.8.2 to 2.12.9.0
    range, and thus renamed the range to 2.12.8.2 to 2.12.9.1.

    Fixed issues related to building Makefile.simple.

    Fixed how the Makefile variable MANPATH is set for macOS.

    Added a bunch of information to the near bottom of HOWTO.INSTALL
    on calc Makefiles.  This information discusses the various
    Makefiles found in the calc source.

    Added comments in various calc Makefiles about their origin.
    In particular, for Makefiles that are constructed such as
    Makefile.simple, custom/Makefile and custom/Makefile.simple
    there are comments about how they were made.

    For all calc Makefiles, including those in sub-directories,
    near the top there is now a line of the form:

	# SRC: ... some message about the origin ...

    Fixed how the calc(1) man page is installed under macOS.

    Fixed how calc man page in ${CATDIR} is formed.

    Fixed how Makefile.simple is formed.

    Fixed the #! calc script argument processing.  The initial #!
    line must end in a -f.  For example, if calc is in /usr/local/bin/calc,
    then the following would be the first line of a calc script:

	#!/usr/local/bin/calc -f
	...

    It is common that -q be usde with a calc script, so assuming the
    same /usr/local/bin/calc path:

	#!/usr/local/bin/calc -q -f
	...

    Use of -s in the #! first line of a calc script is not needed
    since -f implies -f.

    The argv() will now return values more typical of C's main().
    Before it returned one less than the number of arguments.  Now,
    for example, when calc is given 2 args, argv() will return 3.

    The value of argv(0) will be the path to calc, or in the
    case of a #! calc cscript, it will return the name of the script.

    Updated the calc man page and help/argv to reflect the
    above changes.

    Improved the formatting of the calc man page.

    Fixed the formation of the win32 sub-directory via the win32_hsrc
    Makefile rule.

    Due to incompatible changes to the argv() function, and #! calc
    scripts, we are setting the version to the next minor number:

	2.13.0
2021-03-27 05:55:50 -07:00
Landon Curt Noll
eaec46982d Release v2.12.9.1
The following are the changes in this release:

    Fixed a typo typo in help/Makefile that caused the build of
    2.12.9.0 to fail in a number of cases.  Thanks to a report by
    <GitHub user balducci>.

    Pass form Makefile variables ${Q}, ${S}, ${E}, ${H} and ${V} down
    to all sub-directory Makefiles from the top level Makefile.
2021-03-26 09:31:36 -07:00
Landon Curt Noll
ac0d84eef8 Release v2.12.9.0
Added notes to help/unexpected about:

    display() will limit the number of digits printed after decimal point

    %d will format after the decimal point for non-integer numeric values

    %x will format as fractions for non-integer numeric values

    fprintf(fd, "%d\n", huge_value) may need fflush(fd) to finish

Fixed Makefile dependencies for the args.h rule.

Fixed Makefile cases where echo with -n is used.  On some systems,
/bin/sh does not use -n, so we must call /bin/echo -n instead
via the ${ECHON} Makefile variable.

Add missing standard tools to sub-Makefiles to make them
easier to invoke directly.

Sort lists of standard tool Makefile variables and remove duplicates.

Declare the SHELL at the top of Makefiles.

Fixed the depend rule in the custom Makefile.

Improved the messages produced by the depend in the Makefiles.

Changed the UNUSED define in have_unused.h to be a macro with
a parameter.  Changed all use of UNUSED in *.c to be UNUSED(x).

Removed need for HAVE_UNUSED in building the have_unused.h file.

 CCBAN is given to ${CC} in order to control if banned.h is in effect.

 The banned.h attempts to ban the use of certain dangerous functions
 that, if improperly used, could compromise the computational integrity
 if calculations.

 In the case of calc, we are motivated in part by the desire for calc
 to correctly calculate: even during extremely long calculations.

 If UNBAN is NOT defined, then calling certain functions
 will result in a call to a non-existent function (link error).

 While we do NOT encourage defining UNBAN, there may be
 a system / compiler environment where re-defining a
 function may lead to a fatal compiler complication.
 If that happens, consider compiling as:

    make clobber all chk CCBAN=-DUNBAN

 as see if this is a work-a-round.

 If YOU discover a need for the -DUNBAN work-a-round, PLEASE tell us!
 Please send us a bug report.  See the file:

    BUGS

 or the URL:

    http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html

 for how to send us such a bug report.

 Added the building of have_ban_pragma.h, which will determine
 if "#pragma GCC poison func_name" is supported.  If it is not,
 or of HAVE_PRAGMA_GCC_POSION=-DHAVE_NO_PRAGMA_GCC_POSION, then
 banned.h will have no effect.

 Fixed building of the have_getpgid.h file.
 Fixed building of the have_getprid.h file.
 Fixed building of the have_getsid.h file.
 Fixed building of the have_gettime.h file.
 Fixed building of the have_strdup.h file.
 Fixed building of the have_ustat.h file.
 Fixed building of the have_rusage.h file.

 Added HAVE_NO_STRLCPY to control if we want to test if
 the system has a strlcpy() function.  This in turn produces
 the have_strlcpy.h file wherein the symbol HAVE_STRLCPY will
 be defined, or not depending if the system comes with a
 strlcpy() function.

 If the system does not have a strlcpy() function, we
 compile our own strlcpy() function.  See strl.c for details.

 Added HAVE_NO_STRLCAT to control if we want to test if
 the system has a strlcat() function.  This in turn produces
 the have_strlcat.h file wherein the symbol HAVE_STRLCAT will
 be defined, or not depending if the system comes with a
 strlcat() function.

 If the system does not have a strlcat() function, we
 compile our own strlcat() function.  See strl.c for details.

 Fixed places were <string.h>, using #ifdef HAVE_STRING_H
 for legacy systems that do not have that include file.

 Added ${H} Makefile symbol to control the announcement
 of forming and having formed hsrc related files.  By default
 H=@ (announce hsrc file formation) vs. H=@: to silence hsrc
 related file formation.

 Explicitly turn off quiet mode (set Makefile variable ${Q} to
 be empty) when building rpms.

 Improved and fixed the hsrc build process.

 Forming rpms is performed in verbose mode to assist debugging
 to the rpm build process.

 Compile custom code, if needed, after main code is compiled.
2021-03-11 01:54:28 -08:00
Landon Curt Noll
0aca07d278 Release 2.12.8.2
The following are the changes in this release:

    Calc can now correctly compile without CUSTOM being defined,
    thanks to a report by <GitHub user barsnick>.
2021-02-20 09:27:50 -08:00
Landon Curt Noll
33657bb2cc Test pre-release of 2.12.8.1 2021-02-15 22:32:27 -08:00
Landon Curt Noll
91991bb729 Checkpoint on calc version 2.12.8.0
Fixed a mistake in "help intro" where some inserted text
    changed the value of "." and thus made the next result
    incorrect.

    Clarified in "help factor" that 1 is returned if no
    factor below the limit was found.

    Removed Makefile variable ${MAKEFILE_REV}.

    The missing cscript/square.calc file has been restored.

    Fixed compiler errors and warnings related to GCC.
    In particular, gcc/9.3.1 and gcc/10.2.1 now compile
    calc without any compiler errors or warnings,
    even with -Werror -Wextra -pedantic.

    To print out information about the calc compliation
    environment, we added the following make rule:

	make calcinfo

    Improved how 'make debug' operates.

    Moved help/contrib to CONTRIB-CODE.  The help/contrib file
    is now build from a copy of CONTRIB-CODE.

    Created a new calc bug report Email address.  Created a new calc
    question Email address.  Created a new calc contribution Email
    address.  See the BUGS file for details.

    Added "help questions" to print the QUESIONS help file.

    If the environment variable $CALCHELP is defined and is non-empty,
    then calc help files will be in the direcgory by the $CALCHISTFILE
    environment variable.

    If the environment variable $CALCCUSTOMHELP is defined and is
    non-empty, then custom calc help files will be in the direcgory
    by the $CALCCUSTOMHELP environment variable.

    The calc-tester mailing list has been retired.  See:

	* How to submit a calc bug report:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html

	* How to contribute code to calc:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-contrib.html

	* How to submit a question about calc:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-question.html
2021-02-12 15:50:39 -08:00
Landon Curt Noll
71a116ca6f Fix gcc/9.3.1 and gcc/10.2.1 errors and warnings 2021-02-04 17:20:20 -08:00
Landon Curt Noll
229345ade8 Release 2.12.7.6
The following are the changes in this release:

    The missing cscript/square.calc file has been restored.
2021-02-03 13:03:50 -08:00
Landon Curt Noll
41803b878e Added use of $CALCHISTFILE and start of 2.12.7.5
By default, the calc history file is located in ~/.calc_history.
Now, if the environment variable $CALCHISTFILE is defined
and is non-empty, then calc history file will be defined
by the $CALCHISTFILE environment variable.
2021-02-03 00:51:56 -08:00
Landon Curt Noll
68c2edf610 Release 2.12.7.4
These changes are per calc version 2.12.7.3:

Requiring calc shell scripts to use -s -f at the end of the
initial #! line.

Fixed /tmp/mersenne example in calc(1) man page.

Added make variable ${ARCH_CFLAGS}.  The ${ARCH_CFLAGS} is
added after ${CCMISC} and before ${EXTRA_CFLAGS} when building
the ${CFLAGS} for compiling C code.  are ${CC} when compiling
C files.  The default value is:

ARCH_CFLAGS= -march=native

which directs C compiler to compile for the native machine.
To disable use of '-march=native', set ARCH_CFLAGS to the empty
string as in:

make all ARCH_CFLAGS=

To make calc RPMs more portable, they are compiled with an
empty ARCH_CFLAGS.

These changes are per calc version 2.12.7.4:

Fixed issues relating to compiling on macOS.  Fixed issues
where <unistd.h> is needed.
2021-02-02 23:01:11 -08:00
Landon Curt Noll
ccfa797b68 Changes as per calc 2.12.7.3 2021-02-02 20:33:59 -08:00
Landon Curt Noll
c5e416c41f Release calc 2.12.7.2
Fixed a segfault when getpwuid() returned NULL during initialization.
Thanks goes to baratharon GitHub user for reporting this issue.
2018-11-28 12:27:04 -08:00
Landon Curt Noll
a877cb52c0 Corrected CHANGES notes
Corrected CHANGES notes that were mixed up for TAB, VT, CR & NL.
The core in 2.12.7.0 is correct.  The CHANGE notes were mixed up.
Sorry!
2018-11-05 07:33:40 -08:00
Landon Curt Noll
4bec694df3 Release calc version 2.12.7.0
The following are the changes from calc version 2.12.7.0 to date:

    Added a patch to replaces the manual search for include files
    in $(INCDIR) in the have_*.h targets with compiler invocations.
    Thanks goes to Helmut Grohne (helmut at subdivi dot de) who
    implemented the patch and posted it to the Debian bug tracker
    and Martin Buck (m at rtin-buck dor de) for forwarding it to us.

    The check_include make rule was fixed to not assume /usr/include.

    The qprintnum() function now takes outdigits as a 3rd argument.
    Most of the time, this 3rd argument is just conf->outdigits.
    But when it comes to the experimental '%g', this value can
    change.  This avoids having to modify conf->outdigits.

    Fixed a problem where gcc complains about E_FUNC not being defined
    for Linux systems as reported by Martin Buck (m at rtin-buck dor de).

    Updated the help files help/config, help/display, help/epsilon,
    help/fprint, help/printf, and help/strprintf to give more
    examples of how display digits and epsilon precision interact
    with displaying values.

    Added more information about %g in the help file help/printf.

    The '\a' is now recognized in a printf format string as the
    single byte audible bell character (byte 0x07 in ASCII encoding).

    The following is a partial list of escape sequences recognized
    in strings and in printf formats:

        \a      audible bell    byte 0x07 in ASCII encoding
        \b      backspace       byte 0x08 in ASCII encoding
        \f      form feed       byte 0x0c in ASCII encoding
        \n      newline         byte 0x0b in ASCII encoding
        \r      return          byte 0x0a in ASCII encoding
        \t      tab             byte 0x0d in ASCII encoding
        \v      vertical tab    byte 0x09 in ASCII encoding
2018-11-04 17:11:31 -08:00
Landon Curt Noll
54a7a3f7bc Release 2.12.6.10
Added a patch to replaces the manual search for include files
    in $(INCDIR) in the have_*.h targets with compiler invocations.
    Thanks goes to Helmut Grohne <helmut at subdivi dot de> who
    implemented the patch and posted it to the Debian bug tracker
    and Martin Buck (m at rtin-buck dor de) for forwarding it to us.

    The check_include make rule was fixed to not assume /usr/include.

    The qprintnum() function now takes outdigits as a 3rd argument.
    Most of the time, this 3rd argument is just conf->outdigits.
    But when it comes to the experimental '%g', this value can
    change.  This avoids having to modify conf->outdigits.
2018-10-19 19:33:57 -07:00
Landon Curt Noll
2ea77e6151 Release 2.12.6.9
Experimental changes for macOS builds.
2018-10-15 19:37:48 -07:00
Landon Curt Noll
c8705c1198 Release calc 2.12.6.8
The following are the changes in this release:

    For historical purposes, in lucas.cal, gen_v1(1, n) always returns 4.

    Fixed some compiler warnings, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Added work around for a gcc warning bug, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Fixed errors in various help files such as:

	mat randbit seed srandom types

    Removed the MAXSTRING symbol because it was no longer used by calc.

    Increased HIST_SIZE (depth of the history stack) from 10k to 32k.

    Increased TTYSIZE (reallocation size for terminal buffers) from 100 to 8191.

    Increased MAXDEPTH (maximum depth of input stack) from 10 to 255.

    Increased interactive input buffer size from 1024 to 256k.  This has the
    effect of increasing the maximum length of an input line from a tty.
    This helps with an interactive bug that was reported by Ruslan Kabatsayev
    (b7 dot 10110111 at gmail dot com).

    The calc man page indicates that -d also disables the printing of the
    leading tilde.

    Added information to "help command" about how to silence messages
    while reading calc resource files.

    Fixed an error message buffer overflow thanks to a report by
    Frank Peters <nlp at northernlightsphoto dot biz>.

    Replaced all use of the C funcion sprintf() with snprintf().
    Replaced all use of the C funcion vsprintf() with vsnprintf().
    Replaced all DONT_HAVE_VSPRINTF with DONT_HAVE_VSNPRINTF.
    Replaced all Makefile var ${HAVE_VSPRINTF} with ${HAVE_VSNPRINTF}.
2018-09-30 10:25:18 -07:00
Landon Curt Noll
e555a718c0 Released calc 2.12.6.7 with help and input fixes
Fixed errors in various help files such as:

	mat randbit seed srandom types

    Removed the MAXSTRING symbol because it was no longer used by calc.

    Increased HIST_SIZE (depth of the history stack) from 10k to 32k.

    Increased TTYSIZE (reallocation size for terminal buffers) from 100 to 8191.

    Increased MAXDEPTH (maximum depth of input stack) from 10 to 255.

    Increased interactive input buffer size from 1024 to 256k.  This has the
    effect of increasing the maximum length of an input line from a tty.
    This helps with an interactive bug that was reported by Ruslan Kabatsayev
    (b7 dot 10110111 at gmail dot com).
k
2018-03-04 11:09:09 -08:00
Landon Curt Noll
07d8bf0f3e Version 2.12.6.6 2018-02-21 12:38:39 -08:00
Landon Curt Noll
c585d7aa78 Release calc version 2.12.6.5 2018-01-28 18:26:08 -08:00
Landon Curt Noll
8da0471f07 Release calc version 2.12.6.4
Fixed a man page warning about ./myfile where the leading dot
was mistook for an nroff macro.  Thanks goes to David Haller
<dnh at opensuse dot org> for providing the patch.

Improved gen_v1(h,n) in lucas.cal for cases where h is not a
multiple of 3. Optimized the search for v(1) when h is a
multiple of 3.

Fixed a Makefile problem, reported by Doug Hays <doughays6 at gmail
dot com>, where if a macOS user set BINDIR, LIBDIR, CALC_SHAREDIR
or INCDIR in the top section, their values will be overwritten by
the Darwin specific section.
2018-01-16 15:27:13 -08:00
Landon Curt Noll
aeb9a9d473 Prepare for calc version 2.12.6.3 2017-09-06 18:20:35 -07:00
Landon Curt Noll
ea533659ce Release calc version 2.12.6.2 2017-09-06 17:42:41 -07:00
Landon Curt Noll
f91bfaab70 Prep for calc version 2.12.6.1 2017-06-05 21:05:25 -07:00