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 04b87d6dfa.

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@minilop.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Jamey Sharp 2010-04-26 15:05:06 -07:00
parent e372cc58e0
commit 7e573b5ccd
4 changed files with 6 additions and 18 deletions

View File

@ -476,7 +476,8 @@ void PanoramiXExtensionInit(int argc, char *argv[])
panoramiXdataPtr = (PanoramiXData *) panoramiXdataPtr = (PanoramiXData *)
xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData)); xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
BREAK_IF(!panoramiXdataPtr); if (!panoramiXdataPtr)
break;
if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) { if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) {
noPanoramiXExtension = TRUE; noPanoramiXExtension = TRUE;

View File

@ -80,19 +80,6 @@ typedef struct {
#define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--) #define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
#define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(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) #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
#endif /* _PANORAMIX_H_ */ #endif /* _PANORAMIX_H_ */

View File

@ -1728,7 +1728,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
IF_RETURN((narcs % sizeof(xArc)), BadLength); if (narcs % sizeof(xArc)) return BadLength;
narcs /= sizeof(xArc); narcs /= sizeof(xArc);
if (narcs > 0) { if (narcs > 0) {
origArcs = xalloc(narcs * sizeof(xArc)); origArcs = xalloc(narcs * sizeof(xArc));

View File

@ -365,7 +365,7 @@ ProcPanoramiXShapeRectangles(
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
stuff->dest = win->info[j].id; stuff->dest = win->info[j].id;
result = ProcShapeRectangles (client); result = ProcShapeRectangles (client);
BREAK_IF(result != Success); if (result != Success) break;
} }
return (result); return (result);
} }
@ -474,7 +474,7 @@ ProcPanoramiXShapeMask(
if(pmap) if(pmap)
stuff->src = pmap->info[j].id; stuff->src = pmap->info[j].id;
result = ProcShapeMask (client); result = ProcShapeMask (client);
BREAK_IF(result != Success); if (result != Success) break;
} }
return (result); return (result);
} }
@ -600,7 +600,7 @@ ProcPanoramiXShapeCombine(
stuff->dest = win->info[j].id; stuff->dest = win->info[j].id;
stuff->src = win2->info[j].id; stuff->src = win2->info[j].id;
result = ProcShapeCombine (client); result = ProcShapeCombine (client);
BREAK_IF(result != Success); if (result != Success) break;
} }
return (result); return (result);
} }