From 69047ac1e48da57b747aafb6ef4ece24b56cb58b Mon Sep 17 00:00:00 2001 From: Arthur Sonzogni Date: Sun, 16 May 2021 09:38:24 +0200 Subject: [PATCH] Add warning for sign comparison. (#93) --- CMakeLists.txt | 1 - src/ftxui/component/menu.cpp | 2 +- src/ftxui/component/radiobox.cpp | 2 +- src/ftxui/component/toggle.cpp | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 600d7ed..fedfbf1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,6 @@ foreach(lib screen dom component) target_compile_options(${lib} PRIVATE "-pedantic") target_compile_options(${lib} PRIVATE "-Werror") target_compile_options(${lib} PRIVATE "-Wmissing-declarations") - target_compile_options(${lib} PRIVATE "-Wno-sign-compare") endif() endforeach() diff --git a/src/ftxui/component/menu.cpp b/src/ftxui/component/menu.cpp index 86a1204..685c53a 100644 --- a/src/ftxui/component/menu.cpp +++ b/src/ftxui/component/menu.cpp @@ -109,7 +109,7 @@ bool MenuBase::OnEvent(Event event) { bool MenuBase::OnMouseEvent(Event event) { if (!CaptureMouse(event)) return false; - for (int i = 0; i < boxes_.size(); ++i) { + for (int i = 0; i < int(boxes_.size()); ++i) { if (!boxes_[i].Contain(event.mouse().x, event.mouse().y)) continue; diff --git a/src/ftxui/component/radiobox.cpp b/src/ftxui/component/radiobox.cpp index 2be694b..b56b0d1 100644 --- a/src/ftxui/component/radiobox.cpp +++ b/src/ftxui/component/radiobox.cpp @@ -107,7 +107,7 @@ bool RadioboxBase::OnEvent(Event event) { bool RadioboxBase::OnMouseEvent(Event event) { if (!CaptureMouse(event)) return false; - for (int i = 0; i < boxes_.size(); ++i) { + for (int i = 0; i < int(boxes_.size()); ++i) { if (!boxes_[i].Contain(event.mouse().x, event.mouse().y)) continue; diff --git a/src/ftxui/component/toggle.cpp b/src/ftxui/component/toggle.cpp index 75c8786..ca00069 100644 --- a/src/ftxui/component/toggle.cpp +++ b/src/ftxui/component/toggle.cpp @@ -79,7 +79,7 @@ bool ToggleBase::OnEvent(Event event) { bool ToggleBase::OnMouseEvent(Event event) { if (!CaptureMouse(event)) return false; - for (int i = 0; i < boxes_.size(); ++i) { + for (int i = 0; i < int(boxes_.size()); ++i) { if (!boxes_[i].Contain(event.mouse().x, event.mouse().y)) continue;