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

Fix compiler warning #3781

Merged
merged 1 commit into from Nov 11, 2014
Merged

Fix compiler warning #3781

merged 1 commit into from Nov 11, 2014

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Nov 11, 2014

Fixes a compiler warning about uninitialized values that looks like it's coming from Agg, but which is actually matplotlib's fault ;)

@mdboom mdboom added this to the v1.5.x milestone Nov 11, 2014
@mdboom mdboom self-assigned this Nov 11, 2014
@@ -136,8 +136,11 @@ class PathIterator

inline unsigned vertex(double *x, double *y)
{
if (m_iterator >= m_total_vertices)
if (m_iterator >= m_total_vertices) {
*x = 0.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the last vertex to 0 was the source of those 3D polygon bugs, is something similar going to come up here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. When the code returned is agg::path_cmd_stop, the x and y values are actually meaningless and should be ignored by the caller. This fix is only to silence a compiler warning that it is theoretically possible to get a vertex where the x y values were never set (if it were a 0-length path), since the compiler doesn't understand the semantics of the vertex codes.

tacaswell added a commit that referenced this pull request Nov 11, 2014
@tacaswell tacaswell merged commit 2d3b0aa into matplotlib:master Nov 11, 2014
@tacaswell
Copy link
Member

I don't think this is worth back-porting to 1.4.x

@mdboom mdboom deleted the compiler-warning branch March 3, 2015 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants