From 54ce0ac9227d9b91128054699d571e10ef15a095 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Apr 2023 09:12:31 +1000 Subject: [PATCH] Cleanup: use const variables when reading X11 events --- intern/ghost/intern/GHOST_SystemX11.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemX11.cc b/intern/ghost/intern/GHOST_SystemX11.cc index 9ee61550271..f95ee0fd3d9 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cc +++ b/intern/ghost/intern/GHOST_SystemX11.cc @@ -902,7 +902,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe) #endif /* WITH_X11_XINPUT */ switch (xe->type) { case Expose: { - XExposeEvent &xee = xe->xexpose; + const XExposeEvent &xee = xe->xexpose; if (xee.count == 0) { /* Only generate a single expose event @@ -914,7 +914,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe) } case MotionNotify: { - XMotionEvent &xme = xe->xmotion; + const XMotionEvent &xme = xe->xmotion; bool is_tablet = window->GetTabletData().Active != GHOST_kTabletModeNone; @@ -1240,7 +1240,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe) case ButtonPress: case ButtonRelease: { - XButtonEvent &xbe = xe->xbutton; + const XButtonEvent &xbe = xe->xbutton; GHOST_TButton gbmask = GHOST_kButtonMaskLeft; GHOST_TEventType type = (xbe.type == ButtonPress) ? GHOST_kEventButtonDown : GHOST_kEventButtonUp; @@ -1295,14 +1295,14 @@ void GHOST_SystemX11::processEvent(XEvent *xe) /* change of size, border, layer etc. */ case ConfigureNotify: { - // XConfigureEvent & xce = xe->xconfigure; + // const XConfigureEvent & xce = xe->xconfigure; g_event = new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window); break; } case FocusIn: case FocusOut: { - XFocusChangeEvent &xfe = xe->xfocus; + const XFocusChangeEvent &xfe = xe->xfocus; /* TODO: make sure this is the correct place for activate/deactivate */ // printf("X: focus %s for window %d\n", @@ -1390,7 +1390,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe) * (really crossing between windows) since some window-managers * also send grab/un-grab crossings for mouse-wheel events. */ - XCrossingEvent &xce = xe->xcrossing; + const XCrossingEvent &xce = xe->xcrossing; if (xce.mode == NotifyNormal) { g_event = new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, @@ -2381,7 +2381,7 @@ class DialogData { } /* Is the mouse inside the given button */ - bool isInsideButton(XEvent &e, uint button_num) + bool isInsideButton(const XEvent &e, uint button_num) { return ( (e.xmotion.y > int(height - padding_y - button_height)) &&