From 12012f22760f5a53fc8881e9c3eb703021731d80 Mon Sep 17 00:00:00 2001 From: chenrun1 <chenrun1@xiaomi.com> Date: Fri, 2 Feb 2024 15:30:10 +0800 Subject: [PATCH] cachespeed:Fixed the problem of printing variables in 32/64-bit environment Signed-off-by: chenrun1 <chenrun1@xiaomi.com> --- benchmarks/cachespeed/cachespeed_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/cachespeed/cachespeed_main.c b/benchmarks/cachespeed/cachespeed_main.c index c8934e437..30bd06eef 100644 --- a/benchmarks/cachespeed/cachespeed_main.c +++ b/benchmarks/cachespeed/cachespeed_main.c @@ -141,7 +141,7 @@ static void report_line(size_t bytes, TIME cost) if (cost == 0) { - printf(CACHESPEED_PREFIX "%d bytes cost time too small!\n", bytes); + printf(CACHESPEED_PREFIX "%zu bytes cost time too small!\n", bytes); return; } @@ -149,7 +149,7 @@ static void report_line(size_t bytes, TIME cost) rate = 1.00 * bytes * REPEAT_NUM / cost; - printf("%d Bytes: %4lf, %4llu, %4llu\n\r", + printf("%zu Bytes: %4lf, %4" PRIu64", %4" PRIu64"\n\r", bytes, rate, cost / REPEAT_NUM, cost); }