diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-03-25 17:57:54 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-03-25 17:57:54 -0400 |
commit | 4b5802ddbd45271be3cadeae0a83a6742df2515b (patch) | |
tree | 9569d18b523da979175562b113dd610752afd6ec /dix | |
parent | 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4 (diff) |
General DIX static and dead code cleanup.
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dispatch.c | 52 | ||||
-rw-r--r-- | dix/dixutils.c | 6 | ||||
-rw-r--r-- | dix/extension.c | 81 | ||||
-rw-r--r-- | dix/gc.c | 11 | ||||
-rw-r--r-- | dix/swaprep.c | 109 | ||||
-rw-r--r-- | dix/window.c | 120 |
6 files changed, 127 insertions, 252 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 02665edea..3d8e71fdc 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -299,7 +299,6 @@ long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; long SmartScheduleTime; static ClientPtr SmartLastClient; static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; -int SmartScheduleClient(int *clientReady, int nready); #ifdef SMART_DEBUG long SmartLastPrint; @@ -308,7 +307,7 @@ long SmartLastPrint; void Dispatch(void); void InitProcVectors(void); -int +static int SmartScheduleClient (int *clientReady, int nready) { ClientPtr pClient; @@ -834,7 +833,7 @@ ProcCirculateWindow(ClientPtr client) return(client->noClientException); } -int +static int GetGeometry(ClientPtr client, xGetGeometryReply *rep) { DrawablePtr pDraw; @@ -2157,8 +2156,7 @@ ProcPutImage(ClientPtr client) return (client->noClientException); } - -int +static int DoGetImage(ClientPtr client, int format, Drawable drawable, int x, int y, int width, int height, Mask planemask, xGetImageReply **im_return) @@ -3383,6 +3381,28 @@ ProcChangeAccessControl(ClientPtr client) return (result); } +/********************* + * CloseDownRetainedResources + * + * Find all clients that are gone and have terminated in RetainTemporary + * and destroy their resources. + *********************/ + +static void +CloseDownRetainedResources(void) +{ + int i; + ClientPtr client; + + for (i=1; i<currentMaxClients; i++) + { + client = clients[i]; + if (client && (client->closeDownMode == RetainTemporary) + && (client->clientGone)) + CloseDownClient(client); + } +} + int ProcKillClient(ClientPtr client) { @@ -3651,28 +3671,6 @@ KillAllClients() } } -/********************* - * CloseDownRetainedResources - * - * Find all clients that are gone and have terminated in RetainTemporary - * and destroy their resources. - *********************/ - -void -CloseDownRetainedResources() -{ - int i; - ClientPtr client; - - for (i=1; i<currentMaxClients; i++) - { - client = clients[i]; - if (client && (client->closeDownMode == RetainTemporary) - && (client->clientGone)) - CloseDownClient(client); - } -} - extern int clientPrivateLen; extern unsigned *clientPrivateSizes; extern unsigned totalClientSize; diff --git a/dix/dixutils.c b/dix/dixutils.c index c0728da71..44d82c944 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -882,9 +882,7 @@ static CallbackFuncsRec default_cbfuncs = _DeleteCallbackList }; -/* ===== Public Procedures ===== */ - -Bool +static Bool CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs) { CallbackListPtr cbl; @@ -916,6 +914,8 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs) return TRUE; } +/* ===== Public Procedures ===== */ + _X_EXPORT Bool AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) { diff --git a/dix/extension.c b/dix/extension.c index fb4ee6b95..88dff15e2 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -66,8 +66,6 @@ SOFTWARE. #define LAST_EVENT 128 #define LAST_ERROR 255 -static ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS]; - static ExtensionEntry **extensions = (ExtensionEntry **)NULL; int lastEvent = EXTENSION_EVENT_BASE; @@ -298,21 +296,8 @@ CloseDownExtensions() extensions = (ExtensionEntry **)NULL; lastEvent = EXTENSION_EVENT_BASE; lastError = FirstExtensionError; - for (i=0; i<MAXSCREENS; i++) - { - ScreenProcEntry *spentry = &AuxillaryScreenProcs[i]; - - while (spentry->num) - { - spentry->num--; - xfree(spentry->procList[spentry->num].name); - } - xfree(spentry->procList); - spentry->procList = (ProcEntryPtr)NULL; - } } - int ProcQueryExtension(ClientPtr client) { @@ -406,72 +391,6 @@ ProcListExtensions(ClientPtr client) return(client->noClientException); } - -ExtensionLookupProc -LookupProc(char *name, GCPtr pGC) -{ - int i; - ScreenProcEntry *spentry; - spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum]; - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - return(spentry->procList[i].proc); - } - return (ExtensionLookupProc)NULL; -} - -Bool -RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc) -{ - return RegisterScreenProc(name, pGC->pScreen, proc); -} - -Bool -RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) -{ - ScreenProcEntry *spentry; - ProcEntryPtr procEntry = (ProcEntryPtr)NULL; - char *newname; - int i; - - spentry = &AuxillaryScreenProcs[pScreen->myNum]; - /* first replace duplicates */ - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - { - procEntry = &spentry->procList[i]; - break; - } - } - if (procEntry) - procEntry->proc = proc; - else - { - newname = (char *)xalloc(strlen(name)+1); - if (!newname) - return FALSE; - procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, - sizeof(ProcEntryRec) * (spentry->num+1)); - if (!procEntry) - { - xfree(newname); - return FALSE; - } - spentry->procList = procEntry; - procEntry += spentry->num; - procEntry->name = newname; - strcpy(newname, name); - procEntry->proc = proc; - spentry->num++; - } - return TRUE; -} - #ifdef XSERVER_DTRACE void LoadExtensionNames(char **RequestNames) { int i; @@ -907,17 +907,6 @@ FreeGC(pointer value, XID gid) return(Success); } -void -SetGCMask(GCPtr pGC, Mask selectMask, Mask newDataMask) -{ - pGC->stateChanges = (~selectMask & pGC->stateChanges) | - (selectMask & newDataMask); - if (selectMask & newDataMask) - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; -} - - - /* CreateScratchGC(pScreen, depth) like CreateGC, but doesn't do the default tile or stipple, since we can't create them without already having a GC. any code diff --git a/dix/swaprep.c b/dix/swaprep.c index 6f4b277d9..7d3251ae3 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -317,7 +317,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) (void)WriteToClient(pClient, size, (char *) pRep); } -void +static void SwapTimecoord(xTimecoord* pCoord) { char n; @@ -584,7 +584,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep (void)WriteToClient(pClient, size, (char *) pRep); } -void +static void SwapRGB(xrgb *prgb) { char n; @@ -1159,6 +1159,58 @@ SKeymapNotifyEvent(xEvent *from, xEvent *to) *to = *from; } +static void +SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT) +{ + cpswapl(pConnSetup->release, pConnSetupT->release); + cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase); + cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask); + cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize); + cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor); + cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize); + pConnSetupT->minKeyCode = pConnSetup->minKeyCode; + pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode; + pConnSetupT->numRoots = pConnSetup->numRoots; + pConnSetupT->numFormats = pConnSetup->numFormats; + pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder; + pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder; + pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit; + pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad; +} + +static void +SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT) +{ + cpswapl(pRoot->windowId, pRootT->windowId); + cpswapl(pRoot->defaultColormap, pRootT->defaultColormap); + cpswapl(pRoot->whitePixel, pRootT->whitePixel); + cpswapl(pRoot->blackPixel, pRootT->blackPixel); + cpswapl(pRoot->currentInputMask, pRootT->currentInputMask); + cpswaps(pRoot->pixWidth, pRootT->pixWidth); + cpswaps(pRoot->pixHeight, pRootT->pixHeight); + cpswaps(pRoot->mmWidth, pRootT->mmWidth); + cpswaps(pRoot->mmHeight, pRootT->mmHeight); + cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps); + cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps); + cpswapl(pRoot->rootVisualID, pRootT->rootVisualID); + pRootT->backingStore = pRoot->backingStore; + pRootT->saveUnders = pRoot->saveUnders; + pRootT->rootDepth = pRoot->rootDepth; + pRootT->nDepths = pRoot->nDepths; +} + +static void +SwapVisual(xVisualType *pVis, xVisualType *pVisT) +{ + cpswapl(pVis->visualID, pVisT->visualID); + pVisT->class = pVis->class; + pVisT->bitsPerRGB = pVis->bitsPerRGB; + cpswaps(pVis->colormapEntries, pVisT->colormapEntries); + cpswapl(pVis->redMask, pVisT->redMask); + cpswapl(pVis->greenMask, pVisT->greenMask); + cpswapl(pVis->blueMask, pVisT->blueMask); +} + _X_EXPORT void SwapConnSetupInfo( char *pInfo, @@ -1210,7 +1262,6 @@ SwapConnSetupInfo( } } - void WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) { @@ -1227,58 +1278,6 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) DEALLOCATE_LOCAL(pInfoTBase); } -void -SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT) -{ - cpswapl(pConnSetup->release, pConnSetupT->release); - cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase); - cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask); - cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize); - cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor); - cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize); - pConnSetupT->minKeyCode = pConnSetup->minKeyCode; - pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode; - pConnSetupT->numRoots = pConnSetup->numRoots; - pConnSetupT->numFormats = pConnSetup->numFormats; - pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder; - pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder; - pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit; - pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad; -} - -void -SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT) -{ - cpswapl(pRoot->windowId, pRootT->windowId); - cpswapl(pRoot->defaultColormap, pRootT->defaultColormap); - cpswapl(pRoot->whitePixel, pRootT->whitePixel); - cpswapl(pRoot->blackPixel, pRootT->blackPixel); - cpswapl(pRoot->currentInputMask, pRootT->currentInputMask); - cpswaps(pRoot->pixWidth, pRootT->pixWidth); - cpswaps(pRoot->pixHeight, pRootT->pixHeight); - cpswaps(pRoot->mmWidth, pRootT->mmWidth); - cpswaps(pRoot->mmHeight, pRootT->mmHeight); - cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps); - cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps); - cpswapl(pRoot->rootVisualID, pRootT->rootVisualID); - pRootT->backingStore = pRoot->backingStore; - pRootT->saveUnders = pRoot->saveUnders; - pRootT->rootDepth = pRoot->rootDepth; - pRootT->nDepths = pRoot->nDepths; -} - -void -SwapVisual(xVisualType *pVis, xVisualType *pVisT) -{ - cpswapl(pVis->visualID, pVisT->visualID); - pVisT->class = pVis->class; - pVisT->bitsPerRGB = pVis->bitsPerRGB; - cpswaps(pVis->colormapEntries, pVisT->colormapEntries); - cpswapl(pVis->redMask, pVisT->redMask); - cpswapl(pVis->greenMask, pVisT->greenMask); - cpswapl(pVis->blueMask, pVisT->blueMask); -} - _X_EXPORT void SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo) { diff --git a/dix/window.c b/dix/window.c index 2a82f2e0a..7d99477ce 100644 --- a/dix/window.c +++ b/dix/window.c @@ -539,7 +539,7 @@ InitRootWindow(WindowPtr pWin) * window from which the region came. */ -void +static void ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, int x, int y, int w, int h) @@ -836,6 +836,26 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, } static void +DisposeWindowOptional (WindowPtr pWin) +{ + if (!pWin->optional) + return; + /* + * everything is peachy. Delete the optional record + * and clean up + */ + if (pWin->optional->cursor) + { + FreeCursor (pWin->optional->cursor, (Cursor)0); + pWin->cursorIsNone = FALSE; + } + else + pWin->cursorIsNone = TRUE; + xfree (pWin->optional); + pWin->optional = NULL; +} + +static void FreeWindowResources(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; @@ -2703,6 +2723,30 @@ RealizeTree(WindowPtr pWin) } } +static WindowPtr windowDisableMapUnmapEvents; + +void +DisableMapUnmapEvents(WindowPtr pWin) +{ + assert (windowDisableMapUnmapEvents == NULL); + + windowDisableMapUnmapEvents = pWin; +} + +void +EnableMapUnmapEvents(WindowPtr pWin) +{ + assert (windowDisableMapUnmapEvents != NULL); + + windowDisableMapUnmapEvents = NULL; +} + +static Bool +MapUnmapEventsEnabled(WindowPtr pWin) +{ + return pWin != windowDisableMapUnmapEvents; +} + /***** * MapWindow * If some other client has selected SubStructureReDirect on the parent @@ -3203,21 +3247,6 @@ HandleSaveSet(ClientPtr client) /** * - * \param x,y in root - * \param box "return" value - */ -Bool -VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box) -{ - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box)) - return(TRUE); - return(FALSE); -} - -/** - * * \param x,y in root */ Bool @@ -3324,30 +3353,6 @@ SendVisibilityNotify(WindowPtr pWin) DeliverEvents(pWin, &event, 1, NullWindow); } -static WindowPtr windowDisableMapUnmapEvents; - -void -DisableMapUnmapEvents(WindowPtr pWin) -{ - assert (windowDisableMapUnmapEvents == NULL); - - windowDisableMapUnmapEvents = pWin; -} - -void -EnableMapUnmapEvents(WindowPtr pWin) -{ - assert (windowDisableMapUnmapEvents != NULL); - - windowDisableMapUnmapEvents = NULL; -} - -Bool -MapUnmapEventsEnabled(WindowPtr pWin) -{ - return pWin != windowDisableMapUnmapEvents; -} - #define RANDOM_WIDTH 32 #ifndef NOLOGOHACK @@ -3700,41 +3705,6 @@ MakeWindowOptional (WindowPtr pWin) return TRUE; } -void -DisposeWindowOptional (WindowPtr pWin) -{ - if (!pWin->optional) - return; - /* - * everything is peachy. Delete the optional record - * and clean up - */ - /* - * TOG changed this code to: - * - * if (pWin->cursorIsNone == FALSE) - * FreeCursor (pWin->optional->cursor, (Cursor)0); - * pWin->cursorIsNone = TRUE; - * - * This is blatently wrong; windows without optionals can have - * two different cursor values, either None or sharing their - * parents cursor. This difference is controlled by the - * cursorIsNone value; when TRUE, the window has no cursor, - * when false, it shares its cursor with its parent; TOG - * made it impossible for a window to have a cursor without - * an optional record. - */ - if (pWin->optional->cursor) - { - FreeCursor (pWin->optional->cursor, (Cursor)0); - pWin->cursorIsNone = FALSE; - } - else - pWin->cursorIsNone = TRUE; - xfree (pWin->optional); - pWin->optional = NULL; -} - #ifndef NOLOGOHACK static void DrawLogo(WindowPtr pWin) |