All this dance of determining the needed escape characters before
iterating, saving them upfront, evaluating them later using complicated
boolean expressions was not necessary at all. All that is needed is a
simple NeedsEscapes, called at just the right time.
The parentheses were confusing for human readers.
The compiler doesn't really care about the wording of the condition, GCC
5 on amd64 generates non-obvious but nice code anyway, replacing the
logical or with a logical and.
These definitions have originally been added in arch.c 1.27 on
1998-05-21. Even back then they had been unused, at least they had not
been used directly. Since macros are expanded at their use site, there
could have been an indirect use, but that is not the case anymore.
It's no wonder that nobody is using the archive handling of make. The
archives created by GNU binutils cannot be processed using make since the
format of the archive names has changed. GNU binutils appends a slash to
the member names. Support that format from now on.
Add more debugging output in ArchFindMember. Since nobody uses this part
of make, it doesn't hurt that the debug output is now very verbose.
In Arch_Touch and Arch_TouchLib, move the snprintf to where it belongs.
There's no point modifying a local variable just to throw it away
afterwards.
Comparing a string to a space-padded string is complicated enough to be
extracted to a separate function.
The behavior changes a little bit. Before, when searching for an archive
member with a short name (one that is space-padded in the archive), that
member was not searched using the AR_EFMT1 archive format. This doesn't
matter in practice though since no regular archive member has a name
starting with "#1/".
* Replace character literal 0 with '\0'.
* Replace pointer literal 0 with NULL.
* Remove redundant parentheses.
* Parentheses in multi-line conditions are not redundant at the
beginning of a line.
* Replace a few !ptr with ptr == NULL.
* Replace a few ptr with ptr != NULL.
* Replace (expr & mask) == 0 with !(expr & mask).
* Remove redundant braces for blocks in cases where the generated code
stays the same. (Assertions further down in the code would get
different line numbers.)
* Rename parameters in CondParser_String to reflect the data flow.
* Replace #ifdef notdef with #if 0.
The generated code stays exactly the same, at least with GCC 5.5.0 on
NetBSD 8.0 amd64 using the default configuration.