File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,10 +65,10 @@ class Q_GUI_EXPORT QMatrix // 2D transform matrix
6565#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
6666 // ### Qt 6: remove; the compiler-generated ones are fine!
6767 QMatrix &operator =(QMatrix &&other) Q_DECL_NOTHROW // = default
68- { memcpy (this , &other, sizeof (QMatrix)); return *this ; }
68+ { memcpy (static_cast < void *>( this ), static_cast < void *>( &other) , sizeof (QMatrix)); return *this ; }
6969 QMatrix &operator =(const QMatrix &) Q_DECL_NOTHROW; // = default
7070 QMatrix (QMatrix &&other) Q_DECL_NOTHROW // = default
71- { memcpy (this , &other, sizeof (QMatrix)); }
71+ { memcpy (static_cast < void *>( this ), static_cast < void *>( &other) , sizeof (QMatrix)); }
7272 QMatrix (const QMatrix &other) Q_DECL_NOTHROW; // = default
7373#endif
7474
Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ class Q_GUI_EXPORT QTransform
7878#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
7979 // ### Qt 6: remove; the compiler-generated ones are fine!
8080 QTransform &operator =(QTransform &&other) Q_DECL_NOTHROW // = default
81- { memcpy (this , &other, sizeof (QTransform)); return *this ; }
81+ { memcpy (static_cast < void *>( this ), static_cast < void *>( &other) , sizeof (QTransform)); return *this ; }
8282 QTransform &operator =(const QTransform &) Q_DECL_NOTHROW; // = default
8383 QTransform (QTransform &&other) Q_DECL_NOTHROW // = default
8484 : affine(Qt::Uninitialized)
85- { memcpy (this , &other, sizeof (QTransform)); }
85+ { memcpy (static_cast < void *>( this ), static_cast < void *>( &other) , sizeof (QTransform)); }
8686 QTransform (const QTransform &other) Q_DECL_NOTHROW // = default
8787 : affine(Qt::Uninitialized)
88- { memcpy (this , &other, sizeof (QTransform)); }
88+ { memcpy (static_cast < void *>( this ), static_cast < const void *>( &other) , sizeof (QTransform)); }
8989#endif
9090
9191 bool isAffine () const ;
Original file line number Diff line number Diff line change @@ -236,13 +236,13 @@ struct QGlyphLayout
236236 last = numGlyphs;
237237 if (first == 0 && last == numGlyphs
238238 && reinterpret_cast <char *>(offsets + numGlyphs) == reinterpret_cast <char *>(glyphs)) {
239- memset (offsets, 0 , (numGlyphs * SpaceNeeded));
239+ memset (static_cast < void *>( offsets) , 0 , (numGlyphs * SpaceNeeded));
240240 } else {
241241 const int num = last - first;
242- memset (offsets + first, 0 , num * sizeof (QFixedPoint));
242+ memset (static_cast < void *>( offsets + first) , 0 , num * sizeof (QFixedPoint));
243243 memset (glyphs + first, 0 , num * sizeof (glyph_t ));
244- memset (advances + first, 0 , num * sizeof (QFixed));
245- memset (justifications + first, 0 , num * sizeof (QGlyphJustification));
244+ memset (static_cast < void *>( advances + first) , 0 , num * sizeof (QFixed));
245+ memset (static_cast < void *>( justifications + first) , 0 , num * sizeof (QGlyphJustification));
246246 memset (attributes + first, 0 , num * sizeof (QGlyphAttributes));
247247 }
248248 }
Original file line number Diff line number Diff line change @@ -154,9 +154,9 @@ class Q_GUI_EXPORT QTextFrame : public QTextObject
154154 iterator (const iterator &o) Q_DECL_NOTHROW; // = default
155155 iterator &operator =(const iterator &o) Q_DECL_NOTHROW; // = default
156156 iterator (iterator &&other) Q_DECL_NOTHROW // = default
157- { memcpy (this , &other, sizeof (iterator)); }
157+ { memcpy (static_cast < void *>( this ), static_cast < void *>( &other) , sizeof (iterator)); }
158158 iterator &operator =(iterator &&other) Q_DECL_NOTHROW // = default
159- { memcpy (this , &other, sizeof (iterator)); return *this ; }
159+ { memcpy (static_cast < void *>( this ), static_cast < void *>( &other) , sizeof (iterator)); return *this ; }
160160#endif
161161
162162 QTextFrame *parentFrame () const { return f; }
You can’t perform that action at this time.
0 commit comments