Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cppcheck fixes for queued LTR backports branch #59102

Merged

Conversation

nyalldawson
Copy link
Collaborator

@nyalldawson nyalldawson commented Oct 16, 2024

Let's get this branch all green again too...

Manual port of #59091

nyalldawson and others added 29 commits October 16, 2024 11:47
(cherry picked from commit 6935c02)
(cherry picked from commit 249b906)
(cherry picked from commit e03072a)
(cherry picked from commit fc82d4c)
(cherry picked from commit 53a19ca)
(cherry picked from commit 3c2ed21)
(cherry picked from commit dcb7823)
(cherry picked from commit 0fd2191)
(cherry picked from commit 5cfcff1)
which correctly sets all members

(cherry picked from commit bec114f)
(cherry picked from commit b9a3e8c)
(cherry picked from commit afb38d8)
Add TODO for someone to validate later

(cherry picked from commit 2251daf)
(cherry picked from commit a8023f8)
Indeed `QgsAbstractGeometry::operator=()` is already called. This
operator calls the `clear()` method which already clears the cache and
the existing geometries.

(cherry picked from commit 9fed0f1)
Indeed `QgsCurve::operator=()` is already called. As,
`QgsCurve` does not override `operator=`,
`QgsAbstractGeometry::operator=()` is called. This operator calls the
`clear()` method which already clears the cache and the existing
curves.

(cherry picked from commit 04b1dd7)
Indeed `QgsSurface::operator=()` is already called. As,
`QgsSurface` does not override `operator=`,
`QgsAbstractGeometry::operator=()` is called. This operator calls the
`clear()` method which clears the exterior ring, the interior rings
and the cache.

(cherry picked from commit e450947)
@nyalldawson nyalldawson added the Chore GitHub and other CI infrastructure changes label Oct 16, 2024
@nyalldawson nyalldawson added the Backport Is a backport of another pull request label Oct 16, 2024
@github-actions github-actions bot added this to the 3.40.0 milestone Oct 16, 2024
nyalldawson and others added 5 commits October 16, 2024 11:55
We had two different(!!!!) implementations for equality operator
for QgsPointXY, with different logic (one handled empty points,
the other didn't). This compiled only because one was not marked
as const. So we'd get a DIFFERENT equality check logic depending
on whether or not the first point was const... eeek!

Remove the duplicate one, mark the better one as const
I'm not 100% sure if the point == mSnapMatch.point() comparison was
intended be done using QgsPointXY or QgsPoint objects here!

Use QgsPointXY to keep the behavior the same from
before the duplicate QgsPointXY == operator was removed...
@nyalldawson
Copy link
Collaborator Author

Unrelated failures

@nyalldawson nyalldawson merged commit 557d229 into qgis:queued_ltr_backports Oct 16, 2024
26 of 28 checks passed
@nyalldawson nyalldawson deleted the cppcheck_queued_ltr_backports branch October 16, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport Is a backport of another pull request Chore GitHub and other CI infrastructure changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants