diff --git a/libc/src/ctype/isblank.cpp b/libc/src/ctype/isblank.cpp index b29d19aef2f1..1c3061379b29 100644 --- a/libc/src/ctype/isblank.cpp +++ b/libc/src/ctype/isblank.cpp @@ -1,22 +1,22 @@ //===-- Implementation of isblank------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "src/ctype/isblank.h" #include "src/__support/common.h" 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(c); return ch == ' ' || ch == '\t'; } } // namespace __llvm_libc diff --git a/libc/src/ctype/iscntrl.cpp b/libc/src/ctype/iscntrl.cpp index 8962bcae0a84..b061199c47ec 100644 --- a/libc/src/ctype/iscntrl.cpp +++ b/libc/src/ctype/iscntrl.cpp @@ -1,22 +1,22 @@ //===-- Implementation of iscntrl------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "src/ctype/iscntrl.h" #include "src/__support/common.h" 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(c); return ch < 0x20 || ch == 0x7f; } } // namespace __llvm_libc