summaryrefslogtreecommitdiff
path: root/dix/colormap.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-28 09:28:25 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-28 09:28:25 -0400
commit4017d3190234e189a0bbd33193a148d4d3c7556b (patch)
tree2ab228113d410386afde50c893f137d95974b8f3 /dix/colormap.c
parent85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (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/colormap.c')
-rw-r--r--dix/colormap.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/dix/colormap.c b/dix/colormap.c
index 7d6e7da4f..98f2f1b22 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -67,7 +67,6 @@ SOFTWARE.
#include "xace.h"
extern XID clientErrorValue;
-extern int colormapPrivateCount;
static Pixel FindBestPixel(
EntryPtr /*pentFirst*/,
@@ -388,30 +387,11 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
pmap->numPixelsBlue[client] = size;
}
}
- if (!AddResource(mid, RT_COLORMAP, (pointer)pmap))
- return (BadAlloc);
- /* If the device wants a chance to initialize the colormap in any way,
- * this is it. In specific, if this is a Static colormap, this is the
- * time to fill in the colormap's values */
+ pmap->devPrivates = NULL;
pmap->flags |= BeingCreated;
-
- /*
- * Allocate the array of devPrivate's for this colormap.
- */
-
- if (colormapPrivateCount == 0)
- pmap->devPrivates = NULL;
- else
- {
- pmap->devPrivates = (DevUnion *) xcalloc (
- sizeof(DevUnion), colormapPrivateCount);
- if (!pmap->devPrivates)
- {
- FreeResource (mid, RT_NONE);
- return BadAlloc;
- }
- }
+ if (!AddResource(mid, RT_COLORMAP, (pointer)pmap))
+ return (BadAlloc);
/*
* Security creation/labeling check
@@ -423,6 +403,9 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
return i;
}
+ /* If the device wants a chance to initialize the colormap in any way,
+ * this is it. In specific, if this is a Static colormap, this is the
+ * time to fill in the colormap's values */
if (!(*pScreen->CreateColormap)(pmap))
{
FreeResource (mid, RT_NONE);
@@ -486,10 +469,7 @@ FreeColormap (pointer value, XID mid)
}
}
- dixFreePrivates(*DEVPRIV_PTR(pmap));
- if (pmap->devPrivates)
- xfree(pmap->devPrivates);
-
+ dixFreePrivates(pmap->devPrivates);
xfree(pmap);
return(Success);
}