mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 00:50:03 +08:00
[libc][NFC] change isblank and iscntrl from implicit casting
isblank and iscntrl were casting an int to a char implicitly and this was throwing errors under Fuchsia. I've added a static cast to resolve this issue. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D94634
This commit is contained in:
@@ -15,7 +15,7 @@ namespace __llvm_libc {
|
||||
// TODO: Currently restricted to default locale.
|
||||
// These should be extended using locale information.
|
||||
LLVM_LIBC_FUNCTION(int, isblank, (int c)) {
|
||||
const unsigned char ch = c;
|
||||
const unsigned char ch = static_cast<char>(c);
|
||||
return ch == ' ' || ch == '\t';
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace __llvm_libc {
|
||||
// TODO: Currently restricted to default locale.
|
||||
// These should be extended using locale information.
|
||||
LLVM_LIBC_FUNCTION(int, iscntrl, (int c)) {
|
||||
const unsigned char ch = c;
|
||||
const unsigned char ch = static_cast<char>(c);
|
||||
return ch < 0x20 || ch == 0x7f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user