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

Use NULL rather than 0. #778

Merged
merged 1 commit into from Mar 23, 2017
Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Mar 23, 2017

There was few cases of using literal 0 instead of NULL in the context of
pointers. While this was a legitimate C code, using NULL rather than 0 makes
the code clearer.

There was few cases of using literal 0 instead of NULL in the context of
pointers.  While this was a legitimate C code, using NULL rather than 0 makes
the code clearer.
@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Mar 23, 2017
@mention-bot
Copy link

mention-bot commented Mar 23, 2017

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @loewis, @benjaminp and @warsaw to be potential reviewers.

@@ -2179,7 +2179,7 @@ BOOL MyIsUserAnAdmin()
// to leave the library loaded)
if (0 == (shell32=LoadLibrary("shell32.dll")))
return FALSE;
if (0 == (pfnIsUserAnAdmin=(PFNIsUserAnAdmin)GetProcAddress(shell32, "IsUserAnAdmin")))
if (NULL == (pfnIsUserAnAdmin=(PFNIsUserAnAdmin)GetProcAddress(shell32, "IsUserAnAdmin")))
Copy link
Member

@warsaw warsaw Mar 23, 2017

Choose a reason for hiding this comment

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

I find it interesting that we sometimes use NULL == and other times use == NULL. I suppose it's not an inconsistency that matters a lot.

warsaw
warsaw approved these changes Mar 23, 2017
@serhiy-storchaka serhiy-storchaka merged commit 0b3ec19 into python:master Mar 23, 2017
@serhiy-storchaka serhiy-storchaka deleted the badzero branch Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants