Gavin Howard
eb0cd870b9
Make bc work without -Wdeclaration-after-statement warnings
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
5 days ago
Gavin Howard
51ce0e0352
Fix a problem in the algorithms manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 week ago
Gavin Howard
ca53adf83b
Fix bugs and style in filter_text
...
With the bug fixes, the manuals are generated the same as they were
before.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 week ago
Gavin Howard
712d79c03e
Do not use uniq for blank lines in filter_text
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 week ago
Gavin Howard
319d597f9e
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 weeks ago
Gavin Howard
34e31ad80f
Fix a build problem in FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 weeks ago
Gavin Howard
82f85e9d90
Make editline more efficient with no prompt
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 weeks ago
Gavin Howard
36ebd30e2b
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 weeks ago
Gavin Howard
45df56dd2e
Make editline and readline respect BC_PROMPT
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 weeks ago
Gavin Howard
408f9090c1
Make EOF with the line libs more like the built-in history
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
4317afa2fa
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
bb4431262d
Fix a problem with the en_US locale file
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
c58e2be43f
Fix a build problem on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
37068c161d
Fix formatting
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
bd5f5fdb79
Make bc history use tabs
...
The reason I used 8 spaces is because of being able to tell where the
edge of the terminal was. It's not that important.
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
83878f1c2f
Make gen/strgen.c work with Windows again
...
This required some work because Windows is stupid with injecting
carriage returns in the text of files where it doesn't exist. I hate
Windows.
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
a698a33503
Adjust the Windows build for the strgen changes
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
d30762f5c0
Fix a problem in the builtin arg tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
74d8eb2891
Try yet again to fix all of the compiler warnings
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
49adcc7af5
Try again to fix the signals problem
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
4a07fb1580
Try to fix a problem with signals
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
25fe85591a
Fix another compiler warning
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
0ff0f67d60
Fix compiler warnings
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
78ba445e83
Add the new command-line options to the help texts
...
This required a lot because one option does not exist depending on the
build type, so I had to change gen/strgen.c and gen/strgen.sh to filter
out just like scripts/manpage.sh does.
In gen/strgen.sh, I just had it reuse the code in scripts/manpage.sh
(moved to scripts/functions.sh). In gen/strgen.c, I had to use custom
code.
But both work, and both get the job done. I have checked the help texts
for both calculators with every build type.
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
db540c29e3
Fix a typo in the bc manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
a6519f8593
Update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
4beb55fbd8
Update the manuals
...
These have the new features: command-line arguments for builtin
variables. They have also fixed a few problems.
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
44983b5d2a
Add an error test for command-line builtin variables
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
2db127113b
Add tests for the builtin var command-line arguments
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
488d48c87c
Implement command-line args to set the four builtin variables
...
This was requested a long time ago, and I rejected it. I see differently
now because the vast majority of my -e invocations are to set these.
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
4c34391266
Add some directives to the manpages for better style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
0d8bffdb64
Fix FreeBSD issues and typos in the manuals
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
ec41af4679
Simplify the history tests in configure.sh
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 weeks ago
Gavin Howard
c36b91b024
Attempt to fix build failures on the FreeBSD port
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 weeks ago
Gavin Howard
b5812f05c5
Add a note to the README about spam
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 weeks ago
Gavin Howard
7cb4597574
Remove an extra newline output
...
Maybe it's *not* necessary for line libs?
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
6b4ea3432d
Add editline and readline testing to the release script
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
95a9c99f13
Update the release checklist
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
f147e34c8e
Format all C code
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
4e5556e260
Add code formatting infrastructure
...
This is also "borrowed" from Yc.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
27441fc0c2
Fix style
...
This style fixing is to separate out local variables that are pointers
into separate lines, instead of being mashed together. This is an
artifact of the terrible style that was imposed on bc by toybox, but
since I don't maintain that code, I don't care anymore.
Also, I'm trying again to implement automatic code formatting.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
27b59e0aed
Fix lint warnings
...
All of them were just use of memcpy() and friends.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
495e2d7358
Add lint infrastructure
...
This is "borrowed" from my Yc project.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
fd2ea461e4
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
289da0e76a
Update documentation
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
4a10f9c786
Add the line library configure options to the build manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
debc6cd31a
Do not initialize history with a bad terminal
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
a1ef58d12f
Add comments
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
82eb41312e
Fix a typo in the manuals
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
467b54c78e
Add an explanatory comment
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
ecf128aaa0
Make sure there's no UB from changing const strings
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
dddc69be47
Get history working on Windows
...
It turns out that some console modes were automatically enabled that had
to be disabled.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
4eb4b699f6
Fix style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
99eb8bbbb3
Merge branch 'master' into line_libs
1 month ago
Gavin Howard
411e1a8b16
Fix the README folder list
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
75d300d74d
Merge branch 'master' into line_libs
1 month ago
Gavin Howard
1b77c55148
Fix the README file list
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
0549afca5c
Add a missing #include
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
8896082204
Rename two globals
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
0632f1d60d
Make sure ^C is printed without sigint reset for editline
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
6ff6592fd2
Make SIGINT work with editline as well
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
30f96cd088
Make readline handle SIGINT correctly
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
3efc3b9f42
Clean up a lot of the line lib code and consolidate
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
dda04344dd
Attempt to fix no newline on EOF
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
9d4a878f66
Fix the version output
...
This was caused by me forgetting that puts() automatically inserts
newlines. Sigh...stupid puts().
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
c74c2a56d4
Make history work under editline
...
It turns out that I *do* have to manually add to the history. Why? I
register the history function with editline, so why do I have to
explicitly call it?
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
7bbf1eec59
Make SIGWINCH work on FreeBSD
...
This requires testing for FreeBSD, like I do with OpenBSD. When on
FreeBSD, I have to *not* use _POSIX_C_SOURCE and _XOPEN_SOURCE.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
7701612501
Switch static_assert to _Static_assert
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
88e2894e25
Attempt to make bc build in FreeBSD base
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
7112520efe
Make sure to error if the new configure arguments are wrong
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
73a1a62f59
Merge branch 'master' into line_libs
1 month ago
Gavin Howard
54a7ca1a8d
Fix a compile error that I did not catch
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
f8b5ab0dfd
Make the build work on FreeBSD
...
FreeBSD is a pain about defining things. Apparently, it only defines
SIGWINCH if it is not building in a C99 environment, a C11 environment,
or a C89 environment. Seriously?
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
38e85d7ea3
Implement support for editline and readline
...
This was requested by an important FreeBSD user. This was an exploration
of the idea to just use editline and readline. I wasn't sure it was
possible. Turns out, it is.
What is not working: history in editline does not seem to work.
Everything else seems to work. Tests still pass as well.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
e1bd08f895
Fix style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
04ef32e888
Fix a bug
...
This bug was that bc did not properly check the return value of a
function.
Signed-off-by: Gavin Howard <gavin@yzena.com>
1 month ago
Gavin Howard
c96de7c0f6
Add gzip to the package script
...
This was requested by a user.
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 months ago
Gavin Howard
d24ea601aa
Tweak the release notes
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 months ago
Gavin Howard
7fa5dce636
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 months ago
Gavin Howard
cef94931a4
Change the history EOF test for the recent change two commits ago
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 months ago
Gavin Howard
5e0a30e2a9
Fix style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
2 months ago
Warner Losh
f8fa6febf7
Emacs delete-next-character
...
The historic gnu bc behavior was to have ^D be delete next character if
there were any characters in the input, or end of file if there
weren't. This matches what emacs users expect for editing the command
line. Implement this by assuming end of file if the input is empty, and
delete forward character if it isn't.
Signed-off-by: Warner Losh <imp@bsdimp.com>
2 months ago
Gavin Howard
cad172d8f0
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Piotr P. Stefaniak
cb7bde2181
Make Home and End keys work in tmux in history
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Gavin Howard
8ec0c24751
Add a comment warning of the bug that was found
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Gavin Howard
24be19250c
Quiet a useless clang warning
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Piotr P. Stefaniak
e0fb717308
Fix a bug in history refresh
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Gavin Howard
3d6c2e4645
Update copyright for the bc banner
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Gavin Howard
b5c7f6942b
Add a comment
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Gavin Howard
5ba4e300a7
Make sure to not run a generated test if not able to generate
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
3 months ago
Gavin Howard
fd1e659aa6
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
621adbd71d
Workaround a clang bug
...
Clang seems to think that BC_C11 is not defined, but if you look in the
include/status.h header, you'll see that it is definitely defined. So,
we need to work around the Clang bug.
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
6d26f2ac3e
Fix another gcc warning
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
ca6dd9ecf6
Fix style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
de4fa1bd4a
Fix a compile warning from GCC
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
5fc73c7443
Add more tests for multiline comments and strings in expression files
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
dbc4dc4c4e
Fix a problem found with the fix in last commit
...
The problem was that if a backslash was at the end of the line, it
correctly asked for more, but if it didn't get any, it happily just
quit. No bueno.
So if it requests more and doesn't get it, we should attempt to process
it. This will flush out any errors.
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
d778d0b917
Fix the bug mentioned in the last commit
...
This bug was a little bit of an easy one to find and a doozy to fix. The
reason for that is because reading expressions from the command-line is
kind of its own special case, so I had to do a little bit of a redesign.
The redesign wasn't that big, however; I reused the same technique I
used for fixing a similar problem with stdin. I also reused the same
global buffer in BcVm because stdin won't ever use it at the same time.
I even used kind of the same code.
But the idea is the same: have a function the lexer can call when
there is an unfinished comment or string. In fact, I need to add a test
for both of those cases, as well as a test for a multiline string.
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
824859ba47
Add a test for a bug found by a user
...
This test is for multiline comments in bc expression files.
Signed-off-by: Gavin Howard <gavin@yzena.com>
4 months ago
Gavin Howard
85dbc9578e
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
5 months ago
Gavin Howard
81905ee8e2
Fix the argv[0] == NULL bug
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
5 months ago
Gavin Howard
52f7667c88
Fix style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
5 months ago
Gavin Howard
3962313c8b
Fix a wrong doc comment
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
5 months ago
Gavin Howard
329a29def7
Add a static_assert for instructions
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
6 months ago
Gavin Howard
d5b5a5c400
Fix typos
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
6 months ago
Gavin Howard
84ed5cc276
Tweak something in the development manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
6 months ago
Gavin Howard
eca74533b6
Fix style
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
6 months ago
Firas Khalil Khana
232a12f687
Add missing newline character
6 months ago
Gavin Howard
c3b2d28b2d
Fix still another typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
db200ed396
Fix yet another typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
cec89461df
Fix another typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
8f0e794f49
Fix a typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
daf643af7e
Make sure to guard locale-specific stuff
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
23799b7747
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
9ffdd5ec69
Fix the second parse bug found by oguz-ismail
...
This one was that bc allowed function definitions after semicolons when
the POSIX grammar technically does not allow it.
Also, this adds missing a missing error message. I found it because I
needed to add yet anothe error message for this bug.
Also, this commit adds the test too.
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
81f838f657
Add a test for the fix in the previous commit
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
5b2fe303c8
Fix one of two parse bugs found by oguz-ismail
...
This is the one where bc errored if a function definition directly
followed another, which is supposed to be allowed. This fixes that.
Signed-off-by: Gavin Howard <gavin@yzena.com>
7 months ago
Gavin Howard
b20fe46e1c
Update the configure help
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
ddd6bb9daf
Revert "Attempt to make dc.exe a link on Windows"
...
This reverts commit 29055cfd83
.
This did not work, unfortunately, and I don't want to spend time on it.
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
a2cbd36b53
Try again to make release.sh use out-of-source builds
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
a945358c87
Make release script do parallel history test
...
I can do that now that the too-flaky test is removed.
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
0c84e0bf15
Remove a part of a history test that is too flaky
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
8e1928493c
Make the release script not test history in parallel
...
It keeps failing at that point, and not for single-core, so just do
single-core for now.
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
e12eafcf7a
Tweak a doc comment
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
e38c88a415
Make the release script able to do out-of-source builds
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
8b7e59f29e
Update README files
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
29055cfd83
Attempt to make dc.exe a link on Windows
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
9e688779a0
Add documentation for out-of-source builds to README and manuals
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
c8d0d016fb
Change something back
...
I cannot support spaces in path names for out-of-source builds. I will
have to put that into the documentation.
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
6bd6c61f52
Fix some problems with out-of-source builds
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
56a8da67d1
Implement out-of-source builds
...
This took a lot of work, but it would have taken far more if I hadn't
followed good practices from the start.
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
fb2428ca63
Add a gitignore for testing out-of-source builds
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
2427756509
Fix a problem with make clean
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
dc3a588cf9
Update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
c891c10097
Implement a pkg-config file for bcl
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
d92530bad8
Fix the install and uninstall targets for bcl
...
Turns out, they were never hooked up. It seems no one uses bcl because
no one complained. But they will be fixed in the next release.
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
f463085c46
Update the README for the Windows build
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
8 months ago
Gavin Howard
5d9b40c2f6
Add a blurb about global data and signals to the dev manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
4277d5ad1a
Fix a bug in the unlock for the library
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
7ad047d503
Fix interaction between signals and globals
...
I was thinking about setjmp() and longjmp(), and I realized that they
are still dangerous in the presence of global variables. bc has a big
one: BcVm vm.
This commit basically locks signals wherever something directly inside
of BcVm is changed. (Things pointed to do not need to be locked or
already are.) This makes mutating BcVm safe even in the presence of
signals.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
de699c3c22
Fight against flakiness of history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
c4e3e23057
Add BC_EXPR_EXIT back with setting default
...
Since it is possible to set defaults now, why *not* add it back? *I*
want it!
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
80f165451f
Increment the version and update the NEWS
...
I'm not going to release yet; I just want this feature in the next
release whenever it happens.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
9305c6b1af
Update the build manual for the Windows build
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
cf8d717f1b
Update the dev manual for changes to Windows files
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
d0bb26417b
Improve the package.sh script
...
This removes more stuff.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
941147ca1e
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
b240e01963
Add another option to the release script
...
This is to enable/disable karatsuba testing.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
7d5ea1a704
Update the dev manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
d6ff8e3cc1
Add more to the second ifs script test
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
f60ce30fd5
Fix a bug I partially fixed in 5.1.0
...
The bug was the improper ending of if statements in files and before
function definitions. In 5.1.0, I fixed it such that an if statement
right before a function definition works, but not a series of if
statements or if statements inbetween loops.
This does the full fix.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
16cd0feb66
Add more tests for ending if statements
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
06310809dd
Add more to bc stdin tests
...
These additions check for proper checking of ending of if statements.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
bfb15a832f
Relabel a couple tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
2b8d00952f
Update the release checklist
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
aac37fabeb
Update scripts/package.sh for the new Windows stuff
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
e9b9224694
Combine the gitignore files
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
63aa78402c
Increment the version and update the NEWS
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
f38e0e9932
Fix a problem in the bcl manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
343a484995
Fix memory leaks in the bcl test
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
7d549d4bba
Add the new bcl leading zeros to its manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
4dd84d12b4
Add leading zeroes to bcl
...
I did this because there were compile errors with the library using
BC_Z, and I thought to myself that it would be a good feature to add and
would take little code.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
98e2e1dce1
Make leadingzero test only used with extra math
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
50113029c6
Reactivate debug builds in scripts/release.sh
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
5179476cd8
Fix a build error on dc only
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
317169bfdb
Fix benchmarks
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
d44c1fc833
Make ministat work with musl
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
6ee5e9c09d
Update the dev manual for error test changes
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
34e590e2a1
Make error.sh executable
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
b7208a8c41
Update the build manual for the Windows build config
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
depler
74d55ddfc7
tests_bc.bat fix
9 months ago
Gavin Howard
289ad4a089
Parallelize error tests and unparallelize all tests
...
Rather, I unparallelize tests/all.sh if -n is passed and add targets for
it in the Makefile template.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
245917b41d
Add the leading zero test to the Windows tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
b120cd3dd6
Update documentation for the new features
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
8153027201
Add a new bc test to the dev manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
dc59475140
Fix an error message from dc
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
be81c86e31
Change the command-line option for disabling line length checking
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
601179321d
Add tests for the new features
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
dae8e5efa0
Add the plz*() and pnlz*() functions to gen/lib2.bc
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
1363732b61
Fix a bug found by the test in the previous commit
...
It turns that I was not properly ending if statements for the beginning
of functions. If I had an if statement that did not have an else right
before defining a function, bc thought that it was invalid. So I added a
specific check.
Thank goodness I now have a test for it.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
4a0a8ddc66
Add a test to check for global stacks in the globals test script
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
1ead5b9652
Add a way to query global settings in scripts
...
The global settings right now are line length, global stacks enabled or
not, and leading zero enabled or not.
Both dc and bc have these. In bc, they are no-arg builtin functions. In
dc, they are grouped under one command: g.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
12fb20e870
Fix a typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
10d37cca38
Add a table of dc commands to the dev manual
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
a5e62d4e95
Add a command-line option for printing leading zeros
...
This was also requested by depler on GitHub. It took a bit of
refactoring, but it actually wasn't bad.
Later, I will add functions to the extended math library to either print
the leading zero for certain numbers, or not. To do that, I am going to
add builtin functions to query the global state. It makes sense to do so
since I already have other builtin functions for global state.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
7ae40616ec
Add a command-line option to remove char limits on lines
...
This was requested by depler on GitHub. It turns out that it was pretty
easy to implement.
In this case, 0 in vm.line_len means no limit.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
2974454047
Make history test documentation clearer
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
191f409260
Force Windows to use binary mode for files
...
It turns out that if I do not, it silently replaces CRLF with LF and
tells bc that it read less bytes than it did. [1] Wat?!
So, I have to force it to use binary mode instead of text mode so that
it will report the true numbers to me. Sigh...I hate Windows.
[1]: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/read
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
c0a0ebd054
Make reading a file not fail if it does not read everything
...
This makes it more robust because instead, we loop until everything is
read. If an error occurs, we do bail still.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
c441892b61
Update the dev manual with changes to the history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
c754da0a1f
Move the history test scripts back
...
I changed my mind.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
7520bc4662
Fix a bug in the release script with history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
3d192692a3
Fix a bug in the Makefile template with history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
a41d2d5dad
Move the history test scripts
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
a009de9e12
Add history tests to the release script
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
97200a8265
Remove history tests from tests/all.sh
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
761f018460
Remove the history tests from the test suite
...
I am going to change them to run under the release script only.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
0e25d47134
Remove some sleeps from history
...
Since I decided to not support users running history tests, I am going
to cut these down.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
88c38d6d54
Attempt again to fix history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
dec91505ae
Attempt to fix expect in history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
c5bfde5a57
Print the traceback for history timeouts
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
6609fa8680
Make sure banner is on for history tests
...
This was stupid of me. I had `-q` in the args, and was still requiring a
banner. It only worked because `-q` did not work. Now, it does, so I had
to fix the bug.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
70d233f2bb
Reduce the amount of busywork in history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
57a6b69e29
Fix a bug in history.py
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
f85dd7ad3f
Make the Windows test batch files work for me
...
I needed quotes and the -x argument to dc.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
ba792e05c9
Remove history from Windows
...
It just does not work.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
78635d612b
Stop a Windows error
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
5bc06dd271
Make -q work again
...
This was found by depler.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
844cd4609a
Make some changes to history to try to make it work on Windows
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
fe8e217627
Fix a typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
depler
d3793fa5a1
windows tests
9 months ago
depler
10308b01fc
fix
9 months ago
depler
4df58cf232
cleanup
9 months ago
depler
06dcc55074
ReleaseMD, ReleaseMT
9 months ago
depler
7ba018d340
bcl project
9 months ago
depler
3bdd97c520
new bc.vcxproj, static linkage, release configuration
9 months ago
Gavin Howard
da29d88f70
Fix a typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
f356a140ee
Increase and remove timeouts on history tests
...
Under load, FreeBSD cannot run them fast enough in their CI.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
a54167ff45
Shorten the timeout for history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
db5fc4fdf8
Parallelize tests/all.sh
...
This is for FreeBSD, which runs the tests as part of their test suite.
With the history tests, the test suite takes 100-120 seconds to run.
With this change, it gets it under 30 seconds.
The parallelism is...crude. What it does is spawn as many tests into the
background as posssible and then waits on them all, exiting with an
error if any of them failed. There is no special sauce with the GNU
parallel command because that's not portable, and I probably can't get a
guarantee that it will even exist on FreeBSD systems running the test.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
c0d379594d
Skip a history test that does not work on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
2b8d00a1df
Let SIGKILL be okay for history tests
...
For some reason, pexpect is not letting bc quit properly, so I have to
SIGKILL. At this point, I have to allow it.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
94b8747d78
Force kill children on FreeBSD in history tests
...
This is yet another attempt.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
9081d6cba5
Use EOF to make a child quit in history tests
...
This is another attempt to make it work on FreeBSD.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
519368b609
Attempt again to fix history tests on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
7001721959
Attempt to fix history tests on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
a4778d16a1
Make sure banner is not used in shared history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
0dcbde8a83
Reset history.py after all the attempts
...
I have to go about it in a different way.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
b52d178c30
Try again to fix test 9 on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
50cfeedc04
Fix test 9 on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
d2a46e86f4
Try again to fix test 8 on FreeBSD
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
ddd7ad631e
Adjust the timeout limit for bc history test 8
...
It runs *just* longer than 30 seconds on FreeBSD. Sigh...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
9c1bb9db5c
Attempt to fix a history test bug in FreeBSD
...
It is hanging after sending a carriage return.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
25c51cdfe8
Add a function to read all child data to history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
77650a1ab3
Fix a typo
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
66a4f29ba3
Make sure banner is not used in certain history tests
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
4eb2049bf4
Attempt to fix a bug with history tests on FreeBSD
...
They require all bytes to be read before the child will quit, so this
changes it to read it all.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
fc78729bdd
Make history tests take an executable
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
2275af6903
Add a timeout to history tests
...
I did this because there is no timeout on pexpect wait(), which causes
it to run forever if something goes wrong at that point.
Signed-off-by: Gavin Howard <gavin@yzena.com>
9 months ago
Gavin Howard
1cb6c8a7c1
Make ASAN more picky for the release script
...
Signed-off-by: Gavin Howard <gavin@yzena.com>
10 months ago