Fix werror=type-limit on systems with char=unsigned char.

This commit is contained in:
ArthurSonzogni 2020-02-11 23:43:26 +01:00
parent ebf857e73b
commit 65705d5bc7

View File

@ -107,7 +107,8 @@ Event Event::GetEvent(std::function<char()> getchar) {
std::string input; std::string input;
input += getchar(); input += getchar();
switch (input[0]) { unsigned char head = input[0];
switch (head) {
case 24: // CAN case 24: // CAN
case 26: // SUB case 26: // SUB
return Event(); // Ignored. return Event(); // Ignored.
@ -119,10 +120,10 @@ Event Event::GetEvent(std::function<char()> getchar) {
return ParseESC(getchar, input); return ParseESC(getchar, input);
} }
if (input[0] >= 0 && input[0] < 32) // C0 if (head < 32) // C0
return Event::Special(input); return Event::Special(input);
if (input[0] == 127) // Delete if (head == 127) // Delete
return Event::Special(input); return Event::Special(input);
return ParseUTF8(getchar, input); return ParseUTF8(getchar, input);