runners: Fixed 64-bit overflow when size_t < bench_io_t
Long story short: %zd != %jd! This was a simple oversight when writing the bench printing code, and easy to miss on x86_64 and other modern PCs, but the mistake becomes very apparent when trying to bench under qemu in thumb mode!
This commit is contained in:
@@ -659,7 +659,7 @@ void bench_stop(const char *m) {
|
|||||||
for (size_t i = 0; i < bench_record_count; i++) {
|
for (size_t i = 0; i < bench_record_count; i++) {
|
||||||
if (strcmp(bench_records[i].m, m) == 0) {
|
if (strcmp(bench_records[i].m, m) == 0) {
|
||||||
// print results
|
// print results
|
||||||
printf("benched %s %zd %"PRIu64" %"PRIu64" %"PRIu64"\n",
|
printf("benched %s %jd %"PRIu64" %"PRIu64" %"PRIu64"\n",
|
||||||
bench_records[i].m,
|
bench_records[i].m,
|
||||||
bench_records[i].n,
|
bench_records[i].n,
|
||||||
readed - bench_records[i].last_readed,
|
readed - bench_records[i].last_readed,
|
||||||
@@ -684,7 +684,7 @@ void bench_stop(const char *m) {
|
|||||||
|
|
||||||
void bench_result(const char *m, uintmax_t n, uintmax_t result) {
|
void bench_result(const char *m, uintmax_t n, uintmax_t result) {
|
||||||
// we just print these directly
|
// we just print these directly
|
||||||
printf("benched %s %zd %"PRIu64"\n",
|
printf("benched %s %jd %"PRIu64"\n",
|
||||||
m,
|
m,
|
||||||
n,
|
n,
|
||||||
result);
|
result);
|
||||||
@@ -692,7 +692,7 @@ void bench_result(const char *m, uintmax_t n, uintmax_t result) {
|
|||||||
|
|
||||||
void bench_fresult(const char *m, uintmax_t n, double result) {
|
void bench_fresult(const char *m, uintmax_t n, double result) {
|
||||||
// we just print these directly
|
// we just print these directly
|
||||||
printf("benched %s %zd %.6f\n",
|
printf("benched %s %jd %.6f\n",
|
||||||
m,
|
m,
|
||||||
n,
|
n,
|
||||||
result);
|
result);
|
||||||
|
|||||||
Reference in New Issue
Block a user