Skip to content

Commit

Permalink
Added const to resolve cppcheck reporting suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Nov 28, 2024
1 parent bf4790c commit ce455e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vsg/io/BinaryInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void BinaryInput::read(size_t num, long double* value)
std::vector<double> data(num);
_read(num, data.data());

for (auto& v : data)
for (const auto& v : data)
{
*(value++) = v;
}
Expand All @@ -141,7 +141,7 @@ void BinaryInput::read(size_t num, long double* value)
if (native_type == 64)
{
double_64* dest = reinterpret_cast<double_64*>(value);
for (auto& v : data)
for (const auto& v : data)
{
auto& d = *(dest++);
d.sign = v.sign;
Expand All @@ -152,7 +152,7 @@ void BinaryInput::read(size_t num, long double* value)
else if (native_type == 80)
{
double_128* dest = reinterpret_cast<double_128*>(value);
for (auto& v : data)
for (const auto& v : data)
{
auto& d = *(dest++);
d.sign = v.sign;
Expand All @@ -165,7 +165,7 @@ void BinaryInput::read(size_t num, long double* value)
else if (native_type == 128)
{
double_128* dest = reinterpret_cast<double_128*>(value);
for (auto& v : data)
for (const auto& v : data)
{
auto& d = *(dest++);
d.sign = v.sign;
Expand Down

0 comments on commit ce455e9

Please sign in to comment.