From c9549f3c912136e5a99888b0959438b2693591f2 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 31 Oct 2019 01:32:19 +0100 Subject: Pointer.c: reformat comments --- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pointer.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index d344f34b0..ab5496773 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -66,8 +66,8 @@ is" without express or implied warranty. #undef DEBUG /* - * The nxagentReversePointerMap array is used to - * memorize remote display pointer map. + * The nxagentReversePointerMap array is used to memorize remote + * display pointer map. */ unsigned char nxagentReversePointerMap[MAXBUTTONS]; @@ -76,13 +76,12 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) { /* * The original behaviour was to reset the pointer settings - * (acceleration and alas) to the default values. What the - * average user expects, on the contrary, is to have agent - * inheriting whatever value is set on the real X display. - * Having to reflect changes made inside the agent session, - * the correct behavior would be saving the original values - * and restoring them as soon as focus leaves the agent's - * window. + * (acceleration and alas) to the default values. What the average + * user expects, on the contrary, is to have agent inheriting + * whatever value is set on the real X display. Having to reflect + * changes made inside the agent session, the correct behavior would + * be saving the original values and restoring them as soon as focus + * leaves the agent's window. */ if (nxagentOption(DeviceControl) == True) -- cgit v1.2.3 From 024a2bc2e56d5851c584fd34c497d6749170593c Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 31 Oct 2019 01:32:35 +0100 Subject: Pointer.c: scope improvements --- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pointer.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index ab5496773..379a19fa0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -103,10 +103,6 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) int nxagentPointerProc(DeviceIntPtr pDev, int onoff) { - CARD8 map[MAXBUTTONS]; - int nmap; - int i; - switch (onoff) { case DEVICE_INIT: @@ -120,8 +116,10 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } - nmap = XGetPointerMapping(nxagentDisplay, map, MAXBUTTONS); - for (i = 0; i <= nmap; i++) + CARD8 map[MAXBUTTONS]; + + int nmap = XGetPointerMapping(nxagentDisplay, map, MAXBUTTONS); + for (int i = 0; i <= nmap; i++) map[i] = i; /* buttons are already mapped */ InitPointerDeviceStruct((DevicePtr) pDev, map, nmap, miPointerGetMotionEvents, @@ -173,10 +171,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) void nxagentInitPointerMap(void) { - int numButtons; - - int i; - unsigned char pointerMap[MAXBUTTONS]; #ifdef DEBUG @@ -184,13 +178,13 @@ void nxagentInitPointerMap(void) "pointer map from remote display.\n"); #endif - numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS); + int numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS); /* * Computing revers pointer map. */ - for (i = 1; i <= numButtons; i++) + for (int i = 1; i <= numButtons; i++) { nxagentReversePointerMap[pointerMap[i - 1]] = i; } -- cgit v1.2.3