Fix constructor warnings when building with GCC 9
authorRicardo Garcia <rgarcia@igalia.com>
Mon, 6 May 2019 11:10:12 +0000 (13:10 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 9 May 2019 11:16:36 +0000 (07:16 -0400)
When building vk-gl-cts with GCC 9 the building process prints a lot of
warnings related to contructors and assignment operators. This prevents
scripts/check_build_sanity.py from completing successfully on those
systems. This commit fixes those warnings.

Components: Framework
VK-GL-CTS issue: 1765

Change-Id: Ibab73d084488079802116fff55a17636e976c0fc

framework/common/tcuVector.hpp
framework/referencerenderer/rrGenericVector.hpp

index 2b40a18..0a156d5 100644 (file)
@@ -154,6 +154,7 @@ public:
        // Operators.
        Vector<T, Size>&                operator+=      (const Vector<T, Size>& v);
        Vector<T, Size>&                operator-=      (const Vector<T, Size>& v);
+       Vector<T, Size>&                operator=       (const Vector<T, Size>& v);
 
        const T&                                operator[]      (int ndx) const         { DE_ASSERT(de::inBounds(ndx, 0, Size)); return m_data[ndx]; }
        T&                                              operator[]      (int ndx)                       { DE_ASSERT(de::inBounds(ndx, 0, Size)); return m_data[ndx]; }
@@ -218,6 +219,14 @@ inline Vector<T, Size>::Vector (const Vector<T, Size>& v)
 }
 
 template <typename T, int Size>
+inline Vector<T, Size>& Vector<T, Size>::operator=(const Vector<T, Size>& v)
+{
+       for (int i = 0; i < Size; i++)
+               m_data[i] = v.m_data[i];
+       return *this;
+}
+
+template <typename T, int Size>
 inline Vector<T, Size>::Vector (const T (&v)[Size])
 {
        for (int i = 0; i < Size; i++)
index d2e5aa2..b19ae0f 100644 (file)
@@ -72,6 +72,14 @@ public:
                *this = value;
        }
 
+       inline GenericVec4 (const GenericVec4& other)
+       {
+               v.iData[0] = other.v.iData[0];
+               v.iData[1] = other.v.iData[1];
+               v.iData[2] = other.v.iData[2];
+               v.iData[3] = other.v.iData[3];
+       }
+
        GenericVec4& operator= (const GenericVec4& value)
        {
                v.iData[0] = value.v.iData[0];