[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:
Michael Jones
2021-01-13 21:36:05 +00:00
parent 6077d55381
commit ea8034ec35
2 changed files with 2 additions and 2 deletions

View File

@@ -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';
}

View File

@@ -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;
}