mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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
Notes:
sideshowbarker
2024-07-19 04:43:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/70cb4491d78
2 changed files with 6 additions and 6 deletions
|
@ -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; }
|
||||
};
|
||||
|
||||
|
|
|
@ -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<>
|
||||
|
|
Loading…
Reference in a new issue