Our CODING_STYLE suggests not comparing with NULL, but relying on C's
downgrade-to-bool feature for that. Fix up some code to match these
guidelines. (This is not comprehensive, the coccinelle output for this
is unfortunately kinda borked)
--- /dev/null
+@@
+expression e;
+statement s;
+@@
+- if (e == NULL)
++ if (!e)
+s
+@@
+expression e;
+statement s;
+@@
+- if (e != NULL)
++ if (e)
+s
return r;
} else
- assert(ts == NULL);
+ assert(!ts);
if (flags & WRITE_STRING_FILE_CREATE) {
f = fopen(fn, "we");
if (!filename_is_valid(fn))
return -EINVAL;
- if (extra == NULL)
+ if (!extra)
extra = "";
t = new(char, strlen(p) + 2 + strlen(extra) + 6 + 1);
assert(timestamp);
- if (paths == NULL)
+ if (!paths)
return false;
STRV_FOREACH(i, paths) {
if (last_space != NULL && timezone_is_valid(last_space + 1))
tz = last_space + 1;
- if (tz == NULL || endswith_no_case(t, " UTC"))
+ if (!tz || endswith_no_case(t, " UTC"))
return parse_timestamp_impl(t, usec, false);
shared = mmap(NULL, sizeof *shared, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);