Compare commits

..

21 Commits

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

     Thanks to GitHub user @ashamedbit, a long standing memory leak in
     zrandom.c has been fixed.
2024-02-09 08:28:56 -08:00
Landon Curt Noll
ae85846839 improve useful strings produced by update_ver 2024-02-09 08:27:02 -08:00
Landon Curt Noll
e096bd9ad8 credit @ashamedbit a memory leak fix in zrandom.c 2024-02-09 08:02:50 -08:00
Landon Curt Noll
884b1bc81b Merge pull request #142 from ashamedbit/fix-memory-leak
Fix memory leak in zrandom.c
2024-02-09 07:53:47 -08:00
ashamedbit
a30a518ba7 Fix memory leak in zrandom.c 2024-02-09 03:48:11 -05:00
635 changed files with 90719 additions and 90612 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

26
CHANGES
View File

@@ -1,3 +1,29 @@
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
#148 - https://github.com/lcn2/calc/issues/148) they identified
was fixed.
The following are the changes from calc version 2.15.0.5 to 2.15.0.6:
Thanks to GitHub user @ashamedbit, a long standing memory leak in
zrandom.c has been fixed.
The following are the changes from calc version 2.15.0.4 to 2.15.0.5:
make clobber now removes the legacy files: have_fpos.h, help/man,

View File

@@ -1243,11 +1243,11 @@ EXT=
# The calc version in the form of x.y.z.w
#
VERSION= 2.15.0.5
VERSION= 2.15.1.0
# 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

@@ -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

@@ -1512,7 +1512,7 @@ the following GitHub repo:
https://github.com/lcn2/calc
.in -0.5i
.sp
The very latest calc souece is found at the top master branch.
The very latest calc source is found at the top master branch.
.PP

View File

@@ -13,7 +13,7 @@ following topics:
config configuration parameters
custom information about the custom builtin interface
define how to define functions
environment how environment variables effect calc
environment how environment variables affect calc
errorcodes calc generated error codes
expression expression sequences
file using files

View File

@@ -1953,7 +1953,7 @@ qispowerof2(NUMBER *q, NUMBER **qlog2)
* Set *qlog2 to base 2 logarithm of q, which will be a negative value,
* and return true.
*/
*qlog2 = utoq(log2);
**qlog2 = *utoq(log2);
(*qlog2)->num.sign = !(*qlog2)->num.sign; /* set *qlog2 to -log2 */
return true;
}

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

@@ -169,6 +169,7 @@ for i in $MK_SET1; do
echo "$i: $VER_STRING"
fi
done
echo
if [[ -n $VER_ERR ]]; then
echo "$0: FATAL: error in finding calc major version string"
echo "$0: FATAL: exit 10"
@@ -177,15 +178,36 @@ fi
# print other useful calc strings
#
export VER_CALC_OUTPUT=$(./ver_calc)
echo 'Begin text strings used to produce this release:'
echo 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv'
echo
echo "calc $(./ver_calc) release"
echo
echo 'calc-*'$(./ver_calc)'*'
echo
echo "Release v$(./ver_calc)"
echo "$VER_CALC_OUTPUT"
echo
echo "v$VER_CALC_OUTPUT"
echo
echo "Release v$VER_CALC_OUTPUT"
echo
echo "calc $VER_CALC_OUTPUT release"
echo
echo 'For use with sourceforge.net:'
echo
echo 'cd /home/pfs/project/calc/calc'
echo "mkdir $VER_CALC_OUTPUT"
echo "cd $VER_CALC_OUTPUT"
echo 'mput calc-*'"$VER_CALC_OUTPUT"'*'
echo 'put /home/chongo/tmp/README.txt'
echo 'ls'
echo
echo
echo
echo '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
echo 'End text strings used to produce this release:'
echo
# All Done!!! -- Jessica Noll, Age 2
#
echo
echo "VERSION in Makefile.config is up to date"
exit 0

View File

@@ -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 5 /* level 4: minor software version level */
#define MAJOR_PATCH 1 /* level 3: major software version level */
#define MINOR_PATCH 0 /* level 4: minor software version level */
#endif /* !INCLUDE_VERSION_H*/

View File

@@ -2679,6 +2679,9 @@ zsetrandom(CONST RANDOM *state)
*/
if (state != NULL) {
p_blum = randomcopy(state);
if (blum_initialized == true) {
randomfree(&blum);
}
blum = *p_blum;
free(p_blum);
}