summaryrefslogtreecommitdiffstats
path: root/testsuites/samples/nsecs
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-13 11:13:11 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-13 11:13:11 -0500
commit945f31b9a937fb66ab4a3dfbb5d22fa1ef74cbec (patch)
tree9b51b08b57684ebdada8f4353919360e5eba3abe /testsuites/samples/nsecs
parenth8sxsim-testsuite.tcfg: Disable capture test - uses too many task tasks for BSP (diff)
downloadrtems-945f31b9a937fb66ab4a3dfbb5d22fa1ef74cbec.tar.bz2
nsecs/init.c: Use long to avoid overflow on 16-bit targets
Diffstat (limited to 'testsuites/samples/nsecs')
-rw-r--r--testsuites/samples/nsecs/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/testsuites/samples/nsecs/init.c b/testsuites/samples/nsecs/init.c
index ba739ebce1..59995f1da8 100644
--- a/testsuites/samples/nsecs/init.c
+++ b/testsuites/samples/nsecs/init.c
@@ -122,14 +122,15 @@ rtems_task Init(
for (index=1 ; index <=10 ; index++ ) {
struct timespec start, stop;
struct timespec diff;
- int j, max = (index * 10000);
+ long j, max = (index * 10000L);
rtems_clock_get_uptime( &start );
for (j=0 ; j<max ; j++ )
dummy_function_empty_body_to_force_call();
rtems_clock_get_uptime( &stop );
subtract_em( &start, &stop, &diff );
- printf( "loop of %d %" PRIdtime_t ":%ld %" PRIdtime_t ":%ld --> %" PRIdtime_t ":%ld\n",
+ printf( "loop of %ld %" PRIdtime_t
+ ":%ld %" PRIdtime_t ":%ld --> %" PRIdtime_t ":%ld\n",
max,
start.tv_sec, start.tv_nsec,
stop.tv_sec, stop.tv_nsec,