Commit Graph

529 Commits

Author SHA1 Message Date
Landon Curt Noll
e6fc1a92a9 Improve file position handling on Big Engian machines
Added swap_HALFs(dest, src, len) function to byteswap.c.

Calc can now handle Big Engian file position sizes that are a
multiple of BASEB bits in length.  Before handle Big Engian file
positions could only be 32 and 64 bits in length.  This will allow,
for example, a Big Engian file position size of 128 (assuming that
128/BASEB is is an integer).
2022-11-28 15:13:16 -08:00
Landon Curt Noll
3e084d9fb9 Rename have_fpos.h to have_fgetsetpos.h
Renamed have_fpos.h to have_fgetsetpos.h.

Renamed CALC_HAVE_FPOS_H to CALC_HAVE_FGETSETPOS_H.
2022-11-28 14:07:47 -08:00
Landon Curt Noll
340c1990ce Checkpoint on fixing compiling with musl gentoo
Restored use of the #define FPOS_POS_LEN symbol.  This refers to the
length of the __pos element (if the __pos element exists), the fpos_t type
(if that type exists).

Changed SWAP_HALF_IN_FILEPOS(dest, src) mato to use FILEPOS_LEN Little
Endian when FILEPOS is a simple scalar type (i.e., HAVE_FILEPOS_SCALAR
is defined).

Changed #define HAVE_FPOS to HAVE_FGETSETPOS.

Corrected comment in have_fpos_pos.h.  The HAVE_FPOS_POS symbol was NOT
related to fgetpos & fsetpos but rather if we we have an __pos element
in FILEPOS.

Changed #define HAVE_NO_FPOS to HAVE_NO_FGETSETPOS.

Improved comments in have_fpos_pos.h to show why and how HAVE_FPOS_POS,
FPOS_POS_BITS, and FPOS_POS_LEN were defined or undefed.

Changed showfiles builtin to print sizes cast to (long int) with the
"%ld" printf format to avoid implementations that do not support the
"%lld" printf format specifier.
2022-11-28 12:55:29 -08:00
Landon Curt Noll
5acd67c704 Updated calc bug report template version: 1.3 2022-11-27 2022-11-27 19:07:54 -08:00
Landon Curt Noll
083011c9e3 Changed full_debug rule to not stop on sub-task error 2022-11-27 19:01:15 -08:00
Landon Curt Noll
dce2c6f0ee Improve the make debug rule
Added full_debug rule to Makefile.  This does the work of the
old debug rule in a more verbose mode by using Q= H=@ S= E= V=@.

The debug rule in the Makefile now pre-removes debug.out and then
runs make full_debug sending stdout and stderr to debug.out.  It then
prints a few instructions about filing a GitHub issue bug report.
2022-11-27 18:45:58 -08:00
Landon Curt Noll
827988c553 Fixed FILEPOS_LEN symbol and macro problems 2022-11-27 17:05:49 -08:00
Landon Curt Noll
25dcd8cb80 Release v2.14.1.1
The following are the changes in this release:

    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.
v2.14.1.1
2022-11-27 13:41:32 -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
3e4391e2af Fix another comment in comma.cal 2022-06-20 19:39:11 -07:00
Landon Curt Noll
cfc6a6669c Improve comments in comma.cal 2022-06-20 19:36:54 -07:00
Landon Curt Noll
fa457db3cd Fix more comments in cal/comma.cal 2022-06-20 19:30:45 -07:00
Landon Curt Noll
d08b958a15 Fix typo in comma.cal comment 2022-06-20 19:28:16 -07:00
Landon Curt Noll
5f28e5b851 Removed training newline from fprint_comma in comma.cal 2022-06-20 19:26:35 -07:00
Landon Curt Noll
8dc52a532a Fix comma.cal to avoid leading 0's and tilde's 2022-06-20 19:20:34 -07:00
Landon Curt Noll
6fc14730c0 Fix the forming of fraction part in comma.cal 2022-06-20 19:10:20 -07:00
Landon Curt Noll
b97093e58c Fix calc man page \-escape, add cal/comma.cal
Fixed a \-escape bug in calc(1) man page.

Added cal/comma.cal:

    Convert numbers into strings with 3-digit group and integer-fraction
    separators.

    If the value is an integer, the integer-fraction separator is not used.

    str_comma(x, [group, [decimal]])

	Convert x into a string.

	If group is given and is a string, group will be used as
	the 3-digit group separator, otherwise the default 3-digit
	group separator will be used.

	If decimal is given and is a string, group will be used as
	the integer-fraction separator, otherwise the default
	integer-fraction separator will be used.

	The decimal and group arguments are optional.

    set_default_group_separator(group)

	Change the default 3-digit group separator if group is a string,
	otherwise the default 3-digit group separator will not be
	changed.  Return the old 3-digit group separator.

    set_default_decimal_separator(decimal)

	Change the default 3-digit group separator if decimal is a
	string, otherwise the default integer-fraction separator
	will not be changed.  Return the old integer-fraction separator.

    print_comma(x, [group, [decimal]])

	Print the value produced by str_comma(x, [group, [decimal]])
	followed by a newline.

	If the str_comma() does not return a string, nothing is printed.

	The decimal and group arguments are optional.

	The value produced by str_comma() is returned.

    fprint_comma(fd, x, [group, [decimal]])

	Print the value produced by str_comma(x, [group, [decimal]]),
	without a trailing newline, on file fd.

	If the str_comma() does not return a string, nothing is printed.

	If fd is not an open file, nothing is printed.

	The decimal and group arguments are optional.

	The value produced by str_comma() is returned.
2022-06-20 18:25:12 -07:00
Landon Curt Noll
923c36e475 Remove excess whitespace under SECURITY.md 2022-04-08 00:24:42 -07: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.
prod-2.14.1.0 v2.14.1.0
2022-04-08 00:02:44 -07:00
Landon Curt Noll
56b6613da8 Fixed 0^y for y > 0
While 0^0 == 1, now for y > 0, 0^y == 0.

Adjusted cal/test8900.cal to reflect the this bug fix.

Added tests to cal/regress.cal to help verify bug fix is fixed.
2022-04-07 23:54:06 -07:00
Landon Curt Noll
e9eef2dfa2 Merge branch 'master' of github.com:lcn2/calc 2022-04-07 23:44:38 -07:00
Landon Curt Noll
0dbf258696 Fixed alignment of show item section of help command 2022-04-07 23:44:05 -07:00
Landon Curt Noll
f6d558783a Improved security issue template
create a calc GitHub repo issue for a security issue
2022-02-24 13:58:56 -08:00
Landon Curt Noll
6f27a32f79 Calc bug report template version: 1.2 2022-02-24
Added template version and made a minor edit
2022-02-24 12:42:32 -08:00
Landon Curt Noll
d58f605866 Update issue templates
Updated calc Bug report
2022-02-24 12:30:36 -08:00
Landon Curt Noll
b83c5be515 Update issue templates
Add default GitHub Bug and Feature templates
2022-02-15 13:35:46 -08:00
Landon Curt Noll
561928a45c Checkpint disbale use of gettime() under _WIN32 or _WIN64 2022-02-12 13:52:06 -08:00
Landon Curt Noll
7f89af37f5 Checkpoint more Windows 11 Cygwin MINGW64 changes 2022-02-12 13:41:16 -08:00
Landon Curt Noll
4470f1f62e Checkpoint - Windows 11 with Cygwin and MinGW64 packages. 2022-02-12 12:44:32 -08:00
Landon Curt Noll
8217c49b94 Fix lack of quotes in PASSDOWN variables 2022-02-12 11:37:53 -08:00
Landon Curt Noll
d2cb03b4cc Add ${MSYS} to Makefile for Windows 11 MINGW64_NT users 2022-02-12 11:18:49 -08:00
Landon Curt Noll
80f13a4e45 Changed Makefiles as per make depend 2022-01-22 02:52:02 -08:00
Landon Curt Noll
1658343227 Changes to use attributes for noreturn and printf-like functions 2022-01-22 02:48:50 -08:00
Landon Curt Noll
3f177f2d81 Improved source code flow
Changed /*NOTREACHED*/ to not_reached(); and use "attribute.h".

Added .PHONY rule, just after all rule, to Makefiles.

Fixed an improper indentation issue.
2022-01-22 01:16:07 -08:00
Landon Curt Noll
dcd5a987af Added better examples of asan debugging use with gcc and clang 2022-01-13 11:11:32 -08:00
Landon Curt Noll
cb77888045 Expand certain table sizes, add comments to Makefile.local
Expanded the globalsymbol string table size: from 1024 to 65536.

    Expanded the how often to reallocate string table is performed:
    from 100 to 1024.

    Expanded the number env_pool elements to allocate at a time:
    from 10 to 256.

    Improve comments on Makefile.local and add a few more examples
    of how it might be used.
2022-01-02 18:01:21 -08:00
Landon Curt Noll
ce17b267be Minor changes to Makefile, HOWTO.INSTALL, CONTRIBUTING.md
Changed Makefile to set shell before setting the SHELL Makefile
    variable.

    Added text to HOWTO.INSTALL to help people with systems that
    lack the readline package.

    Trimmed long line in the CONTRIBUTING.md file.
2021-12-29 15:16:40 -08:00
Landon Curt Noll
738dd0334e Create CONTRIBUTING.md
Create initial CONTRIBUTING.md file.
2021-12-27 20:01:26 -08:00
Landon Curt Noll
7ba1dbdc65 Create CODE_OF_CONDUCT.md
Initial release of CODE_OF_CONDUCT.md
2021-12-27 19:56:02 -08: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
prod-2.14.0.14 v2.14.0.14
2021-12-27 19:10:56 -08:00
Landon Curt Noll
d4970d66ce Merge branch 'master' of github.com:lcn2/calc 2021-12-27 19:04:53 -08:00
Landon Curt Noll
c3ea3d28a4 Added 2.14.0.14 CHANGES 2021-12-27 19:04:08 -08:00
Landon Curt Noll
3fa34dabfe Fixed typo in comment for Makefile.local 2021-12-13 22:12:03 -08:00
Landon Curt Noll
ffd4422870 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.

Removed constructed help file that incorrectly added as a src file.

=-=

The following are the changes in this release:

    Made major changes to our release process in order to avoid
    missing critical files that happened in calc v2.4.0.12.

    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, BUGS, HOWTO.INSTALL to reflect GitHub use.
v2.14.0.13
2021-12-13 17:41:35 -08:00
Landon Curt Noll
b5b2c3f812 Updated CHANGES to reflect recent commits 2021-12-13 17:00:01 -08:00
Landon Curt Noll
f7dadbf1f8 Improve how Makefiles are formed, updated related doc 2021-12-13 16:54:45 -08:00
Landon Curt Noll
22e123140c Fix to add missing Makefiles to distlist
The output of the distlist rule was used to form the source tarball.
2021-12-13 16:27:37 -08:00
Landon Curt Noll
1242700601 Fix how Makefile.simple and custom/Makefile.simple are formed 2021-12-13 16:11:38 -08:00
Landon Curt Noll
5b7dfeaf11 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.

Removed constructed help file that incorrectly added as a src file.

=-=

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:43:37 -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