QTransform: initialize the d member

Although never used, the d member triggers all sorts of warnings
when copying a QTransform around because it's technically
undefined behavior (reading from an uninitialized variable).

Change-Id: If06b6bea6f0ec0623c38ba330d46958b373cdc65
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
Giuseppe D'Angelo 2014-09-20 17:38:02 +02:00
parent 8c2f0ac382
commit fb8c795302
2 changed files with 12 additions and 2 deletions

View File

@ -258,6 +258,7 @@ QTransform::QTransform()
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxNone)
, d(Q_NULLPTR)
{
}
@ -276,6 +277,7 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h13,
, m_13(h13), m_23(h23), m_33(h33)
, m_type(TxNone)
, m_dirty(TxProject)
, d(Q_NULLPTR)
{
}
@ -292,6 +294,7 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h21,
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxShear)
, d(Q_NULLPTR)
{
}
@ -307,6 +310,7 @@ QTransform::QTransform(const QMatrix &mtx)
m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxShear)
, d(Q_NULLPTR)
{
}

View File

@ -162,12 +162,18 @@ private:
: affine(h11, h12, h21, h22, h31, h32, true)
, m_13(h13), m_23(h23), m_33(h33)
, m_type(TxNone)
, m_dirty(TxProject) {}
, m_dirty(TxProject)
, d(Q_NULLPTR)
{
}
inline QTransform(bool)
: affine(true)
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxNone) {}
, m_dirty(TxNone)
, d(Q_NULLPTR)
{
}
inline TransformationType inline_type() const;
QMatrix affine;
qreal m_13;