Use the explicit NULL macro for pointer comparisons.
This makes it more clear that a null check is intended. Avoiding the use of a pointer as a test condition alse increases the type-safety of the comparisons. (This is also MISRA C 2012 rules 14.4 and 11.9)
This commit is contained in:
@@ -37,13 +37,13 @@ void run_benchmark(char *name, void (*benchmark)(void*), void (*setup)(void*), v
|
||||
double max = 0.0;
|
||||
for (i = 0; i < count; i++) {
|
||||
double begin, total;
|
||||
if (setup) {
|
||||
if (setup != NULL) {
|
||||
setup(data);
|
||||
}
|
||||
begin = gettimedouble();
|
||||
benchmark(data);
|
||||
total = gettimedouble() - begin;
|
||||
if (teardown) {
|
||||
if (teardown != NULL) {
|
||||
teardown(data);
|
||||
}
|
||||
if (total < min) {
|
||||
|
||||
Reference in New Issue
Block a user