Skip to content

MAINT: Add NPY_UNUSED and const qualified suggested by clang#14484

Merged
mattip merged 2 commits intonumpy:masterfrom
seberg:unused-and-const
Sep 12, 2019
Merged

MAINT: Add NPY_UNUSED and const qualified suggested by clang#14484
mattip merged 2 commits intonumpy:masterfrom
seberg:unused-and-const

Conversation

@seberg
Copy link
Member

@seberg seberg commented Sep 11, 2019

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?

# finished
fargs_str = ' '.join(function_args).rstrip(' )')
# remove any white space and the closing bracket:
fargs_str = ' '.join(function_args).rstrip()[:-1].rstrip()
Copy link
Member Author

Choose a reason for hiding this comment

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

This is necessary, because otherwise it parsing api_function(..., type NPY_UNUUSED(parameter)) fails because it strips both closing brackets.

}

ret = PyArray_Resize(self, &newshape, refcheck, NPY_CORDER);
ret = PyArray_Resize(self, &newshape, refcheck, NPY_ANYORDER);
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 order is ignored (that is documented even), ignoring the order is pretty much the same as NPY_ANYORDER, so that seems clearer.

@mattip mattip merged commit 7214ca4 into numpy:master Sep 12, 2019
@mattip
Copy link
Member

mattip commented Sep 12, 2019

Nice start, thanks @seberg

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.

2 participants