From 4aaad461550dac61795f7950f78062f320cd88ba Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 25 Jun 2019 20:29:02 +0200 Subject: Fix const casts --- pugl/pugl_osx.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index 12905d3..01b4d51 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -89,7 +89,7 @@ struct PuglInternalsImpl { puglview, 0 }; - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); return YES; } @@ -202,7 +202,7 @@ struct PuglInternalsImpl { } #endif - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); } - (void) drawRect:(NSRect)rect @@ -327,7 +327,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) 0, 1 }; - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); } - (void) mouseDragged:(NSEvent*)event @@ -361,7 +361,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) getModifiers(puglview, event), (uint32_t)[event buttonNumber] + 1 }; - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); } - (void) mouseUp:(NSEvent*)event @@ -380,7 +380,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) getModifiers(puglview, event), (uint32_t)[event buttonNumber] + 1 }; - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); [self updateTrackingAreas]; } @@ -423,7 +423,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) [event deltaX], [event deltaY] }; - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); [self updateTrackingAreas]; } @@ -455,7 +455,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) false }; strncpy((char*)ev.utf8, str, 8); - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); } - (void) keyUp:(NSEvent*)event @@ -464,7 +464,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) const NSPoint rloc = [NSEvent mouseLocation]; const NSString* chars = [event characters]; const char* str = [chars UTF8String]; - const PuglEventKey ev = { + PuglEventKey ev = { PUGL_KEY_RELEASE, puglview, 0, @@ -481,7 +481,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) false, }; strncpy((char*)ev.utf8, str, 8); - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); } - (void) flagsChanged:(NSEvent*)event @@ -523,7 +523,7 @@ keySymToSpecial(PuglView* view, NSEvent* ev) { 0, 0, 0, 0, 0, 0, 0, 0 }, false }; - puglDispatchEvent(puglview, (PuglEvent*)&ev); + puglDispatchEvent(puglview, (const PuglEvent*)&ev); } puglview->impl->mods = mods; -- cgit v1.2.1