From c56b7ad261c5947339355135850eb4e6cbaad9f0 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Fri, 15 Aug 2014 19:14:17 -0700 Subject: [PATCH] Fixed GCC warnings. --- examples/common/imgui/imgui.cpp | 2 +- examples/common/nanovg/fontstash.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 1e5fd7f2..0b1aa57d 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -652,7 +652,7 @@ struct Imgui m_left = left; m_scroll = _scroll; - _inputChar = 0 > _inputChar ? 0 : _inputChar; + _inputChar = _inputChar & 0x7f; // ASCII of GTFO! :) m_lastChar = m_char; m_char = _inputChar; } diff --git a/examples/common/nanovg/fontstash.h b/examples/common/nanovg/fontstash.h index ca050447..9af8b39d 100644 --- a/examples/common/nanovg/fontstash.h +++ b/examples/common/nanovg/fontstash.h @@ -1207,7 +1207,7 @@ float fonsDrawText(struct FONScontext* stash, const char* str, const char* end) { struct FONSstate* state = fons__getState(stash); - unsigned int codepoint; + unsigned int codepoint = 0; unsigned int utf8state = 0; struct FONSglyph* glyph = NULL; struct FONSglyph* prevGlyph = NULL; @@ -1391,7 +1391,7 @@ float fonsTextBounds(struct FONScontext* stash, float* bounds) { struct FONSstate* state = fons__getState(stash); - unsigned int codepoint; + unsigned int codepoint = 0; unsigned int utf8state = 0; struct FONSquad q; struct FONSglyph* glyph = NULL;