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

Skip to content

MAINT: clean up some macros in scalarapi.c #15386

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 1 commit into from
Jan 22, 2020

Conversation

eric-wieser
Copy link
Member

Using a macro in an if without parens is just weird.

Also, the void cases here match the pattern, so do not need special-casing.

@seberg
Copy link
Member

seberg commented Jan 22, 2020

Agreed about the brackets, could probably remove it from the _CHK macro. Unlike the simple cases, it returns a pointer instead of the value though (well, I suppose it cannot return a value, so maybe that makes sense).

@eric-wieser eric-wieser force-pushed the tidy-scalar-macros branch 2 times, most recently from 3abb51b to 28c3b21 Compare January 22, 2020 18:15
@eric-wieser
Copy link
Member Author

Sloppy of me, thanks for catching the pointer thing. Updated.

Using a macro in an if without parens is just weird.

Also, simplies macros to use existing macros, and add comments to make clear why `Void` is special.
@seberg
Copy link
Member

seberg commented Jan 22, 2020

LGTM, just waiting for tests, thanks.

@eric-wieser
Copy link
Member Author

Glad I got there in the end - a little bit more work than I was intending to put into a throwaway patch that distracted me from #15385

@seberg seberg merged commit 54f0f6e into numpy:master Jan 22, 2020
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