summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/suff.c
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of the third argument to Var_Value() the pointer it pointedharti2005-05-241-5/+2
| | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD
* Use the print_flags function to print the OP_ flags of a target.harti2005-05-131-1/+1
| | | | | Give the function one more argument to decide whether it should print the flags like a C-expression or just space-delimited.
* Cleanup SuffFindArchDeps() to get rid of two const-warnings.harti2005-05-121-11/+9
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.240)
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesharti2005-05-091-1/+1
| | | | | | | | | | only one variable and Var_Subst() which substitutes all. Split out the test whether a variable should not be expanded into match_var(). Make access to the input string consistently using str[]. Remove two unused functions: Var_GetTail() and Var_GetHead(). Patches: 7.184-7.189 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Make paths an explicite datatype instead of using the generic Lst.harti2005-03-231-33/+29
| | | | | | 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.
* Simplify buffer access by using Buf_Data() and Buf_Peel() whereharti2005-03-221-1/+1
| | | | | | | | appropriate. Patch: 7.147-7.151 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Replace calls to Lst_Find with either appropriate LST_FOREACH macrosharti2005-03-211-142/+71
| | | | | plus predicate inlining or a special purpose function with takes and returns the correct types.
* Fix a bug in matching suffixes. Under certain circumstances the codeharti2005-03-181-44/+25
| | | | | | | | | | | | would access memory before the beginning of the string to match (the suffix match starts at the end of both the string and the suffix and proceedes to the begin until either the start of the suffix is hit or the character does not match). This could lead to a memcpy copying into random memory. Fix this by checking the length of the string to match too and replacing the Lst_Find calls with LST_FOREACH loops (last part by me). Submitted by: Matt Dillon <dillon@apollo.backplane.com> (in principle)
* Get rid of another Lst_ForEach in favour of LST_FOREACH. Get ridharti2005-03-141-70/+38
| | | | of the now unused struct LstSrc and collapes two functions into one.
* Move the creation of a Src structure into its own function.harti2005-03-141-43/+33
|
* Convert a couple of other uses of Lst_ForEach to LST_FOREACH andharti2005-03-141-48/+40
| | | | simplify code.
* Simplify the print routines by using LST_FOREACH instead of Lst_ForEachharti2005-03-111-64/+39
| | | | | | and inlining the small printing utility functions. Create a function that can be used to produce printable representations of flag words.
* Remove the leading underscore from structure tags. All identifiersharti2005-03-111-3/+3
| | | | with a leading underscore are in the implementation namespace.
* Style: Fix indentation.harti2005-03-111-1117/+1129
|
* Reorganize Suff_EndTransform to be called only for nodes forharti2005-03-101-38/+30
| | | | which it is needed (transforms).
* Style: fix function style before working on it (mainly intendation).harti2005-03-101-30/+30
|
* Split SuffExpandChildren into three functions: one that skipsharti2005-03-091-179/+190
| | | | | | variables and expands archive specifications, one that expands wild cards and a driver that loops over the children list and expands each child if necessary replacing it with it's expansions.
* Var_Subst() cannot return NULL so there is no reason to checkharti2005-03-091-105/+92
| | | | for it.
* Style: fix indentation of SuffExpandChildren before working on it.harti2005-03-081-178/+194
|
* Make sure the length variable is initialized to 0 before passingharti2005-03-011-1/+1
| | | | | | | | it to Var_Parse(). Patch: 7.85 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Change the return value of Var_Subst to return a Buffer insteadharti2005-02-251-1/+5
| | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move PrintAddr() from util.c into suff.c - the only file where it isharti2005-02-041-0/+17
| | | | | | actuall used, and make it static. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* General whitespace cleanup: remove mixes of tabs and spaces, removeharti2005-02-041-5/+5
| | | | | | space after function names, remove spaces on emtpy lines. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Some more easy constification.harti2005-02-041-1/+2
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Clean up include files and file including. Split nonints.h into piecesharti2005-02-011-5/+17
| | | | | | | | | | | | | 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>
* Remove all the cleanup functions. There is no reason to free memoryharti2004-12-171-28/+6
| | | | | just before exiting (especially given the number of memory leaks) - it just costs time.
* Instead of dynamically allocating list heads allocated them staticallyharti2004-12-161-187/+178
| | | | | | | | 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.
* Don't free the second list in Lst_Concat for LST_CONCLINK; free itharti2004-12-081-0/+3
| | | | in the caller instead.
* Get rid of the sequential access feature of the lists. This was usedharti2004-12-081-28/+12
| | | | | | | | only in a couple of places and all of them except for one were easily converted to use Lst_First/Lst_Succ. The one place is compatibility mode in job.c where the it was used to advance to the next command on each invocation of JobStart. For this case add a pointer to the node to hold the currently executed command.
* Constify the arguments to the list compare function. This temporarilyharti2004-12-081-18/+32
| | | | | | | | 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)
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofharti2004-12-071-60/+60
| | | | | | the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files
* Make needs no circular lists so remove them from the list code.harti2004-12-071-27/+27
|
* Fix breakage introduced on 64-bit platforms with my last commit. Needharti2004-12-031-1/+1
| | | | to change to size_t in a couple of other places too.
* Style: remove a lot of unnecessary casts, add some and spell the nullharti2004-12-011-131/+132
| | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after
* Stylification: missing spaces, extra space after function names, castsharti2004-11-301-215/+218
| | | | | | | | 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)
* The .DEFAULT target with no commands caused a null pointer dereference.ru2004-04-121-1/+6
| | | | | PR: bin/63405 Obtained from: NetBSD
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* Remove efree(), it isn't used consistently enough to even pretend that itjmallett2002-10-231-3/+3
| | | | | | 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.
* Convert make(1) to use ANSI style function declarations. Variablejmallett2002-10-091-101/+43
| | | | | | | | | | | 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.
* Make make(1) WARNS=6 clean except for const issues. This mostly involvesjmallett2002-09-281-15/+15
| | | | | | | | | | | renaming variables to not shadow libc functions or greater scope locals. Kinda makes one wonder if the extern ones weren't meant in some of these places :) The only thing I'd still like to do WRT this is possibly combine rstat and status in compat.c -- that should be fine, as I do not think the codepaths will want both around at once. Sponsored by: Bright Path Solutions
* Add empty default cases where they should be, remove non-local execution stuffjmallett2002-09-281-0/+5
| | | | | | | | | | 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
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichjmallett2002-09-181-29/+29
| | | | | 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.
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingjmallett2002-09-171-76/+32
| | | | | | | | | 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.
* #define<space> -> #define<tab>jmallett2002-09-171-3/+3
|
* Update SCM ID method.obrien2002-04-131-3/+1
|
* De'register.obrien2002-04-131-12/+12
|
* remove __Pimp2002-03-221-24/+24
|
* Fix two bugs in null suffix handling. Both occured only after the suffixtmm2001-03-081-6/+19
| | | | | | | | | | | | list was cleared. Rules with null suffixes would not be rebuilt when the suffixes were added again. Adding null suffix rules would fail when a rule for the same source was declared before the suffix list was cleared. PR: 23328, 24102 Reviewed by: will Approved by: rwatson
* Preceed/preceeding are not english words. Use precede and preceding.asmodai2001-02-181-1/+1
|
* There's also no point in #typedef'ing void/char pointers. Accordingly,will2000-12-021-110/+110
| | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD
OpenPOWER on IntegriCloud