From 236e8e46561b87efdd06fde165632d99cd4c93e0 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 16 Jul 2025 12:06:03 +0200 Subject: [PATCH] mi: use NULL instead of NullClient No need to have another name for NULL, we can use NULL directly. Signed-off-by: Enrico Weigelt, metux IT consult --- mi/miarc.c | 6 +++--- mi/midispcur.c | 10 +++++----- mi/miexpose.c | 6 +++--- mi/miglblt.c | 9 ++++----- mi/mipolypnt.c | 4 ++-- mi/miwideline.c | 12 ++++++------ mi/miwideline.h | 4 ++-- mi/mizerarc.c | 4 ++-- 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/mi/miarc.c b/mi/miarc.c index de869d2f7..d5b820820 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -986,7 +986,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) gcvals[3].val = pGC->lineWidth; gcvals[4].val = pGC->capStyle; gcvals[5].val = pGC->joinStyle; - ChangeGC(NullClient, pGCTo, GCFunction | + ChangeGC(NULL, pGCTo, GCFunction | GCForeground | GCBackground | GCLineWidth | GCCapStyle | GCJoinStyle, gcvals); } @@ -1024,12 +1024,12 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) if (iphase == 1) { gcval.val = bg; - ChangeGC(NullClient, pGC, GCForeground, &gcval); + ChangeGC(NULL, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } else if (pGC->lineStyle == LineDoubleDash) { gcval.val = fg; - ChangeGC(NullClient, pGC, GCForeground, &gcval); + ChangeGC(NULL, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } for (i = 0; i < polyArcs[iphase].narcs; i++) { diff --git a/mi/midispcur.c b/mi/midispcur.c index 922e3a5b6..fd94b8e02 100644 --- a/mi/midispcur.c +++ b/mi/midispcur.c @@ -245,7 +245,7 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor) 0, 0, pCursor->bits->width, pCursor->bits->height, 0, XYPixmap, (char *) pCursor->bits->source); gcvals.val = GXand; - ChangeGC(NullClient, pGC, GCFunction, &gcvals); + ChangeGC(NULL, pGC, GCFunction, &gcvals); ValidateGC((DrawablePtr) sourceBits, pGC); (*pGC->ops->PutImage) ((DrawablePtr) sourceBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, @@ -253,13 +253,13 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor) /* mask bits -- pCursor->mask & ~pCursor->source */ gcvals.val = GXcopy; - ChangeGC(NullClient, pGC, GCFunction, &gcvals); + ChangeGC(NULL, pGC, GCFunction, &gcvals); ValidateGC((DrawablePtr) maskBits, pGC); (*pGC->ops->PutImage) ((DrawablePtr) maskBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, 0, XYPixmap, (char *) pCursor->bits->mask); gcvals.val = GXandInverted; - ChangeGC(NullClient, pGC, GCFunction, &gcvals); + ChangeGC(NULL, pGC, GCFunction, &gcvals); ValidateGC((DrawablePtr) maskBits, pGC); (*pGC->ops->PutImage) ((DrawablePtr) maskBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, @@ -294,7 +294,7 @@ miDCPutBits(DrawablePtr pDrawable, if (sourceGC->fgPixel != source) { gcval.val = source; - ChangeGC(NullClient, sourceGC, GCForeground, &gcval); + ChangeGC(NULL, sourceGC, GCForeground, &gcval); } if (sourceGC->serialNumber != pDrawable->serialNumber) ValidateGC(pDrawable, sourceGC); @@ -312,7 +312,7 @@ miDCPutBits(DrawablePtr pDrawable, x, y); if (maskGC->fgPixel != mask) { gcval.val = mask; - ChangeGC(NullClient, maskGC, GCForeground, &gcval); + ChangeGC(NULL, maskGC, GCForeground, &gcval); } if (maskGC->serialNumber != pDrawable->serialNumber) ValidateGC(pDrawable, maskGC); diff --git a/mi/miexpose.c b/mi/miexpose.c index 9b3ea4ef4..50d45ffba 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -529,7 +529,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) return; } - ChangeGC(NullClient, pGC, gcmask, gcval); + ChangeGC(NULL, pGC, gcmask, gcval); ValidateGC(drawable, pGC); numRects = RegionNumRects(prgn); @@ -562,9 +562,9 @@ miClearDrawable(DrawablePtr pDraw, GCPtr pGC) rect.y = 0; rect.width = pDraw->width; rect.height = pDraw->height; - ChangeGC(NullClient, pGC, GCForeground, &bg); + ChangeGC(NULL, pGC, GCForeground, &bg); ValidateGC(pDraw, pGC); (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); - ChangeGC(NullClient, pGC, GCForeground, &fg); + ChangeGC(NULL, pGC, GCForeground, &fg); ValidateGC(pDraw, pGC); } diff --git a/mi/miglblt.c b/mi/miglblt.c index 230f29200..c81f6fb86 100644 --- a/mi/miglblt.c +++ b/mi/miglblt.c @@ -126,8 +126,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int ngly gcvals[1].val = 1; gcvals[2].val = 0; - ChangeGC(NullClient, pGCtmp, GCFunction | GCForeground | GCBackground, - gcvals); + ChangeGC(NULL, pGCtmp, GCFunction | GCForeground | GCBackground, gcvals); nbyLine = BitmapBytePad(width); pbits = calloc(height, nbyLine); @@ -211,13 +210,13 @@ miImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int ngl gcvals[0].val = GXcopy; gcvals[1].val = pGC->bgPixel; gcvals[2].val = FillSolid; - ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFillStyle, gcvals); + ChangeGC(NULL, pGC, GCFunction | GCForeground | GCFillStyle, gcvals); ValidateGC(pDrawable, pGC); (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &backrect); /* put down the glyphs */ gcvals[0].val = oldFG; - ChangeGC(NullClient, pGC, GCForeground, gcvals); + ChangeGC(NULL, pGC, GCForeground, gcvals); ValidateGC(pDrawable, pGC); (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); @@ -225,7 +224,7 @@ miImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int ngl gcvals[0].val = oldAlu; gcvals[1].val = oldFG; gcvals[2].val = oldFS; - ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFillStyle, gcvals); + ChangeGC(NULL, pGC, GCFunction | GCForeground | GCFillStyle, gcvals); ValidateGC(pDrawable, pGC); } diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c index 1a508bfbd..0ff1939a2 100644 --- a/mi/mipolypnt.c +++ b/mi/mipolypnt.c @@ -94,7 +94,7 @@ miPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */ fsOld.val = pGC->fillStyle; fsNew.val = FillSolid; if (pGC->fillStyle != FillSolid) { - ChangeGC(NullClient, pGC, GCFillStyle, &fsNew); + ChangeGC(NULL, pGC, GCFillStyle, &fsNew); ValidateGC(pDrawable, pGC); } pwidth = pwidthInit; @@ -103,7 +103,7 @@ miPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */ (*pGC->ops->FillSpans) (pDrawable, pGC, npt, pptInit, pwidthInit, FALSE); if (fsOld.val != FillSolid) { - ChangeGC(NullClient, pGC, GCFillStyle, &fsOld); + ChangeGC(NULL, pGC, GCFillStyle, &fsOld); ValidateGC(pDrawable, pGC); } free(pwidthInit); diff --git a/mi/miwideline.c b/mi/miwideline.c index 85864e1bb..bcb918f11 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -616,7 +616,7 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans * spans, oldPixel.val = pGC->fgPixel; if (pixel != oldPixel.val) { tmpPixel.val = (XID) pixel; - ChangeGC(NullClient, pGC, GCForeground, &tmpPixel); + ChangeGC(NULL, pGC, GCForeground, &tmpPixel); ValidateGC(pDrawable, pGC); } (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, @@ -624,7 +624,7 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans * spans, free(spans->widths); free(spans->points); if (pixel != oldPixel.val) { - ChangeGC(NullClient, pGC, GCForeground, &oldPixel); + ChangeGC(NULL, pGC, GCForeground, &oldPixel); ValidateGC(pDrawable, pGC); } } @@ -746,12 +746,12 @@ miFillRectPolyHelper(DrawablePtr pDrawable, oldPixel.val = pGC->fgPixel; if (pixel != oldPixel.val) { tmpPixel.val = (XID) pixel; - ChangeGC(NullClient, pGC, GCForeground, &tmpPixel); + ChangeGC(NULL, pGC, GCForeground, &tmpPixel); ValidateGC(pDrawable, pGC); } (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect); if (pixel != oldPixel.val) { - ChangeGC(NullClient, pGC, GCForeground, &oldPixel); + ChangeGC(NULL, pGC, GCForeground, &oldPixel); ValidateGC(pDrawable, pGC); } } @@ -1870,13 +1870,13 @@ miCleanupSpanData(DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData) pixel.val = pGC->bgPixel; oldPixel.val = pGC->fgPixel; if (pixel.val != oldPixel.val) { - ChangeGC(NullClient, pGC, GCForeground, &pixel); + ChangeGC(NULL, pGC, GCForeground, &pixel); ValidateGC(pDrawable, pGC); } miFillUniqueSpanGroup(pDrawable, pGC, &spanData->bgGroup); miFreeSpanGroup(&spanData->bgGroup); if (pixel.val != oldPixel.val) { - ChangeGC(NullClient, pGC, GCForeground, &oldPixel); + ChangeGC(NULL, pGC, GCForeground, &oldPixel); ValidateGC(pDrawable, pGC); } } diff --git a/mi/miwideline.h b/mi/miwideline.h index 39a2727e4..b849ba151 100644 --- a/mi/miwideline.h +++ b/mi/miwideline.h @@ -82,7 +82,7 @@ typedef struct _LineFace { if (pixel != oldPixel) { \ ChangeGCVal gcval; \ gcval.val = pixel; \ - ChangeGC (NullClient, pGC, GCForeground, &gcval); \ + ChangeGC (NULL, pGC, GCForeground, &gcval); \ ValidateGC (pDrawable, pGC); \ } \ } @@ -90,7 +90,7 @@ typedef struct _LineFace { if (pixel != oldPixel) { \ ChangeGCVal gcval; \ gcval.val = oldPixel; \ - ChangeGC (NullClient, pGC, GCForeground, &gcval); \ + ChangeGC (NULL, pGC, GCForeground, &gcval); \ ValidateGC (pDrawable, pGC); \ } \ } diff --git a/mi/mizerarc.c b/mi/mizerarc.c index f52107ce9..e42df6630 100644 --- a/mi/mizerarc.c +++ b/mi/mizerarc.c @@ -729,7 +729,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) ChangeGCVal gcval; gcval.val = pGC->bgPixel; - ChangeGC(NullClient, pGC, GCForeground, &gcval); + ChangeGC(NULL, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } pts = &points[numPts >> 1]; @@ -755,7 +755,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) ChangeGCVal gcval; gcval.val = fgPixel; - ChangeGC(NullClient, pGC, GCForeground, &gcval); + ChangeGC(NULL, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } }