mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 01:59:26 +00:00
The SET_IF_NOT_NULL() macro avoids a fair amount of tedious boilerplate, checking pointer parameters to see if they're non-NULL and updating them if they are. The macro was already in the dns_zone unit, and this commit moves it to the <isc/util.h> header. I have included a Coccinelle semantic patch to use SET_IF_NOT_NULL() where appropriate. The patch needs an #include in `openssl_shim.c` in order to work.
15 lines
176 B
Plaintext
15 lines
176 B
Plaintext
@@
|
|
type T;
|
|
identifier fun;
|
|
identifier arg;
|
|
expression val;
|
|
@@
|
|
fun(..., T *arg, ...) {
|
|
...
|
|
- if (arg != NULL) {
|
|
- *arg = val;
|
|
- }
|
|
+ SET_IF_NOT_NULL(arg, val);
|
|
...
|
|
}
|