From f78c134d31acca48199433e51bbdf0611f48c425 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 22 May 2001 02:21:57 +0000 Subject: [PATCH] fixed c++ loop index scope problem --- src/libCom/test/epicsEventTest.cpp | 3 ++- src/libCom/test/epicsThreadTest.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libCom/test/epicsEventTest.cpp b/src/libCom/test/epicsEventTest.cpp index 7fcc6c697..e664d7281 100644 --- a/src/libCom/test/epicsEventTest.cpp +++ b/src/libCom/test/epicsEventTest.cpp @@ -129,7 +129,8 @@ static void eventWaitTest() { double errorSum = 0.0; epicsEventId event = epicsEventMustCreate ( epicsEventEmpty ); - for ( int i = 0u; i < 20; i++ ) { + int i; + for ( i = 0u; i < 20; i++ ) { double delay = ldexp ( 1.0 , -i ); errorSum += eventWaitMeasureDelayError ( event, delay ); } diff --git a/src/libCom/test/epicsThreadTest.cpp b/src/libCom/test/epicsThreadTest.cpp index f253a373a..9381a1ce4 100644 --- a/src/libCom/test/epicsThreadTest.cpp +++ b/src/libCom/test/epicsThreadTest.cpp @@ -70,7 +70,8 @@ static double threadSleepMeasureDelayError( const double & delay ) static void threadSleepTest() { double errorSum = 0.0; - for ( int i = 0u; i < 20; i++ ) { + int i; + for ( i = 0u; i < 20; i++ ) { double delay = ldexp ( 1.0 , -i ); errorSum += threadSleepMeasureDelayError ( delay ); }