xf86-video-nested: 2 commits - src/client.h src/driver.c src/xlibclient.c

Keith Packard keithp at kemper.freedesktop.org
Tue Jul 19 16:06:32 UTC 2016


 src/client.h     |    4 ++--
 src/driver.c     |   29 +++++++++++++++++++----------
 src/xlibclient.c |    4 ++--
 3 files changed, 23 insertions(+), 14 deletions(-)

New commits:
commit 1d02fa6da7a8ee54d832d5a80111a9c6e648839c
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jul 19 09:06:04 2016 -0700

    Handle ABI version 23
    
    Block and wakeup handlers have changed function signature.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/driver.c b/src/driver.c
index 8c2b2f1..0e3cb29 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -85,9 +85,6 @@ static Bool NestedCreateScreenResources(ScreenPtr pScreen);
 static void NestedShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf);
 static Bool NestedCloseScreen(CLOSE_SCREEN_ARGS_DECL);
 
-static void NestedBlockHandler(pointer data, OSTimePtr wt, pointer LastSelectMask);
-static void NestedWakeupHandler(pointer data, int i, pointer LastSelectMask);
-
 int NestedValidateModes(ScrnInfoPtr pScrn);
 Bool NestedAddMode(ScrnInfoPtr pScrn, int width, int height);
 void NestedPrintPscreen(ScrnInfoPtr p);
@@ -534,13 +531,23 @@ NestedMouseTimer(OsTimerPtr timer, CARD32 time, pointer arg) {
 }
 
 static void
-NestedBlockHandler(pointer data, OSTimePtr wt, pointer LastSelectMask) {
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
+NestedBlockHandler(void *data, void *wt)
+#else
+NestedBlockHandler(pointer data, OSTimePtr wt, pointer LastSelectMask)
+#endif
+{
     NestedClientPrivatePtr pNestedClient = data;
     NestedClientCheckEvents(pNestedClient);
 }
 
 static void
-NestedWakeupHandler(pointer data, int i, pointer LastSelectMask) {
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
+NestedWakeupHandler(void *data, int i)
+#else
+NestedWakeupHandler(pointer data, int i, pointer LastSelectMask)
+#endif
+{
 }
 
 /* Called at each server generation */
commit 4512072ccd7eb65466402758c298dcf61215ea41
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jul 19 09:04:03 2016 -0700

    Fix const and deprecated func warnings
    
    A few const char warnings, plus XNFcalloc is now deprecated
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/client.h b/src/client.h
index 4c73b3c..c11868c 100644
--- a/src/client.h
+++ b/src/client.h
@@ -38,12 +38,12 @@
 struct NestedClientPrivate;
 typedef struct NestedClientPrivate *NestedClientPrivatePtr;
 
-Bool NestedClientCheckDisplay(char *displayName);
+Bool NestedClientCheckDisplay(const char *displayName);
 
 Bool NestedClientValidDepth(int depth);
 
 NestedClientPrivatePtr NestedClientCreateScreen(int    scrnIndex,
-                                                char  *displayName,
+                                                const char  *displayName,
                                                 int    width,
                                                 int    height,
                                                 int    originX,
diff --git a/src/driver.c b/src/driver.c
index 68b7aa8..8c2b2f1 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -162,7 +162,7 @@ _X_EXPORT XF86ModuleData nestedModuleData = {
 
 /* These stuff should be valid to all server generations */
 typedef struct NestedPrivate {
-    char                        *displayName;
+    const char                   *displayName;
     int                          originX;
     int                          originY;
     NestedClientPrivatePtr       clientData;
@@ -303,7 +303,7 @@ static void NestedFreePrivate(ScrnInfoPtr pScrn) {
 /* Data from here is valid to all server generations */
 static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) {
     NestedPrivatePtr pNested;
-    char *originString = NULL;
+    const char *originString = NULL;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NestedPreInit\n");
 
@@ -492,19 +492,21 @@ NestedAddMode(ScrnInfoPtr pScrn, int width, int height) {
     DisplayModePtr mode;
     char nameBuf[64];
     size_t len;
+    char *modeName;
 
     if (snprintf(nameBuf, 64, "%dx%d", width, height) >= 64)
         return FALSE;
 
-    mode = XNFcalloc(sizeof(DisplayModeRec));
+    mode = xnfcalloc(sizeof(DisplayModeRec), 1);
     mode->status = MODE_OK;
     mode->type = M_T_DRIVER;
     mode->HDisplay = width;
     mode->VDisplay = height;
 
     len = strlen(nameBuf);
-    mode->name = XNFalloc(len+1);
-    strcpy(mode->name, nameBuf);
+    modeName = XNFalloc(len+1);
+    strcpy(modeName, nameBuf);
+    mode->name = modeName;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding mode %s\n", mode->name);
 
diff --git a/src/xlibclient.c b/src/xlibclient.c
index f7fe652..10ab970 100644
--- a/src/xlibclient.c
+++ b/src/xlibclient.c
@@ -78,7 +78,7 @@ struct NestedClientPrivate {
 
 /* Checks if a display is open */
 Bool
-NestedClientCheckDisplay(char *displayName) {
+NestedClientCheckDisplay(const char *displayName) {
     Display *d;
 
     d = XOpenDisplay(displayName);
@@ -159,7 +159,7 @@ NestedClientTryXShm(NestedClientPrivatePtr pPriv, int scrnIndex, int width, int
 
 NestedClientPrivatePtr
 NestedClientCreateScreen(int scrnIndex,
-                         char *displayName,
+                         const char *displayName,
                          int width,
                          int height,
                          int originX,


More information about the xorg-commit mailing list