Fixed UB introduced by the previous commit

This commit is contained in:
Snaipe 2015-09-06 07:54:20 -07:00
parent 7577cf8940
commit ee1828ff46

View file

@ -58,7 +58,7 @@ IMPL_SECTION_LIMITS(struct criterion_suite, cr_sts);
TestSuite();
Test(,) {};
static INLINE void nothing() {}
static INLINE void nothing(void) {}
int cmp_suite(void *a, void *b) {
struct criterion_suite *s1 = a, *s2 = b;
@ -169,14 +169,14 @@ static void run_test_child(struct criterion_test *test,
send_event(PRE_INIT, NULL, 0);
if (suite->data)
suite->data->init ? suite->data->init() : nothing();
test->data->init ? test->data->init() : nothing();
(suite->data->init ? suite->data->init : nothing)();
(test->data->init ? test->data->init : nothing)();
send_event(PRE_TEST, NULL, 0);
struct timespec_compat ts;
if (setup_abort_test()) {
timer_start(&ts);
test->test ? test->test() : nothing();
(test->test ? test->test : nothing)();
}
double elapsed_time;
@ -184,9 +184,9 @@ static void run_test_child(struct criterion_test *test,
elapsed_time = -1;
send_event(POST_TEST, &elapsed_time, sizeof (double));
test->data->fini ? test->data->fini() : nothing();
(test->data->fini ? test->data->fini : nothing)();
if (suite->data)
suite->data->fini ? suite->data->fini() : nothing();
(suite->data->fini ? suite->data->fini : nothing)();
send_event(POST_FINI, NULL, 0);
}