diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qarraydata.h | 14 | ||||
-rw-r--r-- | src/corelib/tools/qeasingcurve.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qversionnumber.cpp | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index dcd95924c1..5e21186bbd 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -56,16 +56,16 @@ struct Q_CORE_EXPORT QArrayData void *data() { - Q_ASSERT(size == 0 - || offset < 0 || size_t(offset) >= sizeof(QArrayData)); - return reinterpret_cast<char *>(this) + offset; + Q_ASSERT(size == 0 || offset < 0 || size_t(offset) >= sizeof(QArrayData)); + const quintptr self = reinterpret_cast<qintptr>(this); + return reinterpret_cast<void *>(self + offset); } const void *data() const { - Q_ASSERT(size == 0 - || offset < 0 || size_t(offset) >= sizeof(QArrayData)); - return reinterpret_cast<const char *>(this) + offset; + Q_ASSERT(size == 0 || offset < 0 || size_t(offset) >= sizeof(QArrayData)); + const quintptr self = reinterpret_cast<qintptr>(this); + return reinterpret_cast<const void *>(self + offset); } // This refers to array data mutability, not "header data" represented by diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 62d2fa33ae..5cf548f4bf 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1356,7 +1356,7 @@ QVector<QPointF> static inline tcbToBezier(const TCBPoints &tcbPoints) /*! Adds a segment of a TCB bezier spline to define a custom easing curve. It is only applicable if type() is QEasingCurve::TCBSpline. - The spline has to start explitly at (0.0, 0.0) and has to end at (1.0, 1.0) to + The spline has to start explicitly at (0.0, 0.0) and has to end at (1.0, 1.0) to be a valid easing curve. The tension \a t changes the length of the tangent vector. The continuity \a c changes the sharpness in change between the tangents. diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp index 58e3c15560..575d7b12a5 100644 --- a/src/corelib/tools/qversionnumber.cpp +++ b/src/corelib/tools/qversionnumber.cpp @@ -189,7 +189,7 @@ QVector<int> QVersionNumber::segments() const /*! \fn int QVersionNumber::segmentAt(int index) const - Returns the segement value at \a index. If the index does not exist, + Returns the segment value at \a index. If the index does not exist, returns 0. \sa segments(), segmentCount() |