mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
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:
parent
02882d5345
commit
70cb4491d7
|
@ -42,9 +42,9 @@ struct NumericLimits<bool> {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct NumericLimits<char> {
|
struct NumericLimits<signed char> {
|
||||||
static constexpr char min() { return -__SCHAR_MAX__ - 1; }
|
static constexpr signed char min() { return -__SCHAR_MAX__ - 1; }
|
||||||
static constexpr char max() { return __SCHAR_MAX__; }
|
static constexpr signed char max() { return __SCHAR_MAX__; }
|
||||||
static constexpr bool is_signed() { return true; }
|
static constexpr bool is_signed() { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -313,7 +313,7 @@ struct MakeUnsigned {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct MakeUnsigned<char> {
|
struct MakeUnsigned<signed char> {
|
||||||
typedef unsigned char type;
|
typedef unsigned char type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -367,8 +367,8 @@ struct MakeSigned {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct MakeSigned<char> {
|
struct MakeSigned<signed char> {
|
||||||
typedef char type;
|
typedef signed char type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in a new issue