Compare commits

..

14 Commits

Author SHA1 Message Date
Landon Curt Noll
4017579aeb prep CHANGES for the next release of calc 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.
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
636 changed files with 90720 additions and 90620 deletions

View File

@@ -13,10 +13,10 @@ name: "CodeQL"
on:
push:
branches: [ master ]
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ "master" ]
schedule:
- cron: '41 1 * * 6'
@@ -33,39 +33,48 @@ jobs:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# make bootstrap
# make release
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

12
.gitignore vendored
View File

@@ -4,8 +4,8 @@
#
*~
*.BAK
.DS_Store
core*
.DS_Store
*.dSYM/
*.exe
*.[oa]
@@ -21,8 +21,6 @@ core*
#
# We sort the list below via: sort -d -u
#
Makefile.our
NOTES
align32
align32.h
align32_tmp
@@ -42,13 +40,13 @@ chk_c
conf.h
const_tmp
cscript/4dsphere
cscript/README
cscript/.all
cscript/fproduct
cscript/mersenne
cscript/piforever
cscript/plus
cscript/powerterm
cscript/README
cscript/simple
cscript/square
custom/.all
@@ -128,8 +126,6 @@ have_urandom.h
have_ustat
have_ustat.h
have_varvs
help/COPYING
help/COPYING-LGPL
help/.all
help/binding
help/bindings
@@ -140,6 +136,8 @@ help/change
help/changes
help/contrib
help/copy
help/COPYING
help/COPYING-LGPL
help/cscript
help/custom_cal
help/errorcode
@@ -163,8 +161,10 @@ libcustcalc.*
ll_tmp
longbits
longbits.h
Makefile.our
memmv_tmp
newstr_tmp
NOTES
offscl_tmp
outfile
posscl_tmp

21
CHANGES
View File

@@ -1,3 +1,24 @@
The following are the changes from calc version 2.15.1.1 to 2.15.1.1:
Change Makefile.config to, if not using not HomeBrew, then try to
detect macports and/or using /opt/local/{lib,include}.
Put full date range (1989-2025) of calc source into version.h.
The following are the changes from calc version 2.15.0.7 to 2.15.1.0:
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.
The following are the changes from calc version 2.15.0.6 to 2.15.0.7:
Thanks to GitHub user @bambooleafz a critical bug (GitHub issue

View File

@@ -1112,6 +1112,9 @@ READLINE_EXTRAS= -lhistory -lncurses
#READLINE_LIB= -L${PREFIX}/lib -lreadline
#READLINE_EXTRAS= -lhistory -lncurses
#
#READLINE_LIB= -L/opt/local/lib -lreadline
#READLINE_EXTRAS= -lhistory -lncurses
#
# For Apple OS X: install fink from http://fink.sourceforge.net
# and then do a 'fink install readline' and then use:
#
@@ -1130,6 +1133,7 @@ READLINE_EXTRAS= -lhistory -lncurses
READLINE_INCLUDE=
#READLINE_INCLUDE= -I/usr/gnu/include
#READLINE_INCLUDE= -I${PREFIX}/include
#READLINE_INCLUDE= -I/opt/local/include
# Handle the case where macOS is being used with HomeBrew
# # and using the readline, history, and ncurses libraries.
@@ -1137,6 +1141,16 @@ READLINE_INCLUDE=
ifneq ($(HOMEBREW_PREFIX),)
READLINE_LIB:= -L${HOMEBREW_PREFIX}/opt/readline/lib -lreadline
READLINE_INCLUDE:= -I${HOMEBREW_PREFIX}/opt/readline/include
# If not HomeBrew, then try to detect macports and/or using /opt/local/{lib,include}
#
else # perhaps macports and/or using /opt/local/{lib,include} ?
ifneq ($(wildcard /opt/local/lib/*),)
READLINE_LIB:= -L/opt/local/lib -lreadline
endif
ifneq ($(wildcard /opt/local/incliude/*),)
READLINE_INCLUDE:= -I/opt/local/include
endif
endif # ($(HOMEBREW_PREFIX),)
# If $PAGER is not set, use this program to display a help file
@@ -1243,11 +1257,11 @@ EXT=
# The calc version in the form of x.y.z.w
#
VERSION= 2.15.0.7
VERSION= 2.15.1.1
# The calc major version in the form of x.y.z
#
VER= 2.15.0
VER= 2.15.1
# Names of shared libraries with versions
#

View File

@@ -283,3 +283,8 @@ help unexpected
It contains information about differences between C and calc
that may surprise C programmers.
# Reporting Security Issues
To report a security issue, please visit "[Reporting Security Issues](https://github.com/lcn2/calc/security/policy)".

View File

@@ -1,4 +1,16 @@
# Security Policy
# Reporting Security Issues
We take security bugs seriously. We appreciate your efforts to responsibly
disclose your findings, and will make every effort to acknowledge your
contributions for any verified security issues when they have been fixed.
To report a security issue, click on: "[Open a draft security advisory](https://github.com/lcn2/calc/security/advisories/new)"
We will send a response indicating the next steps in handling your
report. After the initial reply to your report, we will keep you informed
of the progress towards a fix and full announcement, and may ask for
additional information or guidance.
## Supported Versions
@@ -9,11 +21,3 @@ If the most recent stable of calc is also supported with security updates.
FYI: please review the BUGS file, or enter the calc command:
; help BUGS
## Reporting a Vulnerability
Please create a calc GitHub repo issue:
https://github.com/lcn2/calc/issues
Click on ((New issue)) and follow the issue template.

View File

@@ -3030,6 +3030,24 @@ define test_2600()
strcat(str(tnum++),
': round(log(1.2+1.2i,1e-10),10) == ',
'0.2296962439+0.3410940885i'));
vrfy(log2(0.5) == -1,
strcat(str(tnum++), ': log2(0.5) == -1'));
vrfy(log2(0.5) == -1,
strcat(str(tnum++), ': log2(0.5) == -1'));
vrfy(log2(0.5) == log2(0.5),
strcat(str(tnum++), ': log2(0.5) == log2(0.5)'));
vrfy(0^0 == 1,
strcat(str(tnum++), ': 0^0 == 1'));
vrfy(1^0 == 1,
strcat(str(tnum++), ': 1^0 == 1'));
vrfy(1^1 == 1,
strcat(str(tnum++), ': 1^1 == 1'));
vrfy(2^0 == 1,
strcat(str(tnum++), ': 2^0 == 1'));
vrfy(log2(1) == 0,
strcat(str(tnum++), ': log2(1) == 0'));
vrfy(log2(1.0) == 0,
strcat(str(tnum++), ': log2(1.0) == 0'));
vrfy(log2(2) == 1,
strcat(str(tnum++), ': log2(2) == 1'));
vrfy(log2(4) == 2,

View File

@@ -182,8 +182,8 @@ PICKY_PHASE_1=$(
-name '.git' -o -path './custom/libcustcalc*' -o -path './libcustcalc*' -o \
-name 'sample_many-static' -o -name 'sample_rand-static' -o \
-name 'codeql-analysis.yml' -o -name tags -o -name '*.out' -o \
-name '?' -o -iname '*foo*' -o -iname '*bar*' -o -iname '*baz*' -o \
-iname '*curds*' -o -iname '*whey*' -o -iname '*rmme*' \
-iname '*foo*' -o -iname '*bar*' -o -iname '*baz*' -o \
-name '.lldbinit' -o -iname '*curds*' -o -iname '*whey*' -o -iname '*rmme*' \
\) -prune -o -type f -print0 | \
if [[ -x /usr/local/bin/picky ]]; then
xargs -0 /usr/local/bin/picky -s -v -w132
@@ -218,6 +218,35 @@ if [[ -n $BACKUP_MAKEILES ]]; then
EXIT_CODE=7
fi
# look for ASCII tabs in non-Makefiles
#
TABS_FOUND=$(
find . \( -path './NOTES' -o -path './calc' -o -path './ver_calc' -o \
-name '*.o' -o -name '*.a' -o -name '*ptch*' -o -name 'core*' -o \
-name '*.orig' -o -name '*.rej' -o -name '*.bak' -o \
-name '*.ptch' -o -name 'core.*' -o \
-name '*.so*' -o -name 'calc-static' -o -name 'libcalc.*' -o \
-name 'sample_many' -o -name 'sample_rand' -o -name 'errcode' -o \
-path './help/funclist' -o -path './have_stdvs' -o \
-path './endian' -o -path './no_implicit' -o -name 'chk_c' -o \
-path './longbits' -o -name '.*.swp' -o -name 'conf.h' -o \
-name '.git' -o -path './custom/libcustcalc*' -o -path './libcustcalc*' -o \
-name 'sample_many-static' -o -name 'sample_rand-static' -o \
-name 'codeql-analysis.yml' -o -name tags -o -name '*.out' -o \
-iname '*foo*' -o -iname '*bar*' -o -iname '*baz*' -o \
-name '.lldbinit' -o -iname '*curds*' -o -iname '*whey*' -o -iname '*rmme*' -o \
-iname 'Makefile*' -o -name rpm.mk -o -name 'trailblank' \
\) -prune -o -type f -print0 | \
xargs -0 grep -l -E ' '
)
if [[ -n $TABS_FOUND ]]; then
echo
echo '# ASCII TABs found in non-Makefiles:'
echo "$TABS_FOUND"
EXIT_CODE=8
fi
# All Done!!! -- Jessica Noll, Age 2
#
exit "$EXIT_CODE"

View File

@@ -1,7 +1,7 @@
/*
* version - determine the version of calc
*
* Copyright (C) 2023 David I. Bell and Landon Curt Noll
* Copyright (C) 1989-2025 David I. Bell and Landon Curt Noll
*
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
@@ -63,8 +63,8 @@
*/
#define MAJOR_VER 2 /* level 1: major library version */
#define MINOR_VER 15 /* level 2: minor library version */
#define MAJOR_PATCH 0 /* level 3: major software version level */
#define MINOR_PATCH 7 /* level 4: minor software version level */
#define MAJOR_PATCH 1 /* level 3: major software version level */
#define MINOR_PATCH 1 /* level 4: minor software version level */
#endif /* !INCLUDE_VERSION_H*/