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)
{
ClientPtr client = cl->client;
VisualPtr pVisual;
__GLXcontext *glxc, *shareglxc;
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
** a GL core that needs windowing information (e.g., Mesa).
*/
glxc->pScreen = pGlxScreen->pScreen;
glxc->pGlxScreen = pGlxScreen;
glxc->pVisual = pVisual;
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
* the context screen and that the context fbconfig is compatible
* with the window visual. */
if (pDraw->pScreen != glxc->pScreen ||
if (pDraw->pScreen != glxc->pGlxScreen->pScreen ||
!validGlxFBConfigForWindow(client, glxc->modes, pDraw, error))
return NULL;
@ -1255,7 +1252,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
__glXenterServer(GL_FALSE);
pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen,
width, height, config->rgbBits);
width, height, config->rgbBits, 0);
__glXleaveServer(GL_FALSE);
return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable,
@ -1470,9 +1467,9 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
*pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
*pSendBuf++ = (int)(ctx->share_id);
*pSendBuf++ = GLX_VISUAL_ID_EXT;
*pSendBuf++ = (int)(ctx->pVisual->vid);
*pSendBuf++ = (int)(ctx->modes->visualID);
*pSendBuf++ = GLX_SCREEN_EXT;
*pSendBuf++ = (int)(ctx->pScreen->myNum);
*pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum);
if (client->swapped) {
__glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);

View File

@ -85,14 +85,8 @@ struct __GLXcontext {
** Pointer to screen info data for this context. This is set
** when the context is created.
*/
ScreenPtr pScreen;
__GLXscreen *pGlxScreen;
/*
** This context is created with respect to this visual.
*/
VisualRec *pVisual;
/*
** The XID of this context.
*/
@ -103,11 +97,6 @@ struct __GLXcontext {
*/
XID share_id;
/*
** Visual id.
*/
VisualID vid;
/*
** screen number.
*/
@ -128,11 +117,6 @@ struct __GLXcontext {
*/
GLboolean isDirect;
/*
** Window pending state
*/
GLuint pendingState;
/*
** 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);
__glXenterServer(GL_FALSE);
DRIDestroyDrawable(drawable->pDraw->pScreen,
serverClient, drawable->pDraw);
__glXleaveServer(GL_FALSE);
/* If the X window was destroyed, the dri DestroyWindow hook will
* aready have taken care of this, so only call if pDraw isn't NULL. */
if (drawable->pDraw != NULL) {
__glXenterServer(GL_FALSE);
DRIDestroyDrawable(drawable->pDraw->pScreen,
serverClient, drawable->pDraw);
__glXleaveServer(GL_FALSE);
}
xfree(private);
}
@ -249,7 +253,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext)
context->driContext.destroyContext(&context->driContext);
__glXenterServer(GL_FALSE);
retval = DRIDestroyContext(baseContext->pScreen, context->hwContextID);
retval = DRIDestroyContext(baseContext->pGlxScreen->pScreen, context->hwContextID);
__glXleaveServer(GL_FALSE);
__glXContextDestroy(&context->base);
@ -583,7 +587,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.pScreen = screen->base.pScreen;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
/* Find the requested X visual */
@ -668,11 +671,16 @@ getDrawableInfo(__DRIdrawable *driDrawable,
{
__GLXDRIdrawable *drawable = containerOf(driDrawable,
__GLXDRIdrawable, driDrawable);
ScreenPtr pScreen = drawable->base.pDraw->pScreen;
ScreenPtr pScreen;
drm_clip_rect_t *pClipRects, *pBackClipRects;
GLboolean retval;
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);
retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp,
x, y, width, height,

View File

@ -107,22 +107,8 @@ static int ContextGone(__GLXcontext* cx, XID id)
*/
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
{
__GLXcontext *cx, *cx1;
/*
** 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;
}
glxPriv->pDraw = NULL;
glxPriv->drawId = 0;
__glXUnrefDrawable(glxPriv);
return True;

View File

@ -265,7 +265,7 @@ __glXMesaScreenDestroy(__GLXscreen *screen)
int i;
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])
XMesaDestroyVisual(mesaScreen->xm_vis[i]);
}
@ -363,7 +363,7 @@ createMesaVisuals(__GLXMESAscreen *pMesaScreen)
{
__GLcontextModes *config;
ScreenPtr pScreen;
VisualPtr visual;
VisualPtr visual = NULL;
int i, j;
i = 0;

View File

@ -190,7 +190,6 @@ static char GLXServerExtensions[] =
static Bool glxPositionWindow(WindowPtr pWin, int x, int y)
{
ScreenPtr pScreen;
__GLXcontext *glxc;
__GLXdrawable *glxPriv;
Bool ret;
__GLXscreen *pGlxScreen;
@ -227,16 +226,6 @@ static Bool glxPositionWindow(WindowPtr pWin, int x, int y)
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;
}
@ -408,38 +397,61 @@ initGlxVisual(VisualPtr visual, __GLcontextModes *config)
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
addMinimalSet(__GLXscreen *pGlxScreen)
{
__GLcontextModes *config;
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) {
if (config->visualRating != GLX_NONE)
continue;
if (config->doubleBufferMode && config->depthBits > 0)
break;
}
if (config == NULL)
config = pGlxScreen->fbconfigs;
pGlxScreen->visuals = xcalloc(1, sizeof (__GLcontextModes *));
pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals,
sizeof (__GLcontextModes *));
if (pGlxScreen->visuals == NULL) {
ErrorF("Failed to allocate for minimal set of GLX visuals\n");
return;
}
depth = config->redBits + config->greenBits + config->blueBits;
visuals = AddScreenVisuals(pGlxScreen->pScreen, 1, depth);
if (visuals == NULL) {
xfree(pGlxScreen->visuals);
return;
pGlxScreen->numVisuals = pGlxScreen->pScreen->numVisuals;
visuals = pGlxScreen->pScreen->visuals;
for (i = 0; i < pGlxScreen->numVisuals; i++) {
if (visuals[i].nplanes == 32)
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
@ -505,8 +517,6 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) {
m->fbconfigID = FakeClientID(0);
m->visualID = findVisualForConfig(pScreen, m);
ErrorF("mapping fbconfig id 0x%02lx to visual id 0x%02lx\n",
m->fbconfigID, m->visualID);
i++;
}
pGlxScreen->numFBConfigs = i;

View File

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

View File

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

View File

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

View File

@ -155,7 +155,7 @@ pixCreateImageBuffers (pWin, nbuf, ids, action, hint)
{
pMBBuffer = &pMBWindow->buffers[i];
pMBBuffer->pDrawable = (DrawablePtr)
(*pScreen->CreatePixmap) (pScreen, width, height, depth);
(*pScreen->CreatePixmap) (pScreen, width, height, depth, 0);
if (!pMBBuffer->pDrawable)
break;
@ -263,7 +263,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
int nrects = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion);
pRects = (xRectangle *)ALLOCATE_LOCAL(nrects * sizeof(xRectangle));
pRects = (xRectangle *)xalloc(nrects * sizeof(xRectangle));
if (pRects)
{
int i;
@ -275,7 +275,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
pRects[i].height = pbox->y2 - pbox->y1;
}
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++)
{
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)
{
(* 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;
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
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));
FOR_NSCREENS_FORWARD(j){
@ -1299,7 +1299,7 @@ int PanoramiXPolyPoint(ClientPtr client)
result = (* SavedProcVector[X_PolyPoint])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origPts);
xfree(origPts);
return (result);
} else
return (client->noClientException);
@ -1330,7 +1330,7 @@ int PanoramiXPolyLine(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
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));
FOR_NSCREENS_FORWARD(j){
@ -1357,7 +1357,7 @@ int PanoramiXPolyLine(ClientPtr client)
result = (* SavedProcVector[X_PolyLine])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origPts);
xfree(origPts);
return (result);
} else
return (client->noClientException);
@ -1391,7 +1391,7 @@ int PanoramiXPolySegment(ClientPtr client)
if(nsegs & 4) return BadLength;
nsegs >>= 3;
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));
FOR_NSCREENS_FORWARD(j){
@ -1418,7 +1418,7 @@ int PanoramiXPolySegment(ClientPtr client)
result = (* SavedProcVector[X_PolySegment])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origSegs);
xfree(origSegs);
return (result);
} else
return (client->noClientException);
@ -1453,7 +1453,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
if(nrects & 4) return BadLength;
nrects >>= 3;
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));
FOR_NSCREENS_FORWARD(j){
@ -1479,7 +1479,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
result = (* SavedProcVector[X_PolyRectangle])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origRecs);
xfree(origRecs);
return (result);
} else
return (client->noClientException);
@ -1513,7 +1513,7 @@ int PanoramiXPolyArc(ClientPtr client)
if(narcs % sizeof(xArc)) return BadLength;
narcs /= sizeof(xArc);
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));
FOR_NSCREENS_FORWARD(j){
@ -1537,7 +1537,7 @@ int PanoramiXPolyArc(ClientPtr client)
result = (* SavedProcVector[X_PolyArc])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origArcs);
xfree(origArcs);
return (result);
} else
return (client->noClientException);
@ -1569,7 +1569,7 @@ int PanoramiXFillPoly(ClientPtr client)
count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
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));
FOR_NSCREENS_FORWARD(j){
@ -1596,7 +1596,7 @@ int PanoramiXFillPoly(ClientPtr client)
result = (* SavedProcVector[X_FillPoly])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(locPts);
xfree(locPts);
return (result);
} else
return (client->noClientException);
@ -1630,7 +1630,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
if(things & 4) return BadLength;
things >>= 3;
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));
FOR_NSCREENS_FORWARD(j){
@ -1655,7 +1655,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
result = (* SavedProcVector[X_PolyFillRectangle])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origRects);
xfree(origRects);
return (result);
} else
return (client->noClientException);
@ -1689,7 +1689,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
IF_RETURN((narcs % sizeof(xArc)), BadLength);
narcs /= sizeof(xArc);
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));
FOR_NSCREENS_FORWARD(j){
@ -1714,7 +1714,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
result = (* SavedProcVector[X_PolyFillArc])(client);
if(result != Success) break;
}
DEALLOCATE_LOCAL(origArcs);
xfree(origArcs);
return (result);
} else
return (client->noClientException);

View File

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

View File

@ -1078,7 +1078,7 @@ ProcShapeGetRectangles (client)
}
if (!region) {
nrects = 1;
rects = (xRectangle *) ALLOCATE_LOCAL (sizeof (xRectangle));
rects = (xRectangle *) xalloc (sizeof (xRectangle));
if (!rects)
return BadAlloc;
switch (stuff->kind) {
@ -1105,7 +1105,7 @@ ProcShapeGetRectangles (client)
BoxPtr box;
nrects = REGION_NUM_RECTS(region);
box = REGION_RECTS(region);
rects = (xRectangle *) ALLOCATE_LOCAL (nrects * sizeof (xRectangle));
rects = (xRectangle *) xalloc (nrects * sizeof (xRectangle));
if (!rects && nrects)
return BadAlloc;
for (i = 0; i < nrects; i++, box++) {
@ -1128,7 +1128,7 @@ ProcShapeGetRectangles (client)
}
WriteToClient (client, sizeof (rep), (char *) &rep);
WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
DEALLOCATE_LOCAL (rects);
xfree (rects);
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);
if (!putGC)
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)
{
FreeScratchGC(putGC);
@ -1084,7 +1085,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{
register PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth);
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
if (!pPixmap)
return NullPixmap;

View File

@ -602,7 +602,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events)
if (client->clientGone)
return;
pev = pEvents = (xSyncCounterNotifyEvent *)
ALLOCATE_LOCAL(num_events * sizeof(xSyncCounterNotifyEvent));
xalloc(num_events * sizeof(xSyncCounterNotifyEvent));
if (!pEvents)
return;
UpdateCurrentTime();
@ -623,7 +623,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events)
}
/* swapping will be taken care of by this */
WriteEventsToClient(client, num_events, (xEvent *)pEvents);
DEALLOCATE_LOCAL(pEvents);
xfree(pEvents);
}
@ -733,7 +733,7 @@ SyncAwaitTriggerFired(pTrigger)
pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader;
numwaits = pAwaitUnion->header.num_waitconditions;
ppAwait = (SyncAwait **)ALLOCATE_LOCAL(numwaits * sizeof(SyncAwait *));
ppAwait = (SyncAwait **)xalloc(numwaits * sizeof(SyncAwait *));
if (!ppAwait)
goto bail;
@ -802,7 +802,7 @@ SyncAwaitTriggerFired(pTrigger)
if (num_events)
SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait,
num_events);
DEALLOCATE_LOCAL(ppAwait);
xfree(ppAwait);
bail:
/* unblock the client */
@ -1397,7 +1397,7 @@ ProcSyncListSystemCounters(client)
if (len)
{
walklist = list = (xSyncSystemCounter *) ALLOCATE_LOCAL(len);
walklist = list = (xSyncSystemCounter *) xalloc(len);
if (!list)
return BadAlloc;
}
@ -1443,7 +1443,7 @@ ProcSyncListSystemCounters(client)
if (len)
{
WriteToClient(client, len, (char *) list);
DEALLOCATE_LOCAL(list);
xfree(list);
}
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 */
pRects = (xRectangle *)ALLOCATE_LOCAL(nRects * sizeof(xRectangle *));
pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle *));
if (!pRects)
{
failed = TRUE;
@ -513,7 +513,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
*/
bzero(pBuf, (int)(widthBytesLine * h));
}
if (pRects) DEALLOCATE_LOCAL(pRects);
if (pRects) xfree(pRects);
if (pScratchGC) FreeScratchGC(pScratchGC);
if (pPix) FreeScratchPixmapHeader(pPix);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -133,7 +133,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc)
pbox = REGION_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);
return;
@ -148,7 +148,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc)
cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
GXcopy, &rgnDst, pptSrc, ~0L);
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
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;
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)
return 0;

View File

@ -177,7 +177,8 @@ device_added(LibHalContext *hal_ctx, const char *udi)
if (strcmp(props[i], "input.keys") == 0 ||
strcmp(props[i], "input.keyboard") == 0)
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;
}
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)]),
[ XKBOUTPUT="$withval" ],
[ 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)]),
[ SERVERCONFIG="$withval" ],
[ SERVERCONFIG="${libdir}/xserver" ])
@ -1019,13 +1016,7 @@ if test "x$XDMAUTH" = xyes; then
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(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(SERVERCONFIGdir, SERVERCONFIG, [Server config path])
AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path])
@ -1061,7 +1052,6 @@ else
fi
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(XTEST, 1, [Support XTest 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([extdir])
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
AM_CONDITIONAL([XORG], [test "x$XORG" = 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([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = 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
test "x$MFB" = xauto && MFB="$XORG"

View File

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

View File

@ -744,7 +744,7 @@ UpdateColors (ColormapPtr pmap)
pVisual = pmap->pVisual;
size = pVisual->ColormapEntries;
defs = (xColorItem *)ALLOCATE_LOCAL(size * sizeof(xColorItem));
defs = (xColorItem *)xalloc(size * sizeof(xColorItem));
if (!defs)
return;
n = 0;
@ -794,7 +794,7 @@ UpdateColors (ColormapPtr pmap)
}
if (n)
(*pmap->pScreen->StoreColors)(pmap, n, defs);
DEALLOCATE_LOCAL(defs);
xfree(defs);
}
/* 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++)
*p = 0;
ppixRed = (Pixel *)ALLOCATE_LOCAL(npixR * sizeof(Pixel));
ppixGreen = (Pixel *)ALLOCATE_LOCAL(npixG * sizeof(Pixel));
ppixBlue = (Pixel *)ALLOCATE_LOCAL(npixB * sizeof(Pixel));
ppixRed = (Pixel *)xalloc(npixR * sizeof(Pixel));
ppixGreen = (Pixel *)xalloc(npixG * sizeof(Pixel));
ppixBlue = (Pixel *)xalloc(npixB * sizeof(Pixel));
if (!ppixRed || !ppixGreen || !ppixBlue)
{
if (ppixBlue) DEALLOCATE_LOCAL(ppixBlue);
if (ppixGreen) DEALLOCATE_LOCAL(ppixGreen);
if (ppixRed) DEALLOCATE_LOCAL(ppixRed);
if (ppixBlue) xfree(ppixBlue);
if (ppixGreen) xfree(ppixGreen);
if (ppixRed) xfree(ppixRed);
return(BadAlloc);
}
@ -1790,9 +1790,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
if (okB)
for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++)
pmap->blue[*ppix].refcnt = 0;
DEALLOCATE_LOCAL(ppixBlue);
DEALLOCATE_LOCAL(ppixGreen);
DEALLOCATE_LOCAL(ppixRed);
xfree(ppixBlue);
xfree(ppixGreen);
xfree(ppixRed);
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++)
*pDst |= ALPHAMASK(pmap->pVisual);
DEALLOCATE_LOCAL(ppixBlue);
DEALLOCATE_LOCAL(ppixGreen);
DEALLOCATE_LOCAL(ppixRed);
xfree(ppixBlue);
xfree(ppixGreen);
xfree(ppixRed);
return (Success);
}
@ -1852,7 +1852,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
npix = c << r;
if ((r >= 32) || (npix > pmap->freeRed) || (npix < c))
return(BadAlloc);
if(!(ppixTemp = (Pixel *)ALLOCATE_LOCAL(npix * sizeof(Pixel))))
if(!(ppixTemp = (Pixel *)xalloc(npix * sizeof(Pixel))))
return(BadAlloc);
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->freeRed -= npix;
}
DEALLOCATE_LOCAL(ppixTemp);
xfree(ppixTemp);
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);
npixShared = (c << r) + (c << g) + (c << b);
psharedList = (SHAREDCOLOR **)ALLOCATE_LOCAL(npixShared *
psharedList = (SHAREDCOLOR **)xalloc(npixShared *
sizeof(SHAREDCOLOR *));
if (!psharedList)
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;
}
@ -2672,7 +2672,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
Colormap *pmaps;
int imap, nummaps, found;
pmaps = (Colormap *) ALLOCATE_LOCAL(
pmaps = (Colormap *) xalloc(
pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap));
if(!pmaps)
return(FALSE);
@ -2687,6 +2687,6 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
break;
}
}
DEALLOCATE_LOCAL(pmaps);
xfree(pmaps);
return (found);
}

View File

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

View File

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

View File

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

View File

@ -1098,9 +1098,10 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
#endif
sprite.hotPhys.x = XE_KBPTR.rootX;
sprite.hotPhys.y = XE_KBPTR.rootY;
/* do motion compression */
/* do motion compression, but not if from different devices */
if (tail &&
(tail->event->u.u.type == MotionNotify) &&
(tail->device == device) &&
(tail->pScreen == sprite.hotPhys.pScreen))
{
tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x;
@ -3174,7 +3175,7 @@ drawable.id:0;
#ifdef XKB
/* 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
CoreProcessKeyEvent to be called, as in for example Mouse Keys.
the device's processInputProc to be called, as in for example Mouse Keys.
*/
void
FixKeyState (xEvent *xE, DeviceIntPtr keybd)
@ -3187,22 +3188,19 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd)
kptr = &keyc->down[key >> 3];
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,
(xE->u.u.type==KeyPress?"down":"up"));
(((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress))?"down":"up"));
}
switch (xE->u.u.type)
{
case KeyPress:
if (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress)
*kptr |= bit;
break;
case KeyRelease:
else if (xE->u.u.type == KeyRelease || xE->u.u.type == DeviceKeyRelease)
*kptr &= ~bit;
break;
default:
FatalError("Impossible keyboard event");
}
else
FatalError("Impossible keyboard event");
}
#endif

View File

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

View File

@ -677,7 +677,7 @@ CreateDefaultTile (GCPtr pGC)
(*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen);
pTile = (PixmapPtr)
(*pGC->pScreen->CreatePixmap)(pGC->pScreen,
w, h, pGC->depth);
w, h, pGC->depth, 0);
pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
if (!pTile || !pgcScratch)
{
@ -1020,7 +1020,7 @@ CreateDefaultStipple(int screenNum)
h = 16;
(* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen);
if (!(pScreen->PixmapPerDepth[0] =
(*pScreen->CreatePixmap)(pScreen, w, h, 1)))
(*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
return FALSE;
/* fill stipple with 1 */
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
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,
* you could get unbalanced events here. */
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 ||
pDev->key->modifierMap[key_code] ||
!(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3]
& (1 << (key_code & 7))))
!key_autorepeats(pDev, key_code) ||
pDev->key->modifierMap[key_code])
return 0;
#ifdef XKB

View File

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

View File

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

View File

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

View File

@ -440,6 +440,8 @@ main(int argc, char *argv[], char *envp[])
}
}
NotifyParentProcess();
Dispatch();
/* 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;
else
/* 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 ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -497,7 +497,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu)) {
xRectangle *rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
xRectangle *rects = xalloc(nbox * sizeof(xRectangle));
if (rects) {
int i;
@ -510,7 +510,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
}
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;
}
prect = ALLOCATE_LOCAL(sizeof(xRectangle) * npt);
prect = xalloc(sizeof(xRectangle) * npt);
for (i = 0; i < npt; i++) {
prect[i].x = ppt[i].x;
prect[i].y = ppt[i].y;
@ -631,7 +631,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
prect[i].height = 1;
}
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;
}
prect = ALLOCATE_LOCAL(sizeof(xRectangle) * (npt - 1));
prect = xalloc(sizeof(xRectangle) * (npt - 1));
x1 = ppt[0].x;
y1 = ppt[0].y;
/* 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) {
DEALLOCATE_LOCAL(prect);
xfree(prect);
ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
return;
}
@ -692,7 +692,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
y1 = y2;
}
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++) {
if (pSeg[i].x1 < pSeg[i].x2) {
prect[i].x = pSeg[i].x1;
@ -741,7 +741,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
}
}
pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect);
DEALLOCATE_LOCAL(prect);
xfree(prect);
}
static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -272,7 +272,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
* (BitsPerPixel(depth) >> 3));
if (!pBits) return FALSE;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap) {
xfree(pBits);
return FALSE;
@ -491,7 +491,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
DBG("StoreColors\n");
expanddefs = ALLOCATE_LOCAL(sizeof(xColorItem)
expanddefs = xalloc(sizeof(xColorItem)
* (1 << pScrPriv->myDepth));
if (!expanddefs) return;
@ -518,7 +518,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
pColors++;
}
DEALLOCATE_LOCAL(expanddefs);
xfree(expanddefs);
pCmapPriv->dirty = TRUE;
pScrPriv->colormapDirty = TRUE;
@ -556,9 +556,9 @@ xxInstallColormap(ColormapPtr pmap)
wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap);
}
pixels = ALLOCATE_LOCAL(sizeof(Pixel) * (1 << pScrPriv->myDepth));
colors = ALLOCATE_LOCAL(sizeof(xrgb) * (1 << pScrPriv->myDepth));
defs = ALLOCATE_LOCAL(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
pixels = xalloc(sizeof(Pixel) * (1 << pScrPriv->myDepth));
colors = xalloc(sizeof(xrgb) * (1 << pScrPriv->myDepth));
defs = xalloc(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
if (!pixels || !colors)
return;
@ -586,9 +586,9 @@ xxInstallColormap(ColormapPtr pmap)
}
xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs);
DEALLOCATE_LOCAL(pixels);
DEALLOCATE_LOCAL(colors);
DEALLOCATE_LOCAL(defs);
xfree(pixels);
xfree(colors);
xfree(defs);
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__
.SH NAME
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 quartzHasRoot, quartzEnableRootless;
#define APP_PREFS "org.x.x11"
#define APP_PREFS "org.x.X11"
#define PREFS_APPSMENU "apps_menu"
#define PREFS_FAKEBUTTONS "enable_fake_buttons"

View File

@ -45,7 +45,7 @@
#include <unistd.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 quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
@ -311,6 +311,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
[NSApp activateIgnoringOtherApps:YES];
if ([self modalWindow] == nil) [self activateX:YES];
QuartzMessageServerThread(kXDarwinBringAllToFront, 0);
}
- (void) set_can_quit:(NSNumber *)state {

View File

@ -1,5 +1,4 @@
/* 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.
@ -294,26 +293,17 @@
- (void) launch_client:(NSString *)filename
{
const char *command = [filename UTF8String];
const char *shell;
const char *argv[5];
const char *argv[7];
int child1, child2 = 0;
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[1] = "-fp";
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 */

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>
<head>
<title>XDarwin Help</title>

View File

@ -1,5 +1,4 @@
/* English versions of the Info.plist keys; used by most localizations. */
/* 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__;

View File

@ -1,5 +1,4 @@
/* 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 */
"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>
<head>
<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>
<head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
<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>
<head>
<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>
<title>XDarwin Help</title>
</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>
<head>
<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>
<head>
<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>
<head>
<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 launched from the Finder.
XCOMM
XCOMM $XFree86: $
userclientrc=$HOME/.xinitrc
sysclientrc=XINITDIR/xinitrc

View File

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

View File

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

View File

@ -30,7 +30,6 @@
* sale, use or other dealings in this Software without prior written
* 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>

View File

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

View File

@ -1,7 +1,6 @@
/*
* Cocoa rootless implementation functions for AppleWM extension
*/
/*
*
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
*
* 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,
* 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>

View File

@ -1,7 +1,6 @@
/*
* Cocoa rootless implementation frame functions
*/
/*
*
* Copyright (c) 2001 Greg Parker. 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,
* 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>

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
*/
/*
*
* Copyright (c) 2001 Greg Parker. 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,
* 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>

View File

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

View File

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

View File

@ -1,9 +1,7 @@
/**************************************************************
/*
*
* Quartz-specific support for the Darwin X Server
*
**************************************************************/
/*
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons.
* All Rights Reserved.
*
@ -64,7 +62,7 @@ int quartzServerVisible = TRUE;
int quartzServerQuitting = FALSE;
DevPrivateKey quartzScreenKey = &quartzScreenKey;
int aquaMenuBarHeight = 0;
int noPseudoramiXExtension = TRUE;
int noPseudoramiXExtension = FALSE;
QuartzModeProcsPtr quartzProcs = NULL;
const char *quartzOpenGLBundle = NULL;
@ -389,11 +387,22 @@ void DarwinModeProcessEvent(
QuartzUpdateScreens();
break;
case kXDarwinWindowState:
case kXDarwinWindowMoved:
// FIXME: Not implemented yet
case kXDarwinBringAllToFront:
RootlessOrderAllWindows();
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:
ErrorF("Unknown application defined event type %d.\n",
xe->u.u.type);

View File

@ -3,8 +3,7 @@
*
* External interface of the Quartz display modes seen by the generic, mode
* independent parts of the Darwin X server.
*/
/*
*
* Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
* 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
@ -7,8 +6,6 @@
* This file is separate from the parts of Quartz support
* that use X include files to avoid symbol collisions.
*
**************************************************************/
/*
* Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
* All Rights Reserved.
*
@ -34,7 +31,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* 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 "quartzCommon.h"
@ -45,14 +42,16 @@
#include <Cocoa/Cocoa.h>
#ifndef INXQUARTZ
#import "Preferences.h"
#endif
#include "pseudoramiX.h"
extern void FatalError(const char *, ...);
extern char *display;
extern int noPanoramiXExtension;
#ifndef INXQUARTZ
/*
* QuartzReadPreferences
* Read the user preferences from the Cocoa front end.
@ -98,7 +97,7 @@ void QuartzReadPreferences(void)
darwinDesiredDepth = [Preferences depth] - 1;
}
#endif
/*
* QuartzWriteCocoaPasteboard
@ -163,6 +162,7 @@ char *QuartzReadCocoaPasteboard(void)
int QuartzFSUseQDCursor(
int depth) // screen depth
{
#ifndef INXQUARTZ
switch ([Preferences useQDCursor]) {
case qdCursor_Always:
return TRUE;
@ -174,6 +174,7 @@ int QuartzFSUseQDCursor(
else
return FALSE;
}
#endif
return TRUE;
}

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