Convert the rest of the codebase to C89.

Update build system to enforce -std=c89 -pedantic.
This commit is contained in:
Gregory Maxwell
2015-01-25 17:32:08 +00:00
parent bf2e1ac7cd
commit f735446c4d
15 changed files with 279 additions and 196 deletions

View File

@@ -18,14 +18,16 @@ static double gettimedouble(void) {
}
void run_benchmark(void (*benchmark)(void*), void (*setup)(void*), void (*teardown)(void*), void* data, int count, int iter) {
int i;
double min = HUGE_VAL;
double sum = 0.0;
double max = 0.0;
for (int i = 0; i < count; i++) {
for (i = 0; i < count; i++) {
double begin, total;
if (setup) setup(data);
double begin = gettimedouble();
begin = gettimedouble();
benchmark(data);
double total = gettimedouble() - begin;
total = gettimedouble() - begin;
if (teardown) teardown(data);
if (total < min) min = total;
if (total > max) max = total;