From 65705d5bc79fda017464e777256b508ce5068368 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Tue, 11 Feb 2020 23:43:26 +0100 Subject: [PATCH] Fix werror=type-limit on systems with char=unsigned char. --- src/ftxui/component/event.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ftxui/component/event.cpp b/src/ftxui/component/event.cpp index f47470b..3e651d2 100644 --- a/src/ftxui/component/event.cpp +++ b/src/ftxui/component/event.cpp @@ -107,7 +107,8 @@ Event Event::GetEvent(std::function getchar) { std::string input; input += getchar(); - switch (input[0]) { + unsigned char head = input[0]; + switch (head) { case 24: // CAN case 26: // SUB return Event(); // Ignored. @@ -119,10 +120,10 @@ Event Event::GetEvent(std::function getchar) { return ParseESC(getchar, input); } - if (input[0] >= 0 && input[0] < 32) // C0 + if (head < 32) // C0 return Event::Special(input); - if (input[0] == 127) // Delete + if (head == 127) // Delete return Event::Special(input); return ParseUTF8(getchar, input);