(submit/xnest-gcrec) fix name clash on 'GC' between Xlib and Xserver
Both xlib as well as the Xserver use the same identifier "GC" for different types. While on xlib it's just the numerical ID of a GC, the xserver defines a struct for it by the same name. This is this ugly and needs ridiculous hacks for Xserver code that needs xlib. Easy to solve by just renaming the GC typedef to GCRec (consistent with how we're naming other structs) and replacing GC* by GCPtr. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
3bd44734a4
commit
556c8726ae
|
@ -99,7 +99,7 @@ typedef struct _LFclosure {
|
|||
typedef struct _PTclosure {
|
||||
ClientPtr client;
|
||||
DrawablePtr pDraw;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
unsigned char *pElt;
|
||||
unsigned char *endReq;
|
||||
unsigned char *data;
|
||||
|
@ -115,7 +115,7 @@ typedef struct _PTclosure {
|
|||
typedef struct _ITclosure {
|
||||
ClientPtr client;
|
||||
DrawablePtr pDraw;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
BYTE nChars;
|
||||
unsigned char *data;
|
||||
int xorg;
|
||||
|
|
|
@ -1566,7 +1566,7 @@ int
|
|||
ProcCreateGC(ClientPtr client)
|
||||
{
|
||||
int error, rc;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
unsigned len;
|
||||
|
||||
|
@ -1583,7 +1583,7 @@ ProcCreateGC(ClientPtr client)
|
|||
len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq));
|
||||
if (len != Ones(stuff->mask))
|
||||
return BadLength;
|
||||
pGC = (GC *) CreateGC(pDraw, stuff->mask, (XID *) &stuff[1], &error,
|
||||
pGC = (GCPtr) CreateGC(pDraw, stuff->mask, (XID *) &stuff[1], &error,
|
||||
stuff->gc, client);
|
||||
if (error != Success)
|
||||
return error;
|
||||
|
@ -1595,7 +1595,7 @@ ProcCreateGC(ClientPtr client)
|
|||
int
|
||||
ProcChangeGC(ClientPtr client)
|
||||
{
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
int result;
|
||||
unsigned len;
|
||||
|
||||
|
@ -1616,8 +1616,8 @@ ProcChangeGC(ClientPtr client)
|
|||
int
|
||||
ProcCopyGC(ClientPtr client)
|
||||
{
|
||||
GC *dstGC;
|
||||
GC *pGC;
|
||||
GCPtr dstGC;
|
||||
GCPtr pGC;
|
||||
int result;
|
||||
|
||||
REQUEST(xCopyGCReq);
|
||||
|
@ -1641,7 +1641,7 @@ ProcCopyGC(ClientPtr client)
|
|||
int
|
||||
ProcSetDashes(ClientPtr client)
|
||||
{
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
int result;
|
||||
|
||||
REQUEST(xSetDashesReq);
|
||||
|
@ -1667,7 +1667,7 @@ int
|
|||
ProcSetClipRectangles(ClientPtr client)
|
||||
{
|
||||
int nr, result;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
REQUEST(xSetClipRectanglesReq);
|
||||
|
||||
|
@ -1692,7 +1692,7 @@ ProcSetClipRectangles(ClientPtr client)
|
|||
int
|
||||
ProcFreeGC(ClientPtr client)
|
||||
{
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
int rc;
|
||||
|
||||
REQUEST(xResourceReq);
|
||||
|
@ -1782,7 +1782,7 @@ ProcCopyArea(ClientPtr client)
|
|||
{
|
||||
DrawablePtr pDst;
|
||||
DrawablePtr pSrc;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
REQUEST(xCopyAreaReq);
|
||||
RegionPtr pRgn;
|
||||
|
@ -1820,7 +1820,7 @@ int
|
|||
ProcCopyPlane(ClientPtr client)
|
||||
{
|
||||
DrawablePtr psrcDraw, pdstDraw;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
REQUEST(xCopyPlaneReq);
|
||||
RegionPtr pRgn;
|
||||
|
@ -1866,7 +1866,7 @@ int
|
|||
ProcPolyPoint(ClientPtr client)
|
||||
{
|
||||
int npoint;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolyPointReq);
|
||||
|
@ -1889,7 +1889,7 @@ int
|
|||
ProcPolyLine(ClientPtr client)
|
||||
{
|
||||
int npoint;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolyLineReq);
|
||||
|
@ -1912,7 +1912,7 @@ int
|
|||
ProcPolySegment(ClientPtr client)
|
||||
{
|
||||
int nsegs;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolySegmentReq);
|
||||
|
@ -1932,7 +1932,7 @@ int
|
|||
ProcPolyRectangle(ClientPtr client)
|
||||
{
|
||||
int nrects;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolyRectangleReq);
|
||||
|
@ -1953,7 +1953,7 @@ int
|
|||
ProcPolyArc(ClientPtr client)
|
||||
{
|
||||
int narcs;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolyArcReq);
|
||||
|
@ -1973,7 +1973,7 @@ int
|
|||
ProcFillPoly(ClientPtr client)
|
||||
{
|
||||
int things;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xFillPolyReq);
|
||||
|
@ -2003,7 +2003,7 @@ int
|
|||
ProcPolyFillRectangle(ClientPtr client)
|
||||
{
|
||||
int things;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolyFillRectangleReq);
|
||||
|
@ -2025,7 +2025,7 @@ int
|
|||
ProcPolyFillArc(ClientPtr client)
|
||||
{
|
||||
int narcs;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
||||
REQUEST(xPolyFillArcReq);
|
||||
|
@ -2098,7 +2098,7 @@ ReformatImage(char *base, int nbytes, int bpp, int order)
|
|||
int
|
||||
ProcPutImage(ClientPtr client)
|
||||
{
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
long length; /* length of scanline server padded */
|
||||
long lengthProto; /* length of scanline protocol padded */
|
||||
|
@ -2369,7 +2369,7 @@ ProcPolyText(ClientPtr client)
|
|||
|
||||
REQUEST(xPolyTextReq);
|
||||
DrawablePtr pDraw;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||
|
@ -2393,7 +2393,7 @@ ProcImageText8(ClientPtr client)
|
|||
{
|
||||
int err;
|
||||
DrawablePtr pDraw;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
REQUEST(xImageTextReq);
|
||||
|
||||
|
@ -2419,7 +2419,7 @@ ProcImageText16(ClientPtr client)
|
|||
{
|
||||
int err;
|
||||
DrawablePtr pDraw;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
REQUEST(xImageTextReq);
|
||||
|
||||
|
|
|
@ -1103,7 +1103,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
|||
int err = Success, lgerr; /* err is in X error, not font error, space */
|
||||
enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
|
||||
FontPathElementPtr fpe;
|
||||
GC *origGC = NULL;
|
||||
GCPtr origGC = NULL;
|
||||
int itemSize = c->reqType == X_PolyText8 ? 1 : 2;
|
||||
|
||||
if (client->clientGone) {
|
||||
|
@ -1213,7 +1213,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
|||
if (lgerr == Suspended) {
|
||||
if (!ClientIsAsleep(client)) {
|
||||
int len;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
PTclosurePtr new_closure;
|
||||
|
||||
/* We're putting the client to sleep. We need to do a few things
|
||||
|
@ -1354,7 +1354,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
|||
}
|
||||
|
||||
int
|
||||
PolyText(ClientPtr client, DrawablePtr pDraw, GC * pGC, unsigned char *pElt,
|
||||
PolyText(ClientPtr client, DrawablePtr pDraw, GCPtr pGC, unsigned char *pElt,
|
||||
unsigned char *endReq, int xorg, int yorg, int reqType, XID did)
|
||||
{
|
||||
PTclosureRec local_closure = {
|
||||
|
@ -1409,7 +1409,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
|||
lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, itemSize, c->data);
|
||||
if (lgerr == Suspended) {
|
||||
if (!ClientIsAsleep(client)) {
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
unsigned char *data;
|
||||
ITclosurePtr new_closure;
|
||||
ITclosurePtr old_closure;
|
||||
|
@ -1500,7 +1500,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
|||
}
|
||||
|
||||
int
|
||||
ImageText(ClientPtr client, DrawablePtr pDraw, GC * pGC, int nChars,
|
||||
ImageText(ClientPtr client, DrawablePtr pDraw, GCPtr pGC, int nChars,
|
||||
unsigned char *data, int xorg, int yorg, int reqType, XID did)
|
||||
{
|
||||
ITclosureRec local_closure;
|
||||
|
|
|
@ -202,7 +202,7 @@ int
|
|||
dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access)
|
||||
{
|
||||
int rc;
|
||||
GC *pGC;
|
||||
GCPtr pGC;
|
||||
|
||||
client->errorValue = id; /* EITHER font or gc */
|
||||
rc = dixLookupResourceByType((void **) pFont, id, X11_RESTYPE_FONT, client,
|
||||
|
|
10
dix/gc.c
10
dix/gc.c
|
@ -72,7 +72,7 @@ static Bool CreateDefaultTile(GCPtr pGC);
|
|||
static unsigned char DefaultDash[2] = { 4, 4 };
|
||||
|
||||
void
|
||||
ValidateGC(DrawablePtr pDraw, GC * pGC)
|
||||
ValidateGC(DrawablePtr pDraw, GCPtr pGC)
|
||||
{
|
||||
(*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pDraw);
|
||||
pGC->stateChanges = 0;
|
||||
|
@ -120,7 +120,7 @@ ValidateGC(DrawablePtr pDraw, GC * pGC)
|
|||
_var = (_type)pUnion->ptr; pUnion++; }
|
||||
|
||||
int
|
||||
ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
|
||||
ChangeGC(ClientPtr client, GCPtr pGC, BITS32 mask, ChangeGCValPtr pUnion)
|
||||
{
|
||||
BITS32 index2;
|
||||
int error = 0;
|
||||
|
@ -428,7 +428,7 @@ static const struct {
|
|||
};
|
||||
|
||||
int
|
||||
ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32)
|
||||
ChangeGCXIDs(ClientPtr client, GCPtr pGC, BITS32 mask, CARD32 *pC32)
|
||||
{
|
||||
ChangeGCVal vals[GCLastBit + 1];
|
||||
int i;
|
||||
|
@ -465,7 +465,7 @@ NewGCObject(ScreenPtr pScreen, int depth)
|
|||
{
|
||||
GCPtr pGC;
|
||||
|
||||
pGC = dixAllocateScreenObjectWithPrivates(pScreen, GC, PRIVATE_GC);
|
||||
pGC = dixAllocateScreenObjectWithPrivates(pScreen, GCRec, PRIVATE_GC);
|
||||
if (!pGC) {
|
||||
return (GCPtr) NULL;
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ CreateDefaultTile(GCPtr pGC)
|
|||
}
|
||||
|
||||
int
|
||||
CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask)
|
||||
CopyGC(GCPtr pgcSrc, GCPtr pgcDst, BITS32 mask)
|
||||
{
|
||||
BITS32 index2;
|
||||
BITS32 maskQ;
|
||||
|
|
|
@ -565,7 +565,7 @@ static const int offsets[] = {
|
|||
-1, /* X11_RESTYPE_NONE */
|
||||
offsetof(WindowRec, devPrivates), /* X11_RESTYPE_WINDOW */
|
||||
offsetof(PixmapRec, devPrivates), /* X11_RESTYPE_PIXMAP */
|
||||
offsetof(GC, devPrivates), /* X11_RESTYPE_GC */
|
||||
offsetof(GCRec, devPrivates), /* X11_RESTYPE_GC */
|
||||
-1, /* X11_RESTYPE_FONT */
|
||||
offsetof(CursorRec, devPrivates), /* X11_RESTYPE_CURSOR */
|
||||
offsetof(ColormapRec, devPrivates), /* X11_RESTYPE_COLORMAP */
|
||||
|
|
|
@ -610,7 +610,7 @@ VGAarbiterDestroyClip(GCPtr pGC)
|
|||
/* GC Ops */
|
||||
static void
|
||||
VGAarbiterFillSpans(DrawablePtr pDraw,
|
||||
GC * pGC,
|
||||
GCPtr pGC,
|
||||
int nInit,
|
||||
DDXPointPtr pptInit, int *pwidthInit, int fSorted)
|
||||
{
|
||||
|
@ -659,7 +659,7 @@ VGAarbiterPutImage(DrawablePtr pDraw,
|
|||
static RegionPtr
|
||||
VGAarbiterCopyArea(DrawablePtr pSrc,
|
||||
DrawablePtr pDst,
|
||||
GC * pGC,
|
||||
GCPtr pGC,
|
||||
int srcx, int srcy,
|
||||
int width, int height, int dstx, int dsty)
|
||||
{
|
||||
|
|
|
@ -202,7 +202,7 @@ static void VGAarbiterDestroyClip(GCPtr pGC);
|
|||
static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
|
||||
|
||||
/* GC ops */
|
||||
static void VGAarbiterFillSpans(DrawablePtr pDraw, GC * pGC, int nInit,
|
||||
static void VGAarbiterFillSpans(DrawablePtr pDraw, GCPtr pGC, int nInit,
|
||||
DDXPointPtr pptInit, int *pwidthInit,
|
||||
int fSorted);
|
||||
static void VGAarbiterSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
|
||||
|
@ -212,7 +212,7 @@ static void VGAarbiterPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x,
|
|||
int y, int w, int h, int leftPad, int format,
|
||||
char *pImage);
|
||||
static RegionPtr VGAarbiterCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
|
||||
GC * pGC, int srcx, int srcy, int width,
|
||||
GCPtr pGC, int srcx, int srcy, int width,
|
||||
int height, int dstx, int dsty);
|
||||
static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
|
||||
GCPtr pGC, int srcx, int srcy, int width,
|
||||
|
|
|
@ -279,6 +279,6 @@ typedef struct _GC {
|
|||
const GCOps *ops;
|
||||
PrivateRec *devPrivates;
|
||||
RegionPtr pCompositeClip;
|
||||
} GC;
|
||||
} GCRec;
|
||||
|
||||
#endif /* GCSTRUCT_H */
|
||||
|
|
|
@ -79,7 +79,7 @@ with the sample server.
|
|||
*/
|
||||
|
||||
void
|
||||
miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */
|
||||
miPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */
|
||||
void *pglyphBase /* start of array of glyphs */
|
||||
)
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyp
|
|||
}
|
||||
|
||||
void
|
||||
miImageGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */
|
||||
miImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */
|
||||
void *pglyphBase /* start of array of glyphs */
|
||||
)
|
||||
{
|
||||
|
|
|
@ -634,7 +634,7 @@ damageAddTraps(PicturePtr pPicture,
|
|||
|
||||
static void
|
||||
damageFillSpans(DrawablePtr pDrawable,
|
||||
GC * pGC, int npt, DDXPointPtr ppt, int *pwidth, int fSorted)
|
||||
GCPtr pGC, int npt, DDXPointPtr ppt, int *pwidth, int fSorted)
|
||||
{
|
||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
||||
|
||||
|
@ -753,7 +753,7 @@ damagePutImage(DrawablePtr pDrawable,
|
|||
static RegionPtr
|
||||
damageCopyArea(DrawablePtr pSrc,
|
||||
DrawablePtr pDst,
|
||||
GC * pGC,
|
||||
GCPtr pGC,
|
||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
RegionPtr ret;
|
||||
|
|
Loading…
Reference in New Issue