Age | Commit message (Collapse) | Author |
|
and expand it directly, without needing a variable context.
Use it in Var_SubstVar, so that .for loops values don't need to be entered
into any context nor looked up.
This speeds up .for loops some, and avoids nasty variable capture
side-effects.
Ok'd millert@, miod@, naddy@ (naddy spotted a problem with the first
version of that change).
|
|
iterate_words: light-weight equivalent to brk_string,
which does not need to copy the string, and does not do \ interpretation
which are only needed for the string.
escape_dup: handles escape sequence in a systematic way.
This speeds up variable modifiers.
This also makes .for loops more consistent, as they use the same definition
of `a word' as the rest of make.
|
|
- UNUSED macro that expands to __attribute__((unused)) for gcc
- move rcsid around so that they can be tagged UNUSED.
- activate -Wunused.
- use UNUSED instead of kludgy junk for function arguments.
- add extern to all extern prototypes.
- update comments in lst.h.
- clean up var.c a little bit, constifying arguments, updating comments...
|
|
variable substitution is.
|
|
Apart from a few casts, VAR_GLOBAL and friends are separate
data structures, so we use a small array for local variables.
We also junk allVars, since TargFreeGN can release local nodes,
and var.c has explicit lists for its variables already.
Reviewed millert@ and miod@.
|
|
Lst_Init (constructor) and Lst_New (allocation + construction)
Lst_Destroy (destructor) and Lst_Delete (deallocation + destruction),
and uses that to turn most dynamic allocation of lists (Lst pointers)
into static structures (LIST).
Most of this is mundane, except for allGNs in targ.c, where the code must
be checked to verify that Targ_Init is called soon enough.
Lst_New is a temporary addition. All lists will soon be static.
Reviewed by millert@, like the previous patch.
|
|
|
|
In fact, it can become a macro based on Lst_ForEachFrom.
This also introduces Lst_Every, as a shortcut for the very common case where
Lst_ForEach does not need any user data.
Finally, make consistent use of a few function typedefs, instead of having
explicit void (*)(Lst) arguments all over the place.
|
|
They serve no purpose, except hiding potential bugs.
In particular, remove (ClientData) cast from macro, showing potentially
troublesome use of Hashes to store time_t.
|
|
|
|
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.
|
|
(idiotic to retrieve size every time when it's used half the time)
|
|
|
|
- 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.
|
|
- 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@
|
|
Parse_String starts in the current line, but at a given line number.
.for loops yield correct line numbers, much easier to debug !
|
|
- don't interfere with MACHINE/MACHINE_ARCH defines for bootstrap
- type clean-up, time_t, and printing `unknown' ints
- fix TARGET/MEMBER bug in archive rules
- memmove...
- cleaner Error handler.
- reentrant brk_string
- .MAKE env variable
- preliminary scaffolding for .NOPATH
Other improvements:
- efree
- shellneed streamlined
- display Stop in .CURDIR after an error.
- document most features and misfeatures.
- add a few OpenBSD notes to the tutorial.
|
|
- Merge in FreeBSD and Lite2 changes.
- Fix bug where a non-archive target with a .a suffix would always
be considered to be out of date, since it does not have a TOC.
- Fix NetBSD PR #2930: declare missing variable.
|
|
|
|
|