(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:
Enrico Weigelt, metux IT consult 2024-02-16 17:25:29 +01:00
parent f4dcc1c72c
commit 6a10257030
11 changed files with 45 additions and 45 deletions

View File

@ -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;

View File

@ -1565,7 +1565,7 @@ int
ProcCreateGC(ClientPtr client)
{
int error, rc;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
unsigned len;
@ -1582,7 +1582,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;
@ -1594,7 +1594,7 @@ ProcCreateGC(ClientPtr client)
int
ProcChangeGC(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
int result;
unsigned len;
@ -1615,8 +1615,8 @@ ProcChangeGC(ClientPtr client)
int
ProcCopyGC(ClientPtr client)
{
GC *dstGC;
GC *pGC;
GCPtr dstGC;
GCPtr pGC;
int result;
REQUEST(xCopyGCReq);
@ -1640,7 +1640,7 @@ ProcCopyGC(ClientPtr client)
int
ProcSetDashes(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
int result;
REQUEST(xSetDashesReq);
@ -1666,7 +1666,7 @@ int
ProcSetClipRectangles(ClientPtr client)
{
int nr, result;
GC *pGC;
GCPtr pGC;
REQUEST(xSetClipRectanglesReq);
@ -1691,7 +1691,7 @@ ProcSetClipRectangles(ClientPtr client)
int
ProcFreeGC(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
int rc;
REQUEST(xResourceReq);
@ -1781,7 +1781,7 @@ ProcCopyArea(ClientPtr client)
{
DrawablePtr pDst;
DrawablePtr pSrc;
GC *pGC;
GCPtr pGC;
REQUEST(xCopyAreaReq);
RegionPtr pRgn;
@ -1819,7 +1819,7 @@ int
ProcCopyPlane(ClientPtr client)
{
DrawablePtr psrcDraw, pdstDraw;
GC *pGC;
GCPtr pGC;
REQUEST(xCopyPlaneReq);
RegionPtr pRgn;
@ -1865,7 +1865,7 @@ int
ProcPolyPoint(ClientPtr client)
{
int npoint;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyPointReq);
@ -1888,7 +1888,7 @@ int
ProcPolyLine(ClientPtr client)
{
int npoint;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyLineReq);
@ -1911,7 +1911,7 @@ int
ProcPolySegment(ClientPtr client)
{
int nsegs;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolySegmentReq);
@ -1931,7 +1931,7 @@ int
ProcPolyRectangle(ClientPtr client)
{
int nrects;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyRectangleReq);
@ -1952,7 +1952,7 @@ int
ProcPolyArc(ClientPtr client)
{
int narcs;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyArcReq);
@ -1972,7 +1972,7 @@ int
ProcFillPoly(ClientPtr client)
{
int things;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xFillPolyReq);
@ -2002,7 +2002,7 @@ int
ProcPolyFillRectangle(ClientPtr client)
{
int things;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyFillRectangleReq);
@ -2024,7 +2024,7 @@ int
ProcPolyFillArc(ClientPtr client)
{
int narcs;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyFillArcReq);
@ -2097,7 +2097,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 */
@ -2368,7 +2368,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);
@ -2392,7 +2392,7 @@ ProcImageText8(ClientPtr client)
{
int err;
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
REQUEST(xImageTextReq);
@ -2418,7 +2418,7 @@ ProcImageText16(ClientPtr client)
{
int err;
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
REQUEST(xImageTextReq);

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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 */

View File

@ -609,7 +609,7 @@ VGAarbiterDestroyClip(GCPtr pGC)
/* GC Ops */
static void
VGAarbiterFillSpans(DrawablePtr pDraw,
GC * pGC,
GCPtr pGC,
int nInit,
DDXPointPtr pptInit, int *pwidthInit, int fSorted)
{
@ -658,7 +658,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)
{

View File

@ -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,

View File

@ -279,6 +279,6 @@ typedef struct _GC {
const GCOps *ops;
PrivateRec *devPrivates;
RegionPtr pCompositeClip;
} GC;
} GCRec;
#endif /* GCSTRUCT_H */

View File

@ -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 */
)
{

View File

@ -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;