ArduinoCore-API icon indicating copy to clipboard operation
ArduinoCore-API copied to clipboard

Made WCharacter.h more clear

Open pratikpc opened this issue 6 years ago • 6 comments

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

pratikpc avatar Feb 06 '19 15:02 pratikpc

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 09 '21 13:04 CLAassistant

Hi @leg0 :wave: Can you please sign the CLA?

aentinger avatar May 25 '21 04:05 aentinger

@aentinger I have already signed it.

leg0 avatar May 25 '21 05:05 leg0

We need @pratikpc to sign the CLA: https://cla-assistant.io/arduino/ArduinoCore-API?pullRequest=26

per1234 avatar May 25 '21 06:05 per1234

@aentinger I have already signed it.

Mea culpa :blush:

aentinger avatar May 25 '21 07:05 aentinger

@pratikpc can you please sign it while being logged in via the right email ... likely the email stored in the commit is different from the one you are signed in GitHub.

aentinger avatar Jun 10 '21 13:06 aentinger