aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-10-31 01:32:35 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-05 22:40:32 +0100
commit024a2bc2e56d5851c584fd34c497d6749170593c (patch)
treee0abf2cfc68582d15f95022cb44a245c06540898
parentc9549f3c912136e5a99888b0959438b2693591f2 (diff)
downloadnx-libs-024a2bc2e56d5851c584fd34c497d6749170593c.tar.gz
nx-libs-024a2bc2e56d5851c584fd34c497d6749170593c.tar.bz2
nx-libs-024a2bc2e56d5851c584fd34c497d6749170593c.zip
Pointer.c: scope improvements
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pointer.c18
1 files changed, 6 insertions, 12 deletions
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;
}