From 3dcc075f4a5efce348a6fa00cf5a0adef97b1089 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Apr 2017 16:22:46 -0700 Subject: Move Q_REQUIRED_RESULT to its correct position That's before the return type or static, inline, constexpr or such keywords (if any). Perl Script: s/^(\s+)(.*) Q_REQUIRED_RESULT(;)?(\s*\/\/.*)?$/\1Q_REQUIRED_RESULT \2\3\4/ Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/image/qimage.h | 8 ++++---- src/gui/math3d/qgenericmatrix.h | 2 +- src/gui/math3d/qquaternion.h | 6 +++--- src/gui/math3d/qvector2d.h | 2 +- src/gui/math3d/qvector4d.h | 2 +- src/gui/painting/qcolor.h | 10 +++++----- src/gui/painting/qmatrix.h | 2 +- src/gui/painting/qpainterpath.h | 16 ++++++++-------- src/gui/painting/qpolygon.h | 18 +++++++++--------- src/gui/painting/qregion.h | 28 ++++++++++++++-------------- src/gui/painting/qtransform.h | 6 +++--- 11 files changed, 50 insertions(+), 50 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 204e7a54b2..225ef3d2e8 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -179,9 +179,9 @@ public: Format format() const; #if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QIMAGE_COMPAT_CPP) - Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const & { return convertToFormat_helper(f, flags); } - Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) && { if (convertToFormat_inplace(f, flags)) return std::move(*this); @@ -189,9 +189,9 @@ public: return convertToFormat_helper(f, flags); } #else - QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const; #endif - QImage convertToFormat(Format f, const QVector &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QImage convertToFormat(Format f, const QVector &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const; bool reinterpretAsFormat(Format f); int width() const; diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 9a1ab54124..6a2a9e5bae 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -64,7 +64,7 @@ public: void fill(T value); - QGenericMatrix transposed() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QGenericMatrix transposed() const; QGenericMatrix& operator+=(const QGenericMatrix& other); QGenericMatrix& operator-=(const QGenericMatrix& other); diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index eff427117f..7f7f89db4d 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -90,14 +90,14 @@ public: float length() const; float lengthSquared() const; - QQuaternion normalized() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QQuaternion normalized() const; void normalize(); inline QQuaternion inverted() const; - QQuaternion conjugated() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QQuaternion conjugated() const; #if QT_DEPRECATED_SINCE(5, 5) - QT_DEPRECATED QQuaternion conjugate() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QT_DEPRECATED QQuaternion conjugate() const; #endif QVector3D rotatedVector(const QVector3D& vector) const; diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h index bdb56c9c1f..5e0394b998 100644 --- a/src/gui/math3d/qvector2d.h +++ b/src/gui/math3d/qvector2d.h @@ -82,7 +82,7 @@ public: float length() const; float lengthSquared() const; //In Qt 6 convert to inline and constexpr - QVector2D normalized() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QVector2D normalized() const; void normalize(); float distanceToPoint(const QVector2D &point) const; diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h index f63b2f141b..be373aa806 100644 --- a/src/gui/math3d/qvector4d.h +++ b/src/gui/math3d/qvector4d.h @@ -88,7 +88,7 @@ public: float length() const; float lengthSquared() const; //In Qt 6 convert to inline and constexpr - QVector4D normalized() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QVector4D normalized() const; void normalize(); QVector4D &operator+=(const QVector4D &vector); diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index 22fcbcb2a8..83a93e25ea 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -191,7 +191,7 @@ public: QColor toCmyk() const Q_DECL_NOTHROW; QColor toHsl() const Q_DECL_NOTHROW; - QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW; static QColor fromRgb(QRgb rgb) Q_DECL_NOTHROW; static QColor fromRgba(QRgb rgba) Q_DECL_NOTHROW; @@ -211,10 +211,10 @@ public: static QColor fromHsl(int h, int s, int l, int a = 255); static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0); - QColor light(int f = 150) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - QColor lighter(int f = 150) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - QColor dark(int f = 200) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - QColor darker(int f = 200) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW; bool operator==(const QColor &c) const Q_DECL_NOTHROW; bool operator!=(const QColor &c) const Q_DECL_NOTHROW; diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index 76bf61671c..15e0ab5be1 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -108,7 +108,7 @@ public: bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); } qreal determinant() const { return _m11*_m22 - _m12*_m21; } - QMatrix inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QMatrix inverted(bool *invertible = Q_NULLPTR) const; bool operator==(const QMatrix &) const; bool operator!=(const QMatrix &) const; diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 131fcde8cc..db39c1c5a0 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -154,8 +154,8 @@ public: void translate(qreal dx, qreal dy); inline void translate(const QPointF &offset); - QPainterPath translated(qreal dx, qreal dy) const Q_REQUIRED_RESULT; - inline QPainterPath translated(const QPointF &offset) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPainterPath translated(qreal dx, qreal dy) const; + Q_REQUIRED_RESULT inline QPainterPath translated(const QPointF &offset) const; QRectF boundingRect() const; QRectF controlPointRect() const; @@ -165,7 +165,7 @@ public: bool isEmpty() const; - QPainterPath toReversed() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPainterPath toReversed() const; QList toSubpathPolygons(const QMatrix &matrix = QMatrix()) const; QList toFillPolygons(const QMatrix &matrix = QMatrix()) const; QPolygonF toFillPolygon(const QMatrix &matrix = QMatrix()) const; @@ -185,12 +185,12 @@ public: bool intersects(const QPainterPath &p) const; bool contains(const QPainterPath &p) const; - QPainterPath united(const QPainterPath &r) const Q_REQUIRED_RESULT; - QPainterPath intersected(const QPainterPath &r) const Q_REQUIRED_RESULT; - QPainterPath subtracted(const QPainterPath &r) const Q_REQUIRED_RESULT; - QPainterPath subtractedInverted(const QPainterPath &r) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPainterPath united(const QPainterPath &r) const; + Q_REQUIRED_RESULT QPainterPath intersected(const QPainterPath &r) const; + Q_REQUIRED_RESULT QPainterPath subtracted(const QPainterPath &r) const; + Q_REQUIRED_RESULT QPainterPath subtractedInverted(const QPainterPath &r) const; - QPainterPath simplified() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPainterPath simplified() const; bool operator==(const QPainterPath &other) const; bool operator!=(const QPainterPath &other) const; diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h index c57802e84e..f192e8d10b 100644 --- a/src/gui/painting/qpolygon.h +++ b/src/gui/painting/qpolygon.h @@ -78,8 +78,8 @@ public: void translate(int dx, int dy); void translate(const QPoint &offset); - QPolygon translated(int dx, int dy) const Q_REQUIRED_RESULT; - inline QPolygon translated(const QPoint &offset) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPolygon translated(int dx, int dy) const; + Q_REQUIRED_RESULT inline QPolygon translated(const QPoint &offset) const; QRect boundingRect() const; @@ -95,9 +95,9 @@ public: bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const; - QPolygon united(const QPolygon &r) const Q_REQUIRED_RESULT; - QPolygon intersected(const QPolygon &r) const Q_REQUIRED_RESULT; - QPolygon subtracted(const QPolygon &r) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPolygon united(const QPolygon &r) const; + Q_REQUIRED_RESULT QPolygon intersected(const QPolygon &r) const; + Q_REQUIRED_RESULT QPolygon subtracted(const QPolygon &r) const; }; Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygon) @@ -162,7 +162,7 @@ public: void translate(const QPointF &offset); inline QPolygonF translated(qreal dx, qreal dy) const; - QPolygonF translated(const QPointF &offset) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPolygonF translated(const QPointF &offset) const; QPolygon toPolygon() const; @@ -172,9 +172,9 @@ public: bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const; - QPolygonF united(const QPolygonF &r) const Q_REQUIRED_RESULT; - QPolygonF intersected(const QPolygonF &r) const Q_REQUIRED_RESULT; - QPolygonF subtracted(const QPolygonF &r) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QPolygonF united(const QPolygonF &r) const; + Q_REQUIRED_RESULT QPolygonF intersected(const QPolygonF &r) const; + Q_REQUIRED_RESULT QPolygonF subtracted(const QPolygonF &r) const; }; Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygonF) diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index 4f0a071da8..8dd7649447 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -99,23 +99,23 @@ public: void translate(int dx, int dy); inline void translate(const QPoint &p) { translate(p.x(), p.y()); } - QRegion translated(int dx, int dy) const Q_REQUIRED_RESULT; - inline QRegion translated(const QPoint &p) const Q_REQUIRED_RESULT { return translated(p.x(), p.y()); } + Q_REQUIRED_RESULT QRegion translated(int dx, int dy) const; + Q_REQUIRED_RESULT inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); } - QRegion united(const QRegion &r) const Q_REQUIRED_RESULT; - QRegion united(const QRect &r) const Q_REQUIRED_RESULT; - QRegion intersected(const QRegion &r) const Q_REQUIRED_RESULT; - QRegion intersected(const QRect &r) const Q_REQUIRED_RESULT; - QRegion subtracted(const QRegion &r) const Q_REQUIRED_RESULT; - QRegion xored(const QRegion &r) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QRegion united(const QRegion &r) const; + Q_REQUIRED_RESULT QRegion united(const QRect &r) const; + Q_REQUIRED_RESULT QRegion intersected(const QRegion &r) const; + Q_REQUIRED_RESULT QRegion intersected(const QRect &r) const; + Q_REQUIRED_RESULT QRegion subtracted(const QRegion &r) const; + Q_REQUIRED_RESULT QRegion xored(const QRegion &r) const; #if QT_DEPRECATED_SINCE(5, 0) - inline QT_DEPRECATED QRegion unite(const QRegion &r) const Q_REQUIRED_RESULT { return united(r); } - inline QT_DEPRECATED QRegion unite(const QRect &r) const Q_REQUIRED_RESULT { return united(r); } - inline QT_DEPRECATED QRegion intersect(const QRegion &r) const Q_REQUIRED_RESULT { return intersected(r); } - inline QT_DEPRECATED QRegion intersect(const QRect &r) const Q_REQUIRED_RESULT { return intersected(r); } - inline QT_DEPRECATED QRegion subtract(const QRegion &r) const Q_REQUIRED_RESULT { return subtracted(r); } - inline QT_DEPRECATED QRegion eor(const QRegion &r) const Q_REQUIRED_RESULT { return xored(r); } + Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion unite(const QRegion &r) const { return united(r); } + Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion unite(const QRect &r) const { return united(r); } + Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion intersect(const QRegion &r) const { return intersected(r); } + Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion intersect(const QRect &r) const { return intersected(r); } + Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion subtract(const QRegion &r) const { return subtracted(r); } + Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion eor(const QRegion &r) const { return xored(r); } #endif bool intersects(const QRegion &r) const; diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index 5ca1d46982..06ae611861 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -116,9 +116,9 @@ public: qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33); - QTransform inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT; - QTransform adjoint() const Q_REQUIRED_RESULT; - QTransform transposed() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QTransform inverted(bool *invertible = Q_NULLPTR) const; + Q_REQUIRED_RESULT QTransform adjoint() const; + Q_REQUIRED_RESULT QTransform transposed() const; QTransform &translate(qreal dx, qreal dy); QTransform &scale(qreal sx, qreal sy); -- cgit v1.2.3