Module Name:    xsrc
Committed By:   mrg
Date:           Fri Nov 11 23:50:07 UTC 2022

Modified Files:
        xsrc/external/mit/xf86-input-mouse/dist/src: bsd_mouse.c mouse.c pnp.c

Log Message:
merge xf86-input-mouse 1.9.4.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
    xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c
cvs rdiff -u -r1.19 -r1.20 \
    xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xf86-input-mouse/dist/src/pnp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c
diff -u xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c:1.6 xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c:1.7
--- xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c:1.6	Sat Oct 10 21:50:53 2020
+++ xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c	Fri Nov 11 23:50:07 2022
@@ -61,7 +61,7 @@
 
 #define HID_USAGE2(p,u) (((p) << 16) | u)
 
-/* The UMS mices have middle button as number 3 */
+/* The UMS mice have middle button as number 3 */
 #define UMS_BUT(i) ((i) == 0 ? 2 : (i) == 1 ? 0 : (i) == 2 ? 1 : (i))
 #endif /* USBMOUSE_SUPPORT */
 
@@ -83,7 +83,7 @@ static const char *mouseDevs[] = {
         NULL
 };
 #elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-/* Only wsmouse mices are autoconfigured for now on OpenBSD */
+/* Only wsmouse mice are autoconfigured for now on OpenBSD */
 #define DEFAULT_WSMOUSE_DEV             "/dev/wsmouse"
 #define DEFAULT_WSMOUSE0_DEV            "/dev/wsmouse0"
 
@@ -232,7 +232,7 @@ SetSysMouseRes(InputInfoPtr pInfo, const
         (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
         /*
          * As the FreeBSD sysmouse driver defaults to protocol level 0
-         * everytime it is opened we enforce protocol level 1 again at
+         * every time it is opened we enforce protocol level 1 again at
          * this point.
          */
         mode.level = 1;
@@ -604,8 +604,10 @@ usbMouseProc(DeviceIntPtr pPointer, int 
                 pInfo->fd = -1;
             } else {
                 xf86FlushInput(pInfo->fd);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 23
                 if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
                                               pInfo))
+#endif
                     AddEnabledDevice(pInfo->fd);
             }
         }
@@ -726,7 +728,7 @@ usbPreInit(InputInfoPtr pInfo, const cha
             return FALSE;
         }
     }
-    /* Get USB informations */
+    /* Get USB information */
     reportDesc = hid_get_report_desc(pInfo->fd);
     /* Get packet size & iid */
 #ifdef USB_NEW_HID

Index: xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c
diff -u xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c:1.19 xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c:1.20
--- xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c:1.19	Mon Dec 31 12:01:31 2018
+++ xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c	Fri Nov 11 23:50:07 2022
@@ -38,7 +38,7 @@
  */
 
 /*
- * [PME-02/08/11] Added suport for drag lock buttons
+ * [PME-02/08/11] Added support for drag lock buttons
  * for use with 4 button trackballs for convenience
  * and to help limited dexterity persons
  */
@@ -176,12 +176,18 @@ static Bool autoGood(MouseDevPtr pMse);
 
 #undef MOUSE
 _X_EXPORT InputDriverRec MOUSE = {
-        1,
-        "mouse",
-        NULL,
-        MousePreInit,
-        NULL,
-        NULL,
+	.driverVersion		= 1,
+	.driverName		= "mouse",
+	.Identify		= NULL,
+	.PreInit		= MousePreInit,
+	.UnInit			= NULL,
+	.module			= NULL,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+	.default_options	= NULL,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 21
+	.capabilities		= 0
+#endif
+#endif
 };
 
 #define RETRY_COUNT 4
@@ -819,8 +825,8 @@ InitProtocols(void)
                 !osInfo->CheckProtocol(mouseProtocols[i].name))
                 mouseProtocols[i].id = PROT_UNSUP;
 
-#ifdef __NetBSD__
     /* NetBSD uses PROT_BM for "PS/2". */
+#if defined(__NetBSD__)
     for (i = 0; mouseProtocols[i].name; i++)
         if (mouseProtocols[i].id == PROT_PS2)
             mouseProtocols[i].id = PROT_BM;
@@ -1195,7 +1201,7 @@ MouseReadInput(InputInfoPtr pInfo)
     /*
      * Set blocking to -1 on the first call because we know there is data to
      * read. Xisb automatically clears it after one successful read so that
-     * succeeding reads are preceeded by a select with a 0 timeout to prevent
+     * succeeding reads are preceded by a select with a 0 timeout to prevent
      * read from blocking indefinitely.
      */
     XisbBlockDuration(pMse->buffer, -1);
@@ -1255,11 +1261,11 @@ MouseReadInput(InputInfoPtr pInfo)
                  */
                 /*
                  * [KAZU-030897]
-                 * Receive the fourth byte only when preceeding three bytes
+                 * Receive the fourth byte only when preceding three bytes
                  * have been detected (pBufP >= pMse->protoPara[4]).  In the
                  * previous versions, the test was pBufP == 0; we may have
                  * mistakingly received a byte even if we didn't see anything
-                 * preceeding the byte.
+                 * preceding the byte.
                  */
 #ifdef EXTMOUSEDEBUG
                 LogMessageVerbSigSafe(X_INFO, -1, "mouse 4th byte %x\n",u);
@@ -1908,7 +1914,7 @@ FlushButtons(MouseDevPtr pMse)
  * action = 0: nothing
  * action < 0: ButtonRelease
  *
- * The comment preceeding each section is the current emulation state.
+ * The comment preceding each section is the current emulation state.
  * The comments to the right are of the form
  *      <button state> (<events>) -> <new emulation state>
  * which should be read as
@@ -2586,7 +2592,6 @@ static Bool
 SetupMouse(InputInfoPtr pInfo)
 {
     MouseDevPtr pMse;
-    int i;
     int protoPara[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
     const char *name = NULL;
     Bool automatic = FALSE;
@@ -2597,7 +2602,7 @@ SetupMouse(InputInfoPtr pInfo)
     if (pMse->protocolID == PROT_AUTO) {
         /*
          * We come here when user specifies protocol "auto" in
-         * the configuration file or thru the xf86misc extensions.
+         * the configuration file or through the xf86misc extensions.
          * So we initialize autoprobing here.
          * Probe for PnP/OS mouse first. If unsuccessful
          * try to guess protocol from incoming data.
@@ -2617,7 +2622,7 @@ SetupMouse(InputInfoPtr pInfo)
     if (automatic) {
         if (name) {
             /* Possible protoPara overrides from SetupAuto. */
-            for (i = 0; i < sizeof(pMse->protoPara); i++)
+            for (size_t i = 0; i < sizeof(pMse->protoPara); i++)
                 if (protoPara[i] != -1)
                     pMse->protoPara[i] = protoPara[i];
             /* if we come here PnP/OS mouse probing was successful */
@@ -3243,7 +3248,7 @@ autoOSProtocol(InputInfoPtr pInfo, int *
                     /* Check for a builtin OS-specific protocol. */
                     if (osInfo->CheckProtocol && osInfo->CheckProtocol(name)) {
                         /* We can only come here if the protocol has been
-                         * changed to auto thru the xf86misc extension
+                         * changed to auto through the xf86misc extension
                          * and we have detected an OS specific builtin
                          * protocol. Currently we cannot handle this */
                         name = NULL;
@@ -3722,6 +3727,7 @@ autoGood(MouseDevPtr pMse)
     case AUTOPROBE_H_VALIDATE2:
         if (mPriv->goodCount < PROBE_UNCERTAINTY/2)
             return TRUE;
+        /* FALLTHROUGH */
     default:
         return FALSE;
     }
@@ -3755,8 +3761,9 @@ checkForErraticMovements(InputInfoPtr pI
                 mPriv->acc = abs(mPriv->accDx);
                 AP_DBG(("acc=%i\n",mPriv->acc));
             }
-            else
+            else {
                 AP_DBG(("accDx=%i\n",mPriv->accDx));
+            }
         } else {
             mPriv->accDx = 0;
         }
@@ -3768,8 +3775,9 @@ checkForErraticMovements(InputInfoPtr pI
             if (abs(mPriv->accDy) > mPriv->acc) {
                 mPriv->acc = abs(mPriv->accDy);
                 AP_DBG(("acc: %i\n",mPriv->acc));
-            } else
+            } else {
                 AP_DBG(("accDy=%i\n",mPriv->accDy));
+            }
         } else {
             mPriv->accDy = 0;
         }

Index: xsrc/external/mit/xf86-input-mouse/dist/src/pnp.c
diff -u xsrc/external/mit/xf86-input-mouse/dist/src/pnp.c:1.3 xsrc/external/mit/xf86-input-mouse/dist/src/pnp.c:1.4
--- xsrc/external/mit/xf86-input-mouse/dist/src/pnp.c:1.3	Wed Jun  5 07:11:16 2013
+++ xsrc/external/mit/xf86-input-mouse/dist/src/pnp.c	Fri Nov 11 23:50:07 2022
@@ -411,7 +411,7 @@ pnpparse(InputInfoPtr pInfo, pnpid_t *id
     xf86MsgVerb(X_INFO, 2, "%s: PnP rev %d.%02d\n", pInfo->name,
                 id->revision / 100, id->revision % 100);
 
-    /* EISA vender and product ID */
+    /* EISA vendor and product ID */
     id->eisaid = &buf[3];
     id->neisaid = 7;
 
@@ -601,7 +601,7 @@ ps2SendPacket(InputInfoPtr pInfo, unsign
                 return FALSE;
             }
 #ifdef DEBUG
-            xf86ErrorF("Recieved: 0x%x\n",c);
+            xf86ErrorF("Received: 0x%x\n",c);
 #endif
             if (c == 0xFA) /* ACK */
                 break;
@@ -613,7 +613,7 @@ ps2SendPacket(InputInfoPtr pInfo, unsign
             if (c == 0xFC) /* error */
                 return FALSE;
 
-            /* Some mice accidently enter wrap mode during init */
+            /* Some mice accidentally enter wrap mode during init */
             if (c == *(bytes + i)    /* wrap mode */
                 && (*(bytes + i) != 0xEC)) /* avoid recursion */
                 ps2DisableWrapMode(pInfo);

Reply via email to