Source-Changes-HG archive

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

[xsrc/trunk]: xsrc/external/mit/xorg-server.old/dist/hw/sun More cherry-picks...



details:   https://anonhg.NetBSD.org/xsrc/rev/61748ff94284
branches:  trunk
changeset: 10544:61748ff94284
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Aug 13 19:52:23 2020 +0000

description:
More cherry-picks to sync with xorg-server:

 Remove more redundant command option arg checks.
 Avoid dumb DevicePtr casts.

diffstat:

 external/mit/xorg-server.old/dist/hw/sun/sun.h      |   1 +
 external/mit/xorg-server.old/dist/hw/sun/sunInit.c  |   8 ++------
 external/mit/xorg-server.old/dist/hw/sun/sunIo.c    |  17 ++++++-----------
 external/mit/xorg-server.old/dist/hw/sun/sunKbd.c   |   4 ++--
 external/mit/xorg-server.old/dist/hw/sun/sunMouse.c |   4 ++--
 5 files changed, 13 insertions(+), 21 deletions(-)

diffs (122 lines):

diff -r 429215be8ca0 -r 61748ff94284 external/mit/xorg-server.old/dist/hw/sun/sun.h
--- a/external/mit/xorg-server.old/dist/hw/sun/sun.h    Thu Aug 13 05:12:35 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sun.h    Thu Aug 13 19:52:23 2020 +0000
@@ -300,6 +300,7 @@
 extern Bool            sunSwapLkeys;
 extern Bool            sunForceMono;
 extern Bool            sunDebug;
+extern char            *sunDeviceList;
 extern Bool            sunFlipPixels;
 extern Bool            sunFbInfo;
 extern Bool            sunCG4Frob;
diff -r 429215be8ca0 -r 61748ff94284 external/mit/xorg-server.old/dist/hw/sun/sunInit.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunInit.c        Thu Aug 13 05:12:35 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunInit.c        Thu Aug 13 19:52:23 2020 +0000
@@ -132,6 +132,7 @@
 
 Bool sunSwapLkeys = FALSE;
 Bool sunDebug = FALSE;
+char *sunDeviceList = NULL;
 Bool sunForceMono = FALSE;
 Bool sunFlipPixels = FALSE;
 Bool sunFbInfo = FALSE;
@@ -403,14 +404,9 @@
 {
     int                i;
     char       *envList = NULL;
-    char       *cmdList = NULL;
+    char       *cmdList = sunDeviceList;
     char       **deviceList = (char **)NULL;
 
-    for (i = 1; i < argc; i++)
-       if (strcmp (argv[i], "-dev") == 0 && i+1 < argc) {
-           cmdList = argv[i + 1];
-           break;
-       }
     if (!cmdList)
        envList = getenv ("XDEVICE");
 
diff -r 429215be8ca0 -r 61748ff94284 external/mit/xorg-server.old/dist/hw/sun/sunIo.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunIo.c  Thu Aug 13 05:12:35 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunIo.c  Thu Aug 13 19:52:23 2020 +0000
@@ -170,9 +170,10 @@
 #else
     (void) OsSignal (SIGIO, SIG_IGN);
 #endif
-    devPtr = (DevicePtr)sunKeyboardDevice;
-    if (devPtr)
+    if (sunKeyboardDevice) {
+        devPtr = &sunKeyboardDevice->public;
        (void) sunChangeKbdTranslation (((sunKbdPrivPtr)(devPtr->devicePrivate))->fd, FALSE);
+    }
 #if defined(SVR4) || defined(CSRG_BASED)
     sunNonBlockConsoleOff ();
 #else
@@ -209,7 +210,9 @@
        return 1;
     }
     if (strcmp (argv[i], "-dev") == 0) {       /* -dev /dev/mumble */
-       if (++i >= argc) UseMsg ();
+       if (++i >= argc)
+           UseMsg();
+       sunDeviceList = argv[i];
        return 2;
     }
     if (strcmp (argv[i], "-mono") == 0) {      /* -mono */
@@ -228,14 +231,6 @@
        sunFbInfo = TRUE;
        return 1;
     }
-    if (strcmp (argv[i], "-kbd") == 0) {       /* -kbd */
-       if (++i >= argc) UseMsg();
-       return 2;
-    }
-    if (strcmp (argv[i], "-protect") == 0) {   /* -protect */
-       if (++i >= argc) UseMsg();
-       return 2;
-    }
     if (strcmp (argv[i], "-cg4frob") == 0) {
        sunCG4Frob = TRUE;
        return 1;
diff -r 429215be8ca0 -r 61748ff94284 external/mit/xorg-server.old/dist/hw/sun/sunKbd.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c Thu Aug 13 05:12:35 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunKbd.c Thu Aug 13 19:52:23 2020 +0000
@@ -607,7 +607,7 @@
 int
 sunKbdProc(DeviceIntPtr device, int what)
 {
-    DevicePtr pKeyboard = (DevicePtr) device;
+    DevicePtr pKeyboard = &device->public;
     sunKbdPrivPtr pPriv;
     KeybdCtrl* ctrl = &device->kbdfeed->ctrl;
     XkbRMLVOSet rmlvo;
@@ -617,7 +617,7 @@
 
     switch (what) {
     case DEVICE_INIT:
-       if (pKeyboard != (DevicePtr)sunKeyboardDevice) {
+       if (pKeyboard != &sunKeyboardDevice->public) {
            ErrorF ("Cannot open non-system keyboard\n");
            return (!Success);
        }
diff -r 429215be8ca0 -r 61748ff94284 external/mit/xorg-server.old/dist/hw/sun/sunMouse.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunMouse.c       Thu Aug 13 05:12:35 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunMouse.c       Thu Aug 13 19:52:23 2020 +0000
@@ -119,7 +119,7 @@
 int
 sunMouseProc(DeviceIntPtr device, int what)
 {
-    DevicePtr    pMouse = (DevicePtr) device;
+    DevicePtr    pMouse = &device->public;
     int                  format;
     static int   oformat;
     BYTE         map[4];
@@ -128,7 +128,7 @@
 
     switch (what) {
        case DEVICE_INIT:
-           if (pMouse != (DevicePtr)sunPointerDevice) {
+           if (pMouse != &sunPointerDevice->public) {
                ErrorF ("Cannot open non-system mouse");
                return !Success;
            }



Home | Main Index | Thread Index | Old Index