Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xf86-input-mouse/dist/src merge xf86-input-mo...



details:   https://anonhg.NetBSD.org/xsrc/rev/4d3da7a15426
branches:  trunk
changeset: 7243:4d3da7a15426
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Nov 11 23:50:07 2022 +0000

description:
merge xf86-input-mouse 1.9.4.

diffstat:

 external/mit/xf86-input-mouse/dist/src/bsd_mouse.c |  10 +++--
 external/mit/xf86-input-mouse/dist/src/mouse.c     |  44 +++++++++++++---------
 external/mit/xf86-input-mouse/dist/src/pnp.c       |   6 +-
 3 files changed, 35 insertions(+), 25 deletions(-)

diffs (224 lines):

diff -r 767297cb5661 -r 4d3da7a15426 external/mit/xf86-input-mouse/dist/src/bsd_mouse.c
--- a/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c        Fri Nov 11 23:31:19 2022 +0000
+++ b/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c        Fri Nov 11 23:50:07 2022 +0000
@@ -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 @@
         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 @@
         (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 @@
                 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 @@
             return FALSE;
         }
     }
-    /* Get USB informations */
+    /* Get USB information */
     reportDesc = hid_get_report_desc(pInfo->fd);
     /* Get packet size & iid */
 #ifdef USB_NEW_HID
diff -r 767297cb5661 -r 4d3da7a15426 external/mit/xf86-input-mouse/dist/src/mouse.c
--- a/external/mit/xf86-input-mouse/dist/src/mouse.c    Fri Nov 11 23:31:19 2022 +0000
+++ b/external/mit/xf86-input-mouse/dist/src/mouse.c    Fri Nov 11 23:50:07 2022 +0000
@@ -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 @@
 
 #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 @@
                 !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 @@
     /*
      * 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 @@
                  */
                 /*
                  * [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 @@
  * 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 @@
 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 @@
     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 @@
     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 @@
                     /* 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 @@
     case AUTOPROBE_H_VALIDATE2:
         if (mPriv->goodCount < PROBE_UNCERTAINTY/2)
             return TRUE;
+        /* FALLTHROUGH */
     default:
         return FALSE;
     }
@@ -3755,8 +3761,9 @@
                 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 @@
             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;
         }
diff -r 767297cb5661 -r 4d3da7a15426 external/mit/xf86-input-mouse/dist/src/pnp.c
--- a/external/mit/xf86-input-mouse/dist/src/pnp.c      Fri Nov 11 23:31:19 2022 +0000
+++ b/external/mit/xf86-input-mouse/dist/src/pnp.c      Fri Nov 11 23:50:07 2022 +0000
@@ -411,7 +411,7 @@
     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 @@
                 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 @@
             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);



Home | Main Index | Thread Index | Old Index