Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const. Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.
The macro DE_CONST is used to deal with a handful of very special
places where something is qualified as const but really needs to have
its const qualifier removed.
rdata.c now defines macros for the prototypes of the basic rdata functions,
and all of the lib/dns/rdata/**/*.c files now use them.
Some minor integer-compatibility issues. (IE, ~0x03 is a signed int,
so assigning it to an unsigned int should use a cast. The type of an
enum member is int, so there are some conversion issues there, too.)
A pointers-to-function should not be cast to a pointer-to-object.
Variables should not be named for C reserved identifiers.
One or two set-but-not-used variables removed.
Minor other ISC style cleanups.
"./rdata/generic/tkey_249.c", line 89: remark(1506): implicit conversion from
"unsigned long" to "int": rounding, sign extension, or loss of
accuracy may result
"./rdata/generic/tkey_249.c", line 98: remark(1506): implicit conversion from
"unsigned long" to "int": rounding, sign extension, or loss of
accuracy may result
The values in question were already being checked to be within the range of
a short, so where the warnings were occuring they were just cast to int.
"./rdata/generic/unspec_103.c", line 138: warning(1184): possible use of "="
where "==" was intended
by changing to ==, which is clearly what was intended.
"./rdata/generic/opt_41.c", line 73: remark(1552): variable "option" was set
but never used
by removing option, because there was nothing to do with its value.
"./rdata/generic/nxt_30.c", line 66: warning(1042): operand types are
incompatible ("char *" and "void *")
by casting to char *, as already being done with several other uses of
token.value.as_pointer.
"./rdata/generic/loc_29.c", line ??: remark(1506): implicit conversion from
"unsigned long" to "int": rounding, sign extension, or loss of
accuracy may result
by making sure that the range was suitable for an int and casting to
int in each case. (This appeared to be more desirable than changing
all of the variables in question to longs.)
"./rdata/generic/mx_15.c", line 202: warning(1184): possible use of "=" where
"==" was intended
by changing to == since it was clear that test was desired, not assignment.
Cleanup of redundant/useless header file inclusion.
ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
/*
* This is a comment.
*/