Use %zu instead of %d to print size_t's.

This commit is contained in:
Ralf Corsepius
2009-10-26 09:35:02 +00:00
parent 95a585a591
commit dbd40cad74
4 changed files with 7 additions and 7 deletions

View File

@@ -52,7 +52,7 @@ static void test_realloc(void)
p2 = realloc(p1, i);
if (p2 != p1)
printf( "realloc - failed grow in place: "
"%p != realloc(%p,%d)\n", p1, p2, i);
"%p != realloc(%p,%zu)\n", p1, p2, i);
p1 = p2;
}
free(p1);
@@ -63,7 +63,7 @@ static void test_realloc(void)
p2 = realloc(p1, i);
if (p2 != p1)
printf( "realloc - failed shrink in place: "
"%p != realloc(%p,%d)\n", p1, p2, i);
"%p != realloc(%p,%zu)\n", p1, p2, i);
p1 = p2;
}
free(p1);

View File

@@ -394,7 +394,7 @@ int main(
test_extend( "/tmp/joel", max_size - 1 );
test_cat( "/tmp/joel", max_size / 2, 1024 );
} else {
printf( "Skipping maximum file size test since max_size is %d bytes\n", max_size );
printf( "Skipping maximum file size test since max_size is %zu bytes\n", max_size );
puts("That is likely to be bigger than the available RAM on many targets." );
}

View File

@@ -291,7 +291,7 @@ rtems_test_pause();
);
if (status != RTEMS_SUCCESSFUL)
{
printf("TA1 - msq que size: %d\n", queue_size);
printf("TA1 - msq que size: %zu\n", queue_size);
directive_failed( status, "rtems_message_queue_create of Q1" );
}

View File

@@ -27,7 +27,7 @@ rtems_task Init(rtems_task_argument ignored)
puts( "\n\n*** TEST 48 ***" );
printf( "Largest C program heap block available: %d\n", malloc_free_space() );
printf( "Largest C program heap block available: %zu\n", malloc_free_space() );
for (i=0 ; i<MAX ; i++ ) {
sc = rtems_semaphore_create(
rtems_build_name('s', 'e', 'm', ' '),
@@ -54,7 +54,7 @@ rtems_task Init(rtems_task_argument ignored)
puts( "Created all semaphores allowed in this test" );
printf( "%d semaphores created\n", i );
printf( "Largest C program heap block available: %d\n", malloc_free_space() );
printf( "Largest C program heap block available: %zu\n", malloc_free_space() );
for ( i-- ; i ; i-- ) {
sc = rtems_semaphore_delete( Semaphores[i] );
@@ -66,7 +66,7 @@ rtems_task Init(rtems_task_argument ignored)
}
printf( "%d semaphores successfully deleted\n", created );
printf( "Largest C program heap block available: %d\n", malloc_free_space() );
printf( "Largest C program heap block available: %zu\n", malloc_free_space() );
puts( "*** END OF TEST 48 ***" );
rtems_test_exit( 0 );