Merge branch 'master' into XACE-SELINUX

Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
This commit is contained in:
Eamon Walsh 2007-11-05 19:08:36 -05:00 committed by Eamon Walsh
commit a52c9b2a59
270 changed files with 1595 additions and 1829 deletions

View File

@ -190,7 +190,6 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
__GLXscreen *pGlxScreen, GLboolean isDirect) __GLXscreen *pGlxScreen, GLboolean isDirect)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
VisualPtr pVisual;
__GLXcontext *glxc, *shareglxc; __GLXcontext *glxc, *shareglxc;
LEGAL_NEW_RESOURCE(gcId, client); LEGAL_NEW_RESOURCE(gcId, client);
@ -248,9 +247,7 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
** Initially, setup the part of the context that could be used by ** Initially, setup the part of the context that could be used by
** a GL core that needs windowing information (e.g., Mesa). ** a GL core that needs windowing information (e.g., Mesa).
*/ */
glxc->pScreen = pGlxScreen->pScreen;
glxc->pGlxScreen = pGlxScreen; glxc->pGlxScreen = pGlxScreen;
glxc->pVisual = pVisual;
glxc->modes = config; glxc->modes = config;
/* /*
@ -499,7 +496,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
* a GLX drawable for it. Check that the drawable screen matches * a GLX drawable for it. Check that the drawable screen matches
* the context screen and that the context fbconfig is compatible * the context screen and that the context fbconfig is compatible
* with the window visual. */ * with the window visual. */
if (pDraw->pScreen != glxc->pScreen || if (pDraw->pScreen != glxc->pGlxScreen->pScreen ||
!validGlxFBConfigForWindow(client, glxc->modes, pDraw, error)) !validGlxFBConfigForWindow(client, glxc->modes, pDraw, error))
return NULL; return NULL;
@ -1255,7 +1252,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
__glXenterServer(GL_FALSE); __glXenterServer(GL_FALSE);
pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen,
width, height, config->rgbBits); width, height, config->rgbBits, 0);
__glXleaveServer(GL_FALSE); __glXleaveServer(GL_FALSE);
return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable, return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable,
@ -1470,9 +1467,9 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
*pSendBuf++ = GLX_SHARE_CONTEXT_EXT; *pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
*pSendBuf++ = (int)(ctx->share_id); *pSendBuf++ = (int)(ctx->share_id);
*pSendBuf++ = GLX_VISUAL_ID_EXT; *pSendBuf++ = GLX_VISUAL_ID_EXT;
*pSendBuf++ = (int)(ctx->pVisual->vid); *pSendBuf++ = (int)(ctx->modes->visualID);
*pSendBuf++ = GLX_SCREEN_EXT; *pSendBuf++ = GLX_SCREEN_EXT;
*pSendBuf++ = (int)(ctx->pScreen->myNum); *pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum);
if (client->swapped) { if (client->swapped) {
__glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);

View File

@ -85,14 +85,8 @@ struct __GLXcontext {
** Pointer to screen info data for this context. This is set ** Pointer to screen info data for this context. This is set
** when the context is created. ** when the context is created.
*/ */
ScreenPtr pScreen;
__GLXscreen *pGlxScreen; __GLXscreen *pGlxScreen;
/*
** This context is created with respect to this visual.
*/
VisualRec *pVisual;
/* /*
** The XID of this context. ** The XID of this context.
*/ */
@ -103,11 +97,6 @@ struct __GLXcontext {
*/ */
XID share_id; XID share_id;
/*
** Visual id.
*/
VisualID vid;
/* /*
** screen number. ** screen number.
*/ */
@ -128,11 +117,6 @@ struct __GLXcontext {
*/ */
GLboolean isDirect; GLboolean isDirect;
/*
** Window pending state
*/
GLuint pendingState;
/* /*
** This flag keeps track of whether there are unflushed GL commands. ** This flag keeps track of whether there are unflushed GL commands.
*/ */

View File

@ -185,10 +185,14 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
(*private->driDrawable.destroyDrawable)(&private->driDrawable); (*private->driDrawable.destroyDrawable)(&private->driDrawable);
__glXenterServer(GL_FALSE); /* If the X window was destroyed, the dri DestroyWindow hook will
DRIDestroyDrawable(drawable->pDraw->pScreen, * aready have taken care of this, so only call if pDraw isn't NULL. */
serverClient, drawable->pDraw); if (drawable->pDraw != NULL) {
__glXleaveServer(GL_FALSE); __glXenterServer(GL_FALSE);
DRIDestroyDrawable(drawable->pDraw->pScreen,
serverClient, drawable->pDraw);
__glXleaveServer(GL_FALSE);
}
xfree(private); xfree(private);
} }
@ -249,7 +253,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext)
context->driContext.destroyContext(&context->driContext); context->driContext.destroyContext(&context->driContext);
__glXenterServer(GL_FALSE); __glXenterServer(GL_FALSE);
retval = DRIDestroyContext(baseContext->pScreen, context->hwContextID); retval = DRIDestroyContext(baseContext->pGlxScreen->pScreen, context->hwContextID);
__glXleaveServer(GL_FALSE); __glXleaveServer(GL_FALSE);
__glXContextDestroy(&context->base); __glXContextDestroy(&context->base);
@ -583,7 +587,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy; context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent; context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.pScreen = screen->base.pScreen;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
/* Find the requested X visual */ /* Find the requested X visual */
@ -668,11 +671,16 @@ getDrawableInfo(__DRIdrawable *driDrawable,
{ {
__GLXDRIdrawable *drawable = containerOf(driDrawable, __GLXDRIdrawable *drawable = containerOf(driDrawable,
__GLXDRIdrawable, driDrawable); __GLXDRIdrawable, driDrawable);
ScreenPtr pScreen = drawable->base.pDraw->pScreen; ScreenPtr pScreen;
drm_clip_rect_t *pClipRects, *pBackClipRects; drm_clip_rect_t *pClipRects, *pBackClipRects;
GLboolean retval; GLboolean retval;
size_t size; size_t size;
/* If the X window has been destroyed, give up here. */
if (drawable->base.pDraw == NULL)
return GL_FALSE;
pScreen = drawable->base.pDraw->pScreen;
__glXenterServer(GL_FALSE); __glXenterServer(GL_FALSE);
retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp, retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp,
x, y, width, height, x, y, width, height,

View File

@ -107,22 +107,8 @@ static int ContextGone(__GLXcontext* cx, XID id)
*/ */
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
{ {
__GLXcontext *cx, *cx1; glxPriv->pDraw = NULL;
glxPriv->drawId = 0;
/*
** When a drawable is destroyed, notify all context bound to
** it, that there are no longer bound to anything.
*/
for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
cx1 = cx->nextDrawPriv;
cx->pendingState |= __GLX_PENDING_DESTROY;
}
for (cx = glxPriv->readGlxc; cx; cx = cx1) {
cx1 = cx->nextReadPriv;
cx->pendingState |= __GLX_PENDING_DESTROY;
}
__glXUnrefDrawable(glxPriv); __glXUnrefDrawable(glxPriv);
return True; return True;

View File

@ -265,7 +265,7 @@ __glXMesaScreenDestroy(__GLXscreen *screen)
int i; int i;
if (mesaScreen->xm_vis) { if (mesaScreen->xm_vis) {
for (i = 0; i < mesaScreen->num_vis; i++) { for (i = 0; i < mesaScreen->base.numFBConfigs; i++) {
if (mesaScreen->xm_vis[i]) if (mesaScreen->xm_vis[i])
XMesaDestroyVisual(mesaScreen->xm_vis[i]); XMesaDestroyVisual(mesaScreen->xm_vis[i]);
} }
@ -363,7 +363,7 @@ createMesaVisuals(__GLXMESAscreen *pMesaScreen)
{ {
__GLcontextModes *config; __GLcontextModes *config;
ScreenPtr pScreen; ScreenPtr pScreen;
VisualPtr visual; VisualPtr visual = NULL;
int i, j; int i, j;
i = 0; i = 0;

View File

@ -190,7 +190,6 @@ static char GLXServerExtensions[] =
static Bool glxPositionWindow(WindowPtr pWin, int x, int y) static Bool glxPositionWindow(WindowPtr pWin, int x, int y)
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
__GLXcontext *glxc;
__GLXdrawable *glxPriv; __GLXdrawable *glxPriv;
Bool ret; Bool ret;
__GLXscreen *pGlxScreen; __GLXscreen *pGlxScreen;
@ -227,16 +226,6 @@ static Bool glxPositionWindow(WindowPtr pWin, int x, int y)
ret = False; ret = False;
} }
/* mark contexts as needing resize */
for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) {
glxc->pendingState |= __GLX_PENDING_RESIZE;
}
for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) {
glxc->pendingState |= __GLX_PENDING_RESIZE;
}
return ret; return ret;
} }
@ -408,38 +397,61 @@ initGlxVisual(VisualPtr visual, __GLcontextModes *config)
visual->offsetBlue = findFirstSet(config->blueMask); visual->offsetBlue = findFirstSet(config->blueMask);
} }
typedef struct {
GLboolean doubleBuffer;
GLboolean depthBuffer;
} FBConfigTemplateRec, *FBConfigTemplatePtr;
static __GLcontextModes *
pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
{
__GLcontextModes *config;
for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) {
if (config->visualRating != GLX_NONE)
continue;
if (_gl_convert_to_x_visual_type(config->visualType) != class)
continue;
if ((config->doubleBufferMode > 0) != template->doubleBuffer)
continue;
if ((config->depthBits > 0) != template->depthBuffer)
continue;
return config;
}
return NULL;
}
static void static void
addMinimalSet(__GLXscreen *pGlxScreen) addMinimalSet(__GLXscreen *pGlxScreen)
{ {
__GLcontextModes *config; __GLcontextModes *config;
VisualPtr visuals; VisualPtr visuals;
int depth; int i;
FBConfigTemplateRec best = { GL_TRUE, GL_TRUE };
FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE };
for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals,
if (config->visualRating != GLX_NONE) sizeof (__GLcontextModes *));
continue;
if (config->doubleBufferMode && config->depthBits > 0)
break;
}
if (config == NULL)
config = pGlxScreen->fbconfigs;
pGlxScreen->visuals = xcalloc(1, sizeof (__GLcontextModes *));
if (pGlxScreen->visuals == NULL) { if (pGlxScreen->visuals == NULL) {
ErrorF("Failed to allocate for minimal set of GLX visuals\n"); ErrorF("Failed to allocate for minimal set of GLX visuals\n");
return; return;
} }
depth = config->redBits + config->greenBits + config->blueBits; pGlxScreen->numVisuals = pGlxScreen->pScreen->numVisuals;
visuals = AddScreenVisuals(pGlxScreen->pScreen, 1, depth); visuals = pGlxScreen->pScreen->visuals;
if (visuals == NULL) { for (i = 0; i < pGlxScreen->numVisuals; i++) {
xfree(pGlxScreen->visuals); if (visuals[i].nplanes == 32)
return; config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class);
else
config = pickFBConfig(pGlxScreen, &best, visuals[i].class);
if (config == NULL)
config = pGlxScreen->fbconfigs;
pGlxScreen->visuals[i] = config;
config->visualID = visuals[i].vid;
} }
pGlxScreen->numVisuals = 1;
pGlxScreen->visuals[0] = config;
initGlxVisual(&visuals[0], config);
} }
static void static void
@ -505,8 +517,6 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) { for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) {
m->fbconfigID = FakeClientID(0); m->fbconfigID = FakeClientID(0);
m->visualID = findVisualForConfig(pScreen, m); m->visualID = findVisualForConfig(pScreen, m);
ErrorF("mapping fbconfig id 0x%02lx to visual id 0x%02lx\n",
m->fbconfigID, m->visualID);
i++; i++;
} }
pGlxScreen->numFBConfigs = i; pGlxScreen->numFBConfigs = i;

View File

@ -2066,7 +2066,7 @@ static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req)
} }
nmasks = creq->planes; nmasks = creq->planes;
length = ((long)npixels + (long)nmasks) * sizeof(Pixel); length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
data = (XETrapDatum *)ALLOCATE_LOCAL(sizeof(XETrapDatum)+length); data = (XETrapDatum *)xalloc(sizeof(XETrapDatum)+length);
if (!data) if (!data)
{ {
SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
@ -2084,7 +2084,7 @@ static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req)
{ {
SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
req->reqType, 0L, retval); req->reqType, 0L, retval);
DEALLOCATE_LOCAL(data); xfree(data);
return; return;
} }
crep = (xAllocColorCellsReply *)&(data->u.reply); crep = (xAllocColorCellsReply *)&(data->u.reply);
@ -2109,7 +2109,7 @@ static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req)
SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
req->reqType, 0L, XETrapErrorBase + BadIO); req->reqType, 0L, XETrapErrorBase + BadIO);
} }
DEALLOCATE_LOCAL(data); xfree(data);
} }
static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req) static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req)
{ /* adapted from ProcAllocColorPlanes() in dispatch.c */ { /* adapted from ProcAllocColorPlanes() in dispatch.c */
@ -2137,7 +2137,7 @@ static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req)
return; return;
} }
length = (long)npixels * sizeof(Pixel); length = (long)npixels * sizeof(Pixel);
data = (XETrapDatum *)ALLOCATE_LOCAL(sizeof(XETrapDatum)+length); data = (XETrapDatum *)xalloc(sizeof(XETrapDatum)+length);
if (!data) if (!data)
{ {
SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
@ -2157,7 +2157,7 @@ static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req)
{ {
SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
req->reqType, 0L, retval); req->reqType, 0L, retval);
DEALLOCATE_LOCAL(data); xfree(data);
return; return;
} }
crep->nPixels = npixels; crep->nPixels = npixels;
@ -2182,6 +2182,6 @@ static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req)
SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
req->reqType, 0L, XETrapErrorBase + BadIO); req->reqType, 0L, XETrapErrorBase + BadIO);
} }
DEALLOCATE_LOCAL(data); xfree(data);
} }
#endif /* COLOR_REPLIES */ #endif /* COLOR_REPLIES */

View File

@ -436,7 +436,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint)
pMultibuffer->pMultibuffers = pMultibuffers; pMultibuffer->pMultibuffers = pMultibuffers;
if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer)) if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer))
break; break;
pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth); pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth, 0);
if (!pMultibuffer->pPixmap) if (!pMultibuffer->pPixmap)
break; break;
if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap)) if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap))
@ -557,12 +557,12 @@ ProcDisplayImageBuffers (client)
return Success; return Success;
minDelay = stuff->minDelay; minDelay = stuff->minDelay;
ids = (XID *) &stuff[1]; ids = (XID *) &stuff[1];
ppMultibuffers = (MultibuffersPtr *) ALLOCATE_LOCAL(nbuf * sizeof (MultibuffersPtr)); ppMultibuffers = (MultibuffersPtr *) xalloc(nbuf * sizeof (MultibuffersPtr));
pMultibuffer = (MultibufferPtr *) ALLOCATE_LOCAL(nbuf * sizeof (MultibufferPtr)); pMultibuffer = (MultibufferPtr *) xalloc(nbuf * sizeof (MultibufferPtr));
if (!ppMultibuffers || !pMultibuffer) if (!ppMultibuffers || !pMultibuffer)
{ {
if (ppMultibuffers) DEALLOCATE_LOCAL(ppMultibuffers); if (ppMultibuffers) xfree(ppMultibuffers);
if (pMultibuffer) DEALLOCATE_LOCAL(pMultibuffer); if (pMultibuffer) xfree(pMultibuffer);
client->errorValue = 0; client->errorValue = 0;
return BadAlloc; return BadAlloc;
} }
@ -574,8 +574,8 @@ ProcDisplayImageBuffers (client)
MultibufferResType); MultibufferResType);
if (!pMultibuffer[i]) if (!pMultibuffer[i])
{ {
DEALLOCATE_LOCAL(ppMultibuffers); xfree(ppMultibuffers);
DEALLOCATE_LOCAL(pMultibuffer); xfree(pMultibuffer);
client->errorValue = ids[i]; client->errorValue = ids[i];
return MultibufferErrorBase + MultibufferBadBuffer; return MultibufferErrorBase + MultibufferBadBuffer;
} }
@ -584,8 +584,8 @@ MultibufferResType);
{ {
if (ppMultibuffers[i] == ppMultibuffers[j]) if (ppMultibuffers[i] == ppMultibuffers[j])
{ {
DEALLOCATE_LOCAL(ppMultibuffers); xfree(ppMultibuffers);
DEALLOCATE_LOCAL(pMultibuffer); xfree(pMultibuffer);
client->errorValue = ids[i]; client->errorValue = ids[i];
return BadMatch; return BadMatch;
} }
@ -604,8 +604,8 @@ MultibufferResType);
else else
PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf); PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf);
DEALLOCATE_LOCAL(ppMultibuffers); xfree(ppMultibuffers);
DEALLOCATE_LOCAL(pMultibuffer); xfree(pMultibuffer);
return Success; return Success;
} }
@ -698,7 +698,7 @@ ProcGetMBufferAttributes (client)
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
if (!pMultibuffers) if (!pMultibuffers)
return BadAccess; return BadAccess;
ids = (XID *) ALLOCATE_LOCAL (pMultibuffers->numMultibuffer * sizeof (XID)); ids = (XID *) xalloc (pMultibuffers->numMultibuffer * sizeof (XID));
if (!ids) if (!ids)
return BadAlloc; return BadAlloc;
for (i = 0; i < pMultibuffers->numMultibuffer; i++) for (i = 0; i < pMultibuffers->numMultibuffer; i++)
@ -721,7 +721,7 @@ ProcGetMBufferAttributes (client)
(char *)&rep); (char *)&rep);
WriteToClient (client, (int)(pMultibuffers->numMultibuffer * sizeof (XID)), WriteToClient (client, (int)(pMultibuffers->numMultibuffer * sizeof (XID)),
(char *)ids); (char *)ids);
DEALLOCATE_LOCAL((pointer) ids); xfree((pointer) ids);
return client->noClientException; return client->noClientException;
} }
@ -836,7 +836,7 @@ ProcGetBufferInfo (client)
nInfo += pDepth->numVids; nInfo += pDepth->numVids;
} }
pInfo = (xMbufBufferInfo *) pInfo = (xMbufBufferInfo *)
ALLOCATE_LOCAL (nInfo * sizeof (xMbufBufferInfo)); xalloc (nInfo * sizeof (xMbufBufferInfo));
if (!pInfo) if (!pInfo)
return BadAlloc; return BadAlloc;
@ -872,7 +872,7 @@ ProcGetBufferInfo (client)
} }
WriteToClient (client, sizeof (xMbufGetBufferInfoReply), (pointer) &rep); WriteToClient (client, sizeof (xMbufGetBufferInfoReply), (pointer) &rep);
WriteToClient (client, (int) nInfo * sizeof (xMbufBufferInfo), (pointer) pInfo); WriteToClient (client, (int) nInfo * sizeof (xMbufBufferInfo), (pointer) pInfo);
DEALLOCATE_LOCAL ((pointer) pInfo); xfree ((pointer) pInfo);
return client->noClientException; return client->noClientException;
} }
@ -1289,7 +1289,7 @@ DisplayImageBuffers (ids, nbuf)
MultibuffersPtr *pMultibuffers; MultibuffersPtr *pMultibuffers;
int i, j; int i, j;
pMultibuffer = (MultibufferPtr *) ALLOCATE_LOCAL (nbuf * sizeof *pMultibuffer + pMultibuffer = (MultibufferPtr *) xalloc (nbuf * sizeof *pMultibuffer +
nbuf * sizeof *pMultibuffers); nbuf * sizeof *pMultibuffers);
if (!pMultibuffer) if (!pMultibuffer)
return BadAlloc; return BadAlloc;
@ -1299,19 +1299,19 @@ DisplayImageBuffers (ids, nbuf)
pMultibuffer[i] = (MultibufferPtr) LookupIDByType (ids[i], MultibufferResType); pMultibuffer[i] = (MultibufferPtr) LookupIDByType (ids[i], MultibufferResType);
if (!pMultibuffer[i]) if (!pMultibuffer[i])
{ {
DEALLOCATE_LOCAL (pMultibuffer); xfree (pMultibuffer);
return MultibufferErrorBase + MultibufferBadBuffer; return MultibufferErrorBase + MultibufferBadBuffer;
} }
pMultibuffers[i] = pMultibuffer[i]->pMultibuffers; pMultibuffers[i] = pMultibuffer[i]->pMultibuffers;
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
if (pMultibuffers[i] == pMultibuffers[j]) if (pMultibuffers[i] == pMultibuffers[j])
{ {
DEALLOCATE_LOCAL (pMultibuffer); xfree (pMultibuffer);
return BadMatch; return BadMatch;
} }
} }
PerformDisplayRequest (pMultibuffers, pMultibuffer, nbuf); PerformDisplayRequest (pMultibuffers, pMultibuffer, nbuf);
DEALLOCATE_LOCAL (pMultibuffer); xfree (pMultibuffer);
return Success; return Success;
} }
@ -1415,7 +1415,7 @@ MultibufferExpose (pMultibuffer, pRegion)
numRects = REGION_NUM_RECTS(pRegion); numRects = REGION_NUM_RECTS(pRegion);
pBox = REGION_RECTS(pRegion); pBox = REGION_RECTS(pRegion);
pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)); pEvent = (xEvent *) xalloc(numRects * sizeof(xEvent));
if (pEvent) { if (pEvent) {
pe = pEvent; pe = pEvent;
@ -1431,7 +1431,7 @@ MultibufferExpose (pMultibuffer, pRegion)
} }
(void) DeliverEventsToMultibuffer (pMultibuffer, pEvent, numRects, (void) DeliverEventsToMultibuffer (pMultibuffer, pEvent, numRects,
ExposureMask); ExposureMask);
DEALLOCATE_LOCAL(pEvent); xfree(pEvent);
} }
} }
} }
@ -1609,7 +1609,8 @@ MultibufferPositionWindow (pWin, x, y)
{ {
pMultibuffer = &pMultibuffers->buffers[i]; pMultibuffer = &pMultibuffers->buffers[i];
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pWin->drawable.depth); pWin->drawable.depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
DestroyImageBuffers (pWin); DestroyImageBuffers (pWin);

View File

@ -614,7 +614,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
if (!pGC) if (!pGC)
return; return;
prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * prect = (xRectangle *)xalloc(REGION_NUM_RECTS(prgn) *
sizeof(xRectangle)); sizeof(xRectangle));
if (!prect) if (!prect)
{ {
@ -638,7 +638,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
prect -= numRects; prect -= numRects;
(* pGC->ops->PolyFillRect)(pDrawable, pGC, numRects, prect); (* pGC->ops->PolyFillRect)(pDrawable, pGC, numRects, prect);
DEALLOCATE_LOCAL(prect); xfree(prect);
FreeScratchGC (pGC); FreeScratchGC (pGC);
} }

View File

@ -155,7 +155,7 @@ pixCreateImageBuffers (pWin, nbuf, ids, action, hint)
{ {
pMBBuffer = &pMBWindow->buffers[i]; pMBBuffer = &pMBWindow->buffers[i];
pMBBuffer->pDrawable = (DrawablePtr) pMBBuffer->pDrawable = (DrawablePtr)
(*pScreen->CreatePixmap) (pScreen, width, height, depth); (*pScreen->CreatePixmap) (pScreen, width, height, depth, 0);
if (!pMBBuffer->pDrawable) if (!pMBBuffer->pDrawable)
break; break;
@ -263,7 +263,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
int nrects = REGION_NUM_RECTS(pRegion); int nrects = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion); BoxPtr pbox = REGION_RECTS(pRegion);
pRects = (xRectangle *)ALLOCATE_LOCAL(nrects * sizeof(xRectangle)); pRects = (xRectangle *)xalloc(nrects * sizeof(xRectangle));
if (pRects) if (pRects)
{ {
int i; int i;
@ -275,7 +275,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
pRects[i].height = pbox->y2 - pbox->y1; pRects[i].height = pbox->y2 - pbox->y1;
} }
MultibufferPaintBackgroundRectangles(pWin, pDrawable, nrects, pRects); MultibufferPaintBackgroundRectangles(pWin, pDrawable, nrects, pRects);
DEALLOCATE_LOCAL(pRects); xfree(pRects);
} }
} }
@ -542,7 +542,8 @@ pixPositionWindow (pWin, x, y)
for (i = 0; i < pMBWindow->numMultibuffer; i++) for (i = 0; i < pMBWindow->numMultibuffer; i++)
{ {
pMBBuffer = &pMBWindow->buffers[i]; pMBBuffer = &pMBWindow->buffers[i];
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
(* MB_SCREEN_PRIV(pScreen)->DestroyImageBuffers)(pWin); (* MB_SCREEN_PRIV(pScreen)->DestroyImageBuffers)(pWin);

View File

@ -1272,7 +1272,7 @@ int PanoramiXPolyPoint(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
if (npoint > 0) { if (npoint > 0) {
origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint)); origPts = (xPoint *) xalloc(npoint * sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint)); memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1299,7 +1299,7 @@ int PanoramiXPolyPoint(ClientPtr client)
result = (* SavedProcVector[X_PolyPoint])(client); result = (* SavedProcVector[X_PolyPoint])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origPts); xfree(origPts);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1330,7 +1330,7 @@ int PanoramiXPolyLine(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
if (npoint > 0){ if (npoint > 0){
origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint)); origPts = (xPoint *) xalloc(npoint * sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint)); memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1357,7 +1357,7 @@ int PanoramiXPolyLine(ClientPtr client)
result = (* SavedProcVector[X_PolyLine])(client); result = (* SavedProcVector[X_PolyLine])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origPts); xfree(origPts);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1391,7 +1391,7 @@ int PanoramiXPolySegment(ClientPtr client)
if(nsegs & 4) return BadLength; if(nsegs & 4) return BadLength;
nsegs >>= 3; nsegs >>= 3;
if (nsegs > 0) { if (nsegs > 0) {
origSegs = (xSegment *) ALLOCATE_LOCAL(nsegs * sizeof(xSegment)); origSegs = (xSegment *) xalloc(nsegs * sizeof(xSegment));
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment)); memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1418,7 +1418,7 @@ int PanoramiXPolySegment(ClientPtr client)
result = (* SavedProcVector[X_PolySegment])(client); result = (* SavedProcVector[X_PolySegment])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origSegs); xfree(origSegs);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1453,7 +1453,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
if(nrects & 4) return BadLength; if(nrects & 4) return BadLength;
nrects >>= 3; nrects >>= 3;
if (nrects > 0){ if (nrects > 0){
origRecs = (xRectangle *) ALLOCATE_LOCAL(nrects * sizeof(xRectangle)); origRecs = (xRectangle *) xalloc(nrects * sizeof(xRectangle));
memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle)); memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1479,7 +1479,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
result = (* SavedProcVector[X_PolyRectangle])(client); result = (* SavedProcVector[X_PolyRectangle])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origRecs); xfree(origRecs);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1513,7 +1513,7 @@ int PanoramiXPolyArc(ClientPtr client)
if(narcs % sizeof(xArc)) return BadLength; if(narcs % sizeof(xArc)) return BadLength;
narcs /= sizeof(xArc); narcs /= sizeof(xArc);
if (narcs > 0){ if (narcs > 0){
origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc)); origArcs = (xArc *) xalloc(narcs * sizeof(xArc));
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc)); memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1537,7 +1537,7 @@ int PanoramiXPolyArc(ClientPtr client)
result = (* SavedProcVector[X_PolyArc])(client); result = (* SavedProcVector[X_PolyArc])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origArcs); xfree(origArcs);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1569,7 +1569,7 @@ int PanoramiXFillPoly(ClientPtr client)
count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
if (count > 0){ if (count > 0){
locPts = (DDXPointPtr) ALLOCATE_LOCAL(count * sizeof(DDXPointRec)); locPts = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec));
memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec)); memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1596,7 +1596,7 @@ int PanoramiXFillPoly(ClientPtr client)
result = (* SavedProcVector[X_FillPoly])(client); result = (* SavedProcVector[X_FillPoly])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(locPts); xfree(locPts);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1630,7 +1630,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
if(things & 4) return BadLength; if(things & 4) return BadLength;
things >>= 3; things >>= 3;
if (things > 0){ if (things > 0){
origRects = (xRectangle *) ALLOCATE_LOCAL(things * sizeof(xRectangle)); origRects = (xRectangle *) xalloc(things * sizeof(xRectangle));
memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle)); memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1655,7 +1655,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
result = (* SavedProcVector[X_PolyFillRectangle])(client); result = (* SavedProcVector[X_PolyFillRectangle])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origRects); xfree(origRects);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);
@ -1689,7 +1689,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
IF_RETURN((narcs % sizeof(xArc)), BadLength); IF_RETURN((narcs % sizeof(xArc)), BadLength);
narcs /= sizeof(xArc); narcs /= sizeof(xArc);
if (narcs > 0) { if (narcs > 0) {
origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc)); origArcs = (xArc *) xalloc(narcs * sizeof(xArc));
memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc)); memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j){ FOR_NSCREENS_FORWARD(j){
@ -1714,7 +1714,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
result = (* SavedProcVector[X_PolyFillArc])(client); result = (* SavedProcVector[X_PolyFillArc])(client);
if(result != Success) break; if(result != Success) break;
} }
DEALLOCATE_LOCAL(origArcs); xfree(origArcs);
return (result); return (result);
} else } else
return (client->noClientException); return (client->noClientException);

View File

@ -687,7 +687,7 @@ CreateSaverWindow (pScreen)
wantMap = wColormap (pWin); wantMap = wColormap (pWin);
if (wantMap == None) if (wantMap == None)
return TRUE; return TRUE;
installedMaps = (Colormap *) ALLOCATE_LOCAL (pScreen->maxInstalledCmaps * installedMaps = (Colormap *) xalloc (pScreen->maxInstalledCmaps *
sizeof (Colormap)); sizeof (Colormap));
numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps) numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
(pScreen, installedMaps); (pScreen, installedMaps);
@ -695,7 +695,7 @@ CreateSaverWindow (pScreen)
if (installedMaps[i] == wantMap) if (installedMaps[i] == wantMap)
break; break;
DEALLOCATE_LOCAL ((char *) installedMaps); xfree ((char *) installedMaps);
if (i < numInstalled) if (i < numInstalled)
return TRUE; return TRUE;

View File

@ -1078,7 +1078,7 @@ ProcShapeGetRectangles (client)
} }
if (!region) { if (!region) {
nrects = 1; nrects = 1;
rects = (xRectangle *) ALLOCATE_LOCAL (sizeof (xRectangle)); rects = (xRectangle *) xalloc (sizeof (xRectangle));
if (!rects) if (!rects)
return BadAlloc; return BadAlloc;
switch (stuff->kind) { switch (stuff->kind) {
@ -1105,7 +1105,7 @@ ProcShapeGetRectangles (client)
BoxPtr box; BoxPtr box;
nrects = REGION_NUM_RECTS(region); nrects = REGION_NUM_RECTS(region);
box = REGION_RECTS(region); box = REGION_RECTS(region);
rects = (xRectangle *) ALLOCATE_LOCAL (nrects * sizeof (xRectangle)); rects = (xRectangle *) xalloc (nrects * sizeof (xRectangle));
if (!rects && nrects) if (!rects && nrects)
return BadAlloc; return BadAlloc;
for (i = 0; i < nrects; i++, box++) { for (i = 0; i < nrects; i++, box++) {
@ -1128,7 +1128,7 @@ ProcShapeGetRectangles (client)
} }
WriteToClient (client, sizeof (rep), (char *) &rep); WriteToClient (client, sizeof (rep), (char *) &rep);
WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects); WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
DEALLOCATE_LOCAL (rects); xfree (rects);
return client->noClientException; return client->noClientException;
} }

View File

@ -557,7 +557,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
putGC = GetScratchGC(depth, dst->pScreen); putGC = GetScratchGC(depth, dst->pScreen);
if (!putGC) if (!putGC)
return; return;
pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pmap) if (!pmap)
{ {
FreeScratchGC(putGC); FreeScratchGC(putGC);
@ -1084,7 +1085,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{ {
register PixmapPtr pPixmap; register PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
if (!pPixmap) if (!pPixmap)
return NullPixmap; return NullPixmap;

View File

@ -602,7 +602,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events)
if (client->clientGone) if (client->clientGone)
return; return;
pev = pEvents = (xSyncCounterNotifyEvent *) pev = pEvents = (xSyncCounterNotifyEvent *)
ALLOCATE_LOCAL(num_events * sizeof(xSyncCounterNotifyEvent)); xalloc(num_events * sizeof(xSyncCounterNotifyEvent));
if (!pEvents) if (!pEvents)
return; return;
UpdateCurrentTime(); UpdateCurrentTime();
@ -623,7 +623,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events)
} }
/* swapping will be taken care of by this */ /* swapping will be taken care of by this */
WriteEventsToClient(client, num_events, (xEvent *)pEvents); WriteEventsToClient(client, num_events, (xEvent *)pEvents);
DEALLOCATE_LOCAL(pEvents); xfree(pEvents);
} }
@ -733,7 +733,7 @@ SyncAwaitTriggerFired(pTrigger)
pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader; pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader;
numwaits = pAwaitUnion->header.num_waitconditions; numwaits = pAwaitUnion->header.num_waitconditions;
ppAwait = (SyncAwait **)ALLOCATE_LOCAL(numwaits * sizeof(SyncAwait *)); ppAwait = (SyncAwait **)xalloc(numwaits * sizeof(SyncAwait *));
if (!ppAwait) if (!ppAwait)
goto bail; goto bail;
@ -802,7 +802,7 @@ SyncAwaitTriggerFired(pTrigger)
if (num_events) if (num_events)
SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait, SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait,
num_events); num_events);
DEALLOCATE_LOCAL(ppAwait); xfree(ppAwait);
bail: bail:
/* unblock the client */ /* unblock the client */
@ -1397,7 +1397,7 @@ ProcSyncListSystemCounters(client)
if (len) if (len)
{ {
walklist = list = (xSyncSystemCounter *) ALLOCATE_LOCAL(len); walklist = list = (xSyncSystemCounter *) xalloc(len);
if (!list) if (!list)
return BadAlloc; return BadAlloc;
} }
@ -1443,7 +1443,7 @@ ProcSyncListSystemCounters(client)
if (len) if (len)
{ {
WriteToClient(client, len, (char *) list); WriteToClient(client, len, (char *) list);
DEALLOCATE_LOCAL(list); xfree(list);
} }
return (client->noClientException); return (client->noClientException);

View File

@ -461,7 +461,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
/* convert region to list-of-rectangles for PolyFillRect */ /* convert region to list-of-rectangles for PolyFillRect */
pRects = (xRectangle *)ALLOCATE_LOCAL(nRects * sizeof(xRectangle *)); pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle *));
if (!pRects) if (!pRects)
{ {
failed = TRUE; failed = TRUE;
@ -513,7 +513,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
*/ */
bzero(pBuf, (int)(widthBytesLine * h)); bzero(pBuf, (int)(widthBytesLine * h));
} }
if (pRects) DEALLOCATE_LOCAL(pRects); if (pRects) xfree(pRects);
if (pScratchGC) FreeScratchGC(pScratchGC); if (pScratchGC) FreeScratchGC(pScratchGC);
if (pPix) FreeScratchPixmapHeader(pPix); if (pPix) FreeScratchPixmapHeader(pPix);
} }

View File

@ -483,7 +483,7 @@ ProcXF86BigfontQueryFont(
} else { } else {
#endif #endif
pCI = (xCharInfo *) pCI = (xCharInfo *)
ALLOCATE_LOCAL(nCharInfos * sizeof(xCharInfo)); xalloc(nCharInfos * sizeof(xCharInfo));
if (!pCI) if (!pCI)
return BadAlloc; return BadAlloc;
#ifdef HAS_SHM #ifdef HAS_SHM
@ -546,9 +546,9 @@ ProcXF86BigfontQueryFont(
hashModulus = nCharInfos+1; hashModulus = nCharInfos+1;
tmp = (CARD16*) tmp = (CARD16*)
ALLOCATE_LOCAL((4*nCharInfos+1) * sizeof(CARD16)); xalloc((4*nCharInfos+1) * sizeof(CARD16));
if (!tmp) { if (!tmp) {
if (!pDesc) DEALLOCATE_LOCAL(pCI); if (!pDesc) xfree(pCI);
return BadAlloc; return BadAlloc;
} }
pIndex2UniqIndex = tmp; pIndex2UniqIndex = tmp;
@ -631,12 +631,12 @@ ProcXF86BigfontQueryFont(
+ (nCharInfos+1)/2 * 2 * sizeof(CARD16) + (nCharInfos+1)/2 * 2 * sizeof(CARD16)
: 0); : 0);
xXF86BigfontQueryFontReply* reply = xXF86BigfontQueryFontReply* reply =
(xXF86BigfontQueryFontReply *) ALLOCATE_LOCAL(rlength); (xXF86BigfontQueryFontReply *) xalloc(rlength);
char* p; char* p;
if (!reply) { if (!reply) {
if (nCharInfos > 0) { if (nCharInfos > 0) {
if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex); if (shmid == -1) xfree(pIndex2UniqIndex);
if (!pDesc) DEALLOCATE_LOCAL(pCI); if (!pDesc) xfree(pCI);
} }
return BadAlloc; return BadAlloc;
} }
@ -714,10 +714,10 @@ ProcXF86BigfontQueryFont(
} }
} }
WriteToClient(client, rlength, (char *)reply); WriteToClient(client, rlength, (char *)reply);
DEALLOCATE_LOCAL(reply); xfree(reply);
if (nCharInfos > 0) { if (nCharInfos > 0) {
if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex); if (shmid == -1) xfree(pIndex2UniqIndex);
if (!pDesc) DEALLOCATE_LOCAL(pCI); if (!pDesc) xfree(pCI);
} }
return (client->noClientException); return (client->noClientException);
} }

View File

@ -65,7 +65,7 @@ ProcXResQueryClients (ClientPtr client)
REQUEST_SIZE_MATCH(xXResQueryClientsReq); REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = ALLOCATE_LOCAL((currentMaxClients - 1) * sizeof(int)); current_clients = xalloc((currentMaxClients - 1) * sizeof(int));
num_clients = 0; num_clients = 0;
for(i = 1; i < currentMaxClients; i++) { for(i = 1; i < currentMaxClients; i++) {
@ -103,7 +103,7 @@ ProcXResQueryClients (ClientPtr client)
} }
} }
DEALLOCATE_LOCAL(current_clients); xfree(current_clients);
return (client->noClientException); return (client->noClientException);
} }
@ -136,7 +136,7 @@ ProcXResQueryClientResources (ClientPtr client)
return BadValue; return BadValue;
} }
counts = ALLOCATE_LOCAL((lastResourceType + 1) * sizeof(int)); counts = xalloc((lastResourceType + 1) * sizeof(int));
memset(counts, 0, (lastResourceType + 1) * sizeof(int)); memset(counts, 0, (lastResourceType + 1) * sizeof(int));
@ -188,7 +188,7 @@ ProcXResQueryClientResources (ClientPtr client)
} }
} }
DEALLOCATE_LOCAL(counts); xfree(counts);
return (client->noClientException); return (client->noClientException);
} }

View File

@ -134,7 +134,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
if (num_events) { if (num_events) {
size = sizeof(Time) + (axes * sizeof(INT32)); size = sizeof(Time) + (axes * sizeof(INT32));
tsize = num_events * size; tsize = num_events * size;
coords = (INT32 *) ALLOCATE_LOCAL(tsize); coords = (INT32 *) xalloc(tsize);
if (!coords) if (!coords)
return BadAlloc; return BadAlloc;
rep.nEvents = (v->GetMotionProc) (dev, (xTimecoord *) coords, /* XXX */ rep.nEvents = (v->GetMotionProc) (dev, (xTimecoord *) coords, /* XXX */
@ -160,7 +160,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
WriteToClient(client, length * 4, (char *)coords); WriteToClient(client, length * 4, (char *)coords);
} }
if (coords) if (coords)
DEALLOCATE_LOCAL(coords); xfree(coords);
return Success; return Success;
} }

View File

@ -483,7 +483,8 @@ extern PixmapPtr afbCreatePixmap(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
int /*width*/, int /*width*/,
int /*height*/, int /*height*/,
int /*depth*/ int /*depth*/,
unsigned /*usage_hint*/
); );
extern Bool afbDestroyPixmap( extern Bool afbDestroyPixmap(

View File

@ -279,7 +279,7 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable,
/* Do bit blitting */ /* Do bit blitting */
numRects = REGION_NUM_RECTS(&rgnDst); numRects = REGION_NUM_RECTS(&rgnDst);
if (numRects && width && height) { if (numRects && width && height) {
if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * if(!(pptSrc = (DDXPointPtr)xalloc(numRects *
sizeof(DDXPointRec)))) { sizeof(DDXPointRec)))) {
REGION_UNINIT(pGC->pScreen, &rgnDst); REGION_UNINIT(pGC->pScreen, &rgnDst);
if (freeSrcClip) if (freeSrcClip)
@ -296,7 +296,7 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable,
(*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, (*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc,
planemask); planemask);
DEALLOCATE_LOCAL(pptSrc); xfree(pptSrc);
} }
prgnExposed = NULL; prgnExposed = NULL;

View File

@ -132,12 +132,12 @@ MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
if (nbox > 1) { if (nbox > 1) {
/* keep ordering in each band, reverse order of bands */ /* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox); pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
if(!pboxNew1) if(!pboxNew1)
return; return;
pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox); pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
if(!pptNew1) { if(!pptNew1) {
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
return; return;
} }
pboxBase = pboxNext = pbox+nbox-1; pboxBase = pboxNext = pbox+nbox-1;
@ -169,16 +169,16 @@ MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
if (nbox > 1) { if (nbox > 1) {
/* reverse order of rects in each band */ /* reverse order of rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pboxNew2 || !pptNew2) { if(!pboxNew2 || !pptNew2) {
if (pptNew2) if (pptNew2)
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
if (pboxNew2) if (pboxNew2)
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
if (pboxNew1) { if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
return; return;
} }
@ -553,11 +553,11 @@ bits1 = *--psrc; --pdst; \
pptSrc++; pptSrc++;
} }
if (pboxNew2) { if (pboxNew2) {
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
} }
if (pboxNew1) { if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
} }

View File

@ -112,7 +112,7 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
if (numRects > NUM_STACK_RECTS) { if (numRects > NUM_STACK_RECTS) {
pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec));
if (!pboxClippedBase) if (!pboxClippedBase)
return; return;
} }
@ -288,5 +288,5 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
} }
} }
if (pboxClippedBase != stackRects) if (pboxClippedBase != stackRects)
DEALLOCATE_LOCAL(pboxClippedBase); xfree(pboxClippedBase);
} }

View File

@ -109,11 +109,11 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
unsigned char *rrops; unsigned char *rrops;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -184,8 +184,8 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
pwidth++; pwidth++;
ppt++; ppt++;
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
void void
@ -220,11 +220,11 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
unsigned char *rrops; unsigned char *rrops;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -298,8 +298,8 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
pwidth++; pwidth++;
ppt++; ppt++;
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
void void
@ -334,11 +334,11 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int d; int d;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -429,8 +429,8 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
break; break;
} }
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
void void
@ -466,11 +466,11 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int d; int d;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -588,8 +588,8 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
break; break;
} }
} /* switch (rop) */ } /* switch (rop) */
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
/* Fill spans with tiles that aren't PPW bits wide */ /* Fill spans with tiles that aren't PPW bits wide */
@ -627,11 +627,11 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
register int d; register int d;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -733,8 +733,8 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++; ppt++;
pwidth++; pwidth++;
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
/* Fill spans with stipples that aren't PPW bits wide */ /* Fill spans with stipples that aren't PPW bits wide */
@ -773,11 +773,11 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int depthDst; int depthDst;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -878,8 +878,8 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++; ppt++;
pwidth++; pwidth++;
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
/* Fill spans with OpaqueStipples that aren't PPW bits wide */ /* Fill spans with OpaqueStipples that aren't PPW bits wide */
@ -919,11 +919,11 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int depthDst; int depthDst;
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) { if(!pptFree || !pwidthFree) {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -1125,6 +1125,6 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++; ppt++;
pwidth++; pwidth++;
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }

View File

@ -72,7 +72,8 @@ afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
int depthDst; int depthDst;
/* Create a tmp pixmap */ /* Create a tmp pixmap */
pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth); pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
return; return;

View File

@ -298,7 +298,7 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
int getWidth; /* bits to get from glyph */ int getWidth; /* bits to get from glyph */
#endif #endif
if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS))))
return; return;
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
@ -462,7 +462,7 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
} /* depth */ } /* depth */
} /* for each glyph */ } /* for each glyph */
} /* while nbox-- */ } /* while nbox-- */
DEALLOCATE_LOCAL(ppos); xfree(ppos);
break; break;
} }

View File

@ -70,11 +70,12 @@ SOFTWARE.
#include "mfb.h" #include "mfb.h"
PixmapPtr PixmapPtr
afbCreatePixmap(pScreen, width, height, depth) afbCreatePixmap(pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen; ScreenPtr pScreen;
int width; int width;
int height; int height;
int depth; int depth;
unsigned usage_hint;
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
size_t datasize; size_t datasize;
@ -128,8 +129,10 @@ afbCopyPixmap(PixmapPtr pSrc)
size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth; size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth;
pScreen = pSrc->drawable.pScreen; pScreen = pSrc->drawable.pScreen;
pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width, pDst = (*pScreen->CreatePixmap)(pScreen,
pSrc->drawable.height, pSrc->drawable.depth); pSrc->drawable.width,
pSrc->drawable.height,
pSrc->drawable.depth, 0);
if (!pDst) if (!pDst)
return(NullPixmap); return(NullPixmap);
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
@ -249,7 +252,7 @@ afbYRotatePixmap(pPix, rh)
nbyDown = rh * pPix->devKind; nbyDown = rh * pPix->devKind;
nbyUp = (pPix->devKind * height) - nbyDown; nbyUp = (pPix->devKind * height) - nbyDown;
if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) if(!(ptmp = (char *)xalloc(nbyUp)))
return; return;
for (d = 0; d < pPix->drawable.depth; d++) { for (d = 0; d < pPix->drawable.depth; d++) {
@ -259,7 +262,7 @@ afbYRotatePixmap(pPix, rh)
memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */
} }
DEALLOCATE_LOCAL(ptmp); xfree(ptmp);
} }
void void

View File

@ -278,7 +278,7 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
int getWidth; /* bits to get from glyph */ int getWidth; /* bits to get from glyph */
#endif #endif
if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS))))
return; return;
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst); pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
@ -453,7 +453,7 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
} /* depth */ } /* depth */
} /* for each glyph */ } /* for each glyph */
} /* while nbox-- */ } /* while nbox-- */
DEALLOCATE_LOCAL(ppos); xfree(ppos);
break; break;
} }

View File

@ -142,7 +142,7 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc)
pbox = REGION_RECTS(prgnDst); pbox = REGION_RECTS(prgnDst);
nbox = REGION_NUM_RECTS(prgnDst); nbox = REGION_NUM_RECTS(prgnDst);
if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec))))
return; return;
ppt = pptSrc; ppt = pptSrc;
@ -153,7 +153,7 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc)
afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst, afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst,
pptSrc, ~0); pptSrc, ~0);
DEALLOCATE_LOCAL(pptSrc); xfree(pptSrc);
REGION_DESTROY(pWin->drawable.pScreen, prgnDst); REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
} }

View File

@ -738,7 +738,8 @@ extern PixmapPtr cfbCreatePixmap(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
int /*width*/, int /*width*/,
int /*height*/, int /*height*/,
int /*depth*/ int /*depth*/,
unsigned /*usage_hint*/
); );
extern Bool cfbDestroyPixmap( extern Bool cfbDestroyPixmap(

View File

@ -296,7 +296,7 @@ cfbBitBlt (
numRects = REGION_NUM_RECTS(&rgnDst); numRects = REGION_NUM_RECTS(&rgnDst);
if (numRects && width && height) if (numRects && width && height)
{ {
if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * if(!(pptSrc = (DDXPointPtr)xalloc(numRects *
sizeof(DDXPointRec)))) sizeof(DDXPointRec))))
{ {
REGION_UNINIT(pGC->pScreen, &rgnDst); REGION_UNINIT(pGC->pScreen, &rgnDst);
@ -313,7 +313,7 @@ cfbBitBlt (
} }
(*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask); (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask);
DEALLOCATE_LOCAL(pptSrc); xfree(pptSrc);
} }
prgnExposed = NULL; prgnExposed = NULL;
@ -559,7 +559,7 @@ cfbCopyPlaneReduce (
numRects = REGION_NUM_RECTS(&rgnDst); numRects = REGION_NUM_RECTS(&rgnDst);
if (numRects && width && height) if (numRects && width && height)
{ {
if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * if(!(pptSrc = (DDXPointPtr)xalloc(numRects *
sizeof(DDXPointRec)))) sizeof(DDXPointRec))))
{ {
REGION_UNINIT(pGC->pScreen, &rgnDst); REGION_UNINIT(pGC->pScreen, &rgnDst);
@ -576,7 +576,7 @@ cfbCopyPlaneReduce (
} }
(*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane); (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane);
DEALLOCATE_LOCAL(pptSrc); xfree(pptSrc);
} }
prgnExposed = NULL; prgnExposed = NULL;
@ -1407,7 +1407,8 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
ScreenPtr pScreen = pSrcDrawable->pScreen; ScreenPtr pScreen = pSrcDrawable->pScreen;
GCPtr pGC1; GCPtr pGC1;
pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1); pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pBitmap) if (!pBitmap)
return NULL; return NULL;
pGC1 = GetScratchGC (1, pScreen); pGC1 = GetScratchGC (1, pScreen);

View File

@ -207,13 +207,13 @@ MROP_NAME(cfbDoBitblt)(
if (nbox > 1) if (nbox > 1)
{ {
/* keep ordering in each band, reverse order of bands */ /* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew1) if(!pboxNew1)
return; return;
pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pptNew1) if(!pptNew1)
{ {
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
return; return;
} }
pboxBase = pboxNext = pbox+nbox-1; pboxBase = pboxNext = pbox+nbox-1;
@ -251,16 +251,16 @@ MROP_NAME(cfbDoBitblt)(
if (nbox > 1) if (nbox > 1)
{ {
/* reverse order of rects in each band */ /* reverse order of rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pboxNew2 || !pptNew2) if(!pboxNew2 || !pptNew2)
{ {
if (pptNew2) DEALLOCATE_LOCAL(pptNew2); if (pptNew2) xfree(pptNew2);
if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); if (pboxNew2) xfree(pboxNew2);
if (pboxNew1) if (pboxNew1)
{ {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
return; return;
} }
@ -922,12 +922,12 @@ bits1 = *--psrc; --pdst; \
} }
if (pboxNew2) if (pboxNew2)
{ {
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
} }
if (pboxNew1) if (pboxNew1)
{ {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
} }

View File

@ -196,7 +196,7 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
if (numRects > NUM_STACK_RECTS) if (numRects > NUM_STACK_RECTS)
{ {
pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec));
if (!pboxClippedBase) if (!pboxClippedBase)
return; return;
} }
@ -301,5 +301,5 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
(*BoxFill) (pDrawable, pGC, (*BoxFill) (pDrawable, pGC,
pboxClipped-pboxClippedBase, pboxClippedBase); pboxClipped-pboxClippedBase, pboxClippedBase);
if (pboxClippedBase != stackRects) if (pboxClippedBase != stackRects)
DEALLOCATE_LOCAL(pboxClippedBase); xfree(pboxClippedBase);
} }

View File

@ -186,12 +186,12 @@ int fSorted;
n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
if ( n == 0 ) if ( n == 0 )
return; return;
pwidth = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidth = (int *)xalloc(n * sizeof(int));
ppt = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); ppt = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!ppt || !pwidth) if(!ppt || !pwidth)
{ {
if (ppt) DEALLOCATE_LOCAL(ppt); if (ppt) xfree(ppt);
if (pwidth) DEALLOCATE_LOCAL(pwidth); if (pwidth) xfree(pwidth);
return; return;
} }
n = miClipSpans( cfbGetCompositeClip(pGC), n = miClipSpans( cfbGetCompositeClip(pGC),
@ -203,8 +203,8 @@ int fSorted;
(*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask); (*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask);
DEALLOCATE_LOCAL(ppt); xfree(ppt);
DEALLOCATE_LOCAL(pwidth); xfree(pwidth);
} }
#if PSZ == 8 #if PSZ == 8
@ -251,12 +251,12 @@ int fSorted;
n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
if ( n == 0 ) if ( n == 0 )
return; return;
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) if(!pptFree || !pwidthFree)
{ {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
@ -392,8 +392,8 @@ int fSorted;
} }
} }
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
#else /* PSZ != 8 */ #else /* PSZ != 8 */
@ -434,12 +434,12 @@ int fSorted;
n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
if ( n == 0 ) if ( n == 0 )
return; return;
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) if(!pptFree || !pwidthFree)
{ {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -599,8 +599,8 @@ int fSorted;
ppt++; ppt++;
pwidth++; pwidth++;
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
#endif /* PSZ == 8 */ #endif /* PSZ == 8 */
@ -648,12 +648,12 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
if ( n == 0 ) if ( n == 0 )
return; return;
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) if(!pptFree || !pwidthFree)
{ {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -816,8 +816,8 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
} }
} }
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
void void
@ -862,12 +862,12 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
if ( n == 0 ) if ( n == 0 )
return; return;
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) if(!pptFree || !pwidthFree)
{ {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -997,8 +997,8 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
} }
} }
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }
#endif /* PSZ == 8 */ #endif /* PSZ == 8 */

View File

@ -355,7 +355,7 @@ cfbPolyGlyphBlt8Clipped(
} }
if (!numRects) if (!numRects)
return; return;
clips = (CARD32 *)ALLOCATE_LOCAL ((maxAscent + maxDescent) * clips = (CARD32 *)xalloc ((maxAscent + maxDescent) *
sizeof (CARD32)); sizeof (CARD32));
while (nglyph--) while (nglyph--)
{ {
@ -471,7 +471,7 @@ cfbPolyGlyphBlt8Clipped(
} }
} }
} }
DEALLOCATE_LOCAL (clips); xfree (clips);
} }
#endif /* FOUR_BIT_CODE */ #endif /* FOUR_BIT_CODE */

View File

@ -65,11 +65,12 @@ SOFTWARE.
#include "cfbmskbits.h" #include "cfbmskbits.h"
PixmapPtr PixmapPtr
cfbCreatePixmap (pScreen, width, height, depth) cfbCreatePixmap (pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen; ScreenPtr pScreen;
int width; int width;
int height; int height;
int depth; int depth;
unsigned usage_hint;
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
size_t datasize; size_t datasize;
@ -123,7 +124,7 @@ cfbCopyPixmap(pSrc)
size = pSrc->drawable.height * pSrc->devKind; size = pSrc->drawable.height * pSrc->devKind;
pScreen = pSrc->drawable.pScreen; pScreen = pSrc->drawable.pScreen;
pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width,
pSrc->drawable.height, pSrc->drawable.depth); pSrc->drawable.height, pSrc->drawable.depth, 0);
if (!pDst) if (!pDst)
return NullPixmap; return NullPixmap;
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
@ -270,7 +271,7 @@ cfbXRotatePixmap(pPix, rw)
int size, tsize; int size, tsize;
tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth); tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth);
pwTmp = (CfbBits *) ALLOCATE_LOCAL(pPix->drawable.height * tsize); pwTmp = (CfbBits *) xalloc(pPix->drawable.height * tsize);
if (!pwTmp) if (!pwTmp)
return; return;
/* divide pw (the pixmap) in two vertically at (w - rot) and swap */ /* divide pw (the pixmap) in two vertically at (w - rot) and swap */
@ -288,7 +289,7 @@ cfbXRotatePixmap(pPix, rw)
0, 0, rot, 0, 0, 0, rot, 0,
(int)pPix->drawable.width - rot, (int)pPix->drawable.height, (int)pPix->drawable.width - rot, (int)pPix->drawable.height,
tsize, size); tsize, size);
DEALLOCATE_LOCAL(pwTmp); xfree(pwTmp);
#endif #endif
} }
} }
@ -328,13 +329,13 @@ cfbYRotatePixmap(pPix, rh)
nbyDown = rot * pPix->devKind; nbyDown = rot * pPix->devKind;
nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown; nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown;
if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) if(!(ptmp = (char *)xalloc(nbyUp)))
return; return;
memmove(ptmp, pbase, nbyUp); /* save the low rows */ memmove(ptmp, pbase, nbyUp); /* save the low rows */
memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */
DEALLOCATE_LOCAL(ptmp); xfree(ptmp);
} }
void void

View File

@ -811,12 +811,12 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
devPriv = cfbGetGCPrivate(pGC); devPriv = cfbGetGCPrivate(pGC);
RROP_FETCH_GCPRIV(devPriv) RROP_FETCH_GCPRIV(devPriv)
n = nInit * miFindMaxBand(pGC->pCompositeClip); n = nInit * miFindMaxBand(pGC->pCompositeClip);
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) if(!pptFree || !pwidthFree)
{ {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -1359,7 +1359,7 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
} }
#endif #endif
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
RROP_UNDECLARE RROP_UNDECLARE
} }

View File

@ -367,12 +367,12 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
#endif #endif
n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); pwidthFree = (int *)xalloc(n * sizeof(int));
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) if(!pptFree || !pwidthFree)
{ {
if (pptFree) DEALLOCATE_LOCAL(pptFree); if (pptFree) xfree(pptFree);
if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); if (pwidthFree) xfree(pwidthFree);
return; return;
} }
pwidth = pwidthFree; pwidth = pwidthFree;
@ -512,6 +512,6 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
} }
} }
} }
DEALLOCATE_LOCAL(pptFree); xfree(pptFree);
DEALLOCATE_LOCAL(pwidthFree); xfree(pwidthFree);
} }

View File

@ -133,7 +133,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc)
pbox = REGION_RECTS(&rgnDst); pbox = REGION_RECTS(&rgnDst);
nbox = REGION_NUM_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst);
if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) if(!nbox || !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec))))
{ {
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
return; return;
@ -148,7 +148,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc)
cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
GXcopy, &rgnDst, pptSrc, ~0L); GXcopy, &rgnDst, pptSrc, ~0L);
DEALLOCATE_LOCAL(pptSrc); xfree(pptSrc);
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
} }

View File

@ -462,7 +462,8 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
WindowPtr pParent = pWin->parent; WindowPtr pParent = pWin->parent;
PixmapPtr pPixmap; PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
if (!pPixmap) if (!pPixmap)
return 0; return 0;

View File

@ -177,7 +177,8 @@ device_added(LibHalContext *hal_ctx, const char *udi)
if (strcmp(props[i], "input.keys") == 0 || if (strcmp(props[i], "input.keys") == 0 ||
strcmp(props[i], "input.keyboard") == 0) strcmp(props[i], "input.keyboard") == 0)
type |= TYPE_KEYS; type |= TYPE_KEYS;
if (strcmp(props[i], "input.mouse") == 0) if (strcmp(props[i], "input.mouse") == 0 ||
strcmp(props[i], "input.touchpad") == 0)
type |= TYPE_POINTER; type |= TYPE_POINTER;
} }
libhal_free_string_array(props); libhal_free_string_array(props);

View File

@ -454,9 +454,6 @@ AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XK
AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
[ XKBOUTPUT="$withval" ], [ XKBOUTPUT="$withval" ],
[ XKBOUTPUT="compiled" ]) [ XKBOUTPUT="compiled" ])
AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
[ RGBPATH="$withval" ],
[ RGBPATH="${datadir}/X11/rgb" ])
AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Path to server config (default: ${libdir}/xserver)]), AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Path to server config (default: ${libdir}/xserver)]),
[ SERVERCONFIG="$withval" ], [ SERVERCONFIG="$withval" ],
[ SERVERCONFIG="${libdir}/xserver" ]) [ SERVERCONFIG="${libdir}/xserver" ])
@ -1019,13 +1016,7 @@ if test "x$XDMAUTH" = xyes; then
fi fi
fi fi
AM_CONDITIONAL(USE_RGB_BUILTIN, [test "x$USE_RGB_BUILTIN" = xyes])
if test "x$USE_RGB_BUILTIN" = xyes; then
AC_DEFINE(USE_RGB_BUILTIN, 1, [Use built-in RGB color database])
fi
AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path])
AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path]) AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path])
AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path])
@ -1061,7 +1052,6 @@ else
fi fi
AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
AC_DEFINE(USE_RGB_TXT, 1, [Use rgb.txt directly])
AC_DEFINE(MITMISC, 1, [Support MIT Misc extension]) AC_DEFINE(MITMISC, 1, [Support MIT Misc extension])
AC_DEFINE(XTEST, 1, [Support XTest extension]) AC_DEFINE(XTEST, 1, [Support XTest extension])
AC_DEFINE(XSYNC, 1, [Support XSync extension]) AC_DEFINE(XSYNC, 1, [Support XSync extension])
@ -1564,6 +1554,17 @@ dnl has it in libc), or if libdl is needed to get it.
AC_SUBST([sdkdir]) AC_SUBST([sdkdir])
AC_SUBST([extdir]) AC_SUBST([extdir])
AC_SUBST([logdir]) AC_SUBST([logdir])
# stuff the ABI versions into the pc file too
extract_abi() {
grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }'
}
abi_ansic=`extract_abi ANSIC`
abi_videodrv=`extract_abi VIDEODRV`
abi_xinput=`extract_abi XINPUT`
abi_extension=`extract_abi EXTENSION`
abi_font=`extract_abi FONT`
AC_SUBST([abi_ansic abi_videodrv abi_xinput abi_extension abi_font])
fi fi
AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
@ -1578,7 +1579,9 @@ AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes]) AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes])
AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
AM_CONDITIONAL(DGA, [test "x$DGA" = xyes]) AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
AM_CONDITIONAL([XF86MISC], [test "x$XF86MISC" = xyes])
AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
dnl legacy fb support dnl legacy fb support
test "x$MFB" = xauto && MFB="$XORG" test "x$MFB" = xauto && MFB="$XORG"

View File

@ -178,7 +178,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
if (!(pDbeWindowPrivPriv->pFrontBuffer = if (!(pDbeWindowPrivPriv->pFrontBuffer =
(*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width, (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height, pDbeWindowPriv->height,
pWin->drawable.depth))) pWin->drawable.depth, 0)))
{ {
return(BadAlloc); return(BadAlloc);
} }
@ -187,7 +187,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
if (!(pDbeWindowPrivPriv->pBackBuffer = if (!(pDbeWindowPrivPriv->pBackBuffer =
(*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width, (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height, pDbeWindowPriv->height,
pWin->drawable.depth))) pWin->drawable.depth, 0)))
{ {
(*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer); (*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
return(BadAlloc); return(BadAlloc);
@ -653,10 +653,10 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
/* Create DBE buffer pixmaps equal to size of resized window. */ /* Create DBE buffer pixmaps equal to size of resized window. */
pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, width, height, pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, width, height,
pWin->drawable.depth); pWin->drawable.depth, 0);
pBackBuffer = (*pScreen->CreatePixmap)(pScreen, width, height, pBackBuffer = (*pScreen->CreatePixmap)(pScreen, width, height,
pWin->drawable.depth); pWin->drawable.depth, 0);
if (!pFrontBuffer || !pBackBuffer) if (!pFrontBuffer || !pBackBuffer)
{ {

View File

@ -744,7 +744,7 @@ UpdateColors (ColormapPtr pmap)
pVisual = pmap->pVisual; pVisual = pmap->pVisual;
size = pVisual->ColormapEntries; size = pVisual->ColormapEntries;
defs = (xColorItem *)ALLOCATE_LOCAL(size * sizeof(xColorItem)); defs = (xColorItem *)xalloc(size * sizeof(xColorItem));
if (!defs) if (!defs)
return; return;
n = 0; n = 0;
@ -794,7 +794,7 @@ UpdateColors (ColormapPtr pmap)
} }
if (n) if (n)
(*pmap->pScreen->StoreColors)(pmap, n, defs); (*pmap->pScreen->StoreColors)(pmap, n, defs);
DEALLOCATE_LOCAL(defs); xfree(defs);
} }
/* Get a read-only color from a ColorMap (probably slow for large maps) /* Get a read-only color from a ColorMap (probably slow for large maps)
@ -1745,14 +1745,14 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
for(p = pixels; p < pixels + c; p++) for(p = pixels; p < pixels + c; p++)
*p = 0; *p = 0;
ppixRed = (Pixel *)ALLOCATE_LOCAL(npixR * sizeof(Pixel)); ppixRed = (Pixel *)xalloc(npixR * sizeof(Pixel));
ppixGreen = (Pixel *)ALLOCATE_LOCAL(npixG * sizeof(Pixel)); ppixGreen = (Pixel *)xalloc(npixG * sizeof(Pixel));
ppixBlue = (Pixel *)ALLOCATE_LOCAL(npixB * sizeof(Pixel)); ppixBlue = (Pixel *)xalloc(npixB * sizeof(Pixel));
if (!ppixRed || !ppixGreen || !ppixBlue) if (!ppixRed || !ppixGreen || !ppixBlue)
{ {
if (ppixBlue) DEALLOCATE_LOCAL(ppixBlue); if (ppixBlue) xfree(ppixBlue);
if (ppixGreen) DEALLOCATE_LOCAL(ppixGreen); if (ppixGreen) xfree(ppixGreen);
if (ppixRed) DEALLOCATE_LOCAL(ppixRed); if (ppixRed) xfree(ppixRed);
return(BadAlloc); return(BadAlloc);
} }
@ -1790,9 +1790,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
if (okB) if (okB)
for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++) for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++)
pmap->blue[*ppix].refcnt = 0; pmap->blue[*ppix].refcnt = 0;
DEALLOCATE_LOCAL(ppixBlue); xfree(ppixBlue);
DEALLOCATE_LOCAL(ppixGreen); xfree(ppixGreen);
DEALLOCATE_LOCAL(ppixRed); xfree(ppixRed);
return(BadAlloc); return(BadAlloc);
} }
@ -1834,9 +1834,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
for (pDst = pixels; pDst < pixels + c; pDst++) for (pDst = pixels; pDst < pixels + c; pDst++)
*pDst |= ALPHAMASK(pmap->pVisual); *pDst |= ALPHAMASK(pmap->pVisual);
DEALLOCATE_LOCAL(ppixBlue); xfree(ppixBlue);
DEALLOCATE_LOCAL(ppixGreen); xfree(ppixGreen);
DEALLOCATE_LOCAL(ppixRed); xfree(ppixRed);
return (Success); return (Success);
} }
@ -1852,7 +1852,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
npix = c << r; npix = c << r;
if ((r >= 32) || (npix > pmap->freeRed) || (npix < c)) if ((r >= 32) || (npix > pmap->freeRed) || (npix < c))
return(BadAlloc); return(BadAlloc);
if(!(ppixTemp = (Pixel *)ALLOCATE_LOCAL(npix * sizeof(Pixel)))) if(!(ppixTemp = (Pixel *)xalloc(npix * sizeof(Pixel))))
return(BadAlloc); return(BadAlloc);
ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask); ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask);
@ -1882,7 +1882,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
pmap->numPixelsRed[client] += npix; pmap->numPixelsRed[client] += npix;
pmap->freeRed -= npix; pmap->freeRed -= npix;
} }
DEALLOCATE_LOCAL(ppixTemp); xfree(ppixTemp);
return (ok ? Success : BadAlloc); return (ok ? Success : BadAlloc);
} }
@ -2082,7 +2082,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
npixClientNew = c << (r + g + b); npixClientNew = c << (r + g + b);
npixShared = (c << r) + (c << g) + (c << b); npixShared = (c << r) + (c << g) + (c << b);
psharedList = (SHAREDCOLOR **)ALLOCATE_LOCAL(npixShared * psharedList = (SHAREDCOLOR **)xalloc(npixShared *
sizeof(SHAREDCOLOR *)); sizeof(SHAREDCOLOR *));
if (!psharedList) if (!psharedList)
return FALSE; return FALSE;
@ -2197,7 +2197,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
} }
} }
} }
DEALLOCATE_LOCAL(psharedList); xfree(psharedList);
return TRUE; return TRUE;
} }
@ -2672,7 +2672,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
Colormap *pmaps; Colormap *pmaps;
int imap, nummaps, found; int imap, nummaps, found;
pmaps = (Colormap *) ALLOCATE_LOCAL( pmaps = (Colormap *) xalloc(
pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap));
if(!pmaps) if(!pmaps)
return(FALSE); return(FALSE);
@ -2687,6 +2687,6 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
break; break;
} }
} }
DEALLOCATE_LOCAL(pmaps); xfree(pmaps);
return (found); return (found);
} }

View File

@ -2048,7 +2048,7 @@ ProcGetMotionEvents(ClientPtr client)
{ {
if (CompareTimeStamps(stop, currentTime) == LATER) if (CompareTimeStamps(stop, currentTime) == LATER)
stop = currentTime; stop = currentTime;
coords = (xTimecoord *)ALLOCATE_LOCAL(mouse->valuator->numMotionEvents coords = (xTimecoord *)xalloc(mouse->valuator->numMotionEvents
* sizeof(xTimecoord)); * sizeof(xTimecoord));
if (!coords) if (!coords)
return BadAlloc; return BadAlloc;
@ -2082,7 +2082,7 @@ ProcGetMotionEvents(ClientPtr client)
(char *)coords); (char *)coords);
} }
if (coords) if (coords)
DEALLOCATE_LOCAL(coords); xfree(coords);
return Success; return Success;
} }

View File

@ -379,7 +379,7 @@ Dispatch(void)
InitSelections(); InitSelections();
nClients = 0; nClients = 0;
clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); clientReady = (int *) xalloc(sizeof(int) * MaxClients);
if (!clientReady) if (!clientReady)
return; return;
@ -508,7 +508,7 @@ Dispatch(void)
ddxBeforeReset (); ddxBeforeReset ();
#endif #endif
KillAllClients(); KillAllClients();
DEALLOCATE_LOCAL(clientReady); xfree(clientReady);
dispatchException &= ~DE_RESET; dispatchException &= ~DE_RESET;
#ifdef XSERVER_DTRACE #ifdef XSERVER_DTRACE
FreeRequestNames(); FreeRequestNames();
@ -900,7 +900,7 @@ ProcQueryTree(ClientPtr client)
{ {
int curChild = 0; int curChild = 0;
childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); childIDs = (Window *) xalloc(numChildren * sizeof(Window));
if (!childIDs) if (!childIDs)
return BadAlloc; return BadAlloc;
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
@ -915,7 +915,7 @@ ProcQueryTree(ClientPtr client)
{ {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
DEALLOCATE_LOCAL(childIDs); xfree(childIDs);
} }
return(client->noClientException); return(client->noClientException);
@ -1411,7 +1411,7 @@ ProcQueryFont(ClientPtr client)
rlength = sizeof(xQueryFontReply) + rlength = sizeof(xQueryFontReply) +
FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
nprotoxcistructs * sizeof(xCharInfo); nprotoxcistructs * sizeof(xCharInfo);
reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); reply = (xQueryFontReply *)xalloc(rlength);
if(!reply) if(!reply)
{ {
return(BadAlloc); return(BadAlloc);
@ -1423,7 +1423,7 @@ ProcQueryFont(ClientPtr client)
QueryFont( pFont, reply, nprotoxcistructs); QueryFont( pFont, reply, nprotoxcistructs);
WriteReplyToClient(client, rlength, reply); WriteReplyToClient(client, rlength, reply);
DEALLOCATE_LOCAL(reply); xfree(reply);
return(client->noClientException); return(client->noClientException);
} }
} }
@ -1562,7 +1562,7 @@ ProcCreatePixmap(ClientPtr client)
CreatePmap: CreatePmap:
pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap)
(pDraw->pScreen, stuff->width, (pDraw->pScreen, stuff->width,
stuff->height, stuff->depth); stuff->height, stuff->depth, 0);
if (pMap) if (pMap)
{ {
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
@ -2277,7 +2277,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
length += widthBytesLine; length += widthBytesLine;
} }
} }
if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) if(!(pBuf = (char *) xalloc(length)))
return (BadAlloc); return (BadAlloc);
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
} }
@ -2378,7 +2378,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (pVisibleRegion) if (pVisibleRegion)
REGION_DESTROY(pDraw->pScreen, pVisibleRegion); REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
if (!im_return) if (!im_return)
DEALLOCATE_LOCAL(pBuf); xfree(pBuf);
return (client->noClientException); return (client->noClientException);
} }
@ -2650,7 +2650,7 @@ ProcListInstalledColormaps(ClientPtr client)
goto out; goto out;
preply = (xListInstalledColormapsReply *) preply = (xListInstalledColormapsReply *)
ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + xalloc(sizeof(xListInstalledColormapsReply) +
pWin->drawable.pScreen->maxInstalledCmaps * pWin->drawable.pScreen->maxInstalledCmaps *
sizeof(Colormap)); sizeof(Colormap));
if(!preply) if(!preply)
@ -2665,7 +2665,7 @@ ProcListInstalledColormaps(ClientPtr client)
WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
DEALLOCATE_LOCAL(preply); xfree(preply);
rc = client->noClientException; rc = client->noClientException;
out: out:
return (rc == BadValue) ? BadColor : rc; return (rc == BadValue) ? BadColor : rc;
@ -2794,7 +2794,7 @@ ProcAllocColorCells (ClientPtr client)
} }
nmasks = stuff->planes; nmasks = stuff->planes;
length = ((long)npixels + (long)nmasks) * sizeof(Pixel); length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
ppixels = (Pixel *)ALLOCATE_LOCAL(length); ppixels = (Pixel *)xalloc(length);
if(!ppixels) if(!ppixels)
return(BadAlloc); return(BadAlloc);
pmasks = ppixels + npixels; pmasks = ppixels + npixels;
@ -2802,7 +2802,7 @@ ProcAllocColorCells (ClientPtr client)
if( (rc = AllocColorCells(client->index, pcmp, npixels, nmasks, if( (rc = AllocColorCells(client->index, pcmp, npixels, nmasks,
(Bool)stuff->contiguous, ppixels, pmasks)) ) (Bool)stuff->contiguous, ppixels, pmasks)) )
{ {
DEALLOCATE_LOCAL(ppixels); xfree(ppixels);
if (client->noClientException != Success) if (client->noClientException != Success)
return(client->noClientException); return(client->noClientException);
else else
@ -2821,7 +2821,7 @@ ProcAllocColorCells (ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels); WriteSwappedDataToClient(client, length, ppixels);
} }
DEALLOCATE_LOCAL(ppixels); xfree(ppixels);
return (client->noClientException); return (client->noClientException);
} }
else else
@ -2863,7 +2863,7 @@ ProcAllocColorPlanes(ClientPtr client)
acpr.sequenceNumber = client->sequence; acpr.sequenceNumber = client->sequence;
acpr.nPixels = npixels; acpr.nPixels = npixels;
length = (long)npixels * sizeof(Pixel); length = (long)npixels * sizeof(Pixel);
ppixels = (Pixel *)ALLOCATE_LOCAL(length); ppixels = (Pixel *)xalloc(length);
if(!ppixels) if(!ppixels)
return(BadAlloc); return(BadAlloc);
if( (rc = AllocColorPlanes(client->index, pcmp, npixels, if( (rc = AllocColorPlanes(client->index, pcmp, npixels,
@ -2871,7 +2871,7 @@ ProcAllocColorPlanes(ClientPtr client)
(Bool)stuff->contiguous, ppixels, (Bool)stuff->contiguous, ppixels,
&acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
{ {
DEALLOCATE_LOCAL(ppixels); xfree(ppixels);
if (client->noClientException != Success) if (client->noClientException != Success)
return(client->noClientException); return(client->noClientException);
else else
@ -2886,7 +2886,7 @@ ProcAllocColorPlanes(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels); WriteSwappedDataToClient(client, length, ppixels);
} }
DEALLOCATE_LOCAL(ppixels); xfree(ppixels);
return (client->noClientException); return (client->noClientException);
} }
else else
@ -3016,12 +3016,12 @@ ProcQueryColors(ClientPtr client)
xQueryColorsReply qcr; xQueryColorsReply qcr;
count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); prgbs = (xrgb *)xalloc(count * sizeof(xrgb));
if(!prgbs && count) if(!prgbs && count)
return(BadAlloc); return(BadAlloc);
if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) )
{ {
if (prgbs) DEALLOCATE_LOCAL(prgbs); if (prgbs) xfree(prgbs);
if (client->noClientException != Success) if (client->noClientException != Success)
return(client->noClientException); return(client->noClientException);
else else
@ -3040,7 +3040,7 @@ ProcQueryColors(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
} }
if (prgbs) DEALLOCATE_LOCAL(prgbs); if (prgbs) xfree(prgbs);
return(client->noClientException); return(client->noClientException);
} }

View File

@ -778,7 +778,7 @@ finish:
reply.nFonts = nnames; reply.nFonts = nnames;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); bufptr = bufferStart = (char *) xalloc(reply.length << 2);
if (!bufptr && reply.length) { if (!bufptr && reply.length) {
SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc);
@ -803,7 +803,7 @@ finish:
client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; client->pSwapReplyFunc = ReplySwapVector[X_ListFonts];
WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply);
(void) WriteToClient(client, stringLens + nnames, bufferStart); (void) WriteToClient(client, stringLens + nnames, bufferStart);
DEALLOCATE_LOCAL(bufferStart); xfree(bufferStart);
bail: bail:
if (c->slept) if (c->slept)
@ -1808,7 +1808,7 @@ SetDefaultFontPath(char *path)
/* get enough for string, plus values -- use up commas */ /* get enough for string, plus values -- use up commas */
len = strlen(path) + 1; len = strlen(path) + 1;
nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); nump = cp = newpath = (unsigned char *) xalloc(len);
if (!newpath) if (!newpath)
return BadAlloc; return BadAlloc;
pp = (unsigned char *) path; pp = (unsigned char *) path;
@ -1829,7 +1829,7 @@ SetDefaultFontPath(char *path)
err = SetFontPathElements(num, newpath, &bad, TRUE); err = SetFontPathElements(num, newpath, &bad, TRUE);
DEALLOCATE_LOCAL(newpath); xfree(newpath);
return err; return err;
} }

View File

@ -1098,9 +1098,10 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
#endif #endif
sprite.hotPhys.x = XE_KBPTR.rootX; sprite.hotPhys.x = XE_KBPTR.rootX;
sprite.hotPhys.y = XE_KBPTR.rootY; sprite.hotPhys.y = XE_KBPTR.rootY;
/* do motion compression */ /* do motion compression, but not if from different devices */
if (tail && if (tail &&
(tail->event->u.u.type == MotionNotify) && (tail->event->u.u.type == MotionNotify) &&
(tail->device == device) &&
(tail->pScreen == sprite.hotPhys.pScreen)) (tail->pScreen == sprite.hotPhys.pScreen))
{ {
tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x; tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x;
@ -3174,7 +3175,7 @@ drawable.id:0;
#ifdef XKB #ifdef XKB
/* This function is used to set the key pressed or key released state - /* This function is used to set the key pressed or key released state -
this is only used when the pressing of keys does not cause this is only used when the pressing of keys does not cause
CoreProcessKeyEvent to be called, as in for example Mouse Keys. the device's processInputProc to be called, as in for example Mouse Keys.
*/ */
void void
FixKeyState (xEvent *xE, DeviceIntPtr keybd) FixKeyState (xEvent *xE, DeviceIntPtr keybd)
@ -3187,22 +3188,19 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd)
kptr = &keyc->down[key >> 3]; kptr = &keyc->down[key >> 3];
bit = 1 << (key & 7); bit = 1 << (key & 7);
if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease)||
(xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease))
) {
DebugF("FixKeyState: Key %d %s\n",key, DebugF("FixKeyState: Key %d %s\n",key,
(xE->u.u.type==KeyPress?"down":"up")); (((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress))?"down":"up"));
} }
switch (xE->u.u.type) if (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress)
{
case KeyPress:
*kptr |= bit; *kptr |= bit;
break; else if (xE->u.u.type == KeyRelease || xE->u.u.type == DeviceKeyRelease)
case KeyRelease:
*kptr &= ~bit; *kptr &= ~bit;
break; else
default: FatalError("Impossible keyboard event");
FatalError("Impossible keyboard event");
}
} }
#endif #endif

View File

@ -324,7 +324,7 @@ ProcListExtensions(ClientPtr client)
total_length += strlen(extensions[i]->aliases[j]) + 1; total_length += strlen(extensions[i]->aliases[j]) + 1;
} }
reply.length = (total_length + 3) >> 2; reply.length = (total_length + 3) >> 2;
buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); buffer = bufptr = (char *)xalloc(total_length);
if (!buffer) if (!buffer)
return(BadAlloc); return(BadAlloc);
for (i=0; i<NumExtensions; i++) for (i=0; i<NumExtensions; i++)
@ -348,7 +348,7 @@ ProcListExtensions(ClientPtr client)
if (reply.length) if (reply.length)
{ {
WriteToClient(client, total_length, buffer); WriteToClient(client, total_length, buffer);
DEALLOCATE_LOCAL(buffer); xfree(buffer);
} }
return(client->noClientException); return(client->noClientException);
} }

View File

@ -677,7 +677,7 @@ CreateDefaultTile (GCPtr pGC)
(*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen); (*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen);
pTile = (PixmapPtr) pTile = (PixmapPtr)
(*pGC->pScreen->CreatePixmap)(pGC->pScreen, (*pGC->pScreen->CreatePixmap)(pGC->pScreen,
w, h, pGC->depth); w, h, pGC->depth, 0);
pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen); pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
if (!pTile || !pgcScratch) if (!pTile || !pgcScratch)
{ {
@ -1020,7 +1020,7 @@ CreateDefaultStipple(int screenNum)
h = 16; h = 16;
(* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen); (* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen);
if (!(pScreen->PixmapPerDepth[0] = if (!(pScreen->PixmapPerDepth[0] =
(*pScreen->CreatePixmap)(pScreen, w, h, 1))) (*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
return FALSE; return FALSE;
/* fill stipple with 1 */ /* fill stipple with 1 */
tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid; tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid;

View File

@ -95,7 +95,14 @@ set_key_up(DeviceIntPtr pDev, int key_code)
static Bool static Bool
key_is_down(DeviceIntPtr pDev, int key_code) key_is_down(DeviceIntPtr pDev, int key_code)
{ {
return pDev->key->postdown[key_code >> 3] >> (key_code & 7); return !!(pDev->key->postdown[key_code >> 3] & (1 << (key_code & 7)));
}
static Bool
key_autorepeats(DeviceIntPtr pDev, int key_code)
{
return !!(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] &
(1 << (key_code & 7)));
} }
/** /**
@ -444,10 +451,11 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
* FIXME: In theory, if you're repeating with two keyboards in non-XKB, * FIXME: In theory, if you're repeating with two keyboards in non-XKB,
* you could get unbalanced events here. */ * you could get unbalanced events here. */
if (type == KeyPress && key_is_down(pDev, key_code)) { if (type == KeyPress && key_is_down(pDev, key_code)) {
/* If autorepeating is disabled either globally or just for that key,
* or we have a modifier, don't generate a repeat event. */
if (!pDev->kbdfeed->ctrl.autoRepeat || if (!pDev->kbdfeed->ctrl.autoRepeat ||
pDev->key->modifierMap[key_code] || !key_autorepeats(pDev, key_code) ||
!(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] pDev->key->modifierMap[key_code])
& (1 << (key_code & 7))))
return 0; return 0;
#ifdef XKB #ifdef XKB

View File

@ -136,7 +136,6 @@ Bool screenSaverSuspended = FALSE;
char *defaultFontPath = COMPILEDDEFAULTFONTPATH; char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
char *defaultTextFont = COMPILEDDEFAULTFONT; char *defaultTextFont = COMPILEDDEFAULTFONT;
char *defaultCursorFont = COMPILEDCURSORFONT; char *defaultCursorFont = COMPILEDCURSORFONT;
char *rgbPath = RGB_DB;
char *defaultDisplayClass = COMPILEDDISPLAYCLASS; char *defaultDisplayClass = COMPILEDDISPLAYCLASS;
FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
every compilation of dix code */ every compilation of dix code */

View File

@ -98,7 +98,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned cha
bzero(pbits, nby); bzero(pbits, nby);
ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width, ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width,
cm->height, 1); cm->height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen); pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC) if (!ppix || !pGC)
{ {

View File

@ -378,16 +378,16 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
i++; i++;
if (!i) if (!i)
return TRUE; return TRUE;
deletes = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr)); deletes = (GrabPtr *)xalloc(i * sizeof(GrabPtr));
adds = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr)); adds = (GrabPtr *)xalloc(i * sizeof(GrabPtr));
updates = (Mask ***)ALLOCATE_LOCAL(i * sizeof(Mask **)); updates = (Mask ***)xalloc(i * sizeof(Mask **));
details = (Mask **)ALLOCATE_LOCAL(i * sizeof(Mask *)); details = (Mask **)xalloc(i * sizeof(Mask *));
if (!deletes || !adds || !updates || !details) if (!deletes || !adds || !updates || !details)
{ {
if (details) DEALLOCATE_LOCAL(details); if (details) xfree(details);
if (updates) DEALLOCATE_LOCAL(updates); if (updates) xfree(updates);
if (adds) DEALLOCATE_LOCAL(adds); if (adds) xfree(adds);
if (deletes) DEALLOCATE_LOCAL(deletes); if (deletes) xfree(deletes);
return FALSE; return FALSE;
} }
ndels = nadds = nups = 0; ndels = nadds = nups = 0;
@ -482,10 +482,10 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
*updates[i] = details[i]; *updates[i] = details[i];
} }
} }
DEALLOCATE_LOCAL(details); xfree(details);
DEALLOCATE_LOCAL(updates); xfree(updates);
DEALLOCATE_LOCAL(adds); xfree(adds);
DEALLOCATE_LOCAL(deletes); xfree(deletes);
return ok; return ok;
#undef UPDATE #undef UPDATE

View File

@ -440,6 +440,8 @@ main(int argc, char *argv[], char *envp[])
} }
} }
NotifyParentProcess();
Dispatch(); Dispatch();
/* Now free up whatever must be freed */ /* Now free up whatever must be freed */

View File

@ -59,7 +59,7 @@ GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth,
pScreen->pScratchPixmap = NULL; pScreen->pScratchPixmap = NULL;
else else
/* width and height of 0 means don't allocate any pixmap data */ /* width and height of 0 means don't allocate any pixmap data */
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (pPixmap) { if (pPixmap) {
if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,

View File

@ -135,31 +135,31 @@ ProcRotateProperties(ClientPtr client)
if (!stuff->nAtoms) if (!stuff->nAtoms)
return(Success); return(Success);
atoms = (Atom *) & stuff[1]; atoms = (Atom *) & stuff[1];
props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); props = (PropertyPtr *)xalloc(stuff->nAtoms * sizeof(PropertyPtr));
if (!props) if (!props)
return(BadAlloc); return(BadAlloc);
for (i = 0; i < stuff->nAtoms; i++) for (i = 0; i < stuff->nAtoms; i++)
{ {
if (!ValidAtom(atoms[i])) { if (!ValidAtom(atoms[i])) {
DEALLOCATE_LOCAL(props); xfree(props);
client->errorValue = atoms[i]; client->errorValue = atoms[i];
return BadAtom; return BadAtom;
} }
for (j = i + 1; j < stuff->nAtoms; j++) for (j = i + 1; j < stuff->nAtoms; j++)
if (atoms[j] == atoms[i]) if (atoms[j] == atoms[i])
{ {
DEALLOCATE_LOCAL(props); xfree(props);
return BadMatch; return BadMatch;
} }
pProp = FindProperty(pWin, atoms[i]); pProp = FindProperty(pWin, atoms[i]);
if (!pProp) { if (!pProp) {
DEALLOCATE_LOCAL(props); xfree(props);
return BadMatch; return BadMatch;
} }
rc = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, pProp, rc = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, pProp,
DixReadAccess|DixWriteAccess); DixReadAccess|DixWriteAccess);
if (rc != Success) { if (rc != Success) {
DEALLOCATE_LOCAL(props); xfree(props);
client->errorValue = atoms[i]; client->errorValue = atoms[i];
return rc; return rc;
} }
@ -182,7 +182,7 @@ ProcRotateProperties(ClientPtr client)
props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms];
} }
} }
DEALLOCATE_LOCAL(props); xfree(props);
return Success; return Success;
} }
@ -600,7 +600,7 @@ ProcListProperties(ClientPtr client)
numProps++; numProps++;
} }
if (numProps) if (numProps)
if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom))))
return(BadAlloc); return(BadAlloc);
xlpr.type = X_Reply; xlpr.type = X_Reply;
@ -619,7 +619,7 @@ ProcListProperties(ClientPtr client)
{ {
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
DEALLOCATE_LOCAL(pAtoms); xfree(pAtoms);
} }
return(client->noClientException); return(client->noClientException);
} }

View File

@ -492,13 +492,13 @@ RebuildTable(int client)
*/ */
j = 2 * clientTable[client].buckets; j = 2 * clientTable[client].buckets;
tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); tails = (ResourcePtr **)xalloc(j * sizeof(ResourcePtr *));
if (!tails) if (!tails)
return; return;
resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr));
if (!resources) if (!resources)
{ {
DEALLOCATE_LOCAL(tails); xfree(tails);
return; return;
} }
for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
@ -521,7 +521,7 @@ RebuildTable(int client)
*tptr = &res->next; *tptr = &res->next;
} }
} }
DEALLOCATE_LOCAL(tails); xfree(tails);
clientTable[client].buckets *= 2; clientTable[client].buckets *= 2;
xfree(clientTable[client].resources); xfree(clientTable[client].resources);
clientTable[client].resources = resources; clientTable[client].resources = resources;

View File

@ -101,7 +101,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
CARD32 tmpbuf[1]; CARD32 tmpbuf[1];
/* Allocate as big a buffer as we can... */ /* Allocate as big a buffer as we can... */
while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize))) while (!(pbufT = (CARD32 *) xalloc(bufsize)))
{ {
bufsize >>= 1; bufsize >>= 1;
if (bufsize == 4) if (bufsize == 4)
@ -133,7 +133,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
} }
if (pbufT != tmpbuf) if (pbufT != tmpbuf)
DEALLOCATE_LOCAL ((char *) pbufT); xfree ((char *) pbufT);
} }
/** /**
@ -149,7 +149,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
short tmpbuf[2]; short tmpbuf[2];
/* Allocate as big a buffer as we can... */ /* Allocate as big a buffer as we can... */
while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize))) while (!(pbufT = (short *) xalloc(bufsize)))
{ {
bufsize >>= 1; bufsize >>= 1;
if (bufsize == 4) if (bufsize == 4)
@ -181,7 +181,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
} }
if (pbufT != tmpbuf) if (pbufT != tmpbuf)
DEALLOCATE_LOCAL ((char *) pbufT); xfree ((char *) pbufT);
} }
@ -1267,7 +1267,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
{ {
char *pInfoTBase; char *pInfoTBase;
pInfoTBase = (char *) ALLOCATE_LOCAL(size); pInfoTBase = (char *) xalloc(size);
if (!pInfoTBase) if (!pInfoTBase)
{ {
pClient->noClientException = -1; pClient->noClientException = -1;
@ -1275,7 +1275,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
} }
SwapConnSetupInfo(pInfo, pInfoTBase); SwapConnSetupInfo(pInfo, pInfoTBase);
(void)WriteToClient(pClient, (int)size, (char *) pInfoTBase); (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
DEALLOCATE_LOCAL(pInfoTBase); xfree(pInfoTBase);
} }
_X_EXPORT void _X_EXPORT void

View File

@ -313,7 +313,7 @@ MakeRootTile(WindowPtr pWin)
int i, j; int i, j;
pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
pScreen->rootDepth); pScreen->rootDepth, 0);
pWin->backgroundState = BackgroundPixmap; pWin->backgroundState = BackgroundPixmap;
pGC = GetScratchGC(pScreen->rootDepth, pScreen); pGC = GetScratchGC(pScreen->rootDepth, pScreen);

View File

@ -233,7 +233,8 @@ exaLog2(int val)
* for scratch pixmaps, or to represent the visible screen. * for scratch pixmaps, or to represent the visible screen.
*/ */
static PixmapPtr static PixmapPtr
exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint)
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
ExaPixmapPrivPtr pExaPixmap; ExaPixmapPrivPtr pExaPixmap;
@ -245,10 +246,10 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
return NullPixmap; return NullPixmap;
if (!pExaScr->info->CreatePixmap) { if (!pExaScr->info->CreatePixmap) {
pPixmap = fbCreatePixmap (pScreen, w, h, depth); pPixmap = fbCreatePixmap (pScreen, w, h, depth, usage_hint);
} else { } else {
driver_alloc = 1; driver_alloc = 1;
pPixmap = fbCreatePixmap(pScreen, 0, 0, depth); pPixmap = fbCreatePixmap(pScreen, 0, 0, depth, usage_hint);
} }
if (!pPixmap) if (!pPixmap)

View File

@ -497,7 +497,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu)) { pGC->fillStyle, pGC->alu)) {
xRectangle *rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); xRectangle *rects = xalloc(nbox * sizeof(xRectangle));
if (rects) { if (rects) {
int i; int i;
@ -510,7 +510,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
} }
region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED); region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
DEALLOCATE_LOCAL(rects); xfree(rects);
} }
} }
@ -619,7 +619,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return; return;
} }
prect = ALLOCATE_LOCAL(sizeof(xRectangle) * npt); prect = xalloc(sizeof(xRectangle) * npt);
for (i = 0; i < npt; i++) { for (i = 0; i < npt; i++) {
prect[i].x = ppt[i].x; prect[i].x = ppt[i].x;
prect[i].y = ppt[i].y; prect[i].y = ppt[i].y;
@ -631,7 +631,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
prect[i].height = 1; prect[i].height = 1;
} }
pGC->ops->PolyFillRect(pDrawable, pGC, npt, prect); pGC->ops->PolyFillRect(pDrawable, pGC, npt, prect);
DEALLOCATE_LOCAL(prect); xfree(prect);
} }
/** /**
@ -654,7 +654,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return; return;
} }
prect = ALLOCATE_LOCAL(sizeof(xRectangle) * (npt - 1)); prect = xalloc(sizeof(xRectangle) * (npt - 1));
x1 = ppt[0].x; x1 = ppt[0].x;
y1 = ppt[0].y; y1 = ppt[0].y;
/* If we have any non-horizontal/vertical, fall back. */ /* If we have any non-horizontal/vertical, fall back. */
@ -668,7 +668,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
} }
if (x1 != x2 && y1 != y2) { if (x1 != x2 && y1 != y2) {
DEALLOCATE_LOCAL(prect); xfree(prect);
ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt); ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
return; return;
} }
@ -692,7 +692,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
y1 = y2; y1 = y2;
} }
pGC->ops->PolyFillRect(pDrawable, pGC, npt - 1, prect); pGC->ops->PolyFillRect(pDrawable, pGC, npt - 1, prect);
DEALLOCATE_LOCAL(prect); xfree(prect);
} }
/** /**
@ -723,7 +723,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
} }
} }
prect = ALLOCATE_LOCAL(sizeof(xRectangle) * nseg); prect = xalloc(sizeof(xRectangle) * nseg);
for (i = 0; i < nseg; i++) { for (i = 0; i < nseg; i++) {
if (pSeg[i].x1 < pSeg[i].x2) { if (pSeg[i].x1 < pSeg[i].x2) {
prect[i].x = pSeg[i].x1; prect[i].x = pSeg[i].x1;
@ -741,7 +741,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
} }
} }
pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect); pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect);
DEALLOCATE_LOCAL(prect); xfree(prect);
} }
static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion,

View File

@ -774,7 +774,7 @@ exaCreateAlphaPicture (ScreenPtr pScreen,
} }
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pPictFormat->depth); pPictFormat->depth, 0);
if (!pPixmap) if (!pPixmap)
return 0; return 0;
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);

View File

@ -1621,7 +1621,8 @@ PixmapPtr
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp); fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp);
PixmapPtr PixmapPtr
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth); fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint);
Bool Bool
fbDestroyPixmap (PixmapPtr pPixmap); fbDestroyPixmap (PixmapPtr pPixmap);

View File

@ -326,7 +326,7 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1) if (nbox > 1)
{ {
/* keep ordering in each band, reverse order of bands */ /* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew1) if(!pboxNew1)
return; return;
pboxBase = pboxNext = pbox+nbox-1; pboxBase = pboxNext = pbox+nbox-1;
@ -363,11 +363,11 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1) if (nbox > 1)
{ {
/* reverse order of rects in each band */ /* reverse order of rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew2) if(!pboxNew2)
{ {
if (pboxNew1) if (pboxNew1)
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
return; return;
} }
pboxBase = pboxNext = pbox; pboxBase = pboxNext = pbox;
@ -402,9 +402,9 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
reverse, upsidedown, bitPlane, closure); reverse, upsidedown, bitPlane, closure);
if (pboxNew1) if (pboxNew1)
DEALLOCATE_LOCAL (pboxNew1); xfree (pboxNew1);
if (pboxNew2) if (pboxNew2)
DEALLOCATE_LOCAL (pboxNew2); xfree (pboxNew2);
} }
RegionPtr RegionPtr

View File

@ -136,7 +136,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen)
pbits = pScrPriv->layer[i].u.init.pbits; pbits = pScrPriv->layer[i].u.init.pbits;
width = pScrPriv->layer[i].u.init.width; width = pScrPriv->layer[i].u.init.width;
depth = pScrPriv->layer[i].u.init.depth; depth = pScrPriv->layer[i].u.init.depth;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap) if (!pPixmap)
return FALSE; return FALSE;
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width, if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,

View File

@ -80,7 +80,8 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
} }
PixmapPtr PixmapPtr
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth) fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
{ {
int bpp; int bpp;
bpp = BitsPerPixel (depth); bpp = BitsPerPixel (depth);

View File

@ -272,7 +272,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
* (BitsPerPixel(depth) >> 3)); * (BitsPerPixel(depth) >> 3));
if (!pBits) return FALSE; if (!pBits) return FALSE;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap) { if (!pPixmap) {
xfree(pBits); xfree(pBits);
return FALSE; return FALSE;
@ -491,7 +491,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
DBG("StoreColors\n"); DBG("StoreColors\n");
expanddefs = ALLOCATE_LOCAL(sizeof(xColorItem) expanddefs = xalloc(sizeof(xColorItem)
* (1 << pScrPriv->myDepth)); * (1 << pScrPriv->myDepth));
if (!expanddefs) return; if (!expanddefs) return;
@ -518,7 +518,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
pColors++; pColors++;
} }
DEALLOCATE_LOCAL(expanddefs); xfree(expanddefs);
pCmapPriv->dirty = TRUE; pCmapPriv->dirty = TRUE;
pScrPriv->colormapDirty = TRUE; pScrPriv->colormapDirty = TRUE;
@ -556,9 +556,9 @@ xxInstallColormap(ColormapPtr pmap)
wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap); wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap);
} }
pixels = ALLOCATE_LOCAL(sizeof(Pixel) * (1 << pScrPriv->myDepth)); pixels = xalloc(sizeof(Pixel) * (1 << pScrPriv->myDepth));
colors = ALLOCATE_LOCAL(sizeof(xrgb) * (1 << pScrPriv->myDepth)); colors = xalloc(sizeof(xrgb) * (1 << pScrPriv->myDepth));
defs = ALLOCATE_LOCAL(sizeof(xColorItem) * (1 << pScrPriv->myDepth)); defs = xalloc(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
if (!pixels || !colors) if (!pixels || !colors)
return; return;
@ -586,9 +586,9 @@ xxInstallColormap(ColormapPtr pmap)
} }
xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs); xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs);
DEALLOCATE_LOCAL(pixels); xfree(pixels);
DEALLOCATE_LOCAL(colors); xfree(colors);
DEALLOCATE_LOCAL(defs); xfree(defs);
return; return;
} }

View File

@ -1,5 +1,3 @@
.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.3 2001/09/23 23:02:37 torrey Exp $
.\"
.TH XDARWIN 1 __vendorversion__ .TH XDARWIN 1 __vendorversion__
.SH NAME .SH NAME
XDarwin \- X window system server for Darwin operating system XDarwin \- X window system server for Darwin operating system

Binary file not shown.

View File

@ -79,7 +79,7 @@ extern void X11ApplicationMain (int argc, const char *argv[],
extern int X11EnableKeyEquivalents; extern int X11EnableKeyEquivalents;
extern int quartzHasRoot, quartzEnableRootless; extern int quartzHasRoot, quartzEnableRootless;
#define APP_PREFS "org.x.x11" #define APP_PREFS "org.x.X11"
#define PREFS_APPSMENU "apps_menu" #define PREFS_APPSMENU "apps_menu"
#define PREFS_FAKEBUTTONS "enable_fake_buttons" #define PREFS_FAKEBUTTONS "enable_fake_buttons"

View File

@ -45,7 +45,7 @@
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
#define DEFAULTS_FILE "/usr/X11/lib/X11xserver/Xquartz.plist" #define DEFAULTS_FILE "/usr/X11/lib/X11/xserver/Xquartz.plist"
int X11EnableKeyEquivalents = TRUE; int X11EnableKeyEquivalents = TRUE;
int quartzHasRoot = FALSE, quartzEnableRootless = TRUE; int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
@ -311,6 +311,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:YES];
if ([self modalWindow] == nil) [self activateX:YES]; if ([self modalWindow] == nil) [self activateX:YES];
QuartzMessageServerThread(kXDarwinBringAllToFront, 0);
} }
- (void) set_can_quit:(NSNumber *)state { - (void) set_can_quit:(NSNumber *)state {

View File

@ -1,5 +1,4 @@
/* X11Controller.m -- connect the IB ui, also the NSApp delegate /* X11Controller.m -- connect the IB ui, also the NSApp delegate
$Id: X11Controller.m,v 1.40 2006/09/06 21:19:32 jharper Exp $
Copyright (c) 2002-2007 Apple Inc. All rights reserved. Copyright (c) 2002-2007 Apple Inc. All rights reserved.
@ -294,26 +293,17 @@
- (void) launch_client:(NSString *)filename - (void) launch_client:(NSString *)filename
{ {
const char *command = [filename UTF8String]; const char *command = [filename UTF8String];
const char *shell; const char *argv[7];
const char *argv[5];
int child1, child2 = 0; int child1, child2 = 0;
int status; int status;
/* this old code doesn't work with csh ...
shell = getenv("SHELL");
if (shell == NULL) shell = "/bin/bash";
argv[0] = shell;
argv[1] = "-l";
argv[2] = "-c";
argv[3] = command;
argv[4] = NULL;
... but the new code doesn't work with spaces in a command :(
*/
argv[0] = "/usr/bin/login"; argv[0] = "/usr/bin/login";
argv[1] = "-fp"; argv[1] = "-fp";
argv[2] = getlogin(); argv[2] = getlogin();
argv[3] = "/bin/sh";
argv[4] = "-c";
argv[5] = command;
argv[6] = NULL;
/* Do the fork-twice trick to avoid having to reap zombies */ /* Do the fork-twice trick to avoid having to reap zombies */

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
<html> <html>
<head> <head>
<title>XDarwin Help</title> <title>XDarwin Help</title>

View File

@ -1,5 +1,4 @@
/* English versions of the Info.plist keys; used by most localizations. */ /* English versions of the Info.plist keys; used by most localizations. */
/* Most of these are set in the target application settings. */ /* Most of these are set in the target application settings. */
/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.3 2002/07/17 01:24:55 torrey Exp $ */
NSHumanReadableCopyright = __quote__ X_VENDOR_NAME X_VERSION __quote__; NSHumanReadableCopyright = __quote__ X_VENDOR_NAME X_VERSION __quote__;

View File

@ -1,5 +1,4 @@
/* English localized versions of strings used by the Mac OS X front end. */ /* English localized versions of strings used by the Mac OS X front end. */
/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */
/* Title of alert panel */ /* Title of alert panel */
"Quit X server?" = "Quit X server?"; "Quit X server?" = "Quit X server?";

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1 2001/05/21 01:42:17 torrey Exp $ -->
<html> <html>
<head> <head>
<title>XDarwin Help</title> <title>XDarwin Help</title>

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
<html> <html>
<head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> <head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
<title>XDarwin Help</title> <title>XDarwin Help</title>

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1 2001/05/21 01:42:17 torrey Exp $ -->
<html> <html>
<head> <head>
<title>XDarwin Help</title> <title>XDarwin Help</title>

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ --><html><body>
<head> <head>
<title>XDarwin Help</title> <title>XDarwin Help</title>
</head> </head>

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
<html> <html>
<head> <head>
<title>XDarwin Ayuda</title> <title>XDarwin Ayuda</title>

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
<html> <html>
<head> <head>
<title>XDarwin Help</title> <title>XDarwin Help</title>

View File

@ -1,5 +1,3 @@
<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1 2001/05/21 01:42:17 torrey Exp $ -->
<html> <html>
<head> <head>
<title>XDarwin Help</title> <title>XDarwin Help</title>

View File

@ -2,8 +2,6 @@ XCOMM!/bin/sh
XCOMM This script is used by XDarwin to start X clients when XDarwin is XCOMM This script is used by XDarwin to start X clients when XDarwin is
XCOMM launched from the Finder. XCOMM launched from the Finder.
XCOMM
XCOMM $XFree86: $
userclientrc=$HOME/.xinitrc userclientrc=$HOME/.xinitrc
sysclientrc=XINITDIR/xinitrc sysclientrc=XINITDIR/xinitrc

View File

@ -3,8 +3,6 @@
* Shared code for the Darwin X Server * Shared code for the Darwin X Server
* running with Quartz or IOKit display mode * running with Quartz or IOKit display mode
* *
**************************************************************/
/*
* Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
* Copyright (c) 2007 Apple Inc. * Copyright (c) 2007 Apple Inc.
* *

View File

@ -141,6 +141,7 @@ enum {
kXDarwinQuit, // kill the X server and release the display kXDarwinQuit, // kill the X server and release the display
kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
kXDarwinBringAllToFront, // bring all X windows to front
/* /*
* AppleWM events * AppleWM events
*/ */

View File

@ -30,7 +30,6 @@
* sale, use or other dealings in this Software without prior written * sale, use or other dealings in this Software without prior written
* authorization. * authorization.
*/ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
#include <dix-config.h> #include <dix-config.h>

View File

@ -2,7 +2,7 @@
// XApplication.m // XApplication.m
// //
// Created by Andreas Monitzer on January 6, 2001. // Created by Andreas Monitzer on January 6, 2001.
//
/* /*
* Copyright (c) 2001 Andreas Monitzer. All Rights Reserved. * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
* *
@ -30,7 +30,6 @@
* sale, use or other dealings in this Software without prior written * sale, use or other dealings in this Software without prior written
* authorization. * authorization.
*/ */
/* $XFree86: $ */
#import "XApplication.h" #import "XApplication.h"

View File

@ -1,4 +1,3 @@
.\" $XFree86: xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.man,v 1.1 2002/02/05 19:16:14 torrey Exp $
.TH XDarwinStartup 1 .TH XDarwinStartup 1
.SH NAME .SH NAME
XDarwinStartup - Startup program for the XDarwin X window server XDarwinStartup - Startup program for the XDarwin X window server

View File

@ -34,7 +34,6 @@
* sale, use or other dealings in this Software without prior written * sale, use or other dealings in this Software without prior written
* authorization. * authorization.
*/ */
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
#include <dix-config.h> #include <dix-config.h>
#include "quartzCommon.h" #include "quartzCommon.h"

View File

@ -1,6 +1,6 @@
/************************************************************************** /**************************************************************************
Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. Copyright (c) 2002-2007 Apple Inc. All Rights Reserved.
Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a

View File

@ -29,7 +29,6 @@
* holders shall not be used in advertising or otherwise to promote the sale, * holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization. * use or other dealings in this Software without prior written authorization.
*/ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.1 2003/06/07 05:49:07 torrey Exp $ */
#include <dix-config.h> #include <dix-config.h>

View File

@ -1,7 +1,6 @@
/* /*
* Cocoa rootless implementation functions for AppleWM extension * Cocoa rootless implementation functions for AppleWM extension
*/ *
/*
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
@ -26,7 +25,6 @@
* holders shall not be used in advertising or otherwise to promote the sale, * holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization. * use or other dealings in this Software without prior written authorization.
*/ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
#include <dix-config.h> #include <dix-config.h>

View File

@ -1,7 +1,6 @@
/* /*
* Cocoa rootless implementation frame functions * Cocoa rootless implementation frame functions
*/ *
/*
* Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2001 Greg Parker. All Rights Reserved.
* Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
* *
@ -27,7 +26,6 @@
* holders shall not be used in advertising or otherwise to promote the sale, * holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization. * use or other dealings in this Software without prior written authorization.
*/ */
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.2 2004/04/23 19:15:51 eich Exp $ */
#include <dix-config.h> #include <dix-config.h>

View File

@ -1,8 +1,6 @@
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.4 2004/08/12 20:24:36 torrey Exp $ */
/* /*
* Cocoa rootless implementation initialization * Cocoa rootless implementation initialization
*/ *
/*
* Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2001 Greg Parker. All Rights Reserved.
* Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved.
* *
@ -28,7 +26,6 @@
* holders shall not be used in advertising or otherwise to promote the sale, * holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization. * use or other dealings in this Software without prior written authorization.
*/ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */
#include <dix-config.h> #include <dix-config.h>

View File

@ -2,8 +2,7 @@
* quartzCursor.h * quartzCursor.h
* *
* External interface for Quartz hardware cursor * External interface for Quartz hardware cursor
*/ *
/*
* Copyright (c) 2001 Torrey T. Lyons and Greg Parker. * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
* All Rights Reserved. * All Rights Reserved.
* *

View File

@ -1,4 +1,5 @@
/* /*
*
* This module converts keysym values into the corresponding ISO 10646 * This module converts keysym values into the corresponding ISO 10646
* (UCS, Unicode) values. * (UCS, Unicode) values.
* *

View File

@ -1,9 +1,7 @@
/************************************************************** /*
* *
* Quartz-specific support for the Darwin X Server * Quartz-specific support for the Darwin X Server
* *
**************************************************************/
/*
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons. * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons.
* All Rights Reserved. * All Rights Reserved.
* *
@ -64,7 +62,7 @@ int quartzServerVisible = TRUE;
int quartzServerQuitting = FALSE; int quartzServerQuitting = FALSE;
DevPrivateKey quartzScreenKey = &quartzScreenKey; DevPrivateKey quartzScreenKey = &quartzScreenKey;
int aquaMenuBarHeight = 0; int aquaMenuBarHeight = 0;
int noPseudoramiXExtension = TRUE; int noPseudoramiXExtension = FALSE;
QuartzModeProcsPtr quartzProcs = NULL; QuartzModeProcsPtr quartzProcs = NULL;
const char *quartzOpenGLBundle = NULL; const char *quartzOpenGLBundle = NULL;
@ -389,11 +387,22 @@ void DarwinModeProcessEvent(
QuartzUpdateScreens(); QuartzUpdateScreens();
break; break;
case kXDarwinWindowState: case kXDarwinBringAllToFront:
case kXDarwinWindowMoved: RootlessOrderAllWindows();
// FIXME: Not implemented yet
break; break;
case kXDarwinWindowState:
ErrorF("kXDarwinWindowState\n");
break;
case kXDarwinWindowMoved: {
WindowPtr pWin = (WindowPtr)xe->u.clientMessage.u.l.longs0;
short x = xe->u.clientMessage.u.l.longs1,
y = xe->u.clientMessage.u.l.longs2;
ErrorF("kXDarwinWindowMoved(%p, %hd, %hd)\n", pWin, x, y);
RootlessMoveWindow(pWin, x, y, pWin->nextSib, VTMove);
}
break;
default: default:
ErrorF("Unknown application defined event type %d.\n", ErrorF("Unknown application defined event type %d.\n",
xe->u.u.type); xe->u.u.type);

View File

@ -3,8 +3,7 @@
* *
* External interface of the Quartz display modes seen by the generic, mode * External interface of the Quartz display modes seen by the generic, mode
* independent parts of the Darwin X server. * independent parts of the Darwin X server.
*/ *
/*
* Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons. * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
* All Rights Reserved. * All Rights Reserved.
* *

View File

@ -1,4 +1,3 @@
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.2 2004/04/23 19:15:17 eich Exp $ */
/************************************************************** /**************************************************************
* *
* Quartz-specific support for the Darwin X Server * Quartz-specific support for the Darwin X Server
@ -7,8 +6,6 @@
* This file is separate from the parts of Quartz support * This file is separate from the parts of Quartz support
* that use X include files to avoid symbol collisions. * that use X include files to avoid symbol collisions.
* *
**************************************************************/
/*
* Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker. * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
* All Rights Reserved. * All Rights Reserved.
* *
@ -34,7 +31,7 @@
* holders shall not be used in advertising or otherwise to promote the sale, * holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization. * use or other dealings in this Software without prior written authorization.
*/ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
#include <dix-config.h> #include <dix-config.h>
#include "quartzCommon.h" #include "quartzCommon.h"
@ -45,14 +42,16 @@
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#ifndef INXQUARTZ
#import "Preferences.h" #import "Preferences.h"
#endif
#include "pseudoramiX.h" #include "pseudoramiX.h"
extern void FatalError(const char *, ...); extern void FatalError(const char *, ...);
extern char *display; extern char *display;
extern int noPanoramiXExtension; extern int noPanoramiXExtension;
#ifndef INXQUARTZ
/* /*
* QuartzReadPreferences * QuartzReadPreferences
* Read the user preferences from the Cocoa front end. * Read the user preferences from the Cocoa front end.
@ -98,7 +97,7 @@ void QuartzReadPreferences(void)
darwinDesiredDepth = [Preferences depth] - 1; darwinDesiredDepth = [Preferences depth] - 1;
} }
#endif
/* /*
* QuartzWriteCocoaPasteboard * QuartzWriteCocoaPasteboard
@ -163,6 +162,7 @@ char *QuartzReadCocoaPasteboard(void)
int QuartzFSUseQDCursor( int QuartzFSUseQDCursor(
int depth) // screen depth int depth) // screen depth
{ {
#ifndef INXQUARTZ
switch ([Preferences useQDCursor]) { switch ([Preferences useQDCursor]) {
case qdCursor_Always: case qdCursor_Always:
return TRUE; return TRUE;
@ -174,6 +174,7 @@ int QuartzFSUseQDCursor(
else else
return FALSE; return FALSE;
} }
#endif
return TRUE; return TRUE;
} }

Some files were not shown because too many files have changed in this diff Show More