Skip to content

Commit

Permalink
Apply clang-tidy readability-avoid-const-params-in-decls fixit
Browse files Browse the repository at this point in the history
Checks whether a function declaration has parameters that are
top level const.

const values in declarations do not affect the signature of a
function, so they should not be put there.
  • Loading branch information
nyalldawson committed Jun 5, 2018
1 parent e91aed6 commit 2ed144a
Show file tree
Hide file tree
Showing 203 changed files with 567 additions and 561 deletions.
Expand Up @@ -35,7 +35,7 @@ Determine making the graph from vector line layer
const QString &directDirectionValue,
const QString &reverseDirectionValue,
const QString &bothDirectionValue,
const Direction defaultDirection
Direction defaultDirection
);
%Docstring
Default constructor
Expand Down
6 changes: 3 additions & 3 deletions python/core/auto_generated/effects/qgseffectstack.sip.in
Expand Up @@ -93,7 +93,7 @@ Appends an effect to the end of the stack.
.. seealso:: :py:func:`insertEffect`
%End

bool insertEffect( const int index, QgsPaintEffect *effect /Transfer/ );
bool insertEffect( int index, QgsPaintEffect *effect /Transfer/ );
%Docstring
Inserts an effect at a specified index within the stack.

Expand All @@ -104,7 +104,7 @@ Inserts an effect at a specified index within the stack.
.. seealso:: :py:func:`appendEffect`
%End

bool changeEffect( const int index, QgsPaintEffect *effect /Transfer/ );
bool changeEffect( int index, QgsPaintEffect *effect /Transfer/ );
%Docstring
Replaces the effect at a specified position within the stack.

Expand All @@ -113,7 +113,7 @@ Replaces the effect at a specified position within the stack.
transferred to the stack object.
%End

QgsPaintEffect *takeEffect( const int index /TransferBack/ );
QgsPaintEffect *takeEffect( int index /TransferBack/ );
%Docstring
Removes an effect from the stack and returns a pointer to it.

Expand Down
14 changes: 7 additions & 7 deletions python/core/auto_generated/effects/qgsimageoperation.sip.in
Expand Up @@ -46,15 +46,15 @@ on which is faster for the particular operation.
FlipVertical
};

static void convertToGrayscale( QImage &image, const GrayscaleMode mode = GrayscaleLuminosity );
static void convertToGrayscale( QImage &image, GrayscaleMode mode = GrayscaleLuminosity );
%Docstring
Convert a QImage to a grayscale image. Alpha channel is preserved.

:param image: QImage to convert
:param mode: mode to use during grayscale conversion
%End

static void adjustBrightnessContrast( QImage &image, const int brightness, const double contrast );
static void adjustBrightnessContrast( QImage &image, int brightness, double contrast );
%Docstring
Alter the brightness or contrast of a QImage.

Expand All @@ -67,8 +67,8 @@ Alter the brightness or contrast of a QImage.
contrast of the image.
%End

static void adjustHueSaturation( QImage &image, const double saturation, const QColor &colorizeColor = QColor(),
const double colorizeStrength = 1.0 );
static void adjustHueSaturation( QImage &image, double saturation, const QColor &colorizeColor = QColor(),
double colorizeStrength = 1.0 );
%Docstring
Alter the hue or saturation of a QImage.

Expand All @@ -79,7 +79,7 @@ Alter the hue or saturation of a QImage.
:param colorizeStrength: double between 0 and 1, where 0 = no colorization and 1.0 = full colorization
%End

static void multiplyOpacity( QImage &image, const double factor );
static void multiplyOpacity( QImage &image, double factor );
%Docstring
Multiplies opacity of image pixel values by a factor.

Expand Down Expand Up @@ -118,7 +118,7 @@ using a color ramp.
for the distance transform operation
%End

static void stackBlur( QImage &image, const int radius, const bool alphaOnly = false );
static void stackBlur( QImage &image, int radius, bool alphaOnly = false );
%Docstring
Performs a stack blur on an image. Stack blur represents a good balance between
speed and blur quality.
Expand All @@ -133,7 +133,7 @@ speed and blur quality.
alphaOnly is set to false, or ARGB32 if alphaOnly is true
%End

static QImage *gaussianBlur( QImage &image, const int radius ) /Factory/;
static QImage *gaussianBlur( QImage &image, int radius ) /Factory/;
%Docstring
Performs a gaussian blur on an image. Gaussian blur is slower but results in a high
quality blur.
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/effects/qgspainteffect.sip.in
Expand Up @@ -196,7 +196,7 @@ Returns whether the effect is enabled
.. seealso:: :py:func:`setEnabled`
%End

void setEnabled( const bool enabled );
void setEnabled( bool enabled );
%Docstring
Sets whether the effect is enabled

Expand All @@ -215,7 +215,7 @@ effect if the paint effect is used in a :py:class:`QgsEffectStack`.
.. seealso:: :py:func:`setDrawMode`
%End

void setDrawMode( const DrawMode drawMode );
void setDrawMode( DrawMode drawMode );
%Docstring
Sets the draw mode for the effect. This property only has an
effect if the paint effect is used in a :py:class:`QgsEffectStack`.
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/expression/qgsexpression.sip.in
Expand Up @@ -388,7 +388,7 @@ This function returns variables in each expression between [% and %].
.. versionadded:: 3.2
%End

static double evaluateToDouble( const QString &text, const double fallbackValue );
static double evaluateToDouble( const QString &text, double fallbackValue );
%Docstring
Attempts to evaluate a text string as an expression to a resultant double
value.
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/geometry/qgscircle.sip.in
Expand Up @@ -196,7 +196,7 @@ Note that this method is 2D only and does not consider the z-value of the circle



virtual void setSemiMajorAxis( const double semiMajorAxis );
virtual void setSemiMajorAxis( double semiMajorAxis );

%Docstring
Inherited method. Use setRadius instead.
Expand All @@ -206,7 +206,7 @@ Inherited method. Use setRadius instead.
.. seealso:: :py:func:`setRadius`
%End

virtual void setSemiMinorAxis( const double semiMinorAxis );
virtual void setSemiMinorAxis( double semiMinorAxis );

%Docstring
Inherited method. Use setRadius instead.
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/geometry/qgsellipse.sip.in
Expand Up @@ -34,7 +34,7 @@ Constructor for QgsEllipse.

virtual ~QgsEllipse();

QgsEllipse( const QgsPoint &center, const double semiMajorAxis, const double semiMinorAxis, const double azimuth = 90 );
QgsEllipse( const QgsPoint &center, double semiMajorAxis, double semiMinorAxis, double azimuth = 90 );
%Docstring
Constructs an ellipse by defining all the members.

Expand Down Expand Up @@ -146,21 +146,21 @@ Sets the center point.
.. seealso:: :py:func:`rcenter`
%End

virtual void setSemiMajorAxis( const double semiMajorAxis );
virtual void setSemiMajorAxis( double semiMajorAxis );
%Docstring
Sets the semi-major axis.

.. seealso:: :py:func:`semiMajorAxis`
%End

virtual void setSemiMinorAxis( const double semiMinorAxis );
virtual void setSemiMinorAxis( double semiMinorAxis );
%Docstring
Sets the semi-minor axis.

.. seealso:: :py:func:`semiMinorAxis`
%End

void setAzimuth( const double azimuth );
void setAzimuth( double azimuth );
%Docstring
Sets the azimuth (orientation).

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgsgeometry.sip.in
Expand Up @@ -1751,7 +1751,7 @@ The 2 types should match.
}
%End

QgsGeometry smooth( const unsigned int iterations = 1, const double offset = 0.25,
QgsGeometry smooth( unsigned int iterations = 1, double offset = 0.25,
double minimumDistance = -1.0, double maxAngle = 180.0 ) const;
%Docstring
Smooths a geometry by rounding off corners using the Chaikin algorithm. This operation
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/geometry/qgsgeometryutils.sip.in
Expand Up @@ -102,7 +102,7 @@ supported and is retrieved from the first 3D point amongst ``p1`` and
:return: Whether the lines intersect
%End

static bool segmentIntersection( const QgsPoint &p1, const QgsPoint &p2, const QgsPoint &q1, const QgsPoint &q2, QgsPoint &intersectionPoint /Out/, bool &isIntersection /Out/, const double tolerance = 1e-8, bool acceptImproperIntersection = false );
static bool segmentIntersection( const QgsPoint &p1, const QgsPoint &p2, const QgsPoint &q1, const QgsPoint &q2, QgsPoint &intersectionPoint /Out/, bool &isIntersection /Out/, double tolerance = 1e-8, bool acceptImproperIntersection = false );
%Docstring
Compute the intersection between two segments

Expand Down Expand Up @@ -140,7 +140,7 @@ Compute the intersection between two segments
# (True, 'Point (0 0)', True)
%End

static bool lineCircleIntersection( const QgsPointXY &center, const double radius,
static bool lineCircleIntersection( const QgsPointXY &center, double radius,
const QgsPointXY &linePoint1, const QgsPointXY &linePoint2,
QgsPointXY &intersection /In,Out/ );
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/geometry/qgslinestring.sip.in
Expand Up @@ -220,6 +220,7 @@ segment in the line.

virtual QPolygonF asQPolygonF() const;


virtual bool fromWkb( QgsConstWkbPtr &wkb );

virtual bool fromWkt( const QString &wkt );
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/geometry/qgsrectangle.sip.in
Expand Up @@ -237,13 +237,13 @@ Expand the rectangle so that covers both the original rectangle and the given re
Expand the rectangle so that covers both the original rectangle and the given point.
%End

QgsRectangle operator-( const QgsVector v ) const;
QgsRectangle operator-( QgsVector v ) const;

QgsRectangle operator+( const QgsVector v ) const;
QgsRectangle operator+( QgsVector v ) const;

QgsRectangle &operator-=( const QgsVector v );
QgsRectangle &operator-=( QgsVector v );

QgsRectangle &operator+=( const QgsVector v );
QgsRectangle &operator+=( QgsVector v );

bool isEmpty() const;
%Docstring
Expand Down
10 changes: 5 additions & 5 deletions python/core/auto_generated/geometry/qgsregularpolygon.sip.in
Expand Up @@ -38,7 +38,7 @@ The regular polygon is defined by a center point with a number of sides/vertices
Constructor for QgsRegularPolygon.
%End

QgsRegularPolygon( const QgsPoint &center, const double radius, const double azimuth, const unsigned int numberSides, const ConstructionOption circle );
QgsRegularPolygon( const QgsPoint &center, double radius, double azimuth, unsigned int numberSides, ConstructionOption circle );
%Docstring
Constructs a regular polygon by ``center`` and parameters for the first vertex. An empty regular polygon is returned if ``numberSides`` < 3 or ``ConstructionOption`` isn't valid.

Expand All @@ -49,7 +49,7 @@ Constructs a regular polygon by ``center`` and parameters for the first vertex.
:param circle: Option to create the polygon. see ConstructionOption
%End

QgsRegularPolygon( const QgsPoint &center, const QgsPoint &pt1, const unsigned int numberSides, const ConstructionOption circle );
QgsRegularPolygon( const QgsPoint &center, const QgsPoint &pt1, unsigned int numberSides, ConstructionOption circle );
%Docstring
Constructs a regular polygon by ``center`` and another point.

Expand All @@ -59,7 +59,7 @@ Constructs a regular polygon by ``center`` and another point.
:param circle: Option to create the polygon inscribed in circle (the radius is the distance between the center and vertices) or circumscribed about circle (the radius is the distance from the center to the midpoints of the sides).
%End

QgsRegularPolygon( const QgsPoint &pt1, const QgsPoint &pt2, const unsigned int numberSides );
QgsRegularPolygon( const QgsPoint &pt1, const QgsPoint &pt2, unsigned int numberSides );
%Docstring
Constructs a regular polygon by two points of the first side.

Expand Down Expand Up @@ -123,7 +123,7 @@ Radius is unchanged. The first vertex is reprojected from the new center.
.. seealso:: :py:func:`center`
%End

void setRadius( const double radius );
void setRadius( double radius );
%Docstring
Sets the radius.
Center is unchanged. The first vertex is reprojected from the center with the new radius.
Expand All @@ -139,7 +139,7 @@ Radius is unchanged. The center is reprojected from the new first vertex.
.. seealso:: :py:func:`firstVertex`
%End

void setNumberSides( const unsigned int numberSides );
void setNumberSides( unsigned int numberSides );
%Docstring
Sets the number of sides.
If numberSides < 3, the number of sides is unchanged.
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgstriangle.sip.in
Expand Up @@ -41,7 +41,7 @@ Construct a QgsTriangle from three :py:class:`QgsPoint`.
:param p3: third point
%End

explicit QgsTriangle( const QPointF p1, const QPointF p2, const QPointF p3 );
explicit QgsTriangle( QPointF p1, QPointF p2, QPointF p3 );
%Docstring
Construct a QgsTriangle from three QPointF.

Expand Down
14 changes: 7 additions & 7 deletions python/core/auto_generated/layout/qgslayout.sip.in
Expand Up @@ -88,7 +88,7 @@ Returns the items model attached to the layout.



QList<QgsLayoutItem *> selectedLayoutItems( const bool includeLockedItems = true );
QList<QgsLayoutItem *> selectedLayoutItems( bool includeLockedItems = true );
%Docstring
Returns list of selected layout items.

Expand Down Expand Up @@ -168,7 +168,7 @@ updating the scene for each one.
.. seealso:: :py:func:`updateZValues`
%End

void updateZValues( const bool addUndoCommands = true );
void updateZValues( bool addUndoCommands = true );
%Docstring
Resets the z-values of items based on their position in the internal
z order list. This should be called after any stacking changes
Expand Down Expand Up @@ -237,13 +237,13 @@ Note that template UUIDs are only available while a layout is being restored fro
.. seealso:: :py:func:`itemByUuid`
%End

QgsLayoutItem *layoutItemAt( QPointF position, const bool ignoreLocked = false ) const;
QgsLayoutItem *layoutItemAt( QPointF position, bool ignoreLocked = false ) const;
%Docstring
Returns the topmost layout item at a specified ``position``. Ignores paper items.
If ``ignoreLocked`` is set to true any locked items will be ignored.
%End

QgsLayoutItem *layoutItemAt( QPointF position, const QgsLayoutItem *belowItem, const bool ignoreLocked = false ) const;
QgsLayoutItem *layoutItemAt( QPointF position, const QgsLayoutItem *belowItem, bool ignoreLocked = false ) const;
%Docstring
Returns the topmost layout item at a specified ``position`` which is below a specified ``item``. Ignores paper items.
If ``ignoreLocked`` is set to true any locked items will be ignored.
Expand Down Expand Up @@ -301,7 +301,7 @@ Converts a ``point`` into the layout's native units.
.. seealso:: :py:func:`units`
%End

QgsLayoutMeasurement convertFromLayoutUnits( const double length, const QgsUnitTypes::LayoutUnit unit ) const;
QgsLayoutMeasurement convertFromLayoutUnits( double length, QgsUnitTypes::LayoutUnit unit ) const;
%Docstring
Converts a ``length`` measurement from the layout's native units to a specified target ``unit``.

Expand All @@ -312,7 +312,7 @@ Converts a ``length`` measurement from the layout's native units to a specified
.. seealso:: :py:func:`units`
%End

QgsLayoutSize convertFromLayoutUnits( const QSizeF &size, const QgsUnitTypes::LayoutUnit unit ) const;
QgsLayoutSize convertFromLayoutUnits( const QSizeF &size, QgsUnitTypes::LayoutUnit unit ) const;
%Docstring
Converts a ``size`` from the layout's native units to a specified target ``unit``.

Expand All @@ -323,7 +323,7 @@ Converts a ``size`` from the layout's native units to a specified target ``unit`
.. seealso:: :py:func:`units`
%End

QgsLayoutPoint convertFromLayoutUnits( const QPointF &point, const QgsUnitTypes::LayoutUnit unit ) const;
QgsLayoutPoint convertFromLayoutUnits( const QPointF &point, QgsUnitTypes::LayoutUnit unit ) const;
%Docstring
Converts a ``point`` from the layout's native units to a specified target ``unit``.

Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/layout/qgslayoutframe.sip.in
Expand Up @@ -79,7 +79,7 @@ Returns whether the page should be hidden (ie, not included in layout exports) i
.. seealso:: :py:func:`setHidePageIfEmpty`
%End

void setHidePageIfEmpty( const bool hidePageIfEmpty );
void setHidePageIfEmpty( bool hidePageIfEmpty );
%Docstring
Sets whether the page should be hidden (ie, not included in layout exports) if this frame is empty

Expand All @@ -97,7 +97,7 @@ Returns whether the background and frame stroke should be hidden if this frame i
.. seealso:: :py:func:`setHideBackgroundIfEmpty`
%End

void setHideBackgroundIfEmpty( const bool hideBackgroundIfEmpty );
void setHideBackgroundIfEmpty( bool hideBackgroundIfEmpty );
%Docstring
Sets whether the background and frame stroke should be hidden if this frame is empty

Expand Down
Expand Up @@ -55,7 +55,7 @@ Returns the page/snap grid resolution.
.. seealso:: :py:func:`offset`
%End

void setOffset( const QgsLayoutPoint offset );
void setOffset( QgsLayoutPoint offset );
%Docstring
Sets the ``offset`` of the page/snap grid.

Expand Down

0 comments on commit 2ed144a

Please sign in to comment.