AK: Use "signed char" as the opposite of "unsigned char"

I totally forgot about the C++ basics here. There are three distinct
types: "char", "signed char" and "unsigned char". Whether "char" is
signed or unsigned is implementation specific.
This commit is contained in:
Andreas Kling 2020-07-18 17:19:59 +02:00
parent 02882d5345
commit 70cb4491d7
2 changed files with 6 additions and 6 deletions

View file

@ -42,9 +42,9 @@ struct NumericLimits<bool> {
};
template<>
struct NumericLimits<char> {
static constexpr char min() { return -__SCHAR_MAX__ - 1; }
static constexpr char max() { return __SCHAR_MAX__; }
struct NumericLimits<signed char> {
static constexpr signed char min() { return -__SCHAR_MAX__ - 1; }
static constexpr signed char max() { return __SCHAR_MAX__; }
static constexpr bool is_signed() { return true; }
};

View file

@ -313,7 +313,7 @@ struct MakeUnsigned {
};
template<>
struct MakeUnsigned<char> {
struct MakeUnsigned<signed char> {
typedef unsigned char type;
};
@ -367,8 +367,8 @@ struct MakeSigned {
};
template<>
struct MakeSigned<char> {
typedef char type;
struct MakeSigned<signed char> {
typedef signed char type;
};
template<>