xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 6 17:34:50 UTC 2024


 Xext/saver.c |   39 ++++++++++-----------------------------
 1 file changed, 10 insertions(+), 29 deletions(-)

New commits:
commit fba3eefcc96dc84f8433b9e37f7a0b4e2abc9271
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Fri Jun 28 14:11:13 2024 +0200

    Xext: saver: little bit formatting cleanup
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1586>

diff --git a/Xext/saver.c b/Xext/saver.c
index 296de0dac..0d3d21110 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -63,30 +63,13 @@ in this Software without prior written authorization from the X Consortium.
 
 static int ScreenSaverEventBase = 0;
 
-static Bool ScreenSaverHandle(ScreenPtr /* pScreen */ ,
-                              int /* xstate */ ,
-                              Bool      /* force */
-    );
-
-static Bool
- CreateSaverWindow(ScreenPtr    /* pScreen */
-    );
-
-static Bool
- DestroySaverWindow(ScreenPtr   /* pScreen */
-    );
-
-static void
- UninstallSaverColormap(ScreenPtr       /* pScreen */
-    );
-
-static void
- CheckScreenPrivate(ScreenPtr   /* pScreen */
-    );
-
-static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * /* from */ ,
-                                    xScreenSaverNotifyEvent *   /* to */
-    );
+static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force);
+static Bool CreateSaverWindow(ScreenPtr pScreen);
+static Bool DestroySaverWindow(ScreenPtr pScreen);
+static void UninstallSaverColormap(ScreenPtr pScreen);
+static void CheckScreenPrivate(ScreenPtr pScreen);
+static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent *from,
+                                    xScreenSaverNotifyEvent *to);
 
 static RESTYPE SuspendType;     /* resource type for suspension records */
 
commit df3898765630b5011815efb5d3b49d3cc9bee66f
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Fri Jun 28 13:24:15 2024 +0200

    Xext: saver: drop New() macro
    
    We can directly use calloc() as all other places do.
    
    If we wanna have an convenient macro for struct allocation, that would be the
    job of a separate patch queue and should be done consequently, treewide.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1586>

diff --git a/Xext/saver.c b/Xext/saver.c
index 819aafbea..296de0dac 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -193,8 +193,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
     dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
 #define SetupScreen(s)	ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
 
-#define New(t)	(malloc(sizeof (t)))
-
 static void
 CheckScreenPrivate(ScreenPtr pScreen)
 {
@@ -217,7 +215,7 @@ MakeScreenPrivate(ScreenPtr pScreen)
 
     if (pPriv)
         return pPriv;
-    pPriv = New(ScreenSaverScreenPrivateRec);
+    pPriv = calloc(1, sizeof(ScreenSaverScreenPrivateRec));
     if (!pPriv)
         return 0;
     pPriv->events = 0;
@@ -267,7 +265,7 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
     }
     else {
         if (!pEv) {
-            pEv = New(ScreenSaverEventRec);
+            pEv = calloc(1, sizeof(ScreenSaverEventRec));
             if (!pEv) {
                 CheckScreenPrivate(pScreen);
                 return FALSE;
@@ -846,7 +844,7 @@ ScreenSaverSetAttributes(ClientPtr client)
         if (!pPriv)
             return FALSE;
     }
-    pAttr = New(ScreenSaverAttrRec);
+    pAttr = calloc(1, sizeof(ScreenSaverAttrRec));
     if (!pAttr) {
         ret = BadAlloc;
         goto bail;


More information about the xorg-commit mailing list