xserver: Branch 'master' - 4 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Apr 26 20:18:41 PDT 2010


 Xext/panoramiX.c      |    3 ++-
 Xext/panoramiX.h      |   13 -------------
 Xext/panoramiXprocs.c |    2 +-
 Xext/shape.c          |    6 +++---
 dix/events.c          |    1 -
 mi/miinitext.c        |    3 +--
 6 files changed, 7 insertions(+), 21 deletions(-)

New commits:
commit 3f63db89191701139d45332ca80b9d6eb327c773
Merge: 41bdb6c... 54e51de...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Apr 26 20:18:13 2010 -0700

    Merge remote branch 'jamey/for-keith'

commit 54e51de8cd950b3f5b30e72cf1d604f54f619f0e
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat Apr 24 23:07:47 2010 -0700

    ProcGrabButton: remove redundant error check.
    
    If dixLookupResourceByType did not return Success, it will have set the
    pointer to NULL, so the second if will always be true.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/dix/events.c b/dix/events.c
index 6d0137d..b26e28a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -5355,7 +5355,6 @@ ProcGrabButton(ClientPtr client)
 	rc = dixLookupResourceByType((pointer *)&cursor, stuff->cursor, RT_CURSOR,
 			       client, DixUseAccess);
 	if (rc != Success)
-	if (!cursor)
 	{
 	    client->errorValue = stuff->cursor;
 	    return (rc == BadValue) ? BadCursor : rc;
commit 7e573b5ccd2c759f74ebb84d3a5a23da6b88ec6d
Author: Jamey Sharp <jamey at minilop.net>
Date:   Mon Apr 26 15:05:06 2010 -0700

    Kill unused/useless macros in panoramiX.h: BREAK_IF, IF_RETURN, FORCE_ROOT
    
    This header doesn't seem to be used outside the server tree, so I don't
    think anything was depending on these except what I've fixed in this
    patch.
    
    FORCE_ROOT is not used anywhere, and never has been in all the history
    that's in git. ajax removed its FORCE_WIN and FORCE_CMAP companions
    three years ago, in 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4.
    
    BREAK_IF and IF_RETURN expanded to exactly the keywords in their names,
    which is silly. They were rarely used and served only to make callers
    inconsistent with the idioms used elsewhere in the server.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 96eb8f9..d5965c2 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -476,7 +476,8 @@ void PanoramiXExtensionInit(int argc, char *argv[])
 	panoramiXdataPtr = (PanoramiXData *) 
 		xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
 
-        BREAK_IF(!panoramiXdataPtr);
+	if (!panoramiXdataPtr)
+	    break;
 
 	if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) {
 		noPanoramiXExtension = TRUE;
diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index 463a994..35de179 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -80,19 +80,6 @@ typedef struct {
 #define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
 #define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
 
-#define BREAK_IF(a) if ((a)) break
-#define IF_RETURN(a,b) if ((a)) return (b)
-
-#define FORCE_ROOT(a) { \
-    int _j; \
-    for (_j = PanoramiXNumScreens - 1; _j; _j--) \
-        if ((a).root == WindowTable[_j]->drawable.id)   \
-            break;                                      \
-    (a).rootX += panoramiXdataPtr[_j].x;             \
-    (a).rootY += panoramiXdataPtr[_j].y;             \
-    (a).root = WindowTable[0]->drawable.id;          \
-}
-
 #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
 
 #endif /* _PANORAMIX_H_ */
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 6834efb..6635db9 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1728,7 +1728,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
     isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
 
     narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
-    IF_RETURN((narcs % sizeof(xArc)), BadLength);
+    if (narcs % sizeof(xArc)) return BadLength;
     narcs /= sizeof(xArc);
     if (narcs > 0) {
 	origArcs = xalloc(narcs * sizeof(xArc));
diff --git a/Xext/shape.c b/Xext/shape.c
index cb4126b..58b5c23 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -365,7 +365,7 @@ ProcPanoramiXShapeRectangles(
     FOR_NSCREENS(j) {
 	stuff->dest = win->info[j].id;
 	result = ProcShapeRectangles (client);
-	BREAK_IF(result != Success);
+	if (result != Success) break;
     }
     return (result);
 }
@@ -474,7 +474,7 @@ ProcPanoramiXShapeMask(
 	if(pmap)
 	    stuff->src  = pmap->info[j].id;
 	result = ProcShapeMask (client);
-	BREAK_IF(result != Success);
+	if (result != Success) break;
     }
     return (result);
 }
@@ -600,7 +600,7 @@ ProcPanoramiXShapeCombine(
 	stuff->dest = win->info[j].id;
 	stuff->src =  win2->info[j].id;
 	result = ProcShapeCombine (client);
-	BREAK_IF(result != Success);
+	if (result != Success) break;
     }
     return (result);
 }
commit e372cc58e02391c3e8e82ac03f73fbe8b1f7d49c
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Oct 7 11:06:34 2009 -0700

    Boolean-or short-circuits, so (a || (!a && ...)) is redundant. Simplify.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

diff --git a/mi/miinitext.c b/mi/miinitext.c
index 844863a..a7441c9 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -537,8 +537,7 @@ InitExtensions(int argc, char *argv[])
     for (i = 0; ExtensionModuleList[i].name != NULL; i++) {
 	ext = &ExtensionModuleList[i];
 	if (ext->initFunc != NULL && 
-	    (ext->disablePtr == NULL || 
-	     (ext->disablePtr != NULL && !*ext->disablePtr))) {
+	    (ext->disablePtr == NULL || !*ext->disablePtr)) {
 	    (ext->initFunc)();
 	}
     }


More information about the xorg-commit mailing list