Skip to content

Commit 0ac6f52

Browse files
committed
COMP: Remove compiler warnings
1 parent 8f8b30e commit 0ac6f52

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

src/PerformanceBenchmarkingInformation.cxx.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ PerformanceBenchmarkingInformation ::PerformanceBenchmarkingInformation()
111111
m_InformationInstance = this; // threads need this
112112
m_InformationInstance->UnRegister(); // Remove extra reference
113113

114-
@MAPPING_VALUES@
114+
@MAPPING_VALUES @
115115
}
116116

117117
} // end namespace itk

test/itkHighPriorityRealTimeProbeTest.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,17 @@ itkHighPriorityRealTimeProbeTest(int, char *[])
6767
// time a task
6868
localTimer.Start();
6969

70-
double sum = 0.0;
71-
for (unsigned int i = 0; i < 1e6; ++i)
70+
double sum = 0.0;
71+
constexpr unsigned int big_stopping_criteria = 1e6;
72+
for (unsigned int i = 0; i < big_stopping_criteria; ++i)
7273
{
7374
sum += i;
7475
}
7576

7677
localTimer.Stop();
78+
// Need to use the variable sum to ensure that it is not optimized away.
79+
std::cout << " Time for simple addition summing loop with " << big_stopping_criteria
80+
<< " iterations: " << localTimer.GetMean() << " sum = (" << sum << ")\n";
7781
}
7882

7983
if (!CheckTimeProbe(localTimer))

test/itkHighPriorityRealTimeProbesCollectorTest.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ TestTransformPhysicalPointToIndex(T * image)
6363
for (int i = 0; i < 1000; i++)
6464
{
6565
point3D[0] = static_cast<typename itk::NumericTraits<typename T::PointType>::ValueType>(i);
66-
image->TransformPhysicalPointToIndex(point3D, index3D);
66+
index3D = image->TransformPhysicalPointToIndex(point3D);
6767
}
6868
}
6969
if (k == 5)
70-
std::cout << point3D << std::endl;
70+
{
71+
std::cout << point3D << " at " << index3D << std::endl;
72+
}
7173
}
7274
}
7375
//-------------------------

test/itkTimeProbeTest2.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,16 @@ itkTimeProbeTest2(int, char *[])
6969
// time a task
7070
localTimer.Start();
7171

72-
double sum = 0.0;
73-
for (unsigned int i = 0; i < 1e6; ++i)
72+
double sum = 0.0;
73+
constexpr unsigned int big_stopping_criteria = 1e6;
74+
for (unsigned int i = 0; i < big_stopping_criteria; ++i)
7475
{
7576
sum += i;
7677
}
77-
7878
localTimer.Stop();
79+
// Need to use the variable sum to ensure that it is not optimized away.
80+
std::cout << " Time for simple addition summing loop with " << big_stopping_criteria
81+
<< " iterations: " << localTimer.GetMean() << " sum = (" << sum << ")\n";
7982
}
8083

8184
if (!CheckTimeProbe(localTimer))

test/itkTimeProbesTest2.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ TestTransformPhysicalPointToIndex(T * image)
6262
for (int i = 0; i < 1000; i++)
6363
{
6464
point3D[0] = static_cast<typename itk::NumericTraits<typename T::PointType>::ValueType>(i);
65-
image->TransformPhysicalPointToIndex(point3D, index3D);
65+
index3D = image->TransformPhysicalPointToIndex(point3D);
6666
}
6767
}
6868
if (k == 5)
69-
std::cout << point3D << std::endl;
69+
{
70+
std::cout << point3D << " at " << index3D << std::endl;
71+
}
7072
}
7173
}
7274
//-------------------------

0 commit comments

Comments
 (0)