Commit e8e8461e authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Factor out and simplify size computation.

* pgcc 20 cannot handle this steaming hot C99 material.
parent c0301d89
......@@ -72,13 +72,14 @@ main()
uint32_t (*occCount)[n];
list = xmalloc(sizeof (list[0]) * n);
occCount = xmalloc(sizeof (occCount[0]) * n * n);
size_t occCountSize = sizeof (uint32_t) * n * n;
occCount = xmalloc(occCountSize);
size_t failures;
for (size_t repeats = 0;
repeats < (sizeof (numRunsList)/sizeof (numRunsList[0]));
++repeats)
{
memset(occCount, 0, sizeof (occCount[0]) * n * n);
memset(occCount, 0, occCountSize);
uint32_t numRuns = numRunsList[repeats];
for (uint32_t j = 0; j < numRuns; ++j)
{
......@@ -111,6 +112,8 @@ main()
}
}
}
free(list);
free(occCount);
return failures?EXIT_FAILURE:EXIT_SUCCESS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment