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/dist/hw/sun Avoid dumb DevicePtr ...



details:   https://anonhg.NetBSD.org/xsrc/rev/429215be8ca0
branches:  trunk
changeset: 10543:429215be8ca0
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Aug 13 05:12:35 2020 +0000

description:
Avoid dumb DevicePtr casts.

diffstat:

 external/mit/xorg-server/dist/hw/sun/sunIo.c    |  5 +++--
 external/mit/xorg-server/dist/hw/sun/sunKbd.c   |  4 ++--
 external/mit/xorg-server/dist/hw/sun/sunMouse.c |  4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r a06c25601452 -r 429215be8ca0 external/mit/xorg-server/dist/hw/sun/sunIo.c
--- a/external/mit/xorg-server/dist/hw/sun/sunIo.c      Tue Aug 11 06:49:09 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sunIo.c      Thu Aug 13 05:12:35 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
diff -r a06c25601452 -r 429215be8ca0 external/mit/xorg-server/dist/hw/sun/sunKbd.c
--- a/external/mit/xorg-server/dist/hw/sun/sunKbd.c     Tue Aug 11 06:49:09 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sunKbd.c     Thu Aug 13 05:12:35 2020 +0000
@@ -613,7 +613,7 @@
 int
 sunKbdProc(DeviceIntPtr device, int what)
 {
-    DevicePtr pKeyboard = (DevicePtr) device;
+    DevicePtr pKeyboard = &device->public;
     sunKbdPrivPtr pPriv;
     KeybdCtrl* ctrl = &device->kbdfeed->ctrl;
     XkbRMLVOSet rmlvo;
@@ -623,7 +623,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 a06c25601452 -r 429215be8ca0 external/mit/xorg-server/dist/hw/sun/sunMouse.c
--- a/external/mit/xorg-server/dist/hw/sun/sunMouse.c   Tue Aug 11 06:49:09 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sunMouse.c   Thu Aug 13 05:12:35 2020 +0000
@@ -123,7 +123,7 @@
 int
 sunMouseProc(DeviceIntPtr device, int what)
 {
-    DevicePtr    pMouse = (DevicePtr) device;
+    DevicePtr    pMouse = &device->public;
     int                  format;
     static int   oformat;
     BYTE         map[4];
@@ -132,7 +132,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