Skip to content

Commit 12012f2

Browse files
crafcat7xiaoxiang781216
authored andcommitted
cachespeed:Fixed the problem of printing variables in 32/64-bit environment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
1 parent 57cb20b commit 12012f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmarks/cachespeed/cachespeed_main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ static void report_line(size_t bytes, TIME cost)
141141

142142
if (cost == 0)
143143
{
144-
printf(CACHESPEED_PREFIX "%d bytes cost time too small!\n", bytes);
144+
printf(CACHESPEED_PREFIX "%zu bytes cost time too small!\n", bytes);
145145
return;
146146
}
147147

148148
/* rate = Test Data Size / Execution Time */
149149

150150
rate = 1.00 * bytes * REPEAT_NUM / cost;
151151

152-
printf("%d Bytes: %4lf, %4llu, %4llu\n\r",
152+
printf("%zu Bytes: %4lf, %4" PRIu64", %4" PRIu64"\n\r",
153153
bytes, rate, cost / REPEAT_NUM, cost);
154154
}
155155

0 commit comments

Comments
 (0)