aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/unifdef
Commit message (Collapse)AuthorAgeFilesLines
* Re-apply fixed r354847Conrad Meyer2019-11-201-56/+86
| | | | | | | | | | | | | | | | | unifdef(1): Improve worst-case bound on symbol resolution Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N) and O(N^2). While here, remove arbitrarily limit on number of macros understood. Reverts r354877 and r354878, which disabled the (correct) test. PR: 242095 Reported by: lwhsu Notes: svn path=/head/; revision=354912
* Revert r354847 for nowConrad Meyer2019-11-201-73/+56
| | | | | | | | | | It was broken. PR: 242095 Reported by: lwhsu Notes: svn path=/head/; revision=354911
* unifdef(1): Improve worst-case bound on symbol resolutionConrad Meyer2019-11-191-56/+73
| | | | | | | | | | | | Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N) and O(N^2). Because N is typically small and the former linear array also has great constant factors (as a property of CPU caching), this doesn't provide material benefit most or all of the time. While here, remove arbitrarily limit on number of macros understood. Notes: svn path=/head/; revision=354847
* unifdef(1): Kill totally useless headerConrad Meyer2019-11-192-58/+28
| | | | | | | No functional change. Notes: svn path=/head/; revision=354843
* Link in NetBSD's unifdef(1) testsConrad Meyer2019-11-182-0/+17
| | | | | | | Skip one, is it currently fails. Notes: svn path=/head/; revision=354801
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-2/+8
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Update URLs in usr.binEitan Adler2017-10-292-2/+2
| | | | | | | | | - http -> https - contents have moved locations - removal of URL if I could not find new location Notes: svn path=/head/; revision=325095
* Avoid -Wmissing-initializerTony Finch2015-12-031-14/+14
| | | | Notes: svn path=/head/; revision=291697
* Update to upstream version 2.11Tony Finch2015-12-033-31/+149
| | | | | | | | | | Improved #if expression evaluator and safer modify-in-place. Obtained from: http://dotat.at/prog/unifdef MFC after: 1 week Notes: svn path=/head/; revision=291696
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-274-241/+486
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge head from 7/28Simon J. Gerraty2014-08-191-2/+3
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | sync from headSimon J. Gerraty2013-04-124-218/+417
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Update to upstream version 2.10Hans Petter Selasky2015-02-254-241/+486
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | The most notable new feature is support for definition files. Obtained from: http://dotat.at/prog/unifdef MFC after: 1 week Notes: svn path=/head/; revision=279297
* | | use .Mt to mark up email addresses consistently (part3)Baptiste Daroussin2014-06-231-2/+3
| |/ |/| | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de> Notes: svn path=/head/; revision=267773
* | Update to upstream version 2.7Tony Finch2013-03-284-216/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The most notable new feature is support for processing multiple files in one invocation. There is also support for more make-friendly exit statuses. The most notable bug fix is #line directives now include the input file name. Obtained from: http://dotat.at/prog/unifdef Notes: svn path=/head/; revision=248849
* | No need to call an external program.David E. O'Brien2013-03-131-2/+1
|/ | | | Notes: svn path=/head/; revision=248258
* Remove superfluous paragraph macro.Joel Dahl2012-03-251-1/+0
| | | | Notes: svn path=/head/; revision=233456
* Mark global functions and/or variables in unifdef(1) static where possible.Ed Schouten2011-11-061-1/+1
| | | | | | | This allows compilers and static analyzers to more thorough analysis. Notes: svn path=/head/; revision=227243
* Update to upstrea version 2.5.6.Tony Finch2011-01-211-16/+25
| | | | | | | | | | Detect IO errors properly. Write #line directives to the correct output stream. Obtained from: http://dotat.at/prog/unifdef Notes: svn path=/head/; revision=217698
* Update to upstream version 2.3Tony Finch2011-01-181-15/+10
| | | | | | | | | | Only significant change is to fix a bu when the output file overwrites the input when the input is redirected. Obtained from: http://dotat.at/prog/unifdef Notes: svn path=/head/; revision=217550
* Fix typos.Joel Dahl2010-08-011-1/+1
| | | | Notes: svn path=/head/; revision=210720
* Update to upstream version 2.3Tony Finch2010-03-123-41/+91
| | | | | | | | | | | Add -V (display version) and -S (list controlling symbols per #if with nesting information) options, and improve unifdefall debug output. Done committing 0 revisions to SVN Obtained from: http://dotat.at/prog/unifdef Notes: svn path=/head/; revision=205089
* Update to upstream version 1.338Tony Finch2010-02-192-27/+50
| | | | | | | | | | | | | Fix a long-standing cpp compatibility bug: The -DFOO argument (without an explicit value) should define FOO to 1 not to the empty string. Add support for CRLF newlines, based on a suggestion from Mark Rushakoff. Obtained from: http://dotat.at/prog/unifdef/ Notes: svn path=/head/; revision=204092
* Fix portability to 64 bit platforms.Tony Finch2010-01-191-1/+1
| | | | | | | | | printf("%.*s",i,s) expects an int not a ptrdiff_t Thanks to bf1783 (at) googlemail.com for the bug report. Notes: svn path=/head/; revision=202649
* Sync unifdefall with upstream. It no longer relies entirely on $PATHTony Finch2010-01-191-5/+14
| | | | | | | | to find unifdef, in order to support running the test suite before installing. Notes: svn path=/head/; revision=202636
* Add a -o outfile option, which can be used to specify an output file. TheTony Finch2010-01-192-30/+119
| | | | | | | | | | | file can safely be the same as the input file. Idea from IRIX unifdef(1). This version fixes a bug in the NetBSD unifdef which refuses to write to a -o outfile which does not exist. Obtained from: NetBSD Notes: svn path=/head/; revision=202635
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-1/+0
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* unifdef: fix invalid array access when nesting limit exceededTony Finch2009-11-271-4/+8
| | | | | | | | | | | | | | | If the number of nested #if blocks exceeds 64, nest() increments the nesting depth and then reports an error. The message includes the line number for the start of the current #if block, which is read from past the end of the relevant array. Avoid the out-of-bounds read by reporting the error and exiting before the nesting depth has a chance to increase. Submitted by: Jonathan Nieder <jrnieder@gmail.com> Notes: svn path=/head/; revision=199867
* unifdefall: optimise the loop that builds the unifdef command.Tony Finch2009-11-261-9/+17
| | | | | | | | | | | | | | | | | The old code used a shell loop to convert each controlling macro definition into a command-line argument, reading the macro definitions file each time. The new code converts the list of controlling macros into a sed script which can run through the list of macro definitions in one go. Add some explanatory comments, since the code is quite meta. Use {} instead of () for redirecting a group of commands. Submitted by: Jonathan Nieder <jrnieder@gmail.com> Notes: svn path=/head/; revision=199842
* Remove debugging remnants from unifdefall.Tony Finch2009-11-261-2/+2
| | | | | | | Submitted by: Jonathan Nieder <jrnieder@gmail.com> Notes: svn path=/head/; revision=199817
* Update unifdef to my upstream version 1.188Tony Finch2009-11-253-134/+300
| | | | | | | | | | | | | | | | | | | | | | | | Main highlights: (A) The new -B option compresses blank lines around a deleted section so that blank lines around "paragraphs" of code don't get doubled. (B) Lenient evaluation of && and || so that #if expressions can be evaluated even when some of their sub-expressions cannot be. (C) The evaluator can now handle macros with arguments. (D) Portability fixes, especially for unifdefall. Contributions from: Ben Hutchings at Solarflare Communications (A and B) Anders H Kaseorg <andersk@mit.edu> (A and C) Jonathan Nieder <jrnieder@gmail.com> (D) Obtained from: http://dotat.at/prog/unifdef/ Notes: svn path=/head/; revision=199813
* Add AUTHORS section[*] and fix HISTORY section.Hiroki Sato2008-05-021-1/+7
| | | | | | | | | Requested by: Dave Yost (original author)[*] History checked by: The CSRG Archives MFC after: 3 days Notes: svn path=/head/; revision=178724
* Typo in comment spotted by Hasso Tepper.Tony Finch2008-03-021-2/+2
| | | | | | | Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=176751
* A fix for other ways of triggering joe@'s bug.Tony Finch2008-02-291-9/+12
| | | | Notes: svn path=/head/; revision=176659
* Allow #if defined SYM as well as #if defined(SYM). Fix an abortTony Finch2008-02-291-18/+31
| | | | | | | | | caused by files that have #endif and no newline on the last line (reported by joe@). Also fix a benign uninitialized variable bug. Update and tidy the copyright. Notes: svn path=/head/; revision=176658
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-05-212-2/+5
| | | | Notes: svn path=/head/; revision=146466
* Sync with upstream:Tony Finch2005-03-082-52/+96
| | | | | | | | | | | | | | Allow the user to run unifdef without defining any symbols. This is useful in conjunction with the -k flag. Fix a bug in the -s handling code that would have caused out-of-bounds array accesses. Add a -n option to insert #line directives in the output. Ignore comment markers inside string and character literals (bug reported by Amos Shapira <amos.shapira@netregistry.com.au>). More accurate copyright notices. Notes: svn path=/head/; revision=143285
* Sort sections.Ruslan Ermilov2005-01-181-14/+14
| | | | Notes: svn path=/head/; revision=140420
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* Improve expression evaluation debugging output, tidy up the handling ofTony Finch2003-07-011-22/+23
| | | | | | | EOF, and improve the commentary about backslash-newline handling. Notes: svn path=/head/; revision=117124
* Various fixes from upstream, including a bug...Tony Finch2003-06-301-11/+18
| | | | | | | | | | | | | | | | | | | | Fix the usage synopsis. Amend the copyright notice to reflect the fact that there's no Berkeley code left. Fix a typo in a comment, improve the descriptions of the way we use some global variables (relevant to the bug below), and note that division-by-zero has side effects so the current expression evaluator can't be trivially extended to arithmetic in its current design. Avoid hitting an abort(); /* bug */ when in "text mode" (i.e. ignoring comment state) by updating the line parser state properly. PR: 53907 Notes: svn path=/head/; revision=117076
* MAINTAINER line moved to MAINTAINERS file.Tony Finch2003-06-041-2/+0
| | | | Notes: svn path=/head/; revision=115823