Skip to content

Commit ce455e9

Browse files
committed
Added const to resolve cppcheck reporting suggestion.
1 parent bf4790c commit ce455e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vsg/io/BinaryInput.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void BinaryInput::read(size_t num, long double* value)
127127
std::vector<double> data(num);
128128
_read(num, data.data());
129129

130-
for (auto& v : data)
130+
for (const auto& v : data)
131131
{
132132
*(value++) = v;
133133
}
@@ -141,7 +141,7 @@ void BinaryInput::read(size_t num, long double* value)
141141
if (native_type == 64)
142142
{
143143
double_64* dest = reinterpret_cast<double_64*>(value);
144-
for (auto& v : data)
144+
for (const auto& v : data)
145145
{
146146
auto& d = *(dest++);
147147
d.sign = v.sign;
@@ -152,7 +152,7 @@ void BinaryInput::read(size_t num, long double* value)
152152
else if (native_type == 80)
153153
{
154154
double_128* dest = reinterpret_cast<double_128*>(value);
155-
for (auto& v : data)
155+
for (const auto& v : data)
156156
{
157157
auto& d = *(dest++);
158158
d.sign = v.sign;
@@ -165,7 +165,7 @@ void BinaryInput::read(size_t num, long double* value)
165165
else if (native_type == 128)
166166
{
167167
double_128* dest = reinterpret_cast<double_128*>(value);
168-
for (auto& v : data)
168+
for (const auto& v : data)
169169
{
170170
auto& d = *(dest++);
171171
d.sign = v.sign;

0 commit comments

Comments
 (0)