Commit 024a2bc2 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Pointer.c: scope improvements

parent c9549f3c
...@@ -103,10 +103,6 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) ...@@ -103,10 +103,6 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
int nxagentPointerProc(DeviceIntPtr pDev, int onoff) int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
{ {
CARD8 map[MAXBUTTONS];
int nmap;
int i;
switch (onoff) switch (onoff)
{ {
case DEVICE_INIT: case DEVICE_INIT:
...@@ -120,8 +116,10 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) ...@@ -120,8 +116,10 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return Success; return Success;
} }
nmap = XGetPointerMapping(nxagentDisplay, map, MAXBUTTONS); CARD8 map[MAXBUTTONS];
for (i = 0; i <= nmap; i++)
int nmap = XGetPointerMapping(nxagentDisplay, map, MAXBUTTONS);
for (int i = 0; i <= nmap; i++)
map[i] = i; /* buttons are already mapped */ map[i] = i; /* buttons are already mapped */
InitPointerDeviceStruct((DevicePtr) pDev, map, nmap, InitPointerDeviceStruct((DevicePtr) pDev, map, nmap,
miPointerGetMotionEvents, miPointerGetMotionEvents,
...@@ -173,10 +171,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) ...@@ -173,10 +171,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
void nxagentInitPointerMap(void) void nxagentInitPointerMap(void)
{ {
int numButtons;
int i;
unsigned char pointerMap[MAXBUTTONS]; unsigned char pointerMap[MAXBUTTONS];
#ifdef DEBUG #ifdef DEBUG
...@@ -184,13 +178,13 @@ void nxagentInitPointerMap(void) ...@@ -184,13 +178,13 @@ void nxagentInitPointerMap(void)
"pointer map from remote display.\n"); "pointer map from remote display.\n");
#endif #endif
numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS); int numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS);
/* /*
* Computing revers pointer map. * Computing revers pointer map.
*/ */
for (i = 1; i <= numButtons; i++) for (int i = 1; i <= numButtons; i++)
{ {
nxagentReversePointerMap[pointerMap[i - 1]] = i; nxagentReversePointerMap[pointerMap[i - 1]] = i;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment