-
Notifications
You must be signed in to change notification settings - Fork 386
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
WT-2691 Use wrappers for ctype functions to avoid sign extension errors #2818
Conversation
…rors. Create __wt_* versions of all ctype functions, and use them whenever wt_internal.h is available. Add check to prevent direct use of ctype functions from core source.
@keithbostic, can you review please? |
__wt_iscntrl(int c) | ||
{ | ||
return iscntrl((unsigned char)c); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider omitting unused wrapper until we need them.
Remove unused wrappers.
@michaelcahill, thanks for the comments, please merge if this resolves them. |
@@ -599,7 +600,7 @@ config_opt_file(CONFIG *cfg, const char *filename) | |||
rtrim = comment; | |||
|
|||
/* Skip trailing space again. */ | |||
while (rtrim > ltrim && isspace(rtrim[-1])) | |||
while (rtrim > ltrim && isspace((unsigned char)rtrim[-1])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddanderson, I'd suggest using u_char
.
@ddanderson, lgtm, merge at will as far as I'm concerned. |
self reviewing this last bit, and merging. |
Create _wt* versions of all ctype functions, and use them whenever wt_internal.h is available. Add check to prevent direct use of type functions from core source.
This is an alternative to simply banning the use of plain 'char', as in #2783.