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

Made WCharacter.h more clear #26

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@pratikpc
Copy link

@pratikpc pratikpc commented Feb 6, 2019

It's obvious that a == 0 ? false : true is same as a != 0

Also a != 0 looks more clear as a Return Type to a bool function.
It's more easier to understand what it does in this form.
WCharacter.h was full of functions which utilised a == 0 ? false : true instead of the more easy to read a != 0 which strikes a fine balance between simplicity and readability.

If we are to look at Standard Library Definitions of the various functions used like isdigit, isalpha etc. we find they return 0 when they do not find anything thus making isdigit(ch) != 0 even more clearer

Added extern C
Given the fact that we are using C Functions and code that is compatible with the C Standard, I added extern C. Extern C is also used in similar C Standard Compatible Arduino header files

a == 0 ? false : true is same as a != 0
Also added extern C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.