From 1d7a927dc43b0d7af43799fd45551d74cb0e5bd7 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 2 Oct 2008 21:01:58 +0000 Subject: 2008-10-02 Joel Sherrill * include/timesys.h: Use inttypes.h. * tmck/task1.c: Use uint32_t for count. --- testsuites/tmtests/ChangeLog | 5 +++++ testsuites/tmtests/include/timesys.h | 3 ++- testsuites/tmtests/tmck/task1.c | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'testsuites') diff --git a/testsuites/tmtests/ChangeLog b/testsuites/tmtests/ChangeLog index 1feb0388cd..b3b676e3d7 100644 --- a/testsuites/tmtests/ChangeLog +++ b/testsuites/tmtests/ChangeLog @@ -1,3 +1,8 @@ +2008-10-02 Joel Sherrill + + * include/timesys.h: Use inttypes.h. + * tmck/task1.c: Use uint32_t for count. + 2008-09-17 Joel Sherrill * include/timesys.h: Rename STACK_CHECKER_ON to more appropriate diff --git a/testsuites/tmtests/include/timesys.h b/testsuites/tmtests/include/timesys.h index 38d15ff518..fc29cccccd 100644 --- a/testsuites/tmtests/include/timesys.h +++ b/testsuites/tmtests/include/timesys.h @@ -14,6 +14,7 @@ */ #include +#include /* * This constant determines the maximum number of a resource @@ -36,7 +37,7 @@ #define put_time( _message, _total_time, \ _iterations, _loop_overhead, _overhead ) \ printf( \ - "%s %d\n", \ + "%s %" PRId32 "\n", \ (_message), \ (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \ ) diff --git a/testsuites/tmtests/tmck/task1.c b/testsuites/tmtests/tmck/task1.c index 9e46732f4f..8324289388 100644 --- a/testsuites/tmtests/tmck/task1.c +++ b/testsuites/tmtests/tmck/task1.c @@ -14,12 +14,12 @@ #define CONFIGURE_INIT #include "system.h" -#define MAXIMUM_DISTRIBUTION 10000 +#define MAXIMUM_DISTRIBUTION 1000 #undef OPERATION_COUNT #define OPERATION_COUNT 100000 -int Distribution[ MAXIMUM_DISTRIBUTION + 1 ]; +uint32_t Distribution[ MAXIMUM_DISTRIBUTION + 1 ]; rtems_task Task_1( rtems_task_argument argument @@ -172,8 +172,8 @@ void check_read_timer() for ( index = 0 ; index <= MAXIMUM_DISTRIBUTION ; index++ ) { time += (Distribution[ index ] * index); if ( Distribution[ index ] != 0 ) - printf( "%d %d\n", index, Distribution[ index ] ); + printf( "%" PRId32 " %" PRId32 "\n", index, Distribution[ index ] ); } - printf( "Total time = %d\n", time ); - printf( "Average time = %d\n", time / OPERATION_COUNT ); + printf( "Total time = %" PRId32 "\n", time ); + printf( "Average time = %" PRId32 "\n", time / OPERATION_COUNT ); } -- cgit v1.2.3