Skip to content

Commit d735066

Browse files
committed
Fix OSX warnings + Examples/Apple+GL2 calls super reshape. (#4759, #1873)
1 parent 1b6b860 commit d735066

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/example_apple_opengl2/main.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ -(void)updateAndDrawDemoView
146146
animationTimer = [NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES];
147147
}
148148

149-
-(void)reshape { [[self openGLContext] update]; [self updateAndDrawDemoView]; }
149+
-(void)reshape { [super reshape]; [[self openGLContext] update]; [self updateAndDrawDemoView]; }
150150
-(void)drawRect:(NSRect)bounds { [self updateAndDrawDemoView]; }
151151
-(void)animationTimerFired:(NSTimer*)timer { [self setNeedsDisplay:YES]; }
152152
-(void)dealloc { animationTimer = nil; }

imgui_draw.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3080,7 +3080,7 @@ void ImFontGlyphRangesBuilder::AddText(const char* text, const char* text_end)
30803080
void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges)
30813081
{
30823082
for (; ranges[0]; ranges += 2)
3083-
for (unsigned int c = ranges[0]; c <= ranges[1] && c <= IM_UNICODE_CODEPOINT_MAX; c++)
3083+
for (unsigned int c = ranges[0]; c <= ranges[1] && c <= IM_UNICODE_CODEPOINT_MAX; c++) //-V560
30843084
AddChar((ImWchar)c);
30853085
}
30863086

imgui_widgets.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3695,11 +3695,11 @@ static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx)
36953695
static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) { if (obj->Flags & ImGuiInputTextFlags_Password) return 0; return idx > 0 ? (!is_separator(obj->TextW[idx - 1]) && is_separator(obj->TextW[idx])) : 1; }
36963696
static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; }
36973697
static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; }
3698-
static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; }
36993698
#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h
37003699
#ifdef __APPLE__ // FIXME: Move setting to IO structure
37013700
#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_MAC
37023701
#else
3702+
static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; }
37033703
#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_WIN
37043704
#endif
37053705

0 commit comments

Comments
 (0)