basic: make check-pointer-deref clean
Add the needed assert changes to make the code clean for the new check-pointer-deref script. Note that for `_cmp()` functions its a bit of a question if we want `assert()` or `POINTER_MAY_BE_NULL()` here. The former is more correct but it adds a (small) runtime hit. If we use POINTER_MAY_BE_NULL() it is compiled out but strictly speaking it is wrong (so at least we would need a comment).
This commit is contained in:
@@ -65,9 +65,15 @@ void qsort_r_safe(void *base, size_t nmemb, size_t size, comparison_userdata_fn_
|
||||
}
|
||||
|
||||
int cmp_int(const int *a, const int *b) {
|
||||
assert(a);
|
||||
assert(b);
|
||||
|
||||
return CMP(*a, *b);
|
||||
}
|
||||
|
||||
int cmp_uint16(const uint16_t *a, const uint16_t *b) {
|
||||
assert(a);
|
||||
assert(b);
|
||||
|
||||
return CMP(*a, *b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user