diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-18 17:19:59 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-18 17:57:40 +0200 |
commit | 70cb4491d7813eb40e2d6317d32a13d701b0c7e2 (patch) | |
tree | eea79b162e240648d11cc01c82037d2ac4bb3f23 /AK | |
parent | 02882d53451facacb117a987cfaecb367f8543e5 (diff) | |
download | serenity-70cb4491d7813eb40e2d6317d32a13d701b0c7e2.zip |
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.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/NumericLimits.h | 6 | ||||
-rw-r--r-- | AK/StdLibExtras.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/AK/NumericLimits.h b/AK/NumericLimits.h index 734688ae11..f739eedec3 100644 --- a/AK/NumericLimits.h +++ b/AK/NumericLimits.h @@ -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; } }; diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index d94b6f754a..27249af8b2 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -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<> |