Skip to content

Commit 57cb20b

Browse files
crafcat7xiaoxiang781216
authored andcommitted
ramtest:Fixed the problem of printing variables in 32/64-bit environment
Signed-off-by: chenrun1 <[email protected]>
1 parent 204326c commit 57cb20b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

testing/ramtest/ramtest.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static void marching_ones(FAR struct ramtest_s *info)
281281
{
282282
uint32_t pattern = 0x00000001;
283283

284-
printf(RAMTEST_PREFIX "Marching ones: %08x %d\n",
284+
printf(RAMTEST_PREFIX "Marching ones: %08" PRIxPTR " %zu\n",
285285
info->start, info->size);
286286

287287
while (pattern != 0)
@@ -301,7 +301,7 @@ static void marching_zeros(FAR struct ramtest_s *info)
301301
{
302302
uint32_t pattern = 0xfffffffe;
303303

304-
printf(RAMTEST_PREFIX "Marching zeroes: %08x %d\n",
304+
printf(RAMTEST_PREFIX "Marching zeroes: %08" PRIxPTR " %zu\n",
305305
info->start, info->size);
306306

307307
while (pattern != 0xffffffff)
@@ -436,7 +436,7 @@ static void verify_memory2(FAR struct ramtest_s *info, uint32_t value_1,
436436
static void pattern_test(FAR struct ramtest_s *info, uint32_t pattern1,
437437
uint32_t pattern2)
438438
{
439-
printf(RAMTEST_PREFIX "Pattern test: %08x %d %08" PRIx32
439+
printf(RAMTEST_PREFIX "Pattern test: %08" PRIxPTR " %zu %08" PRIx32
440440
" %08" PRIx32 "\n",
441441
info->start, info->size, pattern1, pattern2);
442442

@@ -548,7 +548,7 @@ static void verify_addrinaddr(FAR struct ramtest_s *info)
548548

549549
static void addr_in_addr(FAR struct ramtest_s *info)
550550
{
551-
printf(RAMTEST_PREFIX "Address-in-address test: %08x %d\n",
551+
printf(RAMTEST_PREFIX "Address-in-address test: %08" PRIxPTR" %zu\n",
552552
info->start, info->size);
553553

554554
write_addrinaddr(info);

0 commit comments

Comments
 (0)