aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/cond.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-1221/+0
| | | | | | | | | | really need it can find it in the devel/fmake port or pkg install fmake. Note: This commit is orthogonal to the question 'can we fmake buildworld'. Differential Revision: https://reviews.freebsd.org/D2840 Notes: svn path=/head/; revision=284464
* Under certain conditions the condition parser would go one past end ofHartmut Brandt2005-05-251-1/+1
| | | | | | | | | the string. Until now this caused no harm, because the buffer code used to tack two NULs onto buffers. With the new, soon to come, parsing code this isn't the case anymore in all cases, so fix this. Notes: svn path=/head/; revision=146625
* Get rid of the third argument to Var_Value() the pointer it pointedHartmut Brandt2005-05-241-3/+1
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Move the Boolean and ReturnStatus stuff from sprite.h to util.h andHartmut Brandt2005-05-131-1/+0
| | | | | | | | | get rid of sprite.h. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146177
* Use a variable initialized to a string instead of the string directlyHartmut Brandt2005-05-121-6/+7
| | | | | | | | | to get rid of a const warning. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.244) Notes: svn path=/head/; revision=146154
* Move code in CondToken() and get rid of a goto.Hartmut Brandt2005-05-121-12/+11
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.243) Notes: svn path=/head/; revision=146153
* Remove a useless else and un-indent the following code.Hartmut Brandt2005-05-121-369/+370
| | | | Notes: svn path=/head/; revision=146152
* Implement a pseudo-target .WARN that allows toggeling the warning flagsHartmut Brandt2005-04-291-2/+2
| | | | | | | | for the current make. This does not override flags specified on the command line and these settings are not passed to sub-makes. Notes: svn path=/head/; revision=145679
* Introduce a flag to enable extended warnings (-x) and make them offHartmut Brandt2005-04-281-4/+7
| | | | | | | | by default. This should fix the problem of getting lots of errors when building with an up-to-date make and old *.mk files. Notes: svn path=/head/; revision=145627
* Rework the directive parsing code. Instead of using a lot of strcmp()sHartmut Brandt2005-04-111-163/+155
| | | | | | | | | | | | | | | on every line that starts with a dot use a minimal perfect hash function and a single strcmp() on the first word after the dot to find out whether it is really a directive call and, if yes, which one. Then directly dispatch to a handler function for that directive (or fall through to the dependency handling code). This makes the directive parse a little bit more strict about the syntax: the directive word must be followed by a character that is not alphanumerical and not an underline (making .undefFOO illegal); .endif and .else can only be followed by comments. Notes: svn path=/head/; revision=144894
* Style: fix indentation.Hartmut Brandt2005-04-011-853/+842
| | | | Notes: svn path=/head/; revision=144473
* Make the structure for handling the input stack local to the parseHartmut Brandt2005-03-301-3/+1
| | | | | | | | | | | | | | module. The only module accessing it (the current line number) was the condition module, so pass the current line number as a function argument. Centralize the pushing of new input sources into one function ParsePushInput() and rename the function handling the popping from ParseEOF() to ParsePopInput(). Make the entire thing a little bit clearer, by holding the current input source in the top element of the stack instead of using extra variables for this. Use a type-safe intrusive list for the input stack. Notes: svn path=/head/; revision=144341
* Make paths an explicite datatype instead of using the generic Lst.Hartmut Brandt2005-03-231-1/+1
| | | | | | | | | A Path is now a TAILQ of PathElements each of which just points to a reference counted directory. Rename all functions dealing with Paths from the Dir_ prefix to a Path_ prefix. Notes: svn path=/head/; revision=144020
* Simplify buffer access by using Buf_Data() and Buf_Peel() whereHartmut Brandt2005-03-221-4/+1
| | | | | | | | | | | appropriate. Patch: 7.147-7.151 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143959
* Replace Lst_Find calls with LST_FOREACH loops. This helps inHartmut Brandt2005-03-181-25/+7
| | | | | | | | constification und simplifies the code because the one-liner predicates can be inlined into the code. Notes: svn path=/head/; revision=143810
* Make sure the length variable is initialized to 0 before passingHartmut Brandt2005-03-011-8/+9
| | | | | | | | | | | it to Var_Parse(). Patch: 7.85 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142937
* Invent a Buf_Append function to append a NUL-terminated stringHartmut Brandt2005-02-071-5/+3
| | | | | | | | | and use it thoughout the code. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141436
* Style: line up with tabulators.Hartmut Brandt2005-02-041-6/+6
| | | | Notes: svn path=/head/; revision=141255
* Use a typedef for the conditional handler function so that declaringHartmut Brandt2005-02-041-7/+9
| | | | | | | | | pointers to these functions is easier. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141254
* Constify an argument to a function.Hartmut Brandt2005-02-031-3/+3
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141192
* Convert several typedefs from beeing pointers to structs to be the structsHartmut Brandt2005-02-021-3/+4
| | | | | | | | | | itself. This will ease constification (think of what 'const Ptr foo' means if Ptr is a pointer to a struct). Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141133
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-02-011-7/+16
| | | | | | | | | | | | | | | | that get included just where they are needed. All headers include the headers that they need to compile (just with an empty .c file). Sort includes alphabetically where apropriate and fix some duplicate commenting for struct Job, struct GNode and struct Shell by removing one version and inlining the comments into the structure declaration (the comments have been somewhat outdated). This patch does not contain functional changes (checked with md5). Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141104
* Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt2004-12-161-2/+2
| | | | | | | | | | | now that their size is only two pointers. This eliminates a lot of calls to Lst_Init and from there to malloc together with many calls to Lst_Destroy (in places where the list is obviously empty). This also reduces the chance to leave a list uninitilized so we can remove more NULL pointer checks and probably eliminates a couple of memory leaks. Notes: svn path=/head/; revision=138916
* Constify the arguments to the list compare function. This temporarilyHartmut Brandt2004-12-081-3/+2
| | | | | | | | | | | requires to make a copy of the filename in ReadMakefile and to duplicate two small functions in suff.c. This hopefully will go away when everything is constified. Submitted by: Max Okumoto <okumoto@ucsd.edu> (partly) Notes: svn path=/head/; revision=138561
* Fix breakage introduced on 64-bit platforms with my last commit. NeedHartmut Brandt2004-12-031-7/+7
| | | | | | | to change to size_t in a couple of other places too. Notes: svn path=/head/; revision=138346
* Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt2004-12-011-8/+10
| | | | | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after Notes: svn path=/head/; revision=138264
* Stylification: missing spaces, extra space after function names, castsHartmut Brandt2004-11-301-57/+57
| | | | | | | | | | | and the sizeof operator, missing empty lines, void casts, extra empty lines. Checked by: diff on make *.o lst.lib/*.o Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly) Notes: svn path=/head/; revision=138232
* Improve make's diagnostic of mistmatched .if-.endif. This patch isHartmut Brandt2004-07-201-2/+21
| | | | | | | | | | | | | slightly different from the patch in the PR. The problem is, that make handles .if clauses inside false .if clauses simply by counting them - it doesn't put them onto the conditional stack, nor even parses them so we need an extra line number stack for these ifs. PR: bin/61257 Submitted by: Mikhail Teterin <mi@aldan.algebra.com> Notes: svn path=/head/; revision=132439
* Keep up with minor changes to NetBSD. Consider a variable empty whenWarner Losh2003-09-071-1/+1
| | | | | | | | | not define. Obtained From: NetBSD (rev 1.18; sjg) Notes: svn path=/head/; revision=119818
* Fixed broken arithmetic expression parser.Ruslan Ermilov2003-07-041-5/+2
| | | | | | | | Reminded by: bde In memory of: alane Notes: svn path=/head/; revision=117226
* Remove efree(), it isn't used consistently enough to even pretend that itJuli Mallett2002-10-231-1/+1
| | | | | | | | | might help on the systems it could possibly be used as a bandaid for. In fact, the only thing it's useful for is instrumenting free(3) calls, and in that capacity, it's better served as a local patch, than a public wrapper. Notes: svn path=/head/; revision=105826
* Convert make(1) to use ANSI style function declarations. VariableJuli Mallett2002-10-091-37/+16
| | | | | | | | | | | | | | documentation already adequatedly existed in the description in most cases. Where it did not, it was added. If no documentation existed beforehand, then none was added. Some unused dummies for use in the traversal functions were marked as __unused during the conversion. Occasionally, local style fixes were applied to lines already being modified or influenced. Now make(1) should always build with WARNS=3. Notes: svn path=/head/; revision=104696
* Add empty default cases where they should be, remove non-local execution stuffJuli Mallett2002-09-281-0/+2
| | | | | | | | | | | | | in compat.c which doesn't even have preprocessor-conditional-hidden support code, and add a debugging statement where we might end up with a nil list somehow, but where I doubt it. First confirmed userland kill for Flexelint. Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104108
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett2002-09-181-4/+4
| | | | | | | | is merely printf() but to stderr. This takes care of the caveat which lead to the use of a vararg macro -- getting everything to stderr. Notes: svn path=/head/; revision=103545
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingJuli Mallett2002-09-171-8/+4
| | | | | | | | | | | | variable length arguments to a macro. Bump version as this makes DEBUG statements *always* go to stderr rather than sometimes stdout. There are a few stragglers, which I will take care of as soon as I can. Mostly these relate to the need-for-death-of some of the remote job code. Nearby stylistic nits and XXX added/fixed where appropriate. Notes: svn path=/head/; revision=103508
* Diff reduction for great justice against NetBSD, cast to unsigned char whenJuli Mallett2002-06-201-1/+1
| | | | | | | passing an argument to isspace(3). Notes: svn path=/head/; revision=98500
* Fix copyrights, and undo SCS ID damage.David E. O'Brien2002-04-131-1/+2
| | | | Notes: svn path=/head/; revision=94589
* Update SCM ID method.David E. O'Brien2002-04-131-3/+1
| | | | Notes: svn path=/head/; revision=94587
* De'register.David E. O'Brien2002-04-131-4/+4
| | | | Notes: svn path=/head/; revision=94584
* remove __PWarner Losh2002-03-221-15/+15
| | | | Notes: svn path=/head/; revision=92921
* There's also no point in #typedef'ing void/char pointers. Accordingly,Will Andrews2000-12-021-4/+4
| | | | | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD Notes: svn path=/head/; revision=69531
* There's no reason to use fancy forms of NULL. Replace all instancesWill Andrews2000-12-021-2/+2
| | | | | | | | | of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD Notes: svn path=/head/; revision=69527
* Use __RCSID()Wilfredo Sanchez2000-07-091-6/+4
| | | | Notes: svn path=/head/; revision=62833
* Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)Tim Vanderhoek1999-09-111-3/+1
| | | | Notes: svn path=/head/; revision=51150
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).Tim Vanderhoek1999-08-171-3/+7
| | | | | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself Notes: svn path=/head/; revision=49938
* Bugfix to last commit: Correctly intuit when an lhs is a string vs. number.Tim Vanderhoek1999-08-121-2/+3
| | | | Notes: svn path=/head/; revision=49658
* Handle ".if ${T} > 1 || ${T} < 3" and friends correctly.Tim Vanderhoek1999-05-251-13/+14
| | | | | | | Reported-by: asami Notes: svn path=/head/; revision=47494
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=23006
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673