From 68dd0b52e13c844d662192654fb10cb993257a59 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 22 Jun 2015 09:36:08 +0200 Subject: Replace 'pointer' type with 'void *' This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Rebased against NX: Mike Gabriel --- nx-X11/programs/Xserver/xfixes/cursor.c | 28 ++++++++++++++-------------- nx-X11/programs/Xserver/xfixes/region.c | 14 +++++++------- nx-X11/programs/Xserver/xfixes/select.c | 10 +++++----- nx-X11/programs/Xserver/xfixes/xfixes.c | 4 ++-- 4 files changed, 28 insertions(+), 28 deletions(-) (limited to 'nx-X11/programs/Xserver/xfixes') diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index f6895d193..8bdaca84d 100755 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -76,7 +76,7 @@ typedef struct _CursorScreen { #define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr)) #define GetCursorScreenIfSet(s) ((CursorScreenPrivateIndex != -1) ? GetCursorScreen(s) : NULL) -#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (pointer) (p)) +#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (void *) (p)) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) @@ -172,13 +172,13 @@ XFixesSelectCursorInput (ClientPtr pClient, */ if (!LookupIDByType(pWindow->drawable.id, CursorWindowType)) if (!AddResource (pWindow->drawable.id, CursorWindowType, - (pointer) pWindow)) + (void *) pWindow)) { xfree (e); return BadAlloc; } - if (!AddResource (e->clientResource, CursorClientType, (pointer) e)) + if (!AddResource (e->clientResource, CursorClientType, (void *) e)) return BadAlloc; *prev = e; @@ -520,13 +520,13 @@ SProcXFixesGetCursorImageAndName (ClientPtr client) * whether it should be replaced with a reference to pCursor. */ -typedef Bool (*TestCursorFunc) (CursorPtr pOld, pointer closure); +typedef Bool (*TestCursorFunc) (CursorPtr pOld, void * closure); typedef struct { RESTYPE type; TestCursorFunc testCursor; CursorPtr pNew; - pointer closure; + void * closure; } ReplaceCursorLookupRec, *ReplaceCursorLookupPtr; static const RESTYPE CursorRestypes[] = { @@ -536,7 +536,7 @@ static const RESTYPE CursorRestypes[] = { #define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0])) static Bool -ReplaceCursorLookup (pointer value, XID id, pointer closure) +ReplaceCursorLookup (void * value, XID id, void * closure) { ReplaceCursorLookupPtr rcl = (ReplaceCursorLookupPtr) closure; WindowPtr pWin; @@ -583,7 +583,7 @@ ReplaceCursorLookup (pointer value, XID id, pointer closure) static void ReplaceCursor (CursorPtr pCursor, TestCursorFunc testCursor, - pointer closure) + void * closure) { int clientIndex; int resIndex; @@ -612,7 +612,7 @@ ReplaceCursor (CursorPtr pCursor, LookupClientResourceComplex (clients[clientIndex], rcl.type, ReplaceCursorLookup, - (pointer) &rcl); + (void *) &rcl); } } /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ @@ -620,7 +620,7 @@ ReplaceCursor (CursorPtr pCursor, } static Bool -TestForCursor (CursorPtr pCursor, pointer closure) +TestForCursor (CursorPtr pCursor, void * closure) { return (pCursor == (CursorPtr) closure); } @@ -635,7 +635,7 @@ ProcXFixesChangeCursor (ClientPtr client) VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); - ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); + ReplaceCursor (pSource, TestForCursor, (void *) pDestination); return (client->noClientException); } @@ -653,7 +653,7 @@ SProcXFixesChangeCursor (ClientPtr client) } static Bool -TestForCursorName (CursorPtr pCursor, pointer closure) +TestForCursorName (CursorPtr pCursor, void * closure) { return (pCursor->name == (Atom) closure); } @@ -671,7 +671,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) tchar = (char *) &stuff[1]; name = MakeAtom (tchar, stuff->nbytes, FALSE); if (name) - ReplaceCursor (pSource, TestForCursorName, (pointer) name); + ReplaceCursor (pSource, TestForCursorName, (void *) name); return (client->noClientException); } @@ -689,7 +689,7 @@ SProcXFixesChangeCursorByName (ClientPtr client) } static int -CursorFreeClient (pointer data, XID id) +CursorFreeClient (void * data, XID id) { CursorEventPtr old = (CursorEventPtr) data; CursorEventPtr *prev, e; @@ -707,7 +707,7 @@ CursorFreeClient (pointer data, XID id) } static int -CursorFreeWindow (pointer data, XID id) +CursorFreeWindow (void * data, XID id) { WindowPtr pWindow = (WindowPtr) data; CursorEventPtr e, next; diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 9ceff6d51..cb9e0de9a 100755 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -39,7 +39,7 @@ extern int RenderErrBase; RESTYPE RegionResType; static int -RegionResFree (pointer data, XID id) +RegionResFree (void * data, XID id) { RegionPtr pRegion = (RegionPtr) data; @@ -87,7 +87,7 @@ ProcXFixesCreateRegion (ClientPtr client) pRegion = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -132,7 +132,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -196,7 +196,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) pRegion = XFixesRegionCopy (pRegion); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -243,7 +243,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -292,7 +292,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -646,7 +646,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client) vals[0] = stuff->xOrigin; vals[1] = stuff->yOrigin; DoChangeGC (pGC, GCClipXOrigin|GCClipYOrigin, vals, 0); - (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); + (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (void *)pRegion, 0); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index ddc776ef7..464979165 100755 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -52,7 +52,7 @@ typedef struct _SelectionEvent { static SelectionEventPtr selectionEvents; static void -XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args) +XFixesSelectionCallback (CallbackListPtr *callbacks, void * data, void * args) { SelectionEventPtr e; SelectionInfoRec *info = (SelectionInfoRec *) args; @@ -172,13 +172,13 @@ XFixesSelectSelectionInput (ClientPtr pClient, */ if (!LookupIDByType(pWindow->drawable.id, SelectionWindowType)) if (!AddResource (pWindow->drawable.id, SelectionWindowType, - (pointer) pWindow)) + (void *) pWindow)) { xfree (e); return BadAlloc; } - if (!AddResource (e->clientResource, SelectionClientType, (pointer) e)) + if (!AddResource (e->clientResource, SelectionClientType, (void *) e)) return BadAlloc; *prev = e; @@ -240,7 +240,7 @@ SXFixesSelectionNotifyEvent (xXFixesSelectionNotifyEvent *from, } static int -SelectionFreeClient (pointer data, XID id) +SelectionFreeClient (void * data, XID id) { SelectionEventPtr old = (SelectionEventPtr) data; SelectionEventPtr *prev, e; @@ -259,7 +259,7 @@ SelectionFreeClient (pointer data, XID id) } static int -SelectionFreeWindow (pointer data, XID id) +SelectionFreeWindow (void * data, XID id) { WindowPtr pWindow = (WindowPtr) data; SelectionEventPtr e, next; diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index 1465931cb..3b3a0f305 100755 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -185,8 +185,8 @@ SProcXFixesDispatch (ClientPtr client) static void XFixesClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void *closure, + void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; -- cgit v1.2.3