Age | Commit message (Collapse) | Author |
|
|
|
avoid races.
Make use of basic Unix semantics, namely you can unlink a file while holding
open fd on the data. Avoid all the mess of having to track useless file names
around.
|
|
Silently ignoring all commands but the first set in a normal dependency
is a generic `feature' of make.
|
|
|
|
for reminding me.
|
|
make needs quite a lot more of cleaning up yet.
|
|
However, I found some more oddities while going through the scanner...
|
|
|
|
Lst_AtEnd, Lst_Concat, Lst_Remove, Lst_Replace.
Don't bother returning one.
|
|
|
|
Get rid of them.
Get rid of list.h, nothing uses it anyway.
|
|
|
|
Perform an explicit ENOENT check to keep the same error message
for known cases.
|
|
split the function specific to for.c out, and give them more sensible
arguments at the same time.
This makes .for loop handling more efficient, as we have some heuristic
to evaluate the size of the buffer needed...
|
|
|
|
- split For_Eval into For_Eval (first line of loop) / For_Accumulate
(remaining lines).
- encapsulate state into a For structure, instead of brain damaged static
variables that need copy.
Very minor performance hit, specifically, For structure is allocated with
malloc/free, instead of playing tricks with static/auto variables.
|
|
This cuts down quite a lot of malloc, since in actual use,
buffer usage is mostly static.
|
|
- CondGetArg needs to differentiate between empty strings and problems.
Returning problems as a separate boolean is cleaner anyway.
- Fix error in conditional parser which would overstep the ending 0, so
that a second zero would be needed.
|
|
Actually, one of these needs to be there, because of two bugs in cond.c
|
|
|
|
(idiotic to retrieve size every time when it's used half the time)
|
|
- Buf_Discard is only used to remove all the bytes in a buffer,
replace with Buf_Reset,
- buffer values are not read unless accessed first through Buf_GetAll,
no need to null-terminate it at every point.
- Buf_Expand need not check if the expansion is needed. That's Buf_AddChar
and Buf_AddChars responsability (otherwise, Buf_AddChar checks twice)
- Buf_Overflow only handles overflow. Adding the character is done in
every case anyway.
|
|
|
|
|
|
|
|
|
|
it is much better to keep them in the global context, marked read-only.
This also makes the next simplification possible, since var values need no
longer be free'd by client code.
(reviewed by ho@, like other patches)
|
|
- buf.c deals exclusively with chars. Be explicit about it, and remove
extraneous dumb casts to char (can hide real type errors).
- buffer sizes are size_t. Note that bp->left can never become NULL.
- Buf_GetAll is happy with a NULL pointer for the size, remove unneeded
extra pointers.
- Propagate size_t to all places where buffer functions are used.
|
|
VAR!=
specifically, properly distinguish between bad commands and empty results.
|
|
- use it to replace .for parsing with something approaching sanity.
(this removes one of the few most blatant misuses of Bufs in make.
More changes to come... patch reviewed by ho@
|
|
|
|
Problem reported by fgsch@.
|
|
(cvs file was copied from nonints.h to give a better sense of history).
|
|
|
|
Parse_String starts in the current line, but at a given line number.
.for loops yield correct line numbers, much easier to debug !
|
|
|
|
|
|
|
|
Move main prototype to main.c, as this is not used
from any other file.
Close open bug.
|
|
perform the exit tests before checking for EOF.
This makes behavior while scanning tests more regular.
e.g,
.if defined(UVM) && ${UVM} == "yes"
...
.endif
without a final newline at the endif should always work,
instead of being an error half the time...
|
|
Temporary solution, until Todd or somebody else *finally* starts reviewing
the first patches of the 20,000 lines diff I currently have...
|
|
check that v is PRECISELY A.
Other BSDs, take notice.
|
|
|
|
make spends time freeing data structures right before exiting.
So don't bother.
Keep the code inside #ifdef, so that it's still there if someone
ever wants to use make code inside a library.
|
|
Replace the buffer reallocation mechanism with something much more
efficient.
Originally from NetBSD. Tweaks to the allocator to first loop finding the
correct size, then reallocate; change the heuristic to double the size
until we're over what's needed by some fixed amount.
|
|
Keep the file for compatibility, but don't bother compiling it.
From NetBsd
|
|
.if defined(VAR) && ${VAR:m}
cond.c has special code (set err to 0) to tell VarParse it shouldn't care
if the variable is not defined.
But this was not completely added, namely the path that deals with
modifiers was blissfully unaware of that.
|
|
|
|
To use to get ports building more user-friendly.
|
|
|