diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-28 09:28:25 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-28 09:28:25 -0400 |
commit | 4017d3190234e189a0bbd33193a148d4d3c7556b (patch) | |
tree | 2ab228113d410386afde50c893f137d95974b8f3 /dix/main.c | |
parent | 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff) |
devPrivates rework: since API is already broken, switch everything
over to new system.
Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
Diffstat (limited to 'dix/main.c')
-rw-r--r-- | dix/main.c | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/dix/main.c b/dix/main.c index 3e5d0e438..7f7bfa539 100644 --- a/dix/main.c +++ b/dix/main.c @@ -118,15 +118,12 @@ Equipment Corporation. #include "dpmsproc.h" #endif -extern int InitClientPrivates(ClientPtr client); - extern void Dispatch(void); char *ConnectionInfo; xConnSetupPrefix connSetupPrefix; extern FontPtr defaultFont; -extern int screenPrivateCount; extern void InitProcVectors(void); extern Bool CreateGCperDepthArray(void); @@ -136,8 +133,6 @@ static #endif Bool CreateConnectionBlock(void); -static void FreeScreen(ScreenPtr); - _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[33]; int connBlockScreenStart; @@ -372,8 +367,6 @@ main(int argc, char *argv[], char *envp[]) if (screenInfo.numVideoScreens < 0) screenInfo.numVideoScreens = screenInfo.numScreens; InitExtensions(argc, argv); - if (!InitClientPrivates(serverClient)) - FatalError("failed to allocate serverClient devprivates"); for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; @@ -472,7 +465,8 @@ main(int argc, char *argv[], char *envp[]) FreeGCperDepth(i); FreeDefaultStipple(i); (* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]); - FreeScreen(screenInfo.screens[i]); + dixFreePrivates(screenInfo.screens[i]->devPrivates); + xfree(screenInfo.screens[i]); screenInfo.numScreens = i; } CloseDownEvents(); @@ -482,8 +476,7 @@ main(int argc, char *argv[], char *envp[]) FreeAuditTimer(); - dixFreePrivates(*DEVPRIV_PTR(serverClient)); - xfree(serverClient->devPrivates); + dixFreePrivates(serverClient->devPrivates); serverClient->devPrivates = NULL; if (dispatchException & DE_TERMINATE) @@ -695,32 +688,9 @@ AddScreen( if (!pScreen) return -1; - pScreen->devPrivates = (DevUnion *)xcalloc(sizeof(DevUnion), - screenPrivateCount); - if (!pScreen->devPrivates && screenPrivateCount) - { - xfree(pScreen); - return -1; - } - - /* must pre-allocate one private for the new devPrivates support */ - pScreen->WindowPrivateLen = 1; - pScreen->WindowPrivateSizes = (unsigned *)xcalloc(1, sizeof(unsigned)); - pScreen->totalWindowSize = PadToLong(sizeof(WindowRec)) + sizeof(DevUnion); - pScreen->GCPrivateLen = 1; - pScreen->GCPrivateSizes = (unsigned *)xcalloc(1, sizeof(unsigned)); - pScreen->totalGCSize = PadToLong(sizeof(GC)) + sizeof(DevUnion); - pScreen->PixmapPrivateLen = 1; - pScreen->PixmapPrivateSizes = (unsigned *)xcalloc(1, sizeof(unsigned)); - pScreen->totalPixmapSize = BitmapBytePad(8 * (sizeof(PixmapRec) + - sizeof(DevUnion))); - if (!pScreen->WindowPrivateSizes || !pScreen->GCPrivateSizes || - !pScreen->PixmapPrivateSizes) { - xfree(pScreen); - return -1; - } - + pScreen->devPrivates = NULL; pScreen->myNum = i; + pScreen->totalPixmapSize = BitmapBytePad(sizeof(PixmapRec)*8); pScreen->ClipNotify = 0; /* for R4 ddx compatibility */ pScreen->CreateScreenResources = 0; @@ -772,20 +742,10 @@ AddScreen( screenInfo.numScreens++; if (!(*pfnInit)(i, pScreen, argc, argv)) { - FreeScreen(pScreen); + dixFreePrivates(pScreen->devPrivates); + xfree(pScreen); screenInfo.numScreens--; return -1; } return i; } - -static void -FreeScreen(ScreenPtr pScreen) -{ - xfree(pScreen->WindowPrivateSizes); - xfree(pScreen->GCPrivateSizes); - xfree(pScreen->PixmapPrivateSizes); - dixFreePrivates(*DEVPRIV_PTR(pScreen)); - xfree(pScreen->devPrivates); - xfree(pScreen); -} |