From 60014a4a98ff924ae7f6840781f768c1cc93bbab Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 15 Dec 2013 01:05:51 -0800 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 --- xfixes/cursor.c | 36 ++++++++++++++++++------------------ xfixes/region.c | 20 ++++++++++---------- xfixes/select.c | 12 ++++++------ xfixes/xfixes.c | 2 +- xfixes/xfixes.h | 2 +- 5 files changed, 36 insertions(+), 36 deletions(-) (limited to 'xfixes') diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 753d5f7bc..2c4b57c13 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -72,7 +72,7 @@ static void deleteCursorHideCountsForScreen(ScreenPtr pScreen); #define VERIFY_CURSOR(pCursor, cursor, client, access) \ do { \ int err; \ - err = dixLookupResourceByType((pointer *) &pCursor, cursor, \ + err = dixLookupResourceByType((void **) &pCursor, cursor, \ RT_CURSOR, client, access); \ if (err != Success) { \ client->errorValue = cursor; \ @@ -195,7 +195,7 @@ static int XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask) { CursorEventPtr *prev, e; - pointer val; + void *val; int rc; for (prev = &cursorEvents; (e = *prev); prev = &e->next) { @@ -228,12 +228,12 @@ XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask) DixGetAttrAccess); if (rc != Success) if (!AddResource(pWindow->drawable.id, CursorWindowType, - (pointer) pWindow)) { + (void *) pWindow)) { free(e); return BadAlloc; } - if (!AddResource(e->clientResource, CursorClientType, (pointer) e)) + if (!AddResource(e->clientResource, CursorClientType, (void *) e)) return BadAlloc; *prev = e; @@ -568,13 +568,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[] = { @@ -584,7 +584,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; @@ -626,7 +626,7 @@ ReplaceCursorLookup(pointer value, XID id, pointer closure) } static void -ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, pointer closure) +ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) { int clientIndex; int resIndex; @@ -652,7 +652,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, pointer closure) */ LookupClientResourceComplex(clients[clientIndex], rcl.type, - ReplaceCursorLookup, (pointer) &rcl); + ReplaceCursorLookup, (void *) &rcl); } } /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ @@ -660,7 +660,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, pointer closure) } static Bool -TestForCursor(CursorPtr pCursor, pointer closure) +TestForCursor(CursorPtr pCursor, void *closure) { return (pCursor == (CursorPtr) closure); } @@ -678,7 +678,7 @@ ProcXFixesChangeCursor(ClientPtr client) VERIFY_CURSOR(pDestination, stuff->destination, client, DixWriteAccess | DixSetAttrAccess); - ReplaceCursor(pSource, TestForCursor, (pointer) pDestination); + ReplaceCursor(pSource, TestForCursor, (void *) pDestination); return Success; } @@ -695,7 +695,7 @@ SProcXFixesChangeCursor(ClientPtr client) } static Bool -TestForCursorName(CursorPtr pCursor, pointer closure) +TestForCursorName(CursorPtr pCursor, void *closure) { Atom *pName = closure; @@ -776,7 +776,7 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen) * Create a resource for this element so it can be deleted * when the client goes away. */ - if (!AddResource(pChc->resource, CursorHideCountType, (pointer) pChc)) { + if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc)) { free(pChc); return BadAlloc; } @@ -841,7 +841,7 @@ ProcXFixesHideCursor(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesHideCursorReq); - ret = dixLookupResourceByType((pointer *) &pWin, stuff->window, RT_WINDOW, + ret = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrAccess); if (ret != Success) { client->errorValue = stuff->window; @@ -905,7 +905,7 @@ ProcXFixesShowCursor(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesShowCursorReq); - rc = dixLookupResourceByType((pointer *) &pWin, stuff->window, RT_WINDOW, + rc = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->window; @@ -946,7 +946,7 @@ SProcXFixesShowCursor(ClientPtr client) } static int -CursorFreeClient(pointer data, XID id) +CursorFreeClient(void *data, XID id) { CursorEventPtr old = (CursorEventPtr) data; CursorEventPtr *prev, e; @@ -962,7 +962,7 @@ CursorFreeClient(pointer data, XID id) } static int -CursorFreeHideCount(pointer data, XID id) +CursorFreeHideCount(void *data, XID id) { CursorHideCountPtr pChc = (CursorHideCountPtr) data; ScreenPtr pScreen = pChc->pScreen; @@ -978,7 +978,7 @@ CursorFreeHideCount(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/xfixes/region.c b/xfixes/region.c index 14a02ba1d..cc8f1a5ef 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -35,7 +35,7 @@ RESTYPE RegionResType; static int -RegionResFree(pointer data, XID id) +RegionResFree(void *data, XID id) { RegionPtr pRegion = (RegionPtr) data; @@ -85,7 +85,7 @@ ProcXFixesCreateRegion(ClientPtr client) pRegion = RegionFromRects(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 Success; @@ -115,7 +115,7 @@ ProcXFixesCreateRegionFromBitmap(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq); LEGAL_NEW_RESOURCE(stuff->region, client); - rc = dixLookupResourceByType((pointer *) &pPixmap, stuff->bitmap, RT_PIXMAP, + rc = dixLookupResourceByType((void **) &pPixmap, stuff->bitmap, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->bitmap; @@ -129,7 +129,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 Success; @@ -159,7 +159,7 @@ ProcXFixesCreateRegionFromWindow(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq); LEGAL_NEW_RESOURCE(stuff->region, client); - rc = dixLookupResourceByType((pointer *) &pWin, stuff->window, RT_WINDOW, + rc = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->window; @@ -188,7 +188,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 Success; @@ -238,7 +238,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 Success; @@ -285,7 +285,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 Success; @@ -629,7 +629,7 @@ ProcXFixesSetGCClipRegion(ClientPtr client) vals[1].val = stuff->yOrigin; ChangeGC(NullClient, pGC, GCClipXOrigin | GCClipYOrigin, vals); (*pGC->funcs->ChangeClip) (pGC, pRegion ? CT_REGION : CT_NONE, - (pointer) pRegion, 0); + (void *) pRegion, 0); return Success; } @@ -661,7 +661,7 @@ ProcXFixesSetWindowShapeRegion(ClientPtr client) REQUEST(xXFixesSetWindowShapeRegionReq); REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); - rc = dixLookupResourceByType((pointer *) &pWin, stuff->dest, RT_WINDOW, + rc = dixLookupResourceByType((void **) &pWin, stuff->dest, RT_WINDOW, client, DixSetAttrAccess); if (rc != Success) { client->errorValue = stuff->dest; diff --git a/xfixes/select.c b/xfixes/select.c index ee8ed6f68..c088ed3de 100644 --- a/xfixes/select.c +++ b/xfixes/select.c @@ -51,7 +51,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; @@ -119,7 +119,7 @@ static int XFixesSelectSelectionInput(ClientPtr pClient, Atom selection, WindowPtr pWindow, CARD32 eventMask) { - pointer val; + void *val; int rc; SelectionEventPtr *prev, e; @@ -159,12 +159,12 @@ XFixesSelectSelectionInput(ClientPtr pClient, DixGetAttrAccess); if (rc != Success) if (!AddResource(pWindow->drawable.id, SelectionWindowType, - (pointer) pWindow)) { + (void *) pWindow)) { free(e); return BadAlloc; } - if (!AddResource(e->clientResource, SelectionClientType, (pointer) e)) + if (!AddResource(e->clientResource, SelectionClientType, (void *) e)) return BadAlloc; *prev = e; @@ -222,7 +222,7 @@ SXFixesSelectionNotifyEvent(xXFixesSelectionNotifyEvent * from, } static int -SelectionFreeClient(pointer data, XID id) +SelectionFreeClient(void *data, XID id) { SelectionEventPtr old = (SelectionEventPtr) data; SelectionEventPtr *prev, e; @@ -239,7 +239,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/xfixes/xfixes.c b/xfixes/xfixes.c index 48af9ea6e..3307f874b 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -213,7 +213,7 @@ SProcXFixesDispatch(ClientPtr client) } static void -XFixesClientCallback(CallbackListPtr *list, pointer closure, pointer data) +XFixesClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; diff --git a/xfixes/xfixes.h b/xfixes/xfixes.h index 98828710f..fdcf44f3f 100644 --- a/xfixes/xfixes.h +++ b/xfixes/xfixes.h @@ -35,7 +35,7 @@ extern _X_EXPORT int XFixesErrorBase; #define VERIFY_REGION(pRegion, rid, client, mode) \ do { \ int err; \ - err = dixLookupResourceByType((pointer *) &pRegion, rid, \ + err = dixLookupResourceByType((void **) &pRegion, rid, \ RegionResType, client, mode); \ if (err != Success) { \ client->errorValue = rid; \ -- cgit v1.2.3