From 70cb4491d7813eb40e2d6317d32a13d701b0c7e2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 18 Jul 2020 17:19:59 +0200 Subject: [PATCH] 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. --- AK/NumericLimits.h | 6 +++--- 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 { }; template<> -struct NumericLimits { - static constexpr char min() { return -__SCHAR_MAX__ - 1; } - static constexpr char max() { return __SCHAR_MAX__; } +struct NumericLimits { + 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 { +struct MakeUnsigned { typedef unsigned char type; }; @@ -367,8 +367,8 @@ struct MakeSigned { }; template<> -struct MakeSigned { - typedef char type; +struct MakeSigned { + typedef signed char type; }; template<>