MAINT: Add NPY_UNUSED and const qualified suggested by clang#14484
Merged
mattip merged 2 commits intonumpy:masterfrom Sep 12, 2019
Merged
MAINT: Add NPY_UNUSED and const qualified suggested by clang#14484mattip merged 2 commits intonumpy:masterfrom
NPY_UNUSED and const qualified suggested by clang#14484mattip merged 2 commits intonumpy:masterfrom
Conversation
seberg
commented
Sep 11, 2019
| # finished | ||
| fargs_str = ' '.join(function_args).rstrip(' )') | ||
| # remove any white space and the closing bracket: | ||
| fargs_str = ' '.join(function_args).rstrip()[:-1].rstrip() |
Member
Author
There was a problem hiding this comment.
This is necessary, because otherwise it parsing api_function(..., type NPY_UNUUSED(parameter)) fails because it strips both closing brackets.
seberg
commented
Sep 11, 2019
| } | ||
|
|
||
| ret = PyArray_Resize(self, &newshape, refcheck, NPY_CORDER); | ||
| ret = PyArray_Resize(self, &newshape, refcheck, NPY_ANYORDER); |
Member
Author
There was a problem hiding this comment.
The order is ignored (that is documented even), ignoring the order is pretty much the same as NPY_ANYORDER, so that seems clearer.
Member
|
Nice start, thanks @seberg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am not sure how much build noise it actually reduces, I skipped a few files (dtype transfer) where there are just a huge amount of unused parameters. So this is basically a start, but am happy to fix it up if others feel it is nice. I see these in the IDE now, I guess at least the NPY_UNUSUED ones show up when compiling with clang?