dix: 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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-07-16 12:02:01 +02:00
committed by Enrico Weigelt
parent e3acb2454c
commit 07eb361846
12 changed files with 33 additions and 33 deletions

View File

@@ -3648,8 +3648,8 @@ CloseDownClient(ClientPtr client)
#endif
if (client->index < nextFreeClientID)
nextFreeClientID = client->index;
clients[client->index] = NullClient;
SmartLastClient = NullClient;
clients[client->index] = NULL;
SmartLastClient = NULL;
dixFreeObjectWithPrivates(client, PRIVATE_CLIENT);
while (!clients[currentMaxClients - 1])

View File

@@ -686,7 +686,7 @@ static inline ClientPtr dixLookupXIDOwner(XID xid)
int clientId = dixClientIdForXID(xid);
if (clientId < currentMaxClients)
return clients[clientId];
return NullClient;
return NULL;
}
#endif /* _XSERVER_DIX_PRIV_H */

View File

@@ -1189,7 +1189,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
ChangeGCVal val;
val.ptr = pFont;
ChangeGC(NullClient, c->pGC, GCFont, &val);
ChangeGC(NULL, c->pGC, GCFont, &val);
ValidateGC(c->pDraw, c->pGC);
}
@@ -1330,7 +1330,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
ChangeGCVal val;
val.ptr = pFont;
ChangeGC(NullClient, origGC, GCFont, &val);
ChangeGC(NULL, origGC, GCFont, &val);
ValidateGC(c->pDraw, origGC);
}
@@ -1349,7 +1349,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
}
if (ClientIsAsleep(client)) {
ClientWakeup(c->client);
ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
ChangeGC(NULL, c->pGC, clearGCmask, clearGC);
/* Unreference the font from the scratch GC */
CloseFont(c->pGC->font, (Font) 0);
@@ -1498,7 +1498,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
}
if (ClientIsAsleep(client)) {
ClientWakeup(c->client);
ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
ChangeGC(NULL, c->pGC, clearGCmask, clearGC);
/* Unreference the font from the scratch GC */
CloseFont(c->pGC->font, (Font) 0);

View File

@@ -2359,7 +2359,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
*pEvents, size_t count, Mask filter, GrabPtr grab)
{
int deliveries = 0, nondeliveries = 0;
ClientPtr client = NullClient;
ClientPtr client = NULL;
Mask deliveryMask = 0; /* If a grab occurs due to a button press, then
this mask is the mask of the grab. */
int type = pEvents->u.u.type;
@@ -2812,7 +2812,7 @@ DeliverEvent(DeviceIntPtr dev, xEvent *xE, int count,
Mask filter;
int deliveries = 0;
if (XaceHookSendAccess(NullClient, dev, win, xE, count) == Success) {
if (XaceHookSendAccess(NULL, dev, win, xE, count) == Success) {
filter = GetEventFilter(dev, xE);
FixUpEventFromWindow(pSprite, xE, win, child, FALSE);
deliveries = DeliverEventsToWindow(dev, win, xE, count, filter, grab);
@@ -4240,7 +4240,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window)
rc = EventToXI(event, &xE, &count);
if (rc == Success &&
XaceHookSendAccess(NullClient, keybd, focus, xE, count) == Success) {
XaceHookSendAccess(NULL, keybd, focus, xE, count) == Success) {
FixUpEventFromWindow(ptr->spriteInfo->sprite, xE, focus, None, FALSE);
deliveries = DeliverEventsToWindow(keybd, focus, xE, count,
GetEventFilter(keybd, xE), NullGrab);
@@ -4256,7 +4256,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window)
if (sendCore) {
rc = EventToCore(event, &core, &count);
if (rc == Success) {
if (XaceHookSendAccess(NullClient, keybd, focus, core, count) ==
if (XaceHookSendAccess(NULL, keybd, focus, core, count) ==
Success) {
FixUpEventFromWindow(keybd->spriteInfo->sprite, core, focus,
None, FALSE);
@@ -4329,7 +4329,7 @@ DeliverOneGrabbedEvent(InternalEvent *event, DeviceIntPtr dev,
if (rc == Success) {
FixUpEventFromWindow(pSprite, xE, grab->window, None, TRUE);
if (XaceHookSendAccess(NullClient, dev, grab->window, xE, count) ||
if (XaceHookSendAccess(NULL, dev, grab->window, xE, count) ||
XaceHookReceiveAccess(dixClientForGrab(grab), grab->window, xE, count))
deliveries = 1; /* don't send, but pretend we did */
else if (level != CORE || !IsInterferingGrab(dixClientForGrab(grab), dev, xE)) {

View File

@@ -86,7 +86,7 @@ ValidateGC(DrawablePtr pDraw, GCPtr pGC)
* The client performing the gc change must be passed so that access
* checks can be performed on any tiles, stipples, or fonts that are
* specified. ddxen can call this too; they should normally pass
* NullClient for the client since any access checking should have
* NULL for the client since any access checking should have
* already been done at a higher level.
*
* If you have any XIDs, you must use ChangeGCXIDs:
@@ -594,7 +594,7 @@ CreateDefaultTile(GCPtr pGC)
tmpval[0].val = GXcopy;
tmpval[1].val = pGC->tile.pixel;
tmpval[2].val = FillSolid;
(void) ChangeGC(NullClient, pgcScratch,
(void) ChangeGC(NULL, pgcScratch,
GCFunction | GCForeground | GCFillStyle, tmpval);
ValidateGC((DrawablePtr) pTile, pgcScratch);
rect.x = 0;
@@ -886,7 +886,7 @@ CreateDefaultStipple(int screenNum)
dixDestroyPixmap(pScreen->defaultStipple, 0);
return FALSE;
}
(void) ChangeGC(NullClient, pgcScratch,
(void) ChangeGC(NULL, pgcScratch,
GCFunction | GCForeground | GCFillStyle, tmpval);
ValidateGC((DrawablePtr) pScreen->defaultStipple, pgcScratch);
rect.x = 0;

View File

@@ -112,13 +112,13 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
gcval[0].val = GXcopy;
gcval[1].val = 0;
gcval[2].ptr = (void *) pfont;
ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, gcval);
ChangeGC(NULL, pGC, GCFunction | GCForeground | GCFont, gcval);
ValidateGC((DrawablePtr) ppix, pGC);
(*pGC->ops->PolyFillRect) ((DrawablePtr) ppix, pGC, 1, &rect);
/* draw the glyph */
gcval[0].val = 1;
ChangeGC(NullClient, pGC, GCForeground, gcval);
ChangeGC(NULL, pGC, GCForeground, gcval);
ValidateGC((DrawablePtr) ppix, pGC);
(*pGC->ops->PolyText16) ((DrawablePtr) ppix, pGC, cm->xhot, cm->yhot,
1, (unsigned short *) char2b);

View File

@@ -14,28 +14,28 @@
ClientPtr dixClientForWindow(WindowPtr pWin) {
if (!pWin)
return NullClient;
return NULL;
return dixClientForXID(pWin->drawable.id);
}
ClientPtr dixClientForGrab(GrabPtr pGrab) {
if (!pGrab)
return NullClient;
return NULL;
return dixClientForXID(pGrab->resource);
}
ClientPtr dixClientForInputClients(InputClientsPtr pInputClients) {
if (!pInputClients)
return NullClient;
return NULL;
return dixClientForXID(pInputClients->resource);
}
ClientPtr dixClientForOtherClients(OtherClientsPtr pOtherClients) {
if (!pOtherClients)
return NullClient;
return NULL;
return dixClientForXID(pOtherClients->resource);
}

View File

@@ -158,7 +158,7 @@ dix_main(int argc, char *argv[], char *envp[])
if (serverGeneration == 1) {
CreateWellKnownSockets();
for (i = 1; i < LimitClients; i++)
clients[i] = NullClient;
clients[i] = NULL;
serverClient = calloc(1, sizeof(ClientRec));
if (!serverClient)
FatalError("couldn't create server client");

View File

@@ -265,7 +265,7 @@ PixmapDirtyCopyArea(PixmapPtr dst, DrawablePtr src,
ChangeGCVal subWindowMode;
subWindowMode.val = IncludeInferiors;
ChangeGC(NullClient, pGC, GCSubwindowMode, &subWindowMode);
ChangeGC(NULL, pGC, GCSubwindowMode, &subWindowMode);
}
ValidateGC(&dst->drawable, pGC);

View File

@@ -39,7 +39,7 @@
* (every client so is assigned a range of XIDs it may use for resource creation)
*
* @param WindowPtr to the window whose client shall be retrieved
* @return pointer to ClientRec structure or NullClient (NULL)
* @return pointer to ClientRec structure or NULL
*/
ClientPtr dixClientForWindow(WindowPtr pWin);
@@ -50,7 +50,7 @@ ClientPtr dixClientForWindow(WindowPtr pWin);
* (every client so is assigned a range of XIDs it may use for resource creation)
*
* @param GrabPtr to the grab whose owning client shall be retrieved
* @return pointer to ClientRec structure or NullClient (NULL)
* @return pointer to ClientRec structure or NULL
*/
ClientPtr dixClientForGrab(GrabPtr pGrab);
@@ -61,7 +61,7 @@ ClientPtr dixClientForGrab(GrabPtr pGrab);
* (every client so is assigned a range of XIDs it may use for resource creation)
*
* @param GrabPtr to the InputClients whose owning client shall be retrieved
* @return pointer to ClientRec structure or NullClient (NULL)
* @return pointer to ClientRec structure or NULL
*/
ClientPtr dixClientForInputClients(InputClientsPtr pInputClients);
@@ -72,7 +72,7 @@ ClientPtr dixClientForInputClients(InputClientsPtr pInputClients);
* (every client so is assigned a range of XIDs it may use for resource creation)
*
* @param GrabPtr to the OtherClients whose owning client shall be retrieved
* @return pointer to ClientRec structure or NullClient (NULL)
* @return pointer to ClientRec structure or NULL
*/
ClientPtr dixClientForOtherClients(OtherClientsPtr pOtherClients);
@@ -98,13 +98,13 @@ static inline int dixClientIdForXID(XID xid) {
* (every client so is assigned a range of XIDs it may use for resource creation)
*
* @param XID the ID of the resource whose client is retrieved
* @return pointer to ClientRec structure or NullClient (NULL)
* @return pointer to ClientRec structure or NULL
*/
static inline ClientPtr dixClientForXID(XID xid) {
const int idx = dixClientIdForXID(xid);
if (idx < MAXCLIENTS)
return clients[idx];
return NullClient;
return NULL;
}
/*

View File

@@ -134,7 +134,7 @@ DeleteWindowFromAnySelections(WindowPtr pWin)
pSel->pWin = (WindowPtr) NULL;
pSel->window = None;
pSel->client = NullClient;
pSel->client = NULL;
}
}
@@ -149,7 +149,7 @@ DeleteClientFromAnySelections(ClientPtr client)
pSel->pWin = (WindowPtr) NULL;
pSel->window = None;
pSel->client = NullClient;
pSel->client = NULL;
}
}
@@ -235,7 +235,7 @@ ProcSetSelectionOwner(ClientPtr client)
pSel->lastTimeChanged = time;
pSel->window = param.owner;
pSel->pWin = pWin;
pSel->client = (pWin ? client : NullClient);
pSel->client = (pWin ? client : NULL);
CallSelectionCallback(pSel, client, SelectionSetOwner);
return Success;

View File

@@ -525,7 +525,7 @@ MakeRootTile(WindowPtr pWin)
attributes[0].val = pScreen->whitePixel;
attributes[1].val = pScreen->blackPixel;
(void) ChangeGC(NullClient, pGC, GCForeground | GCBackground,
(void) ChangeGC(NULL, pGC, GCForeground | GCBackground,
attributes);
}