Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Minor C++ improvements #3691

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

Merged
merged 5 commits into from
Oct 28, 2014
Merged

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Oct 21, 2014

This is just some stuff found with clang-analyzer

@@ -670,10 +670,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
Copy link
Member

Choose a reason for hiding this comment

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

These changes smell funny to me, but so do empty structs so...

Copy link
Member Author

Choose a reason for hiding this comment

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

The latest version of clang on OS-X Yosemite doesn't like empty structs. It's easiest just to put something in them for everyone than to try to detect the compilers that care. We can spare the extra 4 bytes.

@jenshnielsen
Copy link
Member

These changes looks sensible to me. Not sure why Travis doesn't run on the latest version.
OK I guess it is in the queue and the github time on the commits are misleading.

@jenshnielsen
Copy link
Member

Builds and passes the test both with gcc and locally for me with Clang so merging.
How is the policy on modifying the external source? With Clang there is a warning showing up multiple times about an unused variable. Do we want to allow deleting it?

jenshnielsen added a commit that referenced this pull request Oct 28, 2014
@jenshnielsen jenshnielsen merged commit ed95382 into matplotlib:master Oct 28, 2014
@mdboom
Copy link
Member Author

mdboom commented Oct 28, 2014

I generally don't modify the external code unless absolutely necessary -- it makes it harder to update later. But we can also try to submit patches upstream to remove that problem...

@jenshnielsen
Copy link
Member

The warning is harmless so I should probably just forget about my obsession with warnings.

If there is a clear upstream for Agg i guess that would be fine to submit it there.

@mdboom
Copy link
Member Author

mdboom commented Oct 28, 2014

The current upstream for Agg is here (it's a fork of Agg 2.4, so still BSD-compatible):

http://sourceforge.net/projects/agg/

I've been experimenting with upgrading to the SVN version there, but there are some regressions with alpha blending that are proving to be tricky. Once solved, though, the killer feature in the new versions is the floating-point image buffers.

@mdboom mdboom deleted the more-cpp-cleanup branch March 3, 2015 18:44
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.

3 participants