aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/dc/bcode.c
Commit message (Collapse)AuthorAgeFilesLines
* usr.bin/bc: remove OpenBSD derived bc and dc commandsStefan Eßer2024-11-241-1773/+0
| | | | | | | | | | | | | | | | | | | | | | | | In 2020, an improved implementation of the bc and dc commands developed by Gavin D. Howard has been imported into FreeBSD. It has replaced the OpenBSD-derived versions of these commands in all currently supported FreeBSD releases. The OpenBSD versions could still be built using the WITHOUT_GH_BC option. There have been no reports of problems or unexpected deviations from the OpenBSD version for some time, therefore keeping the OpenBSD version is no longer required in FreeBSD. This commit removes the option to build the OpenBSD version and corresponding source files from -CURRENT. No MFC is planned, all currently released FreeBSD versions should retain the build option. The WITHOUT_GH_BC option is no longer accepted and will cause make buildworld to fail. Reviewed by: des, emaste Approved by: des Relnotes: yes Differential Revision: https://reviews.freebsd.org/D46876
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Unbreak usr.bin/dc with OpenSSL 3Enji Cooper2023-08-111-3/+3
| | | | | | | | | OpenSSL's BN_zero API has had a void return value since 1.1.x: chase the change to unbreak the build on OpenSSL 3.x with MK_GH_BC == no. MFC after: 2 weeks Reviewed by: emaste, kevans Differential Revision: https://reviews.freebsd.org/D41410
* Make dc(1) buildable.Jung-uk Kim2018-09-191-8/+8
| | | | Notes: svn path=/projects/openssl111/; revision=338784
* dc(1): fix modulo operations with fractional inputsAlan Somers2017-12-071-10/+29
| | | | | | | | | | | | | | Our dc(1) has never correctly calculated remainders with fractional inputs. Both bmod and bdivmod seem to have copy/pasted code from bdiv, which results in the remainder having the wrong output scale. PR: 162495 Reported by: anonymous Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D13390 Notes: svn path=/head/; revision=326652
* dc(1): fix input of non-decimal fractional numbersAlan Somers2017-12-051-25/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Inputting fractional non-decimal numbers has never worked correctly in our OpenBSD-derived dc(1). It truncates the input to a number of decimal places equal to the number of hexadecimal (or whatever base) places given on the input. That's unacceptable, because many numbers require more precision to represent in base 10 than in their original bases. Fix this bug by using as many decimal places as needed to represent the input, up to the maximum of the global scale factor. This has one mildly surprising side effect: the scale of a number entered in non-decimal mode will no longer necessarily equal the number of hexadecimal (or whatever base) places given on the input. I think that's an acceptable behavior change, given that inputting fractional non-decimal numbers never worked in the first place, and the man page doesn't specify whether trailing zeros on the input should affect a number's scale. PR: 206230 Reported by: nibbana@gmx.us Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D13336 Notes: svn path=/head/; revision=326556
* bc/dc/patch: make some use of reallocarray(3).Pedro F. Giffuni2017-03-051-2/+2
| | | | | | | | | | | reallocarray(3) is a non portable extension from OpenBSD. Given that it is already in FreeBSD, make easier future merges by adopting in some cases where the code has some shared heritage with OpenBSD. Obtained from: OpenBSD Notes: svn path=/head/; revision=314704
* dc(1): Introduce e command, equivalent to p, but writes to stderrPedro F. Giffuni2017-02-281-0/+14
| | | | | | | | Obtained from: OpenBSD MFC after: 2 weeks Notes: svn path=/head/; revision=314409
* dc(1): Merge minor changes from OpenBSD.Pedro F. Giffuni2017-02-261-27/+14
| | | | | | | | | | | | | | Prefer setvbuf() to setlinebuf() for portability. Some style(9) and redundant tests for NULL. These are only meant to ease up merging newer changes but we are skipping changes done in order to accomodate OpenBSD's pledge support. Obtained from: OpenBSD MFC after: 2 weeks Notes: svn path=/head/; revision=314321
* Sync with OpenBSD.Xin LI2014-04-161-10/+9
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=264573
* - Use BN_set_negative() and BN_is_negative() instead of subtracting orKevin Lo2012-12-301-35/+59
| | | | | | | | | | comparing to zero. - Fix fractional number exponentiation, especially for negative exponents. Obtained from: OpenBSD Notes: svn path=/head/; revision=244861
* - Fix an erroneous invocation of the editline.Kevin Lo2012-03-151-1/+1
| | | | | | | | | | | - Fix wrong scaling in the bc.library. - Let length(0.000) conform to what gnu bc does. PR: bin/159227 Submitted by: AIDA Shinra <shinra at j10n dot org> Notes: svn path=/head/; revision=232994
* - Axe out signal handling code, the shell will take care of thisGabor Kovesdan2010-06-101-10/+0
| | | | | | | | Suggested by: jilles Approved by: delphij (mentor) Notes: svn path=/head/; revision=208975
* - Fix signal handling in bc/dc. Now Ctrl-C terminates the execution.Gabor Kovesdan2010-06-061-17/+5
| | | | | | | | Requested by: gk (via private mail) Approved by: delphij (mentor) Notes: svn path=/head/; revision=208868
* - style(9)Gabor Kovesdan2010-02-031-116/+112
| | | | | | | Approved by: delphij (mentor) Notes: svn path=/head/; revision=203443
* - Remove dead variable assignmentsGabor Kovesdan2010-02-031-4/+2
| | | | | | | | | | - Fix -x Submitted by: uqs Approved by: delphij (mentor) Notes: svn path=/head/; revision=203438
* Replace GNU bc/dc with BSDL versions ported from OpenBSD. They have a goodGabor Kovesdan2010-01-201-0/+1781
compatibility level with the GNU counterparts and have shown to be mature enough. For now, the GNU versions aren't removed from the tree, just detached from the build. Sponsored by: Google Summer of Code 2008 Portbuild run by: erwin Approved by: delphij Notes: svn path=/head/; revision=202719