mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
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:
parent
9e1bdca466
commit
f1faaa9c10
@ -205,7 +205,7 @@ std::string StringMaker<bool>::convert(bool b) {
|
|||||||
return b ? "true" : "false";
|
return b ? "true" : "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StringMaker<char>::convert(char value) {
|
std::string StringMaker<signed char>::convert(signed char value) {
|
||||||
if (value == '\r') {
|
if (value == '\r') {
|
||||||
return "'\\r'";
|
return "'\\r'";
|
||||||
} else if (value == '\f') {
|
} else if (value == '\f') {
|
||||||
@ -222,8 +222,8 @@ std::string StringMaker<char>::convert(char value) {
|
|||||||
return chstr;
|
return chstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string StringMaker<signed char>::convert(signed char c) {
|
std::string StringMaker<char>::convert(char c) {
|
||||||
return ::Catch::Detail::stringify(static_cast<char>(c));
|
return ::Catch::Detail::stringify(static_cast<signed char>(c));
|
||||||
}
|
}
|
||||||
std::string StringMaker<unsigned char>::convert(unsigned char c) {
|
std::string StringMaker<unsigned char>::convert(unsigned char c) {
|
||||||
return ::Catch::Detail::stringify(static_cast<char>(c));
|
return ::Catch::Detail::stringify(static_cast<char>(c));
|
||||||
|
Loading…
Reference in New Issue
Block a user