support the two different incompatible rules for build .so files from
.S source on both NetBSD and binutils toolchains:
${CPP} | ${AS} for syscalls
${CC} for non-syscalls
for which the different toolchains's ${AS} requires diffferent flags.
(set them to the null pointer instead).
Thus, code that doesn't specificallly attempt to clean up allocated
memory after an error result is returned from yp_...() won't have an
unexpected memory leak (i.e, most 3rd party code)
calls is initialised to the null pointer so that the error condition
doesn't fail by trying to free() memory that wasn't malloc()ed
* cleanup a bit; remove use of register, KNFify
to the null pointer before invocation, so that the test in the
error case of "if (outdata != NULL) free(outdata)" won't potentially
try and free memory that wasn't malloc()ed.
* factor some duplicated code out of both parts of an "if {} else {}"
construct.
* remove use of `register' & KNFify.
* Ensure that all 'char **outXXX' pointers aren't the null pointer before use.
* Set *outXXX=NULL before checking any other arguments.
* Document that *outXXX will always be NULL or a malloc(3)ed string
unless outXXX was NULL (in which case YPERR_BADARGS will be returned
and the caller shouldn't attempt to free(*outXXX) if *outXXX != NULL;
These changes should prevent most occurances of coredumps when a bad
argument was given to a yp client function and the caller attempts to
free an outvalue that isn't the null pointer. To be really safe, the
caller probably should set the *outvalue=NULL anyway (ref: PR [lib/3580])
This code uses subb instead of cmpb to compare chars. When they are
not equal, the function's return value is computed by sign extending
the difference. The basic idea was contributed by Hiroshi Horitomo
<horimoto@cs-aoi.cs.sist.ac.jp> in PR #3223, but his implementation
used additional instructions to compute the return value.
Also, the series of insns used to compare one pair of characters has
been unrolled 4 times. This helps the 680[23]0, where the cost of a
taken branch is significantly more than that of a not-taken branch.