Commit Graph

458 Commits

Author SHA1 Message Date
Landon Curt Noll
f5d5319a51 Fix typos 2021-03-26 22:47:55 -07:00
Landon Curt Noll
263b8a78ef Fix how calc(1) cat page, if needed, is formed 2021-03-26 22:30:19 -07:00
Landon Curt Noll
3c866367c6 Fix calc(1) man page install uncer macOS 2021-03-26 21:43:41 -07:00
Landon Curt Noll
09d7080547 Added comments in calc Makefiles
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 ...
2021-03-26 16:52:32 -07:00
Landon Curt Noll
f480c8c5df Cleanup CHANGES
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.
2021-03-26 12:04:25 -07:00
Landon Curt Noll
a230431a3b Fix missing quotes in env rule 2021-03-26 11:59:15 -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.
v2.12.9.1
2021-03-26 09:31:36 -07:00
Landon Curt Noll
a86d629982 Fixed a typo in help/Makefile
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>.
2021-03-12 11:31:21 -08:00
Landon Curt Noll
bcbc0cb766 Merge pull request #25 from atsampson/doubleassign
Remove redundant assignments when byteswapping
2021-03-11 03:14:14 -08: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.
v2.12.9.0
2021-03-11 01:54:28 -08:00
Landon Curt Noll
9b4580d861 Fix typo in make depend messages 2021-03-07 02:37:59 -08:00
Landon Curt Noll
2085361df1 Fix make depend plus make depend Makefile changes 2021-03-07 02:03:28 -08:00
Landon Curt Noll
bf4657c138 Cleanup of Makefiles
Fixed Makefile dependenies 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.
2021-03-07 01:26:40 -08:00
Landon Curt Noll
1b5636afed Use ${ECHON} for when /bin/echo -n is needed 2021-03-06 22:21:36 -08:00
Landon Curt Noll
7eba99ac29 Add notes about unexpeded things in using calc 2021-03-06 22:12:14 -08:00
Landon Curt Noll
de6474bf28 Declare SHELL at makefile top, sort and fix standard tool list in Makefiles 2021-03-06 22:09:10 -08:00
Landon Curt Noll
55bc690cd1 Fix dependencies for args.h 2021-03-06 21:00:45 -08:00
Adam Sampson
6dc62c1ab7 Remove redundant assignments when byteswapping.
The SWAP_ macros already write the result to their destination arg, so
there's no need for an extra assignment -- and this is undefined
behaviour because there are two assignments to the same variable without
an intervening sequence point (as GCC 10 correctly warns).
2021-03-06 01:46:04 +00: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>.
2.12.8.2 v2.12.8.2
2021-02-20 09:27:50 -08:00
Landon Curt Noll
1ab3b2c313 Restore ability to compile calc without -DCUSTOM 2021-02-20 09:25:48 -08:00
Landon Curt Noll
64e2c6a262 Release 2.12.8.1
Fixed how the *.tar.bz2 are formed.  The calc-2.12.8.0.tar.bz2 file
    that was formed for calc version 2.12.8.0 was missing most files.

    Expanded 'make chk' to also verify that 'make distchk' and 'make
    distlist' execute successfully.  This will help check a regression
    of the bug that produced the bogus calc-2.12.8.0.tar.bz2 file.

    Added additional regression tests related 0^(zero_expression)==1.
2.12.8.1
2021-02-15 22:53:22 -08:00
Landon Curt Noll
eac02835ed Test pre-release of 2.12.8.1 2021-02-15 22:33:13 -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
8af0b351ae Release 2.12.8.1
Fixed how the *.tar.bz2 are formed.  The calc-2.12.8.0.tar.bz2 file
    that was formed for calc version 2.12.8.0 was missing most files.

    Expanded 'make chk' to also verify that 'make distchk' and 'make
    distlist' execute successfully.  This will help check a regression
    of the bug that produced the bogus calc-2.12.8.0.tar.bz2 file.

    Added additional regression tests related 0^(zero_expression)==1.
2021-02-15 22:21:02 -08:00
Landon Curt Noll
3260f90a73 Changed default MANDIR to make it easier to install on macOS 11 2021-02-12 23:16:26 -08:00
Landon Curt Noll
b7e15195f9 Release 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 compilation
    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 QUESTIONS help file.

    If the environment variable $CALCHELP is defined and is non-empty,
    then calc help files will be in the directory 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 directory
    by the $CALCCUSTOMHELP environment variable.

    Fixed a number of typos in text and in source code comments.

    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
2.12.8.0
2021-02-12 22:35:46 -08:00
Landon Curt Noll
c02725f036 Update copyright date to 2021 for all prev typo fixes 2021-02-12 22:27:51 -08:00
Landon Curt Noll
507fe026e5 Fix many spelling errors 2021-02-12 22:09:47 -08:00
Landon Curt Noll
486f4c5626 Update a few copyright years to 2021 2021-02-12 16:07:00 -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
8b7e01f426 Added missing malloc failure checks 2021-02-04 15:28:51 -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.
2.12.7.6
2021-02-03 13:03:50 -08:00
Landon Curt Noll
0f902b95cf Clarify when factor() builtin returns 1
Clarify that the factor() builtin return 1
if it does not find a factor below the limit.
2021-02-03 12:45:10 -08:00
Landon Curt Noll
8684e1be9c Fix for missing cscript/simple.calc in tarball 2021-02-03 12:44:11 -08:00
Landon Curt Noll
ae3a6129b2 Release 2.12.7.5
Final cleanup for the calc version 2.12.7.5 release.
2.12.7.5
2021-02-03 03:24:47 -08:00
Landon Curt Noll
2c72570b8d Fixed 0^(0) and 0^(6-6) to return 1
Calc as defined 0^0 as 1.  However in the past, 0 raised to
an expression that evaluted to zero returned 1.  The result
was that 0^0 was different than 0^(6-6) or even 0^(0).
Now, calc will return 1 for 0^(0) and 0^zero when zero == 0.
2021-02-03 01:44:17 -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
a8be58becb Merge pull request #8 from jcul/master
Fix compilation with GCC 7+
2021-02-02 23:45:34 -08:00
Landon Curt Noll
067afc140a Merge pull request #7 from thegithubr/patch-1
Little fix
2021-02-02 23:42:05 -08:00
Landon Curt Noll
41128fada9 Merge pull request #12 from guilhermgonzaga/master
Fix typos; Insert missing lines in README.md
2021-02-02 23:41:22 -08:00
Landon Curt Noll
f5fae012f9 Release 2.12.7.4 2021-02-02 23:03:37 -08:00
Landon Curt Noll
3d25fb30cb Release 2.12.7.4 2021-02-02 23:03:10 -08:00
Landon Curt Noll
8374586275 Merge branch 'master' of https://github.com/lcn2/calc 2021-02-02 23:02:24 -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
d58a55a1ed Release 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.

Fixed issues relating to compiling on macOS.  Fixed issues
where <unistd.h> is needed.
2021-02-02 22:54:51 -08:00
Landon Curt Noll
ccfa797b68 Changes as per calc 2.12.7.3 2021-02-02 20:33:59 -08:00
Guilherme Gonzaga de Andrade
0f030f0759 Fix typos; Insert missing lines in README.md
Fixed typos in help/intro and README.md;
Copied missing description lines from help/intro to README.md "What is calc?"
section.
2020-03-03 11:27:23 -04:00
Jack Culhane
af59b9dab2 One FALLTHRU comment was inconsistent with others 2019-05-17 17:31:02 +01:00
Jack Culhane
fa173cd9aa Fix spaces vs tabs and use FALLTHRU as it's used elsewhere 2019-05-17 17:18:07 +01:00