Fix convert from char on ARM build

Some platforms set the signedness of char to unsigned (eg. ARM).
Convert from char should not assume the signedness of char.

Fix build issue with -Werror,-Wtautological-unsigned-zero-compare flags.

Signed-off-by: Miguel Gaio <mgaio35@gmail.com>
This commit is contained in:
Miguel Gaio 2018-10-03 10:22:16 +02:00 committed by Martin Hořeňovský
parent 9e1bdca466
commit f1faaa9c10

View File

@ -205,7 +205,7 @@ std::string StringMaker<bool>::convert(bool b) {
return b ? "true" : "false";
}
std::string StringMaker<char>::convert(char value) {
std::string StringMaker<signed char>::convert(signed char value) {
if (value == '\r') {
return "'\\r'";
} else if (value == '\f') {
@ -222,8 +222,8 @@ std::string StringMaker<char>::convert(char value) {
return chstr;
}
}
std::string StringMaker<signed char>::convert(signed char c) {
return ::Catch::Detail::stringify(static_cast<char>(c));
std::string StringMaker<char>::convert(char c) {
return ::Catch::Detail::stringify(static_cast<signed char>(c));
}
std::string StringMaker<unsigned char>::convert(unsigned char c) {
return ::Catch::Detail::stringify(static_cast<char>(c));