From b05de51a8defba742edf6621ea0bf1f96b4c6ff3 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 6 Apr 2023 08:48:02 -0400 Subject: [PATCH] Fix a few Coverity issues. --- include/eda_text.h | 8 ++------ include/font/text_attributes.h | 16 ++++++---------- include/gal/color4d.h | 6 +----- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/include/eda_text.h b/include/eda_text.h index 70fd38b7f0..f48c11ea0a 100644 --- a/include/eda_text.h +++ b/include/eda_text.h @@ -423,12 +423,8 @@ struct std::hash { std::size_t operator()( const EDA_TEXT& aText ) const { - std::size_t seed; - - hash_combine( seed, aText.GetText(), aText.GetAttributes(), aText.GetTextPos().x, - aText.GetTextPos().y ); - - return seed; + return hash_val( aText.GetText(), aText.GetAttributes(), aText.GetTextPos().x, + aText.GetTextPos().y ); } }; diff --git a/include/font/text_attributes.h b/include/font/text_attributes.h index e153b4267d..4faa9f8a04 100644 --- a/include/font/text_attributes.h +++ b/include/font/text_attributes.h @@ -97,16 +97,12 @@ struct std::hash { std::size_t operator()( const TEXT_ATTRIBUTES& aAttributes ) const { - std::size_t seed; - - hash_combine( seed, aAttributes.m_Font, aAttributes.m_Halign, aAttributes.m_Valign, - aAttributes.m_Angle.AsDegrees(), aAttributes.m_LineSpacing, - aAttributes.m_StrokeWidth, aAttributes.m_Italic, aAttributes.m_Bold, - aAttributes.m_Underlined, aAttributes.m_Color, aAttributes.m_Visible, - aAttributes.m_Mirrored, aAttributes.m_Multiline, aAttributes.m_Size.x, - aAttributes.m_Size.y ); - - return seed; + return hash_val( aAttributes.m_Font, aAttributes.m_Halign, aAttributes.m_Valign, + aAttributes.m_Angle.AsDegrees(), aAttributes.m_LineSpacing, + aAttributes.m_StrokeWidth, aAttributes.m_Italic, aAttributes.m_Bold, + aAttributes.m_Underlined, aAttributes.m_Color, aAttributes.m_Visible, + aAttributes.m_Mirrored, aAttributes.m_Multiline, aAttributes.m_Size.x, + aAttributes.m_Size.y ); } }; diff --git a/include/gal/color4d.h b/include/gal/color4d.h index f1fa893503..319286abbb 100644 --- a/include/gal/color4d.h +++ b/include/gal/color4d.h @@ -441,11 +441,7 @@ struct std::hash { std::size_t operator()( const KIGFX::COLOR4D& aColor ) const { - std::size_t seed; - - hash_combine( seed, aColor.r, aColor.b, aColor.g, aColor.a ); - - return seed; + return hash_val( aColor.r, aColor.b, aColor.g, aColor.a ); } };