[PATCH xf86-input-mouse] Fix compiler warnings

Peter Hutterer peter.hutterer at who-t.net
Sun Jul 29 22:53:22 PDT 2012


pnp.c: In function 'probePs2ProtocolPnP':
pnp.c:711:31: warning: declaration of 'seq' shadows a previous local
[-Wshadow]
pnp.c:705:23: warning: shadowed declaration is here [-Wshadow]

mouse.c: In function 'MouseCommonOptions':
mouse.c:330:13: warning: declaration of 'i' shadows a previous local
[-Wshadow]
mouse.c:279:9: warning: shadowed declaration is here [-Wshadow]

mouse.c: In function 'autoProbeMouse':
mouse.c:3602:29: warning: declaration of 'proto' shadows a global
declaration [-Wshadow]
mouse.c:2482:22: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/mouse.c |   14 +++++++-------
 src/pnp.c   |    4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mouse.c b/src/mouse.c
index 70ea7fb..719b1fa 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -327,7 +327,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
         int lock;             /* lock button */
         int target;           /* target button */
         int lockM,targetM;    /* bitmasks for drag lock, target */
-        int i, j;             /* indexes */
+        int j;                /* indexes */
         char *s1;             /* parse input string */
         DragLockPtr pLock;
 
@@ -3599,14 +3599,14 @@ autoProbeMouse(InputInfoPtr pInfo, Bool inSync, Bool lostSync)
         }
         case AUTOPROBE_SWITCH_PROTOCOL:
         {
-            MouseProtocolID proto;
+            MouseProtocolID prot;
             MouseProtocolPtr pProto;
             void *defaults;
             AP_DBG(("State SWITCH_PROTOCOL\n"));
-            proto = mPriv->protoList[mPriv->protocolID++];
-            if (proto == PROT_UNKNOWN)
+            prot = mPriv->protoList[mPriv->protocolID++];
+            if (prot == PROT_UNKNOWN)
                 mPriv->autoState = AUTOPROBE_SWITCHSERIAL;
-            else if (!((pProto = GetProtocol(proto)) &&
+            else if (!((pProto = GetProtocol(prot)) &&
                        ((defaults = pProto->defaults)))
                        || (mPriv->serialDefaultsNum == -1
                            && (defaults == msDefaults))
@@ -3614,8 +3614,8 @@ autoProbeMouse(InputInfoPtr pInfo, Bool inSync, Bool lostSync)
                            && serialDefaultsList[mPriv->serialDefaultsNum]
                            == defaults)) {
                 AP_DBG(("Changing Protocol to %s\n",
-                        ProtocolIDToName(proto)));
-                SetMouseProto(pMse,proto);
+                        ProtocolIDToName(prot)));
+                SetMouseProto(pMse,prot);
                 FlushButtons(pMse);
                 RESET_VALIDATION;
                 mPriv->autoState = AUTOPROBE_VALIDATE2;
diff --git a/src/pnp.c b/src/pnp.c
index 6eba24d..e5c4bc7 100644
--- a/src/pnp.c
+++ b/src/pnp.c
@@ -708,8 +708,8 @@ probePs2ProtocolPnP(InputInfoPtr pInfo)
             u = ps2GetDeviceID(pInfo);
             if (u == 0x03) {
                 /* found IntelliMouse now try IntelliExplorer */
-                unsigned char seq[] = { 243, 200, 243, 200, 243, 80 };
-                if (ps2SendPacket(pInfo,seq,sizeof(seq))) {
+                unsigned char im_seq[] = { 243, 200, 243, 200, 243, 80 };
+                if (ps2SendPacket(pInfo,im_seq,sizeof(im_seq))) {
                     u = ps2GetDeviceID(pInfo);
                     if (u == 0x04)
                         ret =  PROT_EXPPS2;
-- 
1.7.10.4



More information about the xorg-devel mailing list