Add warning for sign comparison. (#93)

This commit is contained in:
Arthur Sonzogni 2021-05-16 09:38:24 +02:00 committed by GitHub
parent 7daeac25c0
commit 69047ac1e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 4 deletions

View File

@ -157,7 +157,6 @@ foreach(lib screen dom component)
target_compile_options(${lib} PRIVATE "-pedantic") target_compile_options(${lib} PRIVATE "-pedantic")
target_compile_options(${lib} PRIVATE "-Werror") target_compile_options(${lib} PRIVATE "-Werror")
target_compile_options(${lib} PRIVATE "-Wmissing-declarations") target_compile_options(${lib} PRIVATE "-Wmissing-declarations")
target_compile_options(${lib} PRIVATE "-Wno-sign-compare")
endif() endif()
endforeach() endforeach()

View File

@ -109,7 +109,7 @@ bool MenuBase::OnEvent(Event event) {
bool MenuBase::OnMouseEvent(Event event) { bool MenuBase::OnMouseEvent(Event event) {
if (!CaptureMouse(event)) if (!CaptureMouse(event))
return false; 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)) if (!boxes_[i].Contain(event.mouse().x, event.mouse().y))
continue; continue;

View File

@ -107,7 +107,7 @@ bool RadioboxBase::OnEvent(Event event) {
bool RadioboxBase::OnMouseEvent(Event event) { bool RadioboxBase::OnMouseEvent(Event event) {
if (!CaptureMouse(event)) if (!CaptureMouse(event))
return false; 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)) if (!boxes_[i].Contain(event.mouse().x, event.mouse().y))
continue; continue;

View File

@ -79,7 +79,7 @@ bool ToggleBase::OnEvent(Event event) {
bool ToggleBase::OnMouseEvent(Event event) { bool ToggleBase::OnMouseEvent(Event event) {
if (!CaptureMouse(event)) if (!CaptureMouse(event))
return false; 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)) if (!boxes_[i].Contain(event.mouse().x, event.mouse().y))
continue; continue;