[PATCH:libX11 1/3] unifdef MUSTCOPY

Alan Coopersmith alan.coopersmith at oracle.com
Fri Mar 1 14:06:56 PST 2013


MUSTCOPY seems to have only been defined in <X11/Xmd.h> when building for
CRAY, to handle missing some sizes of integer type.

(mostly performed with unifdef, followed by some manual cleanup of
 spacing/indenting in the remaining code)

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 include/X11/Xlibint.h        |    9 -----
 modules/om/generic/omXChar.c |   91 +++++-------------------------------------
 src/ChWindow.c               |    9 -----
 src/ConfWind.c               |   13 ------
 src/CrWindow.c               |    9 -----
 src/DrArc.c                  |   12 ------
 src/DrLine.c                 |   16 --------
 src/DrPoint.c                |   15 -------
 src/DrRect.c                 |   16 --------
 src/FillArc.c                |   16 --------
 src/FillRct.c                |   15 -------
 src/Font.c                   |   44 +-------------------
 src/FontInfo.c               |   24 +----------
 src/MoveWin.c                |    9 -----
 src/PolyTxt16.c              |   23 -----------
 src/RestackWs.c              |    9 -----
 src/StColor.c                |   12 ------
 src/Text16.c                 |   23 -----------
 src/XlibAsync.c              |    5 ---
 19 files changed, 11 insertions(+), 359 deletions(-)

diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
index c2232de..5a7c0ed 100644
--- a/include/X11/Xlibint.h
+++ b/include/X11/Xlibint.h
@@ -701,19 +701,10 @@ extern void _XRead32(
 }
 
 
-#ifdef MUSTCOPY
-
-/* for when 32-bit alignment is not good enough */
-#define OneDataCard32(dpy,dstaddr,srcvar) \
-  { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); }
-
-#else
-
 /* srcvar must be a variable for large architecture version */
 #define OneDataCard32(dpy,dstaddr,srcvar) \
   { *(CARD32 *)(dstaddr) = (srcvar); }
 
-#endif /* MUSTCOPY */
 
 typedef struct _XInternalAsync {
     struct _XInternalAsync *next;
diff --git a/modules/om/generic/omXChar.c b/modules/om/generic/omXChar.c
index ff517d5..c9bbb8e 100644
--- a/modules/om/generic/omXChar.c
+++ b/modules/om/generic/omXChar.c
@@ -262,47 +262,6 @@ _XomGetFontSetFromCharSet(
     return (FontSet) NULL;
 }
 
-#ifdef MUSTCOPY
-static void
-cs_to_xchar2b(
-    register char *from,
-    register XChar2b *to,
-    register length)
-{
-    while (length-- > 0) {
-	to->byte1 = *from++;
-	to->byte2 = *from++;
-	to++;
-    }
-}
-
-static void
-cs_to_xchar2b_gl(
-    register char *from,
-    register XChar2b *to,
-    register length)
-{
-    while (length-- > 0) {
-	to->byte1 = *from++ & 0x7f;
-	to->byte2 = *from++ & 0x7f;
-	to++;
-    }
-}
-
-static void
-cs_to_xchar2b_gr(
-    register char *from,
-    register XChar2b *to,
-    register length)
-{
-    while (length-- > 0) {
-	to->byte1 = *from++ | 0x80;
-	to->byte2 = *from++ | 0x80;
-	to++;
-    }
-}
-#endif
-
 static void
 shift_to_gl(
     register char *text,
@@ -358,10 +317,6 @@ _XomConvert(
     XlcCharSet charset;
     int length, cs_left, ret;
     FontSet font_set;
-#ifdef MUSTCOPY
-    XChar2b *xchar2b;
-    char *buf, buf_local[BUFSIZ];
-#endif
 
     cs = *to;
     cs_left = *to_left;
@@ -380,46 +335,18 @@ _XomConvert(
 
     length = *to_left - cs_left;
 
-#ifdef MUSTCOPY
-    if (font_set->is_xchar2b) {
-	buf = (length > BUFSIZ) ? Xmalloc(length) : buf_local;
-	if (buf == NULL)
-	    return -1;
-	memcpy(buf, (char *) *to, length);
-
-	xchar2b = (XChar2b *) *to;
-	length >>= 1;
-
-	if (font_set->side == charset->side)
-	    cs_to_xchar2b(buf, xchar2b, length);
-	else if (font_set->side == XlcGL)
-	    cs_to_xchar2b_gl(buf, xchar2b, length);
+    if (font_set->side != charset->side) {
+	if (font_set->side == XlcGL)
+	    shift_to_gl(*to, length);
 	else if (font_set->side == XlcGR)
-	    cs_to_xchar2b_gr(buf, xchar2b, length);
-	else
-	    cs_to_xchar2b(buf, xchar2b, length);
-
-	if (buf != buf_local)
-	    Xfree(buf);
-
-	*to = (XPointer) (xchar2b + length);
-	*to_left -= length;
-    } else
-#endif
-    {
-	if (font_set->side != charset->side) {
-	    if (font_set->side == XlcGL)
-		shift_to_gl(*to, length);
-	    else if (font_set->side == XlcGR)
-		shift_to_gr(*to, length);
-	}
-
-	if (font_set->is_xchar2b)
-	    length >>= 1;
-	*to = cs;
-	*to_left -= length;
+	    shift_to_gr(*to, length);
     }
 
+    if (font_set->is_xchar2b)
+	length >>= 1;
+    *to = cs;
+    *to_left -= length;
+
     *((XFontStruct **) args[0]) = font_set->font;
     *((Bool *) args[1]) = font_set->is_xchar2b;
     if(num_args >= 3){
diff --git a/src/ChWindow.c b/src/ChWindow.c
index fbd6e88..89a81e1 100644
--- a/src/ChWindow.c
+++ b/src/ChWindow.c
@@ -43,20 +43,11 @@ XResizeWindow(
 
     req->window = w;
     req->mask = CWWidth | CWHeight;
-#ifdef MUSTCOPY
-    {
-	unsigned long lwidth = width, lheight = height;
-    dpy->bufptr -= 8;
-    Data32 (dpy, (long *) &lwidth, 4);	/* order dictated by values of */
-    Data32 (dpy, (long *) &lheight, 4);	/* CWWidth and CWHeight */
-    }
-#else
     {
 	CARD32 *valuePtr = (CARD32 *) NEXTPTR(req,xConfigureWindowReq);
 	*valuePtr++ = width;
 	*valuePtr = height;
     }
-#endif /* MUSTCOPY */
     UnlockDisplay(dpy);
     SyncHandle();
     return 1;
diff --git a/src/ConfWind.c b/src/ConfWind.c
index dd55b44..eefce4d 100644
--- a/src/ConfWind.c
+++ b/src/ConfWind.c
@@ -44,18 +44,6 @@ XMoveResizeWindow(
     GetReqExtra(ConfigureWindow, 16, req);
     req->window = w;
     req->mask = CWX | CWY | CWWidth | CWHeight;
-#ifdef MUSTCOPY
-    {
-	long lx = x, ly = y;
-	unsigned long lwidth = width, lheight = height;
-
-	dpy->bufptr -= 16;
-	Data32 (dpy, (long *) &lx, 4);	/* order must match values of */
-	Data32 (dpy, (long *) &ly, 4);	/* CWX, CWY, CWWidth, and CWHeight */
-	Data32 (dpy, (long *) &lwidth, 4);
-	Data32 (dpy, (long *) &lheight, 4);
-    }
-#else
     {
 	register CARD32 *valuePtr =
 	  (CARD32 *) NEXTPTR(req,xConfigureWindowReq);
@@ -64,7 +52,6 @@ XMoveResizeWindow(
 	*valuePtr++ = width;
 	*valuePtr   = height;
     }
-#endif /* MUSTCOPY */
     UnlockDisplay(dpy);
     SyncHandle();
     return 1;
diff --git a/src/CrWindow.c b/src/CrWindow.c
index 23f7ddc..7b54601 100644
--- a/src/CrWindow.c
+++ b/src/CrWindow.c
@@ -57,20 +57,11 @@ Window XCreateSimpleWindow(
     wid = req->wid = XAllocID(dpy);
     req->mask = CWBackPixel | CWBorderPixel;
 
-#ifdef MUSTCOPY
-    {
-	unsigned long lbackground = background, lborder = border;
-	dpy->bufptr -= 8;
-	Data32 (dpy, (long *) &lbackground, 4);
-	Data32 (dpy, (long *) &lborder, 4);
-    }
-#else
     {
 	register CARD32 *valuePtr = (CARD32 *) NEXTPTR(req,xCreateWindowReq);
 	*valuePtr++ = background;
 	*valuePtr = border;
     }
-#endif /* MUSTCOPY */
 
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/DrArc.c b/src/DrArc.c
index 1dc4a07..d72fac9 100644
--- a/src/DrArc.c
+++ b/src/DrArc.c
@@ -49,12 +49,6 @@ XDrawArc(
 {
     register xPolyArcReq *req;
     register xArc *arc;
-#ifdef MUSTCOPY
-    xArc arcdata;
-    long len = SIZEOF(xArc);
-
-    arc = &arcdata;
-#endif /* MUSTCOPY */
 
     LockDisplay(dpy);
     FlushGC(dpy, gc);
@@ -63,9 +57,7 @@ XDrawArc(
     req->drawable = d;
     req->gc = gc->gid;
 
-#ifndef MUSTCOPY
     arc = (xArc *) NEXTPTR(req,xPolyArcReq);
-#endif /* MUSTCOPY */
 
     arc->x = x;
     arc->y = y;
@@ -74,10 +66,6 @@ XDrawArc(
     arc->angle1 = angle1;
     arc->angle2 = angle2;
 
-#ifdef MUSTCOPY
-    dpy->bufptr -= SIZEOF(xArc);
-    Data (dpy, (char *) arc, len);
-#endif /* MUSTCOPY */
 
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/DrLine.c b/src/DrLine.c
index 3786f59..dc82d5a 100644
--- a/src/DrLine.c
+++ b/src/DrLine.c
@@ -45,12 +45,6 @@ XDrawLine (
     int y2)
 {
     register xSegment *segment;
-#ifdef MUSTCOPY
-    xSegment segmentdata;
-    long len = SIZEOF(xSegment);
-
-    segment = &segmentdata;
-#endif /* not MUSTCOPY */
 
     LockDisplay(dpy);
     FlushGC(dpy, gc);
@@ -67,21 +61,15 @@ XDrawLine (
        && (((char *)dpy->bufptr - (char *)req) < (gc->values.line_width ?
 						  wsize : zsize)) ) {
 	 req->length += SIZEOF(xSegment) >> 2;
-#ifndef MUSTCOPY
          segment = (xSegment *) dpy->bufptr;
 	 dpy->bufptr += SIZEOF(xSegment);
-#endif /* not MUSTCOPY */
 	 }
 
     else {
 	GetReqExtra (PolySegment, SIZEOF(xSegment), req);
 	req->drawable = d;
 	req->gc = gc->gid;
-#ifdef MUSTCOPY
-	dpy->bufptr -= SIZEOF(xSegment);
-#else
 	segment = (xSegment *) NEXTPTR(req,xPolySegmentReq);
-#endif /* MUSTCOPY */
 	}
 
     segment->x1 = x1;
@@ -89,10 +77,6 @@ XDrawLine (
     segment->x2 = x2;
     segment->y2 = y2;
 
-#ifdef MUSTCOPY
-    Data (dpy, (char *) &segmentdata, len);
-#endif /* MUSTCOPY */
-
     UnlockDisplay(dpy);
     SyncHandle();
     }
diff --git a/src/DrPoint.c b/src/DrPoint.c
index 5c89b5c..f0332e8 100644
--- a/src/DrPoint.c
+++ b/src/DrPoint.c
@@ -42,12 +42,6 @@ XDrawPoint(
     int y) /* INT16 */
 {
     xPoint *point;
-#ifdef MUSTCOPY
-    xPoint pointdata;
-    long len = SIZEOF(xPoint);
-
-    point = &pointdata;
-#endif /* MUSTCOPY */
 
     LockDisplay(dpy);
     FlushGC(dpy, gc);
@@ -65,10 +59,8 @@ XDrawPoint(
        && ((dpy->bufptr + SIZEOF(xPoint)) <= dpy->bufmax)
        && (((char *)dpy->bufptr - (char *)req) < size) ) {
 	 req->length += SIZEOF(xPoint) >> 2;
-#ifndef MUSTCOPY
          point = (xPoint *) dpy->bufptr;
 	 dpy->bufptr += SIZEOF(xPoint);
-#endif /* not MUSTCOPY */
 	 }
 
     else {
@@ -76,19 +68,12 @@ XDrawPoint(
 	req->drawable = d;
 	req->gc = gc->gid;
 	req->coordMode = CoordModeOrigin;
-#ifdef MUSTCOPY
-	dpy->bufptr -= SIZEOF(xPoint);
-#else
 	point = (xPoint *) NEXTPTR(req,xPolyPointReq);
-#endif /* MUSTCOPY */
 	}
 
     point->x = x;
     point->y = y;
 
-#ifdef MUSTCOPY
-    Data (dpy, (char *) point, len);
-#endif /* MUSTCOPY */
     }
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/DrRect.c b/src/DrRect.c
index dadd55e..d9141ee 100644
--- a/src/DrRect.c
+++ b/src/DrRect.c
@@ -45,12 +45,6 @@ XDrawRectangle(
     unsigned int height) /* CARD16 */
 {
     xRectangle *rect;
-#ifdef MUSTCOPY
-    xRectangle rectdata;
-    long len = SIZEOF(xRectangle);
-
-    rect = &rectdata;
-#endif /* MUSTCOPY */
 
     LockDisplay(dpy);
     FlushGC(dpy, gc);
@@ -67,21 +61,15 @@ XDrawRectangle(
        && (((char *)dpy->bufptr - (char *)req) < (gc->values.line_width ?
 						  wsize : zsize)) ) {
 	 req->length += SIZEOF(xRectangle) >> 2;
-#ifndef MUSTCOPY
          rect = (xRectangle *) dpy->bufptr;
 	 dpy->bufptr += SIZEOF(xRectangle);
-#endif /* not MUSTCOPY */
 	 }
 
     else {
 	GetReqExtra(PolyRectangle, SIZEOF(xRectangle), req);
 	req->drawable = d;
 	req->gc = gc->gid;
-#ifdef MUSTCOPY
-	dpy->bufptr -= SIZEOF(xRectangle);
-#else
 	rect = (xRectangle *) NEXTPTR(req,xPolyRectangleReq);
-#endif /* MUSTCOPY */
 	}
 
     rect->x = x;
@@ -89,10 +77,6 @@ XDrawRectangle(
     rect->width = width;
     rect->height = height;
 
-#ifdef MUSTCOPY
-    Data (dpy, (char *) rect, len);	/* subtracted bufptr up above */
-#endif /* MUSTCOPY */
-
     }
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/FillArc.c b/src/FillArc.c
index 0f1ad02..c67f977 100644
--- a/src/FillArc.c
+++ b/src/FillArc.c
@@ -46,12 +46,6 @@ XFillArc(
     int angle2) /* INT16 */
 {
     xArc *arc;
-#ifdef MUSTCOPY
-    xArc arcdata;
-    long len = SIZEOF(xArc);
-
-    arc = &arcdata;
-#endif /* MUSTCOPY */
 
     LockDisplay(dpy);
     FlushGC(dpy, gc);
@@ -67,10 +61,8 @@ XFillArc(
        && ((dpy->bufptr + SIZEOF(xArc)) <= dpy->bufmax)
        && (((char *)dpy->bufptr - (char *)req) < size) ) {
 	 req->length += SIZEOF(xArc) >> 2;
-#ifndef MUSTCOPY
          arc = (xArc *) dpy->bufptr;
 	 dpy->bufptr += SIZEOF(xArc);
-#endif /* not MUSTCOPY */
 	 }
 
     else {
@@ -78,11 +70,7 @@ XFillArc(
 
 	req->drawable = d;
 	req->gc = gc->gid;
-#ifdef MUSTCOPY
-	dpy->bufptr -= SIZEOF(xArc);
-#else
 	arc = (xArc *) NEXTPTR(req,xPolyFillArcReq);
-#endif /* MUSTCOPY */
 	}
     arc->x = x;
     arc->y = y;
@@ -91,10 +79,6 @@ XFillArc(
     arc->angle1 = angle1;
     arc->angle2 = angle2;
 
-#ifdef MUSTCOPY
-    Data (dpy, (char *) arc, len);
-#endif /* MUSTCOPY */
-
     }
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/FillRct.c b/src/FillRct.c
index 4cd104c..3ca9afe 100644
--- a/src/FillRct.c
+++ b/src/FillRct.c
@@ -44,12 +44,6 @@ XFillRectangle(
     unsigned int height) /* CARD16 */
 {
     xRectangle *rect;
-#ifdef MUSTCOPY
-    xRectangle rectdata;
-    long len = SIZEOF(xRectangle);
-
-    rect = &rectdata;
-#endif /* MUSTCOPY */
 
     LockDisplay(dpy);
     FlushGC(dpy, gc);
@@ -66,30 +60,21 @@ XFillRectangle(
        && ((dpy->bufptr + SIZEOF(xRectangle)) <= dpy->bufmax)
        && (((char *)dpy->bufptr - (char *)req) < size) ) {
 	 req->length += SIZEOF(xRectangle) >> 2;
-#ifndef MUSTCOPY
          rect = (xRectangle *) dpy->bufptr;
 	 dpy->bufptr += SIZEOF(xRectangle);
-#endif /* not MUSTCOPY */
 	 }
 
     else {
 	GetReqExtra(PolyFillRectangle, SIZEOF(xRectangle), req);
 	req->drawable = d;
 	req->gc = gc->gid;
-#ifdef MUSTCOPY
-	dpy->bufptr -= SIZEOF(xRectangle);
-#else
 	rect = (xRectangle *) NEXTPTR(req,xPolyFillRectangleReq);
-#endif /* MUSTCOPY */
 	}
     rect->x = x;
     rect->y = y;
     rect->width = width;
     rect->height = height;
 
-#ifdef MUSTCOPY
-    Data (dpy, (char *) rect, len);
-#endif /* MUSTCOPY */
     }
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/Font.c b/src/Font.c
index 7f56f68..25e1790 100644
--- a/src/Font.c
+++ b/src/Font.c
@@ -32,7 +32,7 @@ authorization from the X Consortium and the XFree86 Project.
 #endif
 #include "Xlibint.h"
 
-#if defined(XF86BIGFONT) && !defined(MUSTCOPY)
+#if defined(XF86BIGFONT)
 #define USE_XF86BIGFONT
 #endif
 #ifdef USE_XF86BIGFONT
@@ -228,31 +228,9 @@ _XQueryFont (
     fs->ascent 			= cvtINT16toInt (reply.fontAscent);
     fs->descent 		= cvtINT16toInt (reply.fontDescent);
 
-#ifdef MUSTCOPY
-    {
-	xCharInfo *xcip;
-
-	xcip = (xCharInfo *) &reply.minBounds;
-	fs->min_bounds.lbearing = cvtINT16toShort(xcip->leftSideBearing);
-	fs->min_bounds.rbearing = cvtINT16toShort(xcip->rightSideBearing);
-	fs->min_bounds.width = cvtINT16toShort(xcip->characterWidth);
-	fs->min_bounds.ascent = cvtINT16toShort(xcip->ascent);
-	fs->min_bounds.descent = cvtINT16toShort(xcip->descent);
-	fs->min_bounds.attributes = xcip->attributes;
-
-	xcip = (xCharInfo *) &reply.maxBounds;
-	fs->max_bounds.lbearing = cvtINT16toShort(xcip->leftSideBearing);
-	fs->max_bounds.rbearing =  cvtINT16toShort(xcip->rightSideBearing);
-	fs->max_bounds.width =  cvtINT16toShort(xcip->characterWidth);
-	fs->max_bounds.ascent =  cvtINT16toShort(xcip->ascent);
-	fs->max_bounds.descent =  cvtINT16toShort(xcip->descent);
-	fs->max_bounds.attributes = xcip->attributes;
-    }
-#else
     /* XXX the next two statements won't work if short isn't 16 bits */
     fs->min_bounds = * (XCharStruct *) &reply.minBounds;
     fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
-#endif /* MUSTCOPY */
 
     fs->n_properties = reply.nFontProps;
     /*
@@ -276,7 +254,6 @@ _XQueryFont (
      * If no characters in font, then it is a bad font, but
      * shouldn't try to read nothing.
      */
-    /* have to unpack charinfos on some machines (CRAY) */
     fs->per_char = NULL;
     if (reply.nCharInfos > 0){
 	nbytes = reply.nCharInfos * sizeof(XCharStruct);
@@ -288,27 +265,8 @@ _XQueryFont (
 	    return (XFontStruct *)NULL;
 	}
 
-#ifdef MUSTCOPY
-	{
-	    register XCharStruct *cs = fs->per_char;
-	    register int i;
-
-	    for (i = 0; i < reply.nCharInfos; i++, cs++) {
-		xCharInfo xcip;
-
-		_XRead(dpy, (char *)&xcip, SIZEOF(xCharInfo));
-		cs->lbearing = cvtINT16toShort(xcip.leftSideBearing);
-		cs->rbearing = cvtINT16toShort(xcip.rightSideBearing);
-		cs->width =  cvtINT16toShort(xcip.characterWidth);
-		cs->ascent =  cvtINT16toShort(xcip.ascent);
-		cs->descent =  cvtINT16toShort(xcip.descent);
-		cs->attributes = xcip.attributes;
-	    }
-	}
-#else
 	nbytes = reply.nCharInfos * SIZEOF(xCharInfo);
 	_XRead16 (dpy, (char *)fs->per_char, nbytes);
-#endif
     }
 
     /* call out to any extensions interested */
diff --git a/src/FontInfo.c b/src/FontInfo.c
index 97de40e..fb296b8 100644
--- a/src/FontInfo.c
+++ b/src/FontInfo.c
@@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group.
 #endif
 #include "Xlibint.h"
 
-#if defined(XF86BIGFONT) && !defined(MUSTCOPY)
+#if defined(XF86BIGFONT)
 #define USE_XF86BIGFONT
 #endif
 #ifdef USE_XF86BIGFONT
@@ -133,31 +133,9 @@ XFontStruct **info)	/* RETURN */
 	fs->ascent 		= cvtINT16toInt (reply.fontAscent);
 	fs->descent 		= cvtINT16toInt (reply.fontDescent);
 
-#ifdef MUSTCOPY
-	{
-	    xCharInfo *xcip;
-
-	    xcip = (xCharInfo *) &reply.minBounds;
-	    fs->min_bounds.lbearing = xcip->leftSideBearing;
-	    fs->min_bounds.rbearing = xcip->rightSideBearing;
-	    fs->min_bounds.width = xcip->characterWidth;
-	    fs->min_bounds.ascent = xcip->ascent;
-	    fs->min_bounds.descent = xcip->descent;
-	    fs->min_bounds.attributes = xcip->attributes;
-
-	    xcip = (xCharInfo *) &reply.maxBounds;
-	    fs->max_bounds.lbearing = xcip->leftSideBearing;
-	    fs->max_bounds.rbearing = xcip->rightSideBearing;
-	    fs->max_bounds.width = xcip->characterWidth;
-	    fs->max_bounds.ascent = xcip->ascent;
-	    fs->max_bounds.descent = xcip->descent;
-	    fs->max_bounds.attributes = xcip->attributes;
-	}
-#else
 	/* XXX the next two statements won't work if short isn't 16 bits */
 	fs->min_bounds = * (XCharStruct *) &reply.minBounds;
 	fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
-#endif /* MUSTCOPY */
 
 	fs->n_properties = reply.nFontProps;
 	if (fs->n_properties > 0) {
diff --git a/src/MoveWin.c b/src/MoveWin.c
index 3cd75e1..2eb2283 100644
--- a/src/MoveWin.c
+++ b/src/MoveWin.c
@@ -44,20 +44,11 @@ XMoveWindow (
     req->window = w;
     req->mask = CWX | CWY;
 
-#ifdef MUSTCOPY
-    {
-	long lx = (long) x, ly = (long) y;
-	dpy->bufptr -= 8;
-	Data32 (dpy, (long *) &lx, 4);	/* order dictated by CWX and CWY */
-	Data32 (dpy, (long *) &ly, 4);
-    }
-#else
     {
 	CARD32 *valuePtr = (CARD32 *) NEXTPTR(req,xConfigureWindowReq);
 	*valuePtr++ = x;
 	*valuePtr = y;
     }
-#endif /* MUSTCOPY */
     UnlockDisplay(dpy);
     SyncHandle();
     return 1;
diff --git a/src/PolyTxt16.c b/src/PolyTxt16.c
index dd65818..2e4be16 100644
--- a/src/PolyTxt16.c
+++ b/src/PolyTxt16.c
@@ -168,18 +168,7 @@ XDrawText16(
 		}
 	    	elt->len = 254;
 
-#if defined(MUSTCOPY) || defined(MUSTCOPY2B)
-		{
-		    register int i;
-		    register unsigned char *cp;
-		    for (i = 0, cp = ((unsigned char *)elt) + 2; i < 254; i++) {
-			*cp++ = CharacterOffset[i].byte1;
-			*cp++ = CharacterOffset[i].byte2;
-		    }
-		}
-#else
 		memcpy ((char *) (elt + 1), (char *)CharacterOffset, 254 * 2);
-#endif
 		PartialNChars = PartialNChars - 254;
 		CharacterOffset += 254;
 
@@ -213,21 +202,9 @@ XDrawText16(
 		}
 	    	elt->len = PartialNChars;
 
-#if defined(MUSTCOPY) || defined(MUSTCOPY2B)
-		{
-		    register int i;
-		    register unsigned char *cp;
-		    for (i = 0, cp = ((unsigned char *)elt) + 2; i < PartialNChars;
-			 i++) {
-			*cp++ = CharacterOffset[i].byte1;
-			*cp++ = CharacterOffset[i].byte2;
-		    }
-		}
-#else
 		memcpy ((char *) (elt + 1), (char *)CharacterOffset,
 			PartialNChars *
 2);
-#endif
 	    }
 	}
     item++;
diff --git a/src/RestackWs.c b/src/RestackWs.c
index 1dba3c8..52391ec 100644
--- a/src/RestackWs.c
+++ b/src/RestackWs.c
@@ -36,9 +36,6 @@ XRestackWindows (
     int n)
 {
     int i = 0;
-#ifdef MUSTCOPY
-    unsigned long val = Below;		/* needed for macro below */
-#endif
 
     LockDisplay(dpy);
     while (windows++, ++i < n) {
@@ -47,18 +44,12 @@ XRestackWindows (
     	GetReqExtra (ConfigureWindow, 8, req);
 	req->window = *windows;
 	req->mask = CWSibling | CWStackMode;
-#ifdef MUSTCOPY
-	dpy->bufptr -= 8;
-	Data32 (dpy, (long *)(windows-1), 4);
-	Data32 (dpy, (long *)&val, 4);
-#else
 	{
 	    register CARD32 *values = (CARD32 *)
 	      NEXTPTR(req,xConfigureWindowReq);
 	    *values++ = *(windows-1);
 	    *values   = Below;
 	}
-#endif /* MUSTCOPY */
 	}
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/StColor.c b/src/StColor.c
index 19f2a4b..d5a217f 100644
--- a/src/StColor.c
+++ b/src/StColor.c
@@ -37,21 +37,13 @@ XStoreColor(
 {
     xColorItem *citem;
     register xStoreColorsReq *req;
-#ifdef MUSTCOPY
-    xColorItem citemdata;
-    long len = SIZEOF(xColorItem);
-
-    citem = &citemdata;
-#endif /* MUSTCOPY */
 
     LockDisplay(dpy);
     GetReqExtra(StoreColors, SIZEOF(xColorItem), req); /* assume size is 4*n */
 
     req->cmap = cmap;
 
-#ifndef MUSTCOPY
     citem = (xColorItem *) NEXTPTR(req,xStoreColorsReq);
-#endif /* not MUSTCOPY */
 
     citem->pixel = def->pixel;
     citem->red = def->red;
@@ -59,10 +51,6 @@ XStoreColor(
     citem->blue = def->blue;
     citem->flags = def->flags; /* do_red, do_green, do_blue */
 
-#ifdef MUSTCOPY
-    dpy->bufptr -= SIZEOF(xColorItem);		/* adjust for GetReqExtra */
-    Data (dpy, (char *) citem, len);
-#endif /* MUSTCOPY */
 
     UnlockDisplay(dpy);
     SyncHandle();
diff --git a/src/Text16.c b/src/Text16.c
index 5a66a2b..008a3f7 100644
--- a/src/Text16.c
+++ b/src/Text16.c
@@ -82,18 +82,7 @@ XDrawString16(
 	    BufAlloc (xTextElt *, elt, nbytes);
 	    elt->delta = 0;
 	    elt->len = 254;
-#if defined(MUSTCOPY) || defined(MUSTCOPY2B)
-	    {
-		register int i;
-		register unsigned char *cp;
-		for (i = 0, cp = ((unsigned char *)elt) + 2; i < 254; i++) {
-		    *cp++ = CharacterOffset[i].byte1;
-		    *cp++ = CharacterOffset[i].byte2;
-		}
-	    }
-#else
             memcpy (((char *) elt) + 2, (char *)CharacterOffset, 254 * 2);
-#endif
 	    PartialNChars = PartialNChars - 254;
 	    CharacterOffset += 254;
 	}
@@ -104,19 +93,7 @@ XDrawString16(
 	    BufAlloc (xTextElt *, elt, nbytes);
 	    elt->delta = 0;
 	    elt->len = PartialNChars;
-#if defined(MUSTCOPY) || defined(MUSTCOPY2B)
-	    {
-		register int i;
-		register unsigned char *cp;
-		for (i = 0, cp = ((unsigned char *)elt) + 2; i < PartialNChars;
-		     i++) {
-		    *cp++ = CharacterOffset[i].byte1;
-		    *cp++ = CharacterOffset[i].byte2;
-		}
-	    }
-#else
             memcpy(((char *)elt) + 2, (char *)CharacterOffset, PartialNChars * 2);
-#endif
 	 }
     }
 
diff --git a/src/XlibAsync.c b/src/XlibAsync.c
index b17135c..eb2b819 100644
--- a/src/XlibAsync.c
+++ b/src/XlibAsync.c
@@ -100,11 +100,6 @@ _XGetAsyncReply(
 	    _XRead(dpy, replbuf + len, size - len);
 	    buf = replbuf;
 	    len = size;
-#ifdef MUSTCOPY
-	} else {
-	    memcpy(replbuf, buf, size);
-	    buf = replbuf;
-#endif
 	}
 
 	if (discard && rep->generic.length > extra &&
-- 
1.7.9.2



More information about the xorg-devel mailing list