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 incorrect macro in FT2Font setup. #15748

Merged
merged 1 commit into from Nov 26, 2019
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Nov 22, 2019

This causes a warning about returning NULL as int.

However, I don't believe this call could even fail except in dire circumstances.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [N/A] New features are documented, with examples if plot related
  • [N/A] Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

This causes a warning about returning `NULL` as `int`.
@timhoffm
Copy link
Member

I would like to approve so that this does not get lost, but I do not fully understand the issue. Can you plase give a little more context.

CALL_CPP_INIT returns an errorcode -1 instead of 0 in the case of CALL_CPP. What does this have to do with a warning about returning NULL as int?

@QuLogic
Copy link
Member Author

QuLogic commented Nov 25, 2019

Because NULL is not 0, it is (void *)0; using a pointer as an integer causes a warning.

@timhoffm
Copy link
Member

But where is NULL coming into play here? The PR just changes the returned value from 0 to -1.

@QuLogic
Copy link
Member Author

QuLogic commented Nov 25, 2019

Ah, I see what you're asking; the NULL is there on the v3.2.x and older branches. But that aside, it's also more semantically correct since this is an _init function.

@QuLogic QuLogic added this to the v3.2.0 milestone Nov 25, 2019
@timhoffm timhoffm merged commit 1cd9137 into matplotlib:master Nov 26, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 26, 2019
@QuLogic QuLogic deleted the cpp-warnings branch November 26, 2019 00:29
dopplershift added a commit that referenced this pull request Nov 26, 2019
…748-on-v3.2.x

Backport PR #15748 on branch v3.2.x (Fix incorrect macro in FT2Font setup.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants