Commit 38fe90c3 authored by Lubosz Sarnecki's avatar Lubosz Sarnecki

Fix -Wsign-compare.

parent 48b6b04b
......@@ -24,7 +24,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-Wno-padded
# probably we want to fix these
-Wno-sign-conversion
-Wno-switch-enum
-Wno-double-promotion
-Wno-zero-as-null-pointer-constant
......@@ -38,7 +37,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-Wno-format-nonliteral
-Wno-unused-macros
-Wno-shadow-field
-Wno-sign-compare
-Wno-disabled-macro-expansion
-Wno-covered-switch-default
-Wno-cast-qual
......@@ -54,8 +52,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# We want to ignore these
-Wno-missing-field-initializers
-Wno-unused-parameter
# we want to fix these
-Wno-sign-compare
)
endif()
......
......@@ -734,4 +734,3 @@ static void stb_font_consolas_24_latin1(stb_fontchar font[STB_FONT_consolas_24_l
#define STB_SOMEFONT_NUM_CHARS STB_FONT_consolas_24_latin1_NUM_CHARS
#define STB_SOMEFONT_LINE_SPACING STB_FONT_consolas_24_latin1_LINE_SPACING
#endif
......@@ -351,7 +351,7 @@ class Renderer {
// Select physical device to be used for the Vulkan example
// Defaults to the first device unless specified by command line
uint32_t selected_device = 0;
if (settings->gpu > gpu_count - 1) {
if (settings->gpu > (int) gpu_count - 1) {
vik_log_f("Selected device index %d is out of range,"
" reverting to device 0"
" (use --list-gpus to show available Vulkan devices)",
......
......@@ -78,7 +78,7 @@ class WindowDirectMode : public Window {
if (displays.size() < 1)
vik_log_f("No non-desktop output available.");
if (settings->display > displays.size() - 1) {
if (settings->display > (int) displays.size() - 1) {
vik_log_w("Requested display %d, but only %d displays are available.",
settings->display, displays.size());
......
......@@ -304,7 +304,7 @@ class WindowWayland : public Window {
}
Display* get_display_from_output(wl_output* output) {
for (int i = 0; i < displays.size(); i++) {
for (int i = 0; i < (int) displays.size(); i++) {
if (displays[i].output == output)
return &displays[i];
}
......@@ -359,7 +359,7 @@ class WindowWayland : public Window {
void validate_display() {
Display *d;
if (settings->display > displays.size()) {
if (settings->display > (int) displays.size()) {
vik_log_e("Requested display %d, but only %d displays are available.",
settings->display, displays.size());
......@@ -374,7 +374,7 @@ class WindowWayland : public Window {
void validate_mode() {
Display* d = current_display();
if (settings->mode > d->modes.size()) {
if (settings->mode > (int) d->modes.size()) {
vik_log_e("Requested mode %d, but only %d modes"
" are available on display %d.",
settings->mode,
......
......@@ -97,7 +97,7 @@ class WindowXCB : public Window {
if (settings->fullscreen) {
get_randr_outputs();
if (settings->display > displays.size() - 1) {
if (settings->display > (int) displays.size() - 1) {
vik_log_w("Requested display %d, but only %d displays are available.",
settings->display, displays.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment