From d81afb036b4dfa0372482d8ae3007e27d4b845a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 22 Aug 2023 15:20:53 +0200 Subject: [PATCH] Fixed some cppcheck warnings --- src/OpenMesh/Core/IO/SR_binary_spec.hh | 10 +++++----- src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh | 4 ++-- src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh | 4 ++-- src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/OpenMesh/Core/IO/SR_binary_spec.hh b/src/OpenMesh/Core/IO/SR_binary_spec.hh index d220b398..265b35be 100644 --- a/src/OpenMesh/Core/IO/SR_binary_spec.hh +++ b/src/OpenMesh/Core/IO/SR_binary_spec.hh @@ -190,20 +190,20 @@ SIMPLE_BINARY(unsigned long); static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ - size_t i, b = size_of(_val), N = value_type::size_; \ + size_t b = size_of(_val), N = value_type::size_; \ if (_swap) \ - for (i=0; i::set_error_tolerance_factor(double _factor) { // the smaller the factor, the smaller edge_length_ gets // thus creating a stricter constraint // division by error_tolerance_factor_ is for normalization - typename Mesh::Scalar edge_length = edge_length_ * static_cast(_factor / this->error_tolerance_factor_); - set_edge_length(edge_length); + typename Mesh::Scalar new_edge_length = edge_length_ * static_cast(_factor / this->error_tolerance_factor_); + set_edge_length(new_edge_length); this->error_tolerance_factor_ = _factor; } } diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh b/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh index 5df959da..af310721 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh @@ -267,8 +267,8 @@ void ModHausdorffT::set_error_tolerance_factor(double _factor) { // the smaller the factor, the smaller tolerance gets // thus creating a stricter constraint // division by error_tolerance_factor_ is for normalization - Scalar tolerance = tolerance_ * Scalar(_factor / this->error_tolerance_factor_); - set_tolerance(tolerance); + Scalar new_tolerance = tolerance_ * Scalar(_factor / this->error_tolerance_factor_); + set_tolerance(new_tolerance); this->error_tolerance_factor_ = _factor; } } diff --git a/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh b/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh index cabbe7c5..718ca0a8 100644 --- a/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh @@ -139,8 +139,8 @@ void ModQuadricT::set_error_tolerance_factor(double _factor) { // the smaller the factor, the smaller max_err_ gets // thus creating a stricter constraint // division by error_tolerance_factor_ is for normalization - double max_err = max_err_ * _factor / this->error_tolerance_factor_; - set_max_err(max_err); + double new_max_err = max_err_ * _factor / this->error_tolerance_factor_; + set_max_err(new_max_err); this->error_tolerance_factor_ = _factor; initialize();