Merge remote branch 'jamey/cleanups'

This commit is contained in:
Keith Packard 2010-05-13 18:22:49 -07:00
commit 795432d4a9
84 changed files with 864 additions and 1116 deletions

View File

@ -76,5 +76,5 @@ ProcBigReqDispatch (ClientPtr client)
swapl(&rep.max_request_size, n); swapl(&rep.max_request_size, n);
} }
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep); WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
return(client->noClientException); return Success;
} }

View File

@ -61,7 +61,7 @@ ProcDPMSGetVersion(ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -82,7 +82,7 @@ ProcDPMSCapable(ClientPtr client)
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
} }
WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -108,7 +108,7 @@ ProcDPMSGetTimeouts(ClientPtr client)
swaps(&rep.off, n); swaps(&rep.off, n);
} }
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -134,7 +134,7 @@ ProcDPMSSetTimeouts(ClientPtr client)
DPMSOffTime = stuff->off * MILLI_PER_SECOND; DPMSOffTime = stuff->off * MILLI_PER_SECOND;
SetScreenSaverTimer(); SetScreenSaverTimer();
return(client->noClientException); return Success;
} }
static int static int
@ -150,7 +150,7 @@ ProcDPMSEnable(ClientPtr client)
SetScreenSaverTimer(); SetScreenSaverTimer();
} }
return(client->noClientException); return Success;
} }
static int static int
@ -164,7 +164,7 @@ ProcDPMSDisable(ClientPtr client)
DPMSEnabled = FALSE; DPMSEnabled = FALSE;
return(client->noClientException); return Success;
} }
static int static int
@ -187,7 +187,7 @@ ProcDPMSForceLevel(ClientPtr client)
DPMSSet(client, stuff->level); DPMSSet(client, stuff->level);
return(client->noClientException); return Success;
} }
static int static int
@ -210,7 +210,7 @@ ProcDPMSInfo(ClientPtr client)
swaps(&rep.power_level, n); swaps(&rep.power_level, n);
} }
WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int

View File

@ -91,7 +91,7 @@ ProcGEQueryVersion(ClientPtr client)
} }
WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep); WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
return(client->noClientException); return Success;
} }
int (*ProcGEVector[GENumberRequests])(ClientPtr) = { int (*ProcGEVector[GENumberRequests])(ClientPtr) = {

View File

@ -917,7 +917,7 @@ ProcPanoramiXQueryVersion (ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
int int
@ -944,7 +944,7 @@ ProcPanoramiXGetState(ClientPtr client)
swapl (&rep.window, n); swapl (&rep.window, n);
} }
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
return client->noClientException; return Success;
} }
@ -972,7 +972,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
swapl (&rep.window, n); swapl (&rep.window, n);
} }
WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
return client->noClientException; return Success;
} }
int int
@ -1008,7 +1008,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
swapl (&rep.screen, n); swapl (&rep.screen, n);
} }
WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
return client->noClientException; return Success;
} }
@ -1039,7 +1039,7 @@ ProcXineramaIsActive(ClientPtr client)
swapl (&rep.state, n); swapl (&rep.state, n);
} }
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
return client->noClientException; return Success;
} }
@ -1084,7 +1084,7 @@ ProcXineramaQueryScreens(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }

View File

@ -52,13 +52,6 @@ Equipment Corporation.
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ #define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
CWDontPropagate | CWOverrideRedirect | CWCursor ) CWDontPropagate | CWOverrideRedirect | CWCursor )
/* Various of the DIX function interfaces were not designed to allow
* the client->errorValue to be set on BadValue and other errors.
* Rather than changing interfaces and breaking untold code we introduce
* a new global that dispatch can use.
*/
extern XID clientErrorValue; /* XXX this is a kludge */
int PanoramiXCreateWindow(ClientPtr client) int PanoramiXCreateWindow(ClientPtr client)
{ {
PanoramiXRes *parent, *newWin; PanoramiXRes *parent, *newWin;
@ -579,7 +572,7 @@ int PanoramiXGetGeometry(ClientPtr client)
} }
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
return (client->noClientException); return Success;
} }
int PanoramiXTranslateCoords(ClientPtr client) int PanoramiXTranslateCoords(ClientPtr client)
@ -649,7 +642,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
} }
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
return(client->noClientException); return Success;
} }
int PanoramiXCreatePixmap(ClientPtr client) int PanoramiXCreatePixmap(ClientPtr client)
@ -1088,8 +1081,6 @@ int PanoramiXCopyArea(ClientPtr client)
} }
free(data); free(data);
result = Success;
} else { } else {
DrawablePtr pDst = NULL, pSrc = NULL; DrawablePtr pDst = NULL, pSrc = NULL;
GCPtr pGC = NULL; GCPtr pGC = NULL;
@ -1157,11 +1148,9 @@ int PanoramiXCopyArea(ClientPtr client)
client, &totalReg, stuff->dstDrawable, X_CopyArea, 0); client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
REGION_UNINIT(pScreen, &totalReg); REGION_UNINIT(pScreen, &totalReg);
} }
result = client->noClientException;
} }
return (result); return Success;
} }
@ -1271,7 +1260,7 @@ int PanoramiXCopyPlane(ClientPtr client)
REGION_UNINIT(pScreen, &totalReg); REGION_UNINIT(pScreen, &totalReg);
} }
return (client->noClientException); return Success;
} }
@ -1331,7 +1320,7 @@ int PanoramiXPolyPoint(ClientPtr client)
free(origPts); free(origPts);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1391,7 +1380,7 @@ int PanoramiXPolyLine(ClientPtr client)
free(origPts); free(origPts);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1454,7 +1443,7 @@ int PanoramiXPolySegment(ClientPtr client)
free(origSegs); free(origSegs);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1516,7 +1505,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
free(origRecs); free(origRecs);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1576,7 +1565,7 @@ int PanoramiXPolyArc(ClientPtr client)
free(origArcs); free(origArcs);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1637,7 +1626,7 @@ int PanoramiXFillPoly(ClientPtr client)
free(locPts); free(locPts);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1698,7 +1687,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
free(origRects); free(origRects);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1759,7 +1748,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
free(origArcs); free(origArcs);
return (result); return (result);
} else } else
return (client->noClientException); return Success;
} }
@ -1954,7 +1943,7 @@ int PanoramiXGetImage(ClientPtr client)
} }
} }
free(pBuf); free(pBuf);
return (client->noClientException); return Success;
} }

View File

@ -737,7 +737,7 @@ ProcScreenSaverQueryVersion (ClientPtr client)
swapl(&rep.length, n); swapl(&rep.length, n);
} }
WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -813,7 +813,7 @@ ProcScreenSaverQueryInfo (ClientPtr client)
swapl (&rep.eventMask, n); swapl (&rep.eventMask, n);
} }
WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep); WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -1415,7 +1415,7 @@ ProcScreenSaverSuspend (ClientPtr client)
FreeScreenSaverTimer(); FreeScreenSaverTimer();
} }
return (client->noClientException); return Success;
} }
static DISPATCH_PROC((*NormalVector[])) = { static DISPATCH_PROC((*NormalVector[])) = {

View File

@ -383,7 +383,7 @@ ProcSecurityQueryVersion(
} }
(void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
(char *)&rep); (char *)&rep);
return (client->noClientException); return Success;
} /* ProcSecurityQueryVersion */ } /* ProcSecurityQueryVersion */
@ -604,10 +604,7 @@ ProcSecurityGenerateAuthorization(
pAuth->group, eventMask); pAuth->group, eventMask);
/* the request succeeded; don't call RemoveAuthorization or free pAuth */ /* the request succeeded; don't call RemoveAuthorization or free pAuth */
return Success;
removeAuth = FALSE;
pAuth = NULL;
err = client->noClientException;
bailout: bailout:
if (removeAuth) if (removeAuth)

View File

@ -269,7 +269,7 @@ ProcShapeQueryVersion (ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
/***************** /*****************
@ -736,7 +736,7 @@ ProcShapeQueryExtents (ClientPtr client)
swaps(&rep.heightClipShape, n); swaps(&rep.heightClipShape, n);
} }
WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep); WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
return (client->noClientException); return Success;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -996,7 +996,7 @@ ProcShapeInputSelected (ClientPtr client)
swapl (&rep.length, n); swapl (&rep.length, n);
} }
WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep); WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
return (client->noClientException); return Success;
} }
static int static int
@ -1081,7 +1081,7 @@ ProcShapeGetRectangles (ClientPtr client)
WriteToClient (client, sizeof (rep), (char *) &rep); WriteToClient (client, sizeof (rep), (char *) &rep);
WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects); WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
free(rects); free(rects);
return client->noClientException; return Success;
} }
static int static int

View File

@ -359,7 +359,7 @@ ProcShmQueryVersion(ClientPtr client)
swaps(&rep.gid, n); swaps(&rep.gid, n);
} }
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
/* /*
@ -485,7 +485,7 @@ ProcShmAttach(ClientPtr client)
} }
if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -515,7 +515,7 @@ ProcShmDetach(ClientPtr client)
REQUEST_SIZE_MATCH(xShmDetachReq); REQUEST_SIZE_MATCH(xShmDetachReq);
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
FreeResource(stuff->shmseg, RT_NONE); FreeResource(stuff->shmseg, RT_NONE);
return(client->noClientException); return Success;
} }
/* /*
@ -601,7 +601,7 @@ ProcPanoramiXShmPutImage(ClientPtr client)
stuff->dstY = orig_y - panoramiXdataPtr[j].y; stuff->dstY = orig_y - panoramiXdataPtr[j].y;
} }
result = ProcShmPutImage(client); result = ProcShmPutImage(client);
if(result != client->noClientException) break; if(result != Success) break;
} }
return(result); return(result);
} }
@ -733,7 +733,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
} }
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
return(client->noClientException); return Success;
} }
static int static int
@ -804,7 +804,7 @@ CreatePmap:
for(j = 1; j < PanoramiXNumScreens; j++) for(j = 1; j < PanoramiXNumScreens; j++)
newPix->info[j].id = FakeClientID(client->index); newPix->info[j].id = FakeClientID(client->index);
result = (client->noClientException); result = Success;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
ShmScrPrivateRec *screen_priv; ShmScrPrivateRec *screen_priv;
@ -951,7 +951,7 @@ ProcShmPutImage(ClientPtr client)
WriteEventsToClient(client, 1, (xEvent *) &ev); WriteEventsToClient(client, 1, (xEvent *) &ev);
} }
return (client->noClientException); return Success;
} }
@ -1065,7 +1065,7 @@ ProcShmGetImage(ClientPtr client)
} }
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
return(client->noClientException); return Success;
} }
static PixmapPtr static PixmapPtr
@ -1162,7 +1162,7 @@ CreatePmap:
pMap->drawable.id = stuff->pid; pMap->drawable.id = stuff->pid;
if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
{ {
return(client->noClientException); return Success;
} }
pDraw->pScreen->DestroyPixmap(pMap); pDraw->pScreen->DestroyPixmap(pMap);
} }

View File

@ -1146,7 +1146,7 @@ ProcSyncInitialize(ClientPtr client)
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
} }
WriteToClient(client, sizeof(rep), (char *) &rep); WriteToClient(client, sizeof(rep), (char *) &rep);
return client->noClientException; return Success;
} }
/* /*
@ -1223,7 +1223,7 @@ ProcSyncListSystemCounters(ClientPtr client)
free(list); free(list);
} }
return client->noClientException; return Success;
} }
/* /*
@ -1297,7 +1297,7 @@ ProcSyncGetPriority(ClientPtr client)
WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
return client->noClientException; return Success;
} }
/* /*
@ -1317,7 +1317,7 @@ ProcSyncCreateCounter(ClientPtr client)
if (!SyncCreateCounter(client, stuff->cid, initial)) if (!SyncCreateCounter(client, stuff->cid, initial))
return BadAlloc; return BadAlloc;
return client->noClientException; return Success;
} }
/* /*
@ -1569,7 +1569,7 @@ ProcSyncQueryCounter(ClientPtr client)
swapl(&rep.value_lo, n); swapl(&rep.value_lo, n);
} }
WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
return client->noClientException; return Success;
} }
@ -1749,7 +1749,7 @@ ProcSyncQueryAlarm(ClientPtr client)
} }
WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
return client->noClientException; return Success;
} }
static int static int
@ -1767,7 +1767,7 @@ ProcSyncDestroyAlarm(ClientPtr client)
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc; return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc;
FreeResource(stuff->alarm, RT_NONE); FreeResource(stuff->alarm, RT_NONE);
return client->noClientException; return Success;
} }
/* /*

View File

@ -90,7 +90,7 @@ ProcXCalibrateQueryVersion (ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof (xXCalibrateQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xXCalibrateQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -160,7 +160,7 @@ ProcXCalibrateSetRawMode (ClientPtr client)
swaps (&rep.status, n); swaps (&rep.status, n);
} }
WriteToClient(client, sizeof (rep), (char *) &rep); WriteToClient(client, sizeof (rep), (char *) &rep);
return (client->noClientException); return Success;
} }
static int static int
@ -200,7 +200,7 @@ ProcXCalibrateScreenToCoord (ClientPtr client)
swaps (&rep.y, n); swaps (&rep.y, n);
} }
WriteToClient(client, sizeof (rep), (char *) &rep); WriteToClient(client, sizeof (rep), (char *) &rep);
return (client->noClientException); return Success;
} }
static int static int

View File

@ -83,7 +83,7 @@ ProcXCMiscGetVersion(ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -106,7 +106,7 @@ ProcXCMiscGetXIDRange(ClientPtr client)
swapl(&rep.count, n); swapl(&rep.count, n);
} }
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep); WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -145,7 +145,7 @@ ProcXCMiscGetXIDList(ClientPtr client)
WriteSwappedDataToClient(client, count * sizeof(XID), pids); WriteSwappedDataToClient(client, count * sizeof(XID), pids);
} }
free(pids); free(pids);
return(client->noClientException); return Success;
} }
static int static int

View File

@ -368,7 +368,7 @@ ProcXF86BigfontQueryVersion(
} }
WriteToClient(client, WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply); sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
return client->noClientException; return Success;
} }
static void static void
@ -698,7 +698,7 @@ ProcXF86BigfontQueryFont(
if (shmid == -1) free(pIndex2UniqIndex); if (shmid == -1) free(pIndex2UniqIndex);
if (!pDesc) free(pCI); if (!pDesc) free(pCI);
} }
return (client->noClientException); return Success;
} }
} }

View File

@ -50,7 +50,7 @@ ProcXResQueryVersion (ClientPtr client)
swaps(&rep.server_minor, n); swaps(&rep.server_minor, n);
} }
WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -103,7 +103,7 @@ ProcXResQueryClients (ClientPtr client)
free(current_clients); free(current_clients);
return (client->noClientException); return Success;
} }
@ -184,7 +184,7 @@ ProcXResQueryClientResources (ClientPtr client)
free(counts); free(counts);
return (client->noClientException); return Success;
} }
static unsigned long static unsigned long
@ -295,7 +295,7 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
} }
WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep); WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
return (client->noClientException); return Success;
} }
static int static int

View File

@ -78,7 +78,7 @@ ProcSELinuxQueryVersion(ClientPtr client)
swaps(&rep.server_minor, n); swaps(&rep.server_minor, n);
} }
WriteToClient(client, sizeof(rep), (char *)&rep); WriteToClient(client, sizeof(rep), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -109,7 +109,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep); WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep);
WriteToClient(client, len, ctx); WriteToClient(client, len, ctx);
freecon(ctx); freecon(ctx);
return client->noClientException; return Success;
} }
static int static int
@ -390,7 +390,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
WriteToClient(client, size * 4, (char *)buf); WriteToClient(client, size * 4, (char *)buf);
/* Free stuff and return */ /* Free stuff and return */
rc = client->noClientException; rc = Success;
free(buf); free(buf);
out: out:
SELinuxFreeItems(items, count); SELinuxFreeItems(items, count);

View File

@ -126,7 +126,7 @@ ProcXTestGetVersion(ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -164,7 +164,7 @@ ProcXTestCompareCursor(ClientPtr client)
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
} }
WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep); WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -457,7 +457,7 @@ ProcXTestFakeInput(ClientPtr client)
if (need_ptr_update) if (need_ptr_update)
miPointerUpdateSprite(dev); miPointerUpdateSprite(dev);
return client->noClientException; return Success;
} }
static int static int
@ -475,7 +475,7 @@ ProcXTestGrabControl(ClientPtr client)
MakeClientGrabImpervious(client); MakeClientGrabImpervious(client);
else else
MakeClientGrabPervious(client); MakeClientGrabPervious(client);
return(client->noClientException); return Success;
} }
static int static int

View File

@ -460,7 +460,7 @@ ProcXvQueryAdaptors(ClientPtr client)
} }
return (client->noClientException); return Success;
} }
static int static int
@ -520,7 +520,7 @@ ProcXvQueryEncodings(ClientPtr client)
pe++; pe++;
} }
return (client->noClientException); return Success;
} }
static int static int

View File

@ -126,8 +126,6 @@ unsigned long XvRTPortNotify;
/* EXTERNAL */ /* EXTERNAL */
extern XID clientErrorValue;
static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *); static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *); static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
static Bool CreateResourceTypes(void); static Bool CreateResourceTypes(void);

View File

@ -1851,7 +1851,7 @@ ChangeKeyMapping(ClientPtr client,
XkbApplyMappingChange(dev, &keysyms, firstKeyCode, keyCodes, NULL, XkbApplyMappingChange(dev, &keysyms, firstKeyCode, keyCodes, NULL,
serverClient); serverClient);
return client->noClientException; return Success;
} }
static void static void

View File

@ -497,10 +497,11 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
*/ */
if (pGC) if (pGC)
{ {
XID val = IncludeInferiors; ChangeGCVal val;
val.val = IncludeInferiors;
ValidateGC(&pPixmap->drawable, pGC); ValidateGC(&pPixmap->drawable, pGC);
dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); ChangeGC (serverClient, pGC, GCSubwindowMode, &val);
(*pGC->ops->CopyArea) (&pParent->drawable, (*pGC->ops->CopyArea) (&pParent->drawable,
&pPixmap->drawable, &pPixmap->drawable,
pGC, pGC,

View File

@ -132,7 +132,7 @@ ProcCompositeQueryVersion (ClientPtr client)
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} }
#define VERIFY_WINDOW(pWindow, wid, client, mode) \ #define VERIFY_WINDOW(pWindow, wid, client, mode) \
@ -226,7 +226,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client)
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
static int static int
@ -265,7 +265,7 @@ ProcCompositeNameWindowPixmap (ClientPtr client)
if (!AddResource (stuff->pixmap, RT_PIXMAP, (pointer) pPixmap)) if (!AddResource (stuff->pixmap, RT_PIXMAP, (pointer) pPixmap))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
@ -325,7 +325,7 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
} }
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
return client->noClientException; return Success;
} }
static int static int
@ -351,7 +351,7 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
/* The delete function will free the client structure */ /* The delete function will free the client structure */
FreeResource (pOc->resource, RT_NONE); FreeResource (pOc->resource, RT_NONE);
return client->noClientException; return Success;
} }
static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {

View File

@ -162,7 +162,7 @@ ProcDamageQueryVersion(ClientPtr client)
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} }
static int static int
@ -231,7 +231,7 @@ ProcDamageCreate (ClientPtr client)
DamageRegionAppend(pDrawable, pRegion); DamageRegionAppend(pDrawable, pRegion);
} }
return (client->noClientException); return Success;
} }
static int static int
@ -243,7 +243,7 @@ ProcDamageDestroy (ClientPtr client)
REQUEST_SIZE_MATCH(xDamageDestroyReq); REQUEST_SIZE_MATCH(xDamageDestroyReq);
VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess); VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess);
FreeResource (stuff->damage, RT_NONE); FreeResource (stuff->damage, RT_NONE);
return (client->noClientException); return Success;
} }
static int static int
@ -276,7 +276,7 @@ ProcDamageSubtract (ClientPtr client)
DamageEmpty (pDamage); DamageEmpty (pDamage);
} }
} }
return (client->noClientException); return Success;
} }
static int static int
@ -301,7 +301,7 @@ ProcDamageAdd (ClientPtr client)
DamageRegionAppend(pDrawable, pRegion); DamageRegionAppend(pDrawable, pRegion);
REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y); REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y);
return (client->noClientException); return Success;
} }
/* Major version controls available requests */ /* Major version controls available requests */

View File

@ -147,7 +147,7 @@ ProcDbeGetVersion(ClientPtr client)
WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} /* ProcDbeGetVersion() */ } /* ProcDbeGetVersion() */
@ -810,7 +810,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
free(pDrawables); free(pDrawables);
} }
return(client->noClientException); return Success;
} /* ProcDbeGetVisualInfo() */ } /* ProcDbeGetVisualInfo() */
@ -866,7 +866,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
(char *)&rep); (char *)&rep);
return(client->noClientException); return Success;
} /* ProcDbeGetbackBufferAttributes() */ } /* ProcDbeGetbackBufferAttributes() */
@ -1283,7 +1283,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
return(FALSE); return(FALSE);
} }
return dixChangeGC(NullClient, pGC, gcmask, NULL, gcvalues) == 0; return ChangeGC(NullClient, pGC, gcmask, gcvalues) == 0;
} /* DbeSetupBackgroundPainter() */ } /* DbeSetupBackgroundPainter() */

View File

@ -65,8 +65,6 @@ SOFTWARE.
#include "privates.h" #include "privates.h"
#include "xace.h" #include "xace.h"
extern XID clientErrorValue;
static Pixel FindBestPixel( static Pixel FindBestPixel(
EntryPtr /*pentFirst*/, EntryPtr /*pentFirst*/,
int /*size*/, int /*size*/,
@ -1415,7 +1413,7 @@ BlueComp (EntryPtr pent, xrgb *prgb)
/* Read the color value of a cell */ /* Read the color value of a cell */
int int
QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList, ClientPtr client)
{ {
Pixel *ppix, pixel; Pixel *ppix, pixel;
xrgb *prgb; xrgb *prgb;
@ -1438,14 +1436,14 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList)
{ {
pixel = *ppix; pixel = *ppix;
if (pixel & rgbbad) { if (pixel & rgbbad) {
clientErrorValue = pixel; client->errorValue = pixel;
errVal = BadValue; errVal = BadValue;
continue; continue;
} }
i = (pixel & pVisual->redMask) >> pVisual->offsetRed; i = (pixel & pVisual->redMask) >> pVisual->offsetRed;
if (i >= numred) if (i >= numred)
{ {
clientErrorValue = pixel; client->errorValue = pixel;
errVal = BadValue; errVal = BadValue;
continue; continue;
} }
@ -1453,7 +1451,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList)
i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen;
if (i >= numgreen) if (i >= numgreen)
{ {
clientErrorValue = pixel; client->errorValue = pixel;
errVal = BadValue; errVal = BadValue;
continue; continue;
} }
@ -1461,7 +1459,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList)
i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue;
if (i >= numblue) if (i >= numblue)
{ {
clientErrorValue = pixel; client->errorValue = pixel;
errVal = BadValue; errVal = BadValue;
continue; continue;
} }
@ -1475,7 +1473,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList)
pixel = *ppix; pixel = *ppix;
if (pixel >= pVisual->ColormapEntries) if (pixel >= pVisual->ColormapEntries)
{ {
clientErrorValue = pixel; client->errorValue = pixel;
errVal = BadValue; errVal = BadValue;
} }
else else
@ -2238,7 +2236,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask)
} }
if ((mask != rmask) && count) if ((mask != rmask) && count)
{ {
clientErrorValue = *pixels | mask; clients[client]->errorValue = *pixels | mask;
result = BadValue; result = BadValue;
} }
/* XXX should worry about removing any RT_CMAPENTRY resource */ /* XXX should worry about removing any RT_CMAPENTRY resource */
@ -2320,7 +2318,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
pixTest = ((*pptr | bits) & cmask) >> offset; pixTest = ((*pptr | bits) & cmask) >> offset;
if ((pixTest >= numents) || (*pptr & rgbbad)) if ((pixTest >= numents) || (*pptr & rgbbad))
{ {
clientErrorValue = *pptr | bits; clients[client]->errorValue = *pptr | bits;
errVal = BadValue; errVal = BadValue;
continue; continue;
} }
@ -2401,7 +2399,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
/* Redefine color values */ /* Redefine color values */
int int
StoreColors (ColormapPtr pmap, int count, xColorItem *defs) StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client)
{ {
Pixel pix; Pixel pix;
xColorItem *pdef; xColorItem *pdef;
@ -2439,7 +2437,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs)
if (pdef->pixel & rgbbad) if (pdef->pixel & rgbbad)
{ {
errVal = BadValue; errVal = BadValue;
clientErrorValue = pdef->pixel; client->errorValue = pdef->pixel;
continue; continue;
} }
pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed; pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed;
@ -2511,7 +2509,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs)
defs[idef] = defs[n]; defs[idef] = defs[n];
idef++; idef++;
} else } else
clientErrorValue = pdef->pixel; client->errorValue = pdef->pixel;
} }
} }
else else
@ -2522,7 +2520,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs)
ok = TRUE; ok = TRUE;
if (pdef->pixel >= pVisual->ColormapEntries) if (pdef->pixel >= pVisual->ColormapEntries)
{ {
clientErrorValue = pdef->pixel; client->errorValue = pdef->pixel;
errVal = BadValue; errVal = BadValue;
ok = FALSE; ok = FALSE;
} }

View File

@ -1535,7 +1535,7 @@ ProcSetModifierMapping(ClientPtr client)
rep.success = rc; rep.success = rc;
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep); WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
return client->noClientException; return Success;
} }
int int
@ -1561,7 +1561,7 @@ ProcGetModifierMapping(ClientPtr client)
free(modkeymap); free(modkeymap);
return client->noClientException; return Success;
} }
int int
@ -1619,7 +1619,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
stuff->keyCodes, NULL, client); stuff->keyCodes, NULL, client);
} }
return client->noClientException; return Success;
} }
int int
@ -1722,7 +1722,7 @@ ProcGetKeyboardMapping(ClientPtr client)
free(syms->map); free(syms->map);
free(syms); free(syms);
return client->noClientException; return Success;
} }
int int

View File

@ -176,13 +176,6 @@ CallbackListPtr ClientStateCallback;
volatile char dispatchException = 0; volatile char dispatchException = 0;
volatile char isItTimeToYield; volatile char isItTimeToYield;
/* Various of the DIX function interfaces were not designed to allow
* the client->errorValue to be set on BadValue and other errors.
* Rather than changing interfaces and breaking untold code we introduce
* a new global that dispatch can use.
*/
XID clientErrorValue; /* XXX this is a kludge */
#define SAME_SCREENS(a, b) (\ #define SAME_SCREENS(a, b) (\
(a.pScreen == b.pScreen)) (a.pScreen == b.pScreen))
@ -444,16 +437,18 @@ Dispatch(void)
client->sequence, client->index, result); client->sequence, client->index, result);
#endif #endif
if (result != Success) if (client->noClientException != Success)
{ {
if (client->noClientException != Success) CloseDownClient(client);
CloseDownClient(client);
else
SendErrorToClient(client, MAJOROP,
MinorOpcodeOfRequest(client),
client->errorValue, result);
break; break;
} }
else if (result != Success)
{
SendErrorToClient(client, MAJOROP,
MinorOpcodeOfRequest(client),
client->errorValue, result);
break;
}
} }
FlushAllOutput(); FlushAllOutput();
client = clients[clientReady[nready]]; client = clients[clientReady[nready]];
@ -675,10 +670,7 @@ ProcCreateWindow(ClientPtr client)
return BadAlloc; return BadAlloc;
pWin->eventMask = mask; pWin->eventMask = mask;
} }
if (client->noClientException != Success) return rc;
return(client->noClientException);
else
return rc;
} }
int int
@ -686,7 +678,7 @@ ProcChangeWindowAttributes(ClientPtr client)
{ {
WindowPtr pWin; WindowPtr pWin;
REQUEST(xChangeWindowAttributesReq); REQUEST(xChangeWindowAttributesReq);
int result, len, rc; int len, rc;
Mask access_mode = 0; Mask access_mode = 0;
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
@ -698,14 +690,10 @@ ProcChangeWindowAttributes(ClientPtr client)
len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq)); len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq));
if (len != Ones(stuff->valueMask)) if (len != Ones(stuff->valueMask))
return BadLength; return BadLength;
result = ChangeWindowAttributes(pWin, return ChangeWindowAttributes(pWin,
stuff->valueMask, stuff->valueMask,
(XID *) &stuff[1], (XID *) &stuff[1],
client); client);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
int int
@ -723,7 +711,7 @@ ProcGetWindowAttributes(ClientPtr client)
memset(&wa, 0, sizeof(xGetWindowAttributesReply)); memset(&wa, 0, sizeof(xGetWindowAttributesReply));
GetWindowAttributes(pWin, client, &wa); GetWindowAttributes(pWin, client, &wa);
WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa);
return(client->noClientException); return Success;
} }
int int
@ -744,7 +732,7 @@ ProcDestroyWindow(ClientPtr client)
return rc; return rc;
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
} }
return(client->noClientException); return Success;
} }
int int
@ -759,7 +747,7 @@ ProcDestroySubwindows(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
DestroySubwindows(pWin, client); DestroySubwindows(pWin, client);
return(client->noClientException); return Success;
} }
int int
@ -767,7 +755,7 @@ ProcChangeSaveSet(ClientPtr client)
{ {
WindowPtr pWin; WindowPtr pWin;
REQUEST(xChangeSaveSetReq); REQUEST(xChangeSaveSetReq);
int result, rc; int rc;
REQUEST_SIZE_MATCH(xChangeSaveSetReq); REQUEST_SIZE_MATCH(xChangeSaveSetReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
@ -776,18 +764,9 @@ ProcChangeSaveSet(ClientPtr client)
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
return BadMatch; return BadMatch;
if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete))
{ return AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE);
result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); client->errorValue = stuff->mode;
if (client->noClientException != Success) return BadValue;
return(client->noClientException);
else
return(result);
}
else
{
client->errorValue = stuff->mode;
return( BadValue );
}
} }
int int
@ -795,7 +774,7 @@ ProcReparentWindow(ClientPtr client)
{ {
WindowPtr pWin, pParent; WindowPtr pWin, pParent;
REQUEST(xReparentWindowReq); REQUEST(xReparentWindowReq);
int result, rc; int rc;
REQUEST_SIZE_MATCH(xReparentWindowReq); REQUEST_SIZE_MATCH(xReparentWindowReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
@ -804,23 +783,16 @@ ProcReparentWindow(ClientPtr client)
rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
if (SAME_SCREENS(pWin->drawable, pParent->drawable)) if (!SAME_SCREENS(pWin->drawable, pParent->drawable))
{ return BadMatch;
if ((pWin->backgroundState == ParentRelative) && if ((pWin->backgroundState == ParentRelative) &&
(pParent->drawable.depth != pWin->drawable.depth)) (pParent->drawable.depth != pWin->drawable.depth))
return BadMatch; return BadMatch;
if ((pWin->drawable.class != InputOnly) && if ((pWin->drawable.class != InputOnly) &&
(pParent->drawable.class == InputOnly)) (pParent->drawable.class == InputOnly))
return BadMatch; return BadMatch;
result = ReparentWindow(pWin, pParent, return ReparentWindow(pWin, pParent,
(short)stuff->x, (short)stuff->y, client); (short)stuff->x, (short)stuff->y, client);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
}
else
return (BadMatch);
} }
int int
@ -836,7 +808,7 @@ ProcMapWindow(ClientPtr client)
return rc; return rc;
MapWindow(pWin, client); MapWindow(pWin, client);
/* update cache to say it is mapped */ /* update cache to say it is mapped */
return(client->noClientException); return Success;
} }
int int
@ -852,7 +824,7 @@ ProcMapSubwindows(ClientPtr client)
return rc; return rc;
MapSubwindows(pWin, client); MapSubwindows(pWin, client);
/* update cache to say it is mapped */ /* update cache to say it is mapped */
return(client->noClientException); return Success;
} }
int int
@ -868,7 +840,7 @@ ProcUnmapWindow(ClientPtr client)
return rc; return rc;
UnmapWindow(pWin, FALSE); UnmapWindow(pWin, FALSE);
/* update cache to say it is mapped */ /* update cache to say it is mapped */
return(client->noClientException); return Success;
} }
int int
@ -883,7 +855,7 @@ ProcUnmapSubwindows(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
UnmapSubwindows(pWin); UnmapSubwindows(pWin);
return(client->noClientException); return Success;
} }
int int
@ -891,7 +863,6 @@ ProcConfigureWindow(ClientPtr client)
{ {
WindowPtr pWin; WindowPtr pWin;
REQUEST(xConfigureWindowReq); REQUEST(xConfigureWindowReq);
int result;
int len, rc; int len, rc;
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
@ -902,12 +873,7 @@ ProcConfigureWindow(ClientPtr client)
len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq)); len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq));
if (Ones((Mask)stuff->mask) != len) if (Ones((Mask)stuff->mask) != len)
return BadLength; return BadLength;
result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], return ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], client);
client);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
int int
@ -928,7 +894,7 @@ ProcCirculateWindow(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
CirculateWindow(pWin, (int)stuff->direction, client); CirculateWindow(pWin, (int)stuff->direction, client);
return(client->noClientException); return Success;
} }
static int static int
@ -987,7 +953,7 @@ ProcGetGeometry(ClientPtr client)
return status; return status;
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
return(client->noClientException); return Success;
} }
@ -1037,7 +1003,7 @@ ProcQueryTree(ClientPtr client)
free(childIDs); free(childIDs);
} }
return(client->noClientException); return Success;
} }
int int
@ -1064,7 +1030,7 @@ ProcInternAtom(ClientPtr client)
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
reply.atom = atom; reply.atom = atom;
WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
return(client->noClientException); return Success;
} }
else else
return (BadAlloc); return (BadAlloc);
@ -1089,7 +1055,7 @@ ProcGetAtomName(ClientPtr client)
reply.nameLength = len; reply.nameLength = len;
WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply);
(void)WriteToClient(client, len, str); (void)WriteToClient(client, len, str);
return(client->noClientException); return Success;
} }
else else
{ {
@ -1109,7 +1075,7 @@ ProcGrabServer(ClientPtr client)
client->sequence--; client->sequence--;
BITSET(grabWaiters, client->index); BITSET(grabWaiters, client->index);
IgnoreClient(client); IgnoreClient(client);
return(client->noClientException); return Success;
} }
rc = OnlyListenToOneClient(client); rc = OnlyListenToOneClient(client);
if (rc != Success) if (rc != Success)
@ -1125,7 +1091,7 @@ ProcGrabServer(ClientPtr client)
CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo);
} }
return(client->noClientException); return Success;
} }
static void static void
@ -1160,7 +1126,7 @@ ProcUngrabServer(ClientPtr client)
{ {
REQUEST_SIZE_MATCH(xReq); REQUEST_SIZE_MATCH(xReq);
UngrabServer(client); UngrabServer(client);
return(client->noClientException); return Success;
} }
int int
@ -1234,7 +1200,7 @@ ProcTranslateCoords(ClientPtr client)
rep.dstY = y - pDst->drawable.y; rep.dstY = y - pDst->drawable.y;
} }
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
return(client->noClientException); return Success;
} }
int int
@ -1250,7 +1216,7 @@ ProcOpenFont(ClientPtr client)
stuff->nbytes, (char *)&stuff[1]); stuff->nbytes, (char *)&stuff[1]);
if (err == Success) if (err == Success)
{ {
return(client->noClientException); return Success;
} }
else else
return err; return err;
@ -1269,7 +1235,7 @@ ProcCloseFont(ClientPtr client)
if (rc == Success) if (rc == Success)
{ {
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
return(client->noClientException); return Success;
} }
else else
{ {
@ -1321,7 +1287,7 @@ ProcQueryFont(ClientPtr client)
WriteReplyToClient(client, rlength, reply); WriteReplyToClient(client, rlength, reply);
free(reply); free(reply);
return(client->noClientException); return Success;
} }
} }
@ -1362,7 +1328,7 @@ ProcQueryTextExtents(ClientPtr client)
reply.overallLeft = info.overallLeft; reply.overallLeft = info.overallLeft;
reply.overallRight = info.overallRight; reply.overallRight = info.overallRight;
WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply);
return(client->noClientException); return Success;
} }
int int
@ -1463,7 +1429,7 @@ CreatePmap:
return rc; return rc;
} }
if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
return(client->noClientException); return Success;
(*pDraw->pScreen->DestroyPixmap)(pMap); (*pDraw->pScreen->DestroyPixmap)(pMap);
} }
return (BadAlloc); return (BadAlloc);
@ -1482,7 +1448,7 @@ ProcFreePixmap(ClientPtr client)
if (rc == Success) if (rc == Success)
{ {
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
return(client->noClientException); return Success;
} }
else else
{ {
@ -1517,7 +1483,7 @@ ProcCreateGC(ClientPtr client)
return error; return error;
if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) if (!AddResource(stuff->gc, RT_GC, (pointer)pGC))
return (BadAlloc); return (BadAlloc);
return(client->noClientException); return Success;
} }
int int
@ -1537,14 +1503,7 @@ ProcChangeGC(ClientPtr client)
if (len != Ones(stuff->mask)) if (len != Ones(stuff->mask))
return BadLength; return BadLength;
result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0); return ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]);
if (client->noClientException != Success)
return(client->noClientException);
else
{
client->errorValue = clientErrorValue;
return(result);
}
} }
int int
@ -1564,14 +1523,12 @@ ProcCopyGC(ClientPtr client)
return result; return result;
if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth))
return (BadMatch); return (BadMatch);
result = CopyGC(pGC, dstGC, stuff->mask); if (stuff->mask & ~GCAllBits)
if (client->noClientException != Success)
return(client->noClientException);
else
{ {
client->errorValue = clientErrorValue; client->errorValue = stuff->mask;
return(result); return BadValue;
} }
return CopyGC(pGC, dstGC, stuff->mask);
} }
int int
@ -1592,15 +1549,11 @@ ProcSetDashes(ClientPtr client)
if (result != Success) if (result != Success)
return result; return result;
result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, /* If there's an error, either there's no sensible errorValue,
* or there was a dash segment of 0. */
client->errorValue = 0;
return SetDashes(pGC, stuff->dashOffset, stuff->nDashes,
(unsigned char *)&stuff[1]); (unsigned char *)&stuff[1]);
if (client->noClientException != Success)
return(client->noClientException);
else
{
client->errorValue = clientErrorValue;
return(result);
}
} }
int int
@ -1625,12 +1578,8 @@ ProcSetClipRectangles(ClientPtr client)
if (nr & 4) if (nr & 4)
return(BadLength); return(BadLength);
nr >>= 3; nr >>= 3;
result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, return SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin,
nr, (xRectangle *)&stuff[1], (int)stuff->ordering); nr, (xRectangle *)&stuff[1], (int)stuff->ordering);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
int int
@ -1646,7 +1595,7 @@ ProcFreeGC(ClientPtr client)
return rc; return rc;
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
return(client->noClientException); return Success;
} }
int int
@ -1673,7 +1622,7 @@ ProcClearToBackground(ClientPtr client)
(*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y,
stuff->width, stuff->height, stuff->width, stuff->height,
(Bool)stuff->exposures); (Bool)stuff->exposures);
return(client->noClientException); return Success;
} }
int int
@ -1715,7 +1664,7 @@ ProcCopyArea(ClientPtr client)
REGION_DESTROY(pDst->pScreen, pRgn); REGION_DESTROY(pDst->pScreen, pRgn);
} }
return(client->noClientException); return Success;
} }
int int
@ -1764,7 +1713,7 @@ ProcCopyPlane(ClientPtr client)
if (pRgn) if (pRgn)
REGION_DESTROY(pdstDraw->pScreen, pRgn); REGION_DESTROY(pdstDraw->pScreen, pRgn);
} }
return(client->noClientException); return Success;
} }
int int
@ -1787,7 +1736,7 @@ ProcPolyPoint(ClientPtr client)
if (npoint) if (npoint)
(*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint, (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint,
(xPoint *) &stuff[1]); (xPoint *) &stuff[1]);
return (client->noClientException); return Success;
} }
int int
@ -1810,7 +1759,7 @@ ProcPolyLine(ClientPtr client)
if (npoint > 1) if (npoint > 1)
(*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint, (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint,
(DDXPointPtr) &stuff[1]); (DDXPointPtr) &stuff[1]);
return(client->noClientException); return Success;
} }
int int
@ -1829,7 +1778,7 @@ ProcPolySegment(ClientPtr client)
nsegs >>= 3; nsegs >>= 3;
if (nsegs) if (nsegs)
(*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]);
return (client->noClientException); return Success;
} }
int int
@ -1849,7 +1798,7 @@ ProcPolyRectangle (ClientPtr client)
if (nrects) if (nrects)
(*pGC->ops->PolyRectangle)(pDraw, pGC, (*pGC->ops->PolyRectangle)(pDraw, pGC,
nrects, (xRectangle *) &stuff[1]); nrects, (xRectangle *) &stuff[1]);
return(client->noClientException); return Success;
} }
int int
@ -1868,7 +1817,7 @@ ProcPolyArc(ClientPtr client)
narcs /= sizeof(xArc); narcs /= sizeof(xArc);
if (narcs) if (narcs)
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]);
return (client->noClientException); return Success;
} }
int int
@ -1899,7 +1848,7 @@ ProcFillPoly(ClientPtr client)
(*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape,
stuff->coordMode, things, stuff->coordMode, things,
(DDXPointPtr) &stuff[1]); (DDXPointPtr) &stuff[1]);
return(client->noClientException); return Success;
} }
int int
@ -1920,7 +1869,7 @@ ProcPolyFillRectangle(ClientPtr client)
if (things) if (things)
(*pGC->ops->PolyFillRect) (pDraw, pGC, things, (*pGC->ops->PolyFillRect) (pDraw, pGC, things,
(xRectangle *) &stuff[1]); (xRectangle *) &stuff[1]);
return (client->noClientException); return Success;
} }
int int
@ -1939,7 +1888,7 @@ ProcPolyFillArc(ClientPtr client)
narcs /= sizeof(xArc); narcs /= sizeof(xArc);
if (narcs) if (narcs)
(*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]);
return (client->noClientException); return Success;
} }
#ifdef MATCH_CLIENT_ENDIAN #ifdef MATCH_CLIENT_ENDIAN
@ -2050,7 +1999,7 @@ ProcPutImage(ClientPtr client)
stuff->width, stuff->height, stuff->width, stuff->height,
stuff->leftPad, stuff->format, tmpImage); stuff->leftPad, stuff->format, tmpImage);
return (client->noClientException); return Success;
} }
static int static int
@ -2294,7 +2243,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
REGION_DESTROY(pDraw->pScreen, pVisibleRegion); REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
if (!im_return) if (!im_return)
free(pBuf); free(pBuf);
return (client->noClientException); return Success;
} }
int int
@ -2333,7 +2282,7 @@ ProcPolyText(ClientPtr client)
if (err == Success) if (err == Success)
{ {
return(client->noClientException); return Success;
} }
else else
return err; return err;
@ -2363,7 +2312,7 @@ ProcImageText8(ClientPtr client)
if (err == Success) if (err == Success)
{ {
return(client->noClientException); return Success;
} }
else else
return err; return err;
@ -2393,7 +2342,7 @@ ProcImageText16(ClientPtr client)
if (err == Success) if (err == Success)
{ {
return(client->noClientException); return Success;
} }
else else
return err; return err;
@ -2431,12 +2380,8 @@ ProcCreateColormap(ClientPtr client)
{ {
if (pVisual->vid != stuff->visual) if (pVisual->vid != stuff->visual)
continue; continue;
result = CreateColormap(mid, pScreen, pVisual, &pmap, return CreateColormap(mid, pScreen, pVisual, &pmap,
(int)stuff->alloc, client->index); (int)stuff->alloc, client->index);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
client->errorValue = stuff->visual; client->errorValue = stuff->visual;
return(BadMatch); return(BadMatch);
@ -2457,7 +2402,7 @@ ProcFreeColormap(ClientPtr client)
/* Freeing a default colormap is a no-op */ /* Freeing a default colormap is a no-op */
if (!(pmap->flags & IsDefault)) if (!(pmap->flags & IsDefault))
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
return (client->noClientException); return Success;
} }
else else
{ {
@ -2481,18 +2426,9 @@ ProcCopyColormapAndFree(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP, rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP,
client, DixReadAccess|DixRemoveAccess); client, DixReadAccess|DixRemoveAccess);
if (rc == Success) if (rc == Success)
{ return CopyColormapAndFree(mid, pSrcMap, client->index);
rc = CopyColormapAndFree(mid, pSrcMap, client->index); client->errorValue = stuff->srcCmap;
if (client->noClientException != Success) return (rc == BadValue) ? BadColor : rc;
return(client->noClientException);
else
return rc;
}
else
{
client->errorValue = stuff->srcCmap;
return (rc == BadValue) ? BadColor : rc;
}
} }
int int
@ -2513,8 +2449,8 @@ ProcInstallColormap(ClientPtr client)
goto out; goto out;
(*(pcmp->pScreen->InstallColormap)) (pcmp); (*(pcmp->pScreen->InstallColormap)) (pcmp);
return Success;
rc = client->noClientException;
out: out:
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc; return (rc == BadValue) ? BadColor : rc;
@ -2539,8 +2475,8 @@ ProcUninstallColormap(ClientPtr client)
if(pcmp->mid != pcmp->pScreen->defColormap) if(pcmp->mid != pcmp->pScreen->defColormap)
(*(pcmp->pScreen->UninstallColormap)) (pcmp); (*(pcmp->pScreen->UninstallColormap)) (pcmp);
return Success;
rc = client->noClientException;
out: out:
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc; return (rc == BadValue) ? BadColor : rc;
@ -2557,12 +2493,12 @@ ProcListInstalledColormaps(ClientPtr client)
rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
if (rc != Success) if (rc != Success)
goto out; return rc;
rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen,
DixGetAttrAccess); DixGetAttrAccess);
if (rc != Success) if (rc != Success)
goto out; return rc;
preply = malloc(sizeof(xListInstalledColormapsReply) + preply = malloc(sizeof(xListInstalledColormapsReply) +
pWin->drawable.pScreen->maxInstalledCmaps * pWin->drawable.pScreen->maxInstalledCmaps *
@ -2580,9 +2516,7 @@ ProcListInstalledColormaps(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
free(preply); free(preply);
rc = client->noClientException; return Success;
out:
return rc;
} }
int int
@ -2607,17 +2541,12 @@ ProcAllocColor (ClientPtr client)
acr.pixel = 0; acr.pixel = 0;
if( (rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, if( (rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue,
&acr.pixel, client->index)) ) &acr.pixel, client->index)) )
{ return rc;
if (client->noClientException != Success)
return(client->noClientException);
else
return rc;
}
#ifdef PANORAMIX #ifdef PANORAMIX
if (noPanoramiXExtension || !pmap->pScreen->myNum) if (noPanoramiXExtension || !pmap->pScreen->myNum)
#endif #endif
WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); WriteReplyToClient(client, sizeof(xAllocColorReply), &acr);
return (client->noClientException); return Success;
} }
else else
@ -2655,17 +2584,12 @@ ProcAllocNamedColor (ClientPtr client)
if( (rc = AllocColor(pcmp, if( (rc = AllocColor(pcmp,
&ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue,
&ancr.pixel, client->index)) ) &ancr.pixel, client->index)) )
{ return rc;
if (client->noClientException != Success)
return(client->noClientException);
else
return rc;
}
#ifdef PANORAMIX #ifdef PANORAMIX
if (noPanoramiXExtension || !pcmp->pScreen->myNum) if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif #endif
WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr);
return (client->noClientException); return Success;
} }
else else
return(BadName); return(BadName);
@ -2717,10 +2641,7 @@ ProcAllocColorCells (ClientPtr client)
(Bool)stuff->contiguous, ppixels, pmasks)) ) (Bool)stuff->contiguous, ppixels, pmasks)) )
{ {
free(ppixels); free(ppixels);
if (client->noClientException != Success) return rc;
return(client->noClientException);
else
return rc;
} }
#ifdef PANORAMIX #ifdef PANORAMIX
if (noPanoramiXExtension || !pcmp->pScreen->myNum) if (noPanoramiXExtension || !pcmp->pScreen->myNum)
@ -2736,7 +2657,7 @@ ProcAllocColorCells (ClientPtr client)
WriteSwappedDataToClient(client, length, ppixels); WriteSwappedDataToClient(client, length, ppixels);
} }
free(ppixels); free(ppixels);
return (client->noClientException); return Success;
} }
else else
{ {
@ -2786,10 +2707,7 @@ ProcAllocColorPlanes(ClientPtr client)
&acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
{ {
free(ppixels); free(ppixels);
if (client->noClientException != Success) return rc;
return(client->noClientException);
else
return rc;
} }
acpr.length = bytes_to_int32(length); acpr.length = bytes_to_int32(length);
#ifdef PANORAMIX #ifdef PANORAMIX
@ -2801,7 +2719,7 @@ ProcAllocColorPlanes(ClientPtr client)
WriteSwappedDataToClient(client, length, ppixels); WriteSwappedDataToClient(client, length, ppixels);
} }
free(ppixels); free(ppixels);
return (client->noClientException); return Success;
} }
else else
{ {
@ -2827,16 +2745,8 @@ ProcFreeColors(ClientPtr client)
if(pcmp->flags & AllAllocated) if(pcmp->flags & AllAllocated)
return(BadAccess); return(BadAccess);
count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq));
rc = FreeColors(pcmp, client->index, count, return FreeColors(pcmp, client->index, count,
(Pixel *)&stuff[1], (Pixel)stuff->planeMask); (Pixel *)&stuff[1], (Pixel)stuff->planeMask);
if (client->noClientException != Success)
return(client->noClientException);
else
{
client->errorValue = clientErrorValue;
return rc;
}
} }
else else
{ {
@ -2863,14 +2773,7 @@ ProcStoreColors (ClientPtr client)
if (count % sizeof(xColorItem)) if (count % sizeof(xColorItem))
return(BadLength); return(BadLength);
count /= sizeof(xColorItem); count /= sizeof(xColorItem);
rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); return StoreColors(pcmp, count, (xColorItem *)&stuff[1], client);
if (client->noClientException != Success)
return(client->noClientException);
else
{
client->errorValue = clientErrorValue;
return rc;
}
} }
else else
{ {
@ -2898,11 +2801,7 @@ ProcStoreNamedColor (ClientPtr client)
{ {
def.flags = stuff->flags; def.flags = stuff->flags;
def.pixel = stuff->pixel; def.pixel = stuff->pixel;
rc = StoreColors(pcmp, 1, &def); return StoreColors(pcmp, 1, &def, client);
if (client->noClientException != Success)
return(client->noClientException);
else
return rc;
} }
return (BadName); return (BadName);
} }
@ -2933,16 +2832,10 @@ ProcQueryColors(ClientPtr client)
prgbs = calloc(1, count * sizeof(xrgb)); prgbs = calloc(1, count * sizeof(xrgb));
if(!prgbs && count) if(!prgbs && count)
return(BadAlloc); return(BadAlloc);
if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs, client)) )
{ {
if (prgbs) free(prgbs); if (prgbs) free(prgbs);
if (client->noClientException != Success) return rc;
return(client->noClientException);
else
{
client->errorValue = clientErrorValue;
return rc;
}
} }
memset(&qcr, 0, sizeof(xQueryColorsReply)); memset(&qcr, 0, sizeof(xQueryColorsReply));
qcr.type = X_Reply; qcr.type = X_Reply;
@ -2956,7 +2849,7 @@ ProcQueryColors(ClientPtr client)
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
} }
if (prgbs) free(prgbs); if (prgbs) free(prgbs);
return(client->noClientException); return Success;
} }
else else
@ -2994,7 +2887,7 @@ ProcLookupColor(ClientPtr client)
&lcr.screenBlue, &lcr.screenBlue,
pcmp->pVisual); pcmp->pVisual);
WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
return(client->noClientException); return Success;
} }
return (BadName); return (BadName);
} }
@ -3093,7 +2986,7 @@ ProcCreateCursor (ClientPtr client)
if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
return BadAlloc; return BadAlloc;
return client->noClientException; return Success;
} }
int int
@ -3115,7 +3008,7 @@ ProcCreateGlyphCursor (ClientPtr client)
if (res != Success) if (res != Success)
return res; return res;
if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
return client->noClientException; return Success;
return BadAlloc; return BadAlloc;
} }
@ -3133,7 +3026,7 @@ ProcFreeCursor (ClientPtr client)
if (rc == Success) if (rc == Success)
{ {
FreeResource(stuff->id, RT_NONE); FreeResource(stuff->id, RT_NONE);
return (client->noClientException); return Success;
} }
else else
{ {
@ -3179,7 +3072,7 @@ ProcQueryBestSize (ClientPtr client)
reply.width = stuff->width; reply.width = stuff->width;
reply.height = stuff->height; reply.height = stuff->height;
WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
return (client->noClientException); return Success;
} }
@ -3243,7 +3136,7 @@ ProcSetScreenSaver (ClientPtr client)
ScreenSaverInterval = defaultScreenSaverInterval; ScreenSaverInterval = defaultScreenSaverInterval;
SetScreenSaverTimer(); SetScreenSaverTimer();
return (client->noClientException); return Success;
} }
int int
@ -3268,31 +3161,24 @@ ProcGetScreenSaver(ClientPtr client)
rep.preferBlanking = ScreenSaverBlanking; rep.preferBlanking = ScreenSaverBlanking;
rep.allowExposures = ScreenSaverAllowExposures; rep.allowExposures = ScreenSaverAllowExposures;
WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
return (client->noClientException); return Success;
} }
int int
ProcChangeHosts(ClientPtr client) ProcChangeHosts(ClientPtr client)
{ {
REQUEST(xChangeHostsReq); REQUEST(xChangeHostsReq);
int result;
REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength);
if(stuff->mode == HostInsert) if(stuff->mode == HostInsert)
result = AddHost(client, (int)stuff->hostFamily, return AddHost(client, (int)stuff->hostFamily,
stuff->hostLength, (pointer)&stuff[1]); stuff->hostLength, (pointer)&stuff[1]);
else if (stuff->mode == HostDelete) if (stuff->mode == HostDelete)
result = RemoveHost(client, (int)stuff->hostFamily, return RemoveHost(client, (int)stuff->hostFamily,
stuff->hostLength, (pointer)&stuff[1]); stuff->hostLength, (pointer)&stuff[1]);
else client->errorValue = stuff->mode;
{ return BadValue;
client->errorValue = stuff->mode;
return BadValue;
}
if (!result)
result = client->noClientException;
return (result);
} }
int int
@ -3324,13 +3210,12 @@ ProcListHosts(ClientPtr client)
WriteSwappedDataToClient(client, len, pdata); WriteSwappedDataToClient(client, len, pdata);
} }
free(pdata); free(pdata);
return (client->noClientException); return Success;
} }
int int
ProcChangeAccessControl(ClientPtr client) ProcChangeAccessControl(ClientPtr client)
{ {
int result;
REQUEST(xSetAccessControlReq); REQUEST(xSetAccessControlReq);
REQUEST_SIZE_MATCH(xSetAccessControlReq); REQUEST_SIZE_MATCH(xSetAccessControlReq);
@ -3339,10 +3224,7 @@ ProcChangeAccessControl(ClientPtr client)
client->errorValue = stuff->mode; client->errorValue = stuff->mode;
return BadValue; return BadValue;
} }
result = ChangeAccessControl(client, stuff->mode == EnableAccess); return ChangeAccessControl(client, stuff->mode == EnableAccess);
if (!result)
result = client->noClientException;
return (result);
} }
/********************* /*********************
@ -3378,7 +3260,7 @@ ProcKillClient(ClientPtr client)
if (stuff->id == AllTemporary) if (stuff->id == AllTemporary)
{ {
CloseDownRetainedResources(); CloseDownRetainedResources();
return (client->noClientException); return Success;
} }
rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess); rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess);
@ -3393,7 +3275,7 @@ ProcKillClient(ClientPtr client)
isItTimeToYield = TRUE; isItTimeToYield = TRUE;
return (Success); return (Success);
} }
return (client->noClientException); return Success;
} }
else else
return rc; return rc;
@ -3405,7 +3287,7 @@ ProcSetFontPath(ClientPtr client)
unsigned char *ptr; unsigned char *ptr;
unsigned long nbytes, total; unsigned long nbytes, total;
long nfonts; long nfonts;
int n, result; int n;
REQUEST(xSetFontPathReq); REQUEST(xSetFontPathReq);
REQUEST_AT_LEAST_SIZE(xSetFontPathReq); REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
@ -3423,10 +3305,7 @@ ProcSetFontPath(ClientPtr client)
} }
if (total >= 4) if (total >= 4)
return(BadLength); return(BadLength);
result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]); return SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]);
if (!result)
result = client->noClientException;
return (result);
} }
int int
@ -3450,7 +3329,7 @@ ProcGetFontPath(ClientPtr client)
WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
if (stringLens || numpaths) if (stringLens || numpaths)
(void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart);
return(client->noClientException); return Success;
} }
int int
@ -3469,7 +3348,7 @@ ProcChangeCloseDownMode(ClientPtr client)
(stuff->mode == RetainTemporary)) (stuff->mode == RetainTemporary))
{ {
client->closeDownMode = stuff->mode; client->closeDownMode = stuff->mode;
return (client->noClientException); return Success;
} }
else else
{ {
@ -3494,7 +3373,7 @@ int ProcForceScreenSaver(ClientPtr client)
rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, (int)stuff->mode); rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, (int)stuff->mode);
if (rc != Success) if (rc != Success)
return rc; return rc;
return client->noClientException; return Success;
} }
int ProcNoOperation(ClientPtr client) int ProcNoOperation(ClientPtr client)
@ -3502,7 +3381,7 @@ int ProcNoOperation(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xReq); REQUEST_AT_LEAST_SIZE(xReq);
/* noop -- don't do anything */ /* noop -- don't do anything */
return(client->noClientException); return Success;
} }
void void
@ -3720,7 +3599,7 @@ ProcInitialConnection(ClientPtr client)
swaps(&stuff->length, whichbyte); swaps(&stuff->length, whichbyte);
} }
ResetCurrentRequest(client); ResetCurrentRequest(client);
return (client->noClientException); return Success;
} }
static int static int
@ -3817,7 +3696,7 @@ SendConnSetup(ClientPtr client, char *reason)
clientinfo.setup = (xConnSetup *)lConnectionInfo; clientinfo.setup = (xConnSetup *)lConnectionInfo;
CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
} }
return (client->noClientException); return Success;
} }
int int
@ -3851,7 +3730,7 @@ ProcEstablishConnection(ClientPtr client)
client->clientState = ClientStateCheckedSecurity; client->clientState = ClientStateCheckedSecurity;
else if (client->clientState != ClientStateAuthenticating) else if (client->clientState != ClientStateAuthenticating)
return(SendConnSetup(client, reason)); return(SendConnSetup(client, reason));
return(client->noClientException); return Success;
} }
void void

View File

@ -1166,7 +1166,7 @@ badAlloc:
#define TextEltHeader 2 #define TextEltHeader 2
#define FontShiftSize 5 #define FontShiftSize 5
static XID clearGC[] = { CT_NONE }; static ChangeGCVal clearGC[] = { { .ptr = NullPixmap } };
#define clearGCmask (GCClipMask) #define clearGCmask (GCClipMask)
int int
@ -1261,7 +1261,9 @@ doPolyText(ClientPtr client, PTclosurePtr c)
{ {
if (pFont != c->pGC->font && c->pDraw) if (pFont != c->pGC->font && c->pDraw)
{ {
dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL); ChangeGCVal val;
val.ptr = pFont;
ChangeGC(NullClient, c->pGC, GCFont, &val);
ValidateGC(c->pDraw, c->pGC); ValidateGC(c->pDraw, c->pGC);
if (c->reqType == X_PolyText8) if (c->reqType == X_PolyText8)
c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
@ -1404,7 +1406,9 @@ bail:
/* Step 4 */ /* Step 4 */
if (pFont != origGC->font) if (pFont != origGC->font)
{ {
dixChangeGC(NullClient, origGC, GCFont, &fid, NULL); ChangeGCVal val;
val.ptr = pFont;
ChangeGC(NullClient, origGC, GCFont, &val);
ValidateGC(c->pDraw, origGC); ValidateGC(c->pDraw, origGC);
} }
@ -1423,7 +1427,7 @@ bail:
if (c->slept) if (c->slept)
{ {
ClientWakeup(c->client); ClientWakeup(c->client);
dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL); ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
/* Unreference the font from the scratch GC */ /* Unreference the font from the scratch GC */
CloseFont(c->pGC->font, (Font)0); CloseFont(c->pGC->font, (Font)0);
@ -1580,7 +1584,7 @@ bail:
if (c->slept) if (c->slept)
{ {
ClientWakeup(c->client); ClientWakeup(c->client);
dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL); ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
/* Unreference the font from the scratch GC */ /* Unreference the font from the scratch GC */
CloseFont(c->pGC->font, (Font)0); CloseFont(c->pGC->font, (Font)0);

View File

@ -293,7 +293,7 @@ ProcQueryExtension(ClientPtr client)
} }
} }
WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply);
return(client->noClientException); return Success;
} }
int int
@ -354,5 +354,5 @@ ProcListExtensions(ClientPtr client)
WriteToClient(client, total_length, buffer); WriteToClient(client, total_length, buffer);
free(buffer); free(buffer);
} }
return(client->noClientException); return Success;
} }

255
dix/gc.c
View File

@ -66,7 +66,6 @@ SOFTWARE.
#include "xace.h" #include "xace.h"
#include <assert.h> #include <assert.h>
extern XID clientErrorValue;
extern FontPtr defaultFont; extern FontPtr defaultFont;
static Bool CreateDefaultTile(GCPtr pGC); static Bool CreateDefaultTile(GCPtr pGC);
@ -82,69 +81,55 @@ ValidateGC(DrawablePtr pDraw, GC *pGC)
} }
/* dixChangeGC(client, pGC, mask, pC32, pUnion) /*
* * ChangeGC/ChangeGCXIDs:
* This function was created as part of the Security extension *
* implementation. The client performing the gc change must be passed so * The client performing the gc change must be passed so that access
* that access checks can be performed on any tiles, stipples, or fonts * checks can be performed on any tiles, stipples, or fonts that are
* that are specified. ddxen can call this too; they should normally * specified. ddxen can call this too; they should normally pass
* pass NullClient for the client since any access checking should have * NullClient for the client since any access checking should have
* already been done at a higher level. * already been done at a higher level.
* *
* You can pass the list of gc values via pC32 or pUnion, but not both; * If you have any XIDs, you must use ChangeGCXIDs:
* one of them must be NULL. If you don't need to pass any pointers,
* you can use either one:
* *
* example calling dixChangeGC using pC32 parameter
*
* CARD32 v[2]; * CARD32 v[2];
* v[0] = foreground; * v[0] = FillTiled;
* v[1] = background; * v[1] = pid;
* dixChangeGC(client, pGC, GCForeground|GCBackground, v, NULL); * ChangeGCXIDs(client, pGC, GCFillStyle|GCTile, v);
* *
* example calling dixChangeGC using pUnion parameter; * However, if you need to pass a pointer to a pixmap or font, you must
* same effect as above * use ChangeGC:
*
* ChangeGCVal v[2];
* v[0].val = FillTiled;
* v[1].ptr = pPixmap;
* ChangeGC(client, pGC, GCFillStyle|GCTile, v);
*
* If you have neither XIDs nor pointers, you can use either function,
* but ChangeGC will do less work.
* *
* ChangeGCVal v[2]; * ChangeGCVal v[2];
* v[0].val = foreground; * v[0].val = foreground;
* v[1].val = background; * v[1].val = background;
* dixChangeGC(client, pGC, GCForeground|GCBackground, NULL, v); * ChangeGC(client, pGC, GCForeground|GCBackground, v);
*
* However, if you need to pass a pointer to a pixmap or font, you MUST
* use the pUnion parameter.
*
* example calling dixChangeGC passing pointers in the value list
* v[1].ptr is a pointer to a pixmap
*
* ChangeGCVal v[2];
* v[0].val = FillTiled;
* v[1].ptr = pPixmap;
* dixChangeGC(client, pGC, GCFillStyle|GCTile, NULL, v);
*
* Note: we could have gotten by with just the pUnion parameter, but on
* 64 bit machines that would have forced us to copy the value list that
* comes in the ChangeGC request.
*/ */
#define NEXTVAL(_type, _var) { \ #define NEXTVAL(_type, _var) { \
if (pC32) _var = (_type)*pC32++; \
else { \
_var = (_type)(pUnion->val); pUnion++; \ _var = (_type)(pUnion->val); pUnion++; \
} \
} }
#define NEXT_PTR(_type, _var) { \ #define NEXT_PTR(_type, _var) { \
assert(pUnion); _var = (_type)pUnion->ptr; pUnion++; } _var = (_type)pUnion->ptr; pUnion++; }
int int
dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion) ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion)
{ {
BITS32 index2; BITS32 index2;
int rc, error = 0; int error = 0;
PixmapPtr pPixmap; PixmapPtr pPixmap;
BITS32 maskQ; BITS32 maskQ;
assert( (pC32 && !pUnion) || (!pC32 && pUnion) ); assert(pUnion);
pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
maskQ = mask; /* save these for when we walk the GCque */ maskQ = mask; /* save these for when we walk the GCque */
@ -163,7 +148,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->alu = newalu; pGC->alu = newalu;
else else
{ {
clientErrorValue = newalu; if (client)
client->errorValue = newalu;
error = BadValue; error = BadValue;
} }
break; break;
@ -196,7 +182,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->lineStyle = newlinestyle; pGC->lineStyle = newlinestyle;
else else
{ {
clientErrorValue = newlinestyle; if (client)
client->errorValue = newlinestyle;
error = BadValue; error = BadValue;
} }
break; break;
@ -209,7 +196,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->capStyle = newcapstyle; pGC->capStyle = newcapstyle;
else else
{ {
clientErrorValue = newcapstyle; if (client)
client->errorValue = newcapstyle;
error = BadValue; error = BadValue;
} }
break; break;
@ -222,7 +210,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->joinStyle = newjoinstyle; pGC->joinStyle = newjoinstyle;
else else
{ {
clientErrorValue = newjoinstyle; if (client)
client->errorValue = newjoinstyle;
error = BadValue; error = BadValue;
} }
break; break;
@ -235,7 +224,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->fillStyle = newfillstyle; pGC->fillStyle = newfillstyle;
else else
{ {
clientErrorValue = newfillstyle; if (client)
client->errorValue = newfillstyle;
error = BadValue; error = BadValue;
} }
break; break;
@ -248,29 +238,14 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->fillRule = newfillrule; pGC->fillRule = newfillrule;
else else
{ {
clientErrorValue = newfillrule; if (client)
client->errorValue = newfillrule;
error = BadValue; error = BadValue;
} }
break; break;
} }
case GCTile: case GCTile:
if (pUnion) NEXT_PTR(PixmapPtr, pPixmap);
{
NEXT_PTR(PixmapPtr, pPixmap);
}
else
{
XID newpix;
NEXTVAL(XID, newpix);
rc = dixLookupResourceByType((pointer *)&pPixmap, newpix,
RT_PIXMAP, client, DixReadAccess);
if (rc != Success)
{
clientErrorValue = newpix;
error = (rc == BadValue) ? BadPixmap : rc;
break;
}
}
if ((pPixmap->drawable.depth != pGC->depth) || if ((pPixmap->drawable.depth != pGC->depth) ||
(pPixmap->drawable.pScreen != pGC->pScreen)) (pPixmap->drawable.pScreen != pGC->pScreen))
{ {
@ -286,23 +261,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
} }
break; break;
case GCStipple: case GCStipple:
if (pUnion) NEXT_PTR(PixmapPtr, pPixmap);
{
NEXT_PTR(PixmapPtr, pPixmap);
}
else
{
XID newstipple;
NEXTVAL(XID, newstipple)
rc = dixLookupResourceByType((pointer *)&pPixmap, newstipple,
RT_PIXMAP, client, DixReadAccess);
if (rc != Success)
{
clientErrorValue = newstipple;
error = (rc == BadValue) ? BadPixmap : rc;
break;
}
}
if ((pPixmap->drawable.depth != 1) || if ((pPixmap->drawable.depth != 1) ||
(pPixmap->drawable.pScreen != pGC->pScreen)) (pPixmap->drawable.pScreen != pGC->pScreen))
{ {
@ -325,23 +284,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
case GCFont: case GCFont:
{ {
FontPtr pFont; FontPtr pFont;
if (pUnion) NEXT_PTR(FontPtr, pFont);
{
NEXT_PTR(FontPtr, pFont);
}
else
{
XID newfont;
NEXTVAL(XID, newfont)
rc = dixLookupResourceByType((pointer *)&pFont, newfont,
RT_FONT, client, DixUseAccess);
if (rc != Success)
{
clientErrorValue = newfont;
error = (rc == BadValue) ? BadFont : rc;
break;
}
}
pFont->refcnt++; pFont->refcnt++;
if (pGC->font) if (pGC->font)
CloseFont(pGC->font, (Font)0); CloseFont(pGC->font, (Font)0);
@ -356,7 +299,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->subWindowMode = newclipmode; pGC->subWindowMode = newclipmode;
else else
{ {
clientErrorValue = newclipmode; if (client)
client->errorValue = newclipmode;
error = BadValue; error = BadValue;
} }
break; break;
@ -369,7 +313,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->graphicsExposures = newge; pGC->graphicsExposures = newge;
else else
{ {
clientErrorValue = newge; if (client)
client->errorValue = newge;
error = BadValue; error = BadValue;
} }
break; break;
@ -381,28 +326,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
NEXTVAL(INT16, pGC->clipOrg.y); NEXTVAL(INT16, pGC->clipOrg.y);
break; break;
case GCClipMask: case GCClipMask:
if (pUnion) NEXT_PTR(PixmapPtr, pPixmap);
{
NEXT_PTR(PixmapPtr, pPixmap);
}
else
{
Pixmap pid;
NEXTVAL(Pixmap, pid)
if (pid == None)
pPixmap = NullPixmap;
else {
rc = dixLookupResourceByType((pointer *)&pPixmap, pid,
RT_PIXMAP, client,
DixReadAccess);
if (rc != Success) {
clientErrorValue = pid;
error = (rc == BadValue) ? BadPixmap : rc;
break;
}
}
}
if (pPixmap) if (pPixmap)
{ {
if ((pPixmap->drawable.depth != 1) || if ((pPixmap->drawable.depth != 1) ||
@ -451,7 +375,8 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
} }
else else
{ {
clientErrorValue = newdash; if (client)
client->errorValue = newdash;
error = BadValue; error = BadValue;
} }
break; break;
@ -464,13 +389,15 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
pGC->arcMode = newarcmode; pGC->arcMode = newarcmode;
else else
{ {
clientErrorValue = newarcmode; if (client)
client->errorValue = newarcmode;
error = BadValue; error = BadValue;
} }
break; break;
} }
default: default:
clientErrorValue = maskQ; if (client)
client->errorValue = maskQ;
error = BadValue; error = BadValue;
break; break;
} }
@ -491,6 +418,53 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
#undef NEXTVAL #undef NEXTVAL
#undef NEXT_PTR #undef NEXT_PTR
static const struct {
BITS32 mask;
RESTYPE type;
Mask access_mode;
} xidfields[] = {
{ GCTile, RT_PIXMAP, DixReadAccess },
{ GCStipple, RT_PIXMAP, DixReadAccess },
{ GCFont, RT_FONT, DixUseAccess },
{ GCClipMask, RT_PIXMAP, DixReadAccess },
};
int
ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32)
{
ChangeGCVal vals[GCLastBit + 1];
int i;
if (mask & ~GCAllBits)
{
client->errorValue = mask;
return BadValue;
}
for (i = Ones(mask); i; --i)
vals[i].val = pC32[i];
for (i = 0; i < sizeof(xidfields) / sizeof(*xidfields); ++i)
{
int offset, rc;
if (!(mask & xidfields[i].mask))
continue;
offset = Ones(mask & (xidfields[i].mask - 1));
if (xidfields[i].mask == GCClipMask && vals[offset].val == None)
{
vals[offset].ptr = NullPixmap;
continue;
}
rc = dixLookupResourceByType(&vals[offset].ptr, vals[offset].val,
xidfields[i].type, client, xidfields[i].access_mode);
if (rc != Success)
{
client->errorValue = vals[offset].val;
if (rc == BadValue)
rc = (xidfields[i].type == RT_PIXMAP) ? BadPixmap : BadFont;
return rc;
}
}
return ChangeGC(client, pGC, mask, vals);
}
/* CreateGC(pDrawable, mask, pval, pStatus) /* CreateGC(pDrawable, mask, pval, pStatus)
creates a default GC for the given drawable, using mask to fill creates a default GC for the given drawable, using mask to fill
in any non-default values. in any non-default values.
@ -570,11 +544,11 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
if (*pStatus != Success) if (*pStatus != Success)
goto out; goto out;
pGC->stateChanges = (1 << (GCLastBit+1)) - 1; pGC->stateChanges = GCAllBits;
if (!(*pGC->pScreen->CreateGC)(pGC)) if (!(*pGC->pScreen->CreateGC)(pGC))
*pStatus = BadAlloc; *pStatus = BadAlloc;
else if (mask) else if (mask)
*pStatus = dixChangeGC(client, pGC, mask, pval, NULL); *pStatus = ChangeGCXIDs(client, pGC, mask, pval);
else else
*pStatus = Success; *pStatus = Success;
@ -593,7 +567,7 @@ out:
static Bool static Bool
CreateDefaultTile (GCPtr pGC) CreateDefaultTile (GCPtr pGC)
{ {
XID tmpval[3]; ChangeGCVal tmpval[3];
PixmapPtr pTile; PixmapPtr pTile;
GCPtr pgcScratch; GCPtr pgcScratch;
xRectangle rect; xRectangle rect;
@ -614,10 +588,10 @@ CreateDefaultTile (GCPtr pGC)
FreeScratchGC(pgcScratch); FreeScratchGC(pgcScratch);
return FALSE; return FALSE;
} }
tmpval[0] = GXcopy; tmpval[0].val = GXcopy;
tmpval[1] = pGC->tile.pixel; tmpval[1].val = pGC->tile.pixel;
tmpval[2] = FillSolid; tmpval[2].val = FillSolid;
(void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL); (void)ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval);
ValidateGC((DrawablePtr)pTile, pgcScratch); ValidateGC((DrawablePtr)pTile, pgcScratch);
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
@ -773,9 +747,7 @@ CopyGC(GC *pgcSrc, GC *pgcDst, BITS32 mask)
pgcDst->arcMode = pgcSrc->arcMode; pgcDst->arcMode = pgcSrc->arcMode;
break; break;
default: default:
clientErrorValue = maskQ; FatalError ("CopyGC: Unhandled mask!\n");
error = BadValue;
break;
} }
} }
if (pgcDst->fillStyle == FillTiled && pgcDst->tileIsPixel) if (pgcDst->fillStyle == FillTiled && pgcDst->tileIsPixel)
@ -873,7 +845,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
pGC->lastWinOrg.x = 0; pGC->lastWinOrg.x = 0;
pGC->lastWinOrg.y = 0; pGC->lastWinOrg.y = 0;
pGC->stateChanges = (1 << (GCLastBit+1)) - 1; pGC->stateChanges = GCAllBits;
if (!(*pScreen->CreateGC)(pGC)) if (!(*pScreen->CreateGC)(pGC))
{ {
FreeGC(pGC, (XID)0); FreeGC(pGC, (XID)0);
@ -935,7 +907,7 @@ Bool
CreateDefaultStipple(int screenNum) CreateDefaultStipple(int screenNum)
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
XID tmpval[3]; ChangeGCVal tmpval[3];
xRectangle rect; xRectangle rect;
CARD16 w, h; CARD16 w, h;
GCPtr pgcScratch; GCPtr pgcScratch;
@ -949,14 +921,16 @@ CreateDefaultStipple(int screenNum)
(*pScreen->CreatePixmap)(pScreen, w, h, 1, 0))) (*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
return FALSE; return FALSE;
/* fill stipple with 1 */ /* fill stipple with 1 */
tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid; tmpval[0].val = GXcopy;
tmpval[1].val = 1;
tmpval[2].val = FillSolid;
pgcScratch = GetScratchGC(1, pScreen); pgcScratch = GetScratchGC(1, pScreen);
if (!pgcScratch) if (!pgcScratch)
{ {
(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]); (*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
return FALSE; return FALSE;
} }
(void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL); (void)ChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch); ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
@ -989,7 +963,6 @@ SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash)
if (!*p++) if (!*p++)
{ {
/* dash segment must be > 0 */ /* dash segment must be > 0 */
clientErrorValue = 0;
return BadValue; return BadValue;
} }
} }
@ -1152,7 +1125,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen)
pGC->clipOrg.y = 0; pGC->clipOrg.y = 0;
if (pGC->clientClipType != CT_NONE) if (pGC->clientClipType != CT_NONE)
(*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0); (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0);
pGC->stateChanges = (1 << (GCLastBit+1)) - 1; pGC->stateChanges = GCAllBits;
return pGC; return pGC;
} }
/* if we make it this far, need to roll our own */ /* if we make it this far, need to roll our own */

View File

@ -118,14 +118,13 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned cha
gcval[0].val = GXcopy; gcval[0].val = GXcopy;
gcval[1].val = 0; gcval[1].val = 0;
gcval[2].ptr = (pointer)pfont; gcval[2].ptr = (pointer)pfont;
dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, gcval);
NULL, gcval);
ValidateGC((DrawablePtr)ppix, pGC); ValidateGC((DrawablePtr)ppix, pGC);
(*pGC->ops->PolyFillRect)((DrawablePtr)ppix, pGC, 1, &rect); (*pGC->ops->PolyFillRect)((DrawablePtr)ppix, pGC, 1, &rect);
/* draw the glyph */ /* draw the glyph */
gcval[0].val = 1; gcval[0].val = 1;
dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval); ChangeGC(NullClient, pGC, GCForeground, gcval);
ValidateGC((DrawablePtr)ppix, pGC); ValidateGC((DrawablePtr)ppix, pGC);
(*pGC->ops->PolyText16)((DrawablePtr)ppix, pGC, cm->xhot, cm->yhot, (*pGC->ops->PolyText16)((DrawablePtr)ppix, pGC, cm->xhot, cm->yhot,
1, (unsigned short *)char2b); 1, (unsigned short *)char2b);

View File

@ -244,7 +244,7 @@ ProcChangeProperty(ClientPtr client)
if (err != Success) if (err != Success)
return err; return err;
else else
return client->noClientException; return Success;
} }
int int
@ -442,7 +442,7 @@ NullPropertyReply(
reply->propertyType = propertyType; reply->propertyType = propertyType;
reply->format = format; reply->format = format;
WriteReplyToClient(client, sizeof(xGenericReply), reply); WriteReplyToClient(client, sizeof(xGenericReply), reply);
return(client->noClientException); return Success;
} }
/***************** /*****************
@ -574,7 +574,7 @@ ProcGetProperty(ClientPtr client)
free(pProp->data); free(pProp->data);
free(pProp); free(pProp);
} }
return(client->noClientException); return Success;
} }
int int
@ -620,7 +620,7 @@ ProcListProperties(ClientPtr client)
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
} }
free(pAtoms); free(pAtoms);
return(client->noClientException); return Success;
} }
int int
@ -641,9 +641,5 @@ ProcDeleteProperty(ClientPtr client)
return (BadAtom); return (BadAtom);
} }
result = DeleteProperty(client, pWin, stuff->property); return DeleteProperty(client, pWin, stuff->property);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }

View File

@ -225,7 +225,7 @@ ProcSetSelectionOwner(ClientPtr client)
pSel->client = (pWin ? client : NullClient); pSel->client = (pWin ? client : NullClient);
CallSelectionCallback(pSel, client, SelectionSetOwner); CallSelectionCallback(pSel, client, SelectionSetOwner);
return client->noClientException; return Success;
} }
int int
@ -257,7 +257,7 @@ ProcGetSelectionOwner(ClientPtr client)
return rc; return rc;
WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
return client->noClientException; return Success;
} }
int int
@ -298,7 +298,7 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionRequest.property = stuff->property; event.u.selectionRequest.property = stuff->property;
if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask, if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab)) NoEventMask /* CantBeFiltered */, NullGrab))
return client->noClientException; return Success;
} }
event.u.u.type = SelectionNotify; event.u.u.type = SelectionNotify;
@ -309,5 +309,5 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionNotify.property = None; event.u.selectionNotify.property = None;
TryClientEvents(client, NULL, &event, 1, NoEventMask, TryClientEvents(client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab); NoEventMask /* CantBeFiltered */, NullGrab);
return client->noClientException; return Success;
} }

View File

@ -323,12 +323,12 @@ MakeRootTile(WindowPtr pWin)
FatalError("could not create root tile"); FatalError("could not create root tile");
{ {
CARD32 attributes[2]; ChangeGCVal attributes[2];
attributes[0] = pScreen->whitePixel; attributes[0].val = pScreen->whitePixel;
attributes[1] = pScreen->blackPixel; attributes[1].val = pScreen->blackPixel;
(void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL); (void)ChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes);
} }
ValidateGC((DrawablePtr)pWin->background.pixmap, pGC); ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
@ -3743,7 +3743,7 @@ DrawLogo(WindowPtr pWin)
querypixels[0] = fore[0].val; querypixels[0] = fore[0].val;
querypixels[1] = pWin->background.pixel; querypixels[1] = pWin->background.pixel;
QueryColors(cmap, 2, querypixels, rgb); QueryColors(cmap, 2, querypixels, rgb, serverClient);
if ((rgb[0].red == rgb[1].red) && if ((rgb[0].red == rgb[1].red) &&
(rgb[0].green == rgb[1].green) && (rgb[0].green == rgb[1].green) &&
(rgb[0].blue == rgb[1].blue)) { (rgb[0].blue == rgb[1].blue)) {
@ -3763,8 +3763,7 @@ DrawLogo(WindowPtr pWin)
} else { } else {
back[0].val = 0; back[0].val = 0;
back[1].val = 0; back[1].val = 0;
dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, ChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, back);
NULL, back);
back[0].val = FillTiled; back[0].val = FillTiled;
back[1].ptr = pWin->background.pixmap; back[1].ptr = pWin->background.pixmap;
bmask = GCFillStyle|GCTile; bmask = GCFillStyle|GCTile;
@ -3802,7 +3801,7 @@ DrawLogo(WindowPtr pWin)
poly[1].x = x + size-d31; poly[1].y = y; poly[1].x = x + size-d31; poly[1].y = y;
poly[2].x = x + 0; poly[2].y = y + size; poly[2].x = x + 0; poly[2].y = y + size;
poly[3].x = x + d31; poly[3].y = y + size; poly[3].x = x + d31; poly[3].y = y + size;
dixChangeGC(NullClient, pGC, fmask, NULL, fore); ChangeGC(NullClient, pGC, fmask, fore);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
@ -3821,7 +3820,7 @@ DrawLogo(WindowPtr pWin)
poly[1].x = x + size / 2; poly[1].y = y + size/2; poly[1].x = x + size / 2; poly[1].y = y + size/2;
poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2; poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2;
poly[3].x = x + d31; poly[3].y = y + size; poly[3].x = x + d31; poly[3].y = y + size;
dixChangeGC(NullClient, pGC, bmask, NULL, back); ChangeGC(NullClient, pGC, bmask, back);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
@ -3860,7 +3859,7 @@ DrawLogo(WindowPtr pWin)
poly[1].x = x + size/4; poly[1].y = y; poly[1].x = x + size/4; poly[1].y = y;
poly[2].x = x + size; poly[2].y = y + size; poly[2].x = x + size; poly[2].y = y + size;
poly[3].x = x + size - size/4; poly[3].y = y + size; poly[3].x = x + size - size/4; poly[3].y = y + size;
dixChangeGC(NullClient, pGC, fmask, NULL, fore); ChangeGC(NullClient, pGC, fmask, fore);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
@ -3878,7 +3877,7 @@ DrawLogo(WindowPtr pWin)
poly[1].x = x + size-( thin+gap); poly[1].y = y; poly[1].x = x + size-( thin+gap); poly[1].y = y;
poly[2].x = x + thin; poly[2].y = y + size; poly[2].x = x + thin; poly[2].y = y + size;
poly[3].x = x + thin + gap; poly[3].y = y + size; poly[3].x = x + thin + gap; poly[3].y = y + size;
dixChangeGC(NullClient, pGC, bmask, NULL, back); ChangeGC(NullClient, pGC, bmask, back);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);

View File

@ -250,7 +250,9 @@ fbSetFg (DrawablePtr pDrawable,
{ {
if (fg != pGC->fgPixel) if (fg != pGC->fgPixel)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL); ChangeGCVal val;
val.val = fg;
ChangeGC (NullClient, pGC, GCForeground, &val);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }

View File

@ -292,14 +292,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
return &context->base; return &context->base;
} }
static void
glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
{
CARD32 v[1];
v[0] = val;
dixChangeGC(NullClient, gc, mask, v, NULL);
}
static __GLXdrawable * static __GLXdrawable *
__glXDRIscreenCreateDrawable(ClientPtr client, __glXDRIscreenCreateDrawable(ClientPtr client,
__GLXscreen *screen, __GLXscreen *screen,
@ -309,6 +301,7 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
XID glxDrawId, XID glxDrawId,
__GLXconfig *glxConfig) __GLXconfig *glxConfig)
{ {
ChangeGCVal gcvals[2];
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private; __GLXDRIdrawable *private;
@ -333,9 +326,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
private->gc = CreateScratchGC(pScreen, pDraw->depth); private->gc = CreateScratchGC(pScreen, pDraw->depth);
private->swapgc = CreateScratchGC(pScreen, pDraw->depth); private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
glxChangeGC(private->gc, GCFunction, GXcopy); gcvals[0].val = GXcopy;
glxChangeGC(private->swapgc, GCFunction, GXcopy); ChangeGC(NullClient, private->gc, GCFunction, gcvals);
glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE); gcvals[1].val = FALSE;
ChangeGC(NullClient, private->gc, GCFunction | GCGraphicsExposures, gcvals);
private->driDrawable = private->driDrawable =
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen, (*driScreen->swrast->createNewDrawable)(driScreen->driScreen,

View File

@ -583,7 +583,7 @@ static int __glXDispatch(ClientPtr client)
ResetCurrentRequest(client); ResetCurrentRequest(client);
client->sequence--; client->sequence--;
IgnoreClient(client); IgnoreClient(client);
return(client->noClientException); return Success;
} }
/* /*

View File

@ -46,8 +46,6 @@
#include <windowstr.h> #include <windowstr.h>
#include <dixfontstr.h> #include <dixfontstr.h>
extern XID clientErrorValue; /* imported kludge from dix layer */
/* /*
** Make a single GL bitmap from a single X glyph ** Make a single GL bitmap from a single X glyph
*/ */

View File

@ -235,7 +235,7 @@ static int ProcDMXQueryVersion(ClientPtr client)
swapl(&rep.patchVersion, n); swapl(&rep.patchVersion, n);
} }
WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXSync(ClientPtr client) static int ProcDMXSync(ClientPtr client)
@ -257,7 +257,7 @@ static int ProcDMXSync(ClientPtr client)
swapl(&rep.status, n); swapl(&rep.status, n);
} }
WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep); WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXForceWindowCreation(ClientPtr client) static int ProcDMXForceWindowCreation(ClientPtr client)
@ -326,7 +326,7 @@ static int ProcDMXGetScreenCount(ClientPtr client)
swapl(&rep.screenCount, n); swapl(&rep.screenCount, n);
} }
WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep); WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXGetScreenAttributes(ClientPtr client) static int ProcDMXGetScreenAttributes(ClientPtr client)
@ -384,7 +384,7 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
} }
WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep); WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
if (length) WriteToClient(client, length, (char *)attr.displayName); if (length) WriteToClient(client, length, (char *)attr.displayName);
return client->noClientException; return Success;
} }
static int ProcDMXChangeScreensAttributes(ClientPtr client) static int ProcDMXChangeScreensAttributes(ClientPtr client)
@ -457,7 +457,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
WriteToClient(client, WriteToClient(client,
sizeof(xDMXChangeScreensAttributesReply), sizeof(xDMXChangeScreensAttributesReply),
(char *)&rep); (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXAddScreen(ClientPtr client) static int ProcDMXAddScreen(ClientPtr client)
@ -508,7 +508,7 @@ static int ProcDMXAddScreen(ClientPtr client)
WriteToClient(client, WriteToClient(client,
sizeof(xDMXAddScreenReply), sizeof(xDMXAddScreenReply),
(char *)&rep); (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXRemoveScreen(ClientPtr client) static int ProcDMXRemoveScreen(ClientPtr client)
@ -534,7 +534,7 @@ static int ProcDMXRemoveScreen(ClientPtr client)
WriteToClient(client, WriteToClient(client,
sizeof(xDMXRemoveScreenReply), sizeof(xDMXRemoveScreenReply),
(char *)&rep); (char *)&rep);
return client->noClientException; return Success;
} }
@ -678,7 +678,7 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
free(windows); free(windows);
free(screens); free(screens);
return client->noClientException; return Success;
} }
static int ProcDMXGetDesktopAttributes(ClientPtr client) static int ProcDMXGetDesktopAttributes(ClientPtr client)
@ -709,7 +709,7 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client)
swapl(&rep.shiftY, n); swapl(&rep.shiftY, n);
} }
WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep); WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXChangeDesktopAttributes(ClientPtr client) static int ProcDMXChangeDesktopAttributes(ClientPtr client)
@ -752,7 +752,7 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
WriteToClient(client, WriteToClient(client,
sizeof(xDMXChangeDesktopAttributesReply), sizeof(xDMXChangeDesktopAttributesReply),
(char *)&rep); (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXGetInputCount(ClientPtr client) static int ProcDMXGetInputCount(ClientPtr client)
@ -772,7 +772,7 @@ static int ProcDMXGetInputCount(ClientPtr client)
swapl(&rep.inputCount, n); swapl(&rep.inputCount, n);
} }
WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep); WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXGetInputAttributes(ClientPtr client) static int ProcDMXGetInputAttributes(ClientPtr client)
@ -810,7 +810,7 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
} }
WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep); WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
if (length) WriteToClient(client, length, (char *)attr.name); if (length) WriteToClient(client, length, (char *)attr.name);
return client->noClientException; return Success;
} }
static int ProcDMXAddInput(ClientPtr client) static int ProcDMXAddInput(ClientPtr client)
@ -861,7 +861,7 @@ static int ProcDMXAddInput(ClientPtr client)
swapl(&rep.physicalId, n); swapl(&rep.physicalId, n);
} }
WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep); WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXRemoveInput(ClientPtr client) static int ProcDMXRemoveInput(ClientPtr client)
@ -887,7 +887,7 @@ static int ProcDMXRemoveInput(ClientPtr client)
swapl(&rep.status, n); swapl(&rep.status, n);
} }
WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep); WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
return client->noClientException; return Success;
} }
static int ProcDMXDispatch(ClientPtr client) static int ProcDMXDispatch(ClientPtr client)

View File

@ -208,8 +208,6 @@ static int dmxProcSetFontPath(ClientPtr client)
/* Restore old fontpath in the DMX server */ /* Restore old fontpath in the DMX server */
SetFontPath(client, nOldPaths, oldFontPath); SetFontPath(client, nOldPaths, oldFontPath);
client->errorValue = error; client->errorValue = error;
} else {
result = client->noClientException;
} }
} }

View File

@ -97,17 +97,17 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver; EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa; EphyrFakexaPriv *fakexa = scrpriv->fakexa;
CARD32 tmpval[3]; ChangeGCVal tmpval[3];
ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST);
fakexa->pDst = pPix; fakexa->pDst = pPix;
fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen); fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen);
tmpval[0] = alu; tmpval[0].val = alu;
tmpval[1] = pm; tmpval[1].val = pm;
tmpval[2] = fg; tmpval[2].val = fg;
dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL); ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval);
ValidateGC(&pPix->drawable, fakexa->pGC); ValidateGC(&pPix->drawable, fakexa->pGC);
@ -161,7 +161,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver; EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa; EphyrFakexaPriv *fakexa = scrpriv->fakexa;
CARD32 tmpval[2]; ChangeGCVal tmpval[2];
ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST);
ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC);
@ -170,9 +170,9 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
fakexa->pDst = pDst; fakexa->pDst = pDst;
fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen); fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen);
tmpval[0] = alu; tmpval[0].val = alu;
tmpval[1] = pm; tmpval[1].val = pm;
dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL); ChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
ValidateGC(&pDst->drawable, fakexa->pGC); ValidateGC(&pDst->drawable, fakexa->pGC);

View File

@ -636,7 +636,7 @@ ProcXF86DRIQueryVersion (register ClientPtr client)
} }
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -674,7 +674,7 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -717,7 +717,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client)
if (rep.busIdStringLength) if (rep.busIdStringLength)
WriteToClient(client, rep.busIdStringLength, busIdString); WriteToClient(client, rep.busIdStringLength, busIdString);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -744,7 +744,7 @@ ProcXF86DRIAuthConnection (register ClientPtr client)
} }
WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -763,7 +763,7 @@ ProcXF86DRICloseConnection (register ClientPtr client)
*/ */
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -802,7 +802,7 @@ ProcXF86DRIGetClientDriverName (register ClientPtr client)
rep.clientDriverNameLength, rep.clientDriverNameLength,
clientDriverName); clientDriverName);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -848,7 +848,7 @@ ProcXF86DRICreateContext (register ClientPtr client)
WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -868,7 +868,7 @@ ProcXF86DRIDestroyContext (register ClientPtr client)
} }
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static Bool static Bool
@ -1079,7 +1079,7 @@ ProcXF86DRICreateDrawable (ClientPtr client)
WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep);
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -1123,7 +1123,7 @@ ProcXF86DRIDestroyDrawable (register ClientPtr client)
pair->remote=0; pair->remote=0;
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -1257,7 +1257,7 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client)
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int
@ -1308,7 +1308,7 @@ ProcXF86DRIGetDeviceInfo (register ClientPtr client)
WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate);
} }
EPHYR_LOG ("leave\n") ; EPHYR_LOG ("leave\n") ;
return (client->noClientException); return Success;
} }
static int static int

View File

@ -58,7 +58,7 @@ KdSetColormap (ScreenPtr pScreen)
for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++)
pixels[i] = i; pixels[i] = i;
QueryColors (pCmap, (1 << pScreenPriv->screen->fb.depth), pixels, colors); QueryColors (pCmap, (1 << pScreenPriv->screen->fb.depth), pixels, colors, serverClient);
for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++)
{ {

View File

@ -1867,7 +1867,7 @@ void
KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
{ {
GCPtr pGC; GCPtr pGC;
CARD32 val[2]; ChangeGCVal val[2];
xRectangle *rects, *r; xRectangle *rects, *r;
BoxPtr pBox = REGION_RECTS (pRgn); BoxPtr pBox = REGION_RECTS (pRgn);
int nBox = REGION_NUM_RECTS (pRgn); int nBox = REGION_NUM_RECTS (pRgn);
@ -1890,9 +1890,9 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
if (!pGC) if (!pGC)
goto bail1; goto bail1;
val[0] = fg; val[0].val = fg;
val[1] = IncludeInferiors; val[1].val = IncludeInferiors;
dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL); ChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val);
ValidateGC (pDraw, pGC); ValidateGC (pDraw, pGC);

View File

@ -445,7 +445,7 @@ vfbInstallColormap(ColormapPtr pmap)
for (i = 0; i < entries; i++) ppix[i] = i; for (i = 0; i < entries; i++) ppix[i] = i;
/* XXX truecolor */ /* XXX truecolor */
QueryColors(pmap, entries, ppix, prgb); QueryColors(pmap, entries, ppix, prgb, serverClient);
for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */ for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */ defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */

View File

@ -1834,7 +1834,6 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
WindowPtr pWin = (WindowPtr)pDraw; WindowPtr pWin = (WindowPtr)pDraw;
XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin);
GCPtr pGC = NULL; GCPtr pGC = NULL;
XID pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes); BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes);
xRectangle *rects; xRectangle *rects;
@ -1846,6 +1845,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
if(!pGC) { if(!pGC) {
int status; int status;
XID pval[2];
pval[0] = key; pval[0] = key;
pval[1] = IncludeInferiors; pval[1] = IncludeInferiors;
pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status, pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status,
@ -1854,8 +1854,9 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
if (pPriv) pPriv->pGC = pGC; if (pPriv) pPriv->pGC = pGC;
} else if (key != pGC->fgPixel){ } else if (key != pGC->fgPixel){
pval[0] = key; ChangeGCVal val;
dixChangeGC(NullClient, pGC, GCForeground, pval, NULL); val.val = key;
ChangeGC(NullClient, pGC, GCForeground, &val);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }
@ -1881,7 +1882,7 @@ void
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
{ {
DrawablePtr root = &WindowTable[pScreen->myNum]->drawable; DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
XID pval[2]; ChangeGCVal pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes); BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes);
xRectangle *rects; xRectangle *rects;
@ -1890,9 +1891,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
if(!xf86Screens[pScreen->myNum]->vtSema) return; if(!xf86Screens[pScreen->myNum]->vtSema) return;
gc = GetScratchGC(root->depth, pScreen); gc = GetScratchGC(root->depth, pScreen);
pval[0] = key; pval[0].val = key;
pval[1] = IncludeInferiors; pval[1].val = IncludeInferiors;
(void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL); (void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval);
ValidateGC(root, gc); ValidateGC(root, gc);
rects = malloc(nbox * sizeof(xRectangle)); rects = malloc(nbox * sizeof(xRectangle));

View File

@ -129,7 +129,7 @@ ProcXDGAQueryVersion(ClientPtr client)
rep.minorVersion = SERVER_XDGA_MINOR_VERSION; rep.minorVersion = SERVER_XDGA_MINOR_VERSION;
WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -166,7 +166,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client)
if(rep.length) if(rep.length)
WriteToClient(client, nameSize, deviceName); WriteToClient(client, nameSize, deviceName);
return (client->noClientException); return Success;
} }
@ -185,7 +185,7 @@ ProcXDGACloseFramebuffer(ClientPtr client)
DGACloseFramebuffer(stuff->screen); DGACloseFramebuffer(stuff->screen);
return (client->noClientException); return Success;
} }
static int static int
@ -210,12 +210,12 @@ ProcXDGAQueryModes(ClientPtr client)
rep.number = 0; rep.number = 0;
rep.length = 0; rep.length = 0;
WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
return (client->noClientException); return Success;
} }
if(!(num = DGAGetModes(stuff->screen))) { if(!(num = DGAGetModes(stuff->screen))) {
WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
return (client->noClientException); return Success;
} }
if(!(mode = (XDGAModePtr)malloc(num * sizeof(XDGAModeRec)))) if(!(mode = (XDGAModePtr)malloc(num * sizeof(XDGAModeRec))))
@ -269,7 +269,7 @@ ProcXDGAQueryModes(ClientPtr client)
free(mode); free(mode);
return (client->noClientException); return Success;
} }
@ -342,7 +342,7 @@ ProcXDGASetMode(ClientPtr client)
DGASelectInput(stuff->screen, NULL, 0); DGASelectInput(stuff->screen, NULL, 0);
DGASetMode(stuff->screen, 0, &mode, &pPix); DGASetMode(stuff->screen, 0, &mode, &pPix);
WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep); WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
return (client->noClientException); return Success;
} }
if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix)) if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix))
@ -397,7 +397,7 @@ ProcXDGASetMode(ClientPtr client)
WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info)); WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
WriteToClient(client, size, mode.name); WriteToClient(client, size, mode.name);
return (client->noClientException); return Success;
} }
static int static int
@ -415,7 +415,7 @@ ProcXDGASetViewport(ClientPtr client)
DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags); DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags);
return (client->noClientException); return Success;
} }
static int static int
@ -435,14 +435,10 @@ ProcXDGAInstallColormap(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP, rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP,
client, DixInstallAccess); client, DixInstallAccess);
if (rc == Success) { if (rc != Success)
DGAInstallCmap(cmap);
return (client->noClientException);
} else {
return (rc == BadValue) ? BadColor : rc; return (rc == BadValue) ? BadColor : rc;
} DGAInstallCmap(cmap);
return Success;
return (client->noClientException);
} }
@ -462,7 +458,7 @@ ProcXDGASelectInput(ClientPtr client)
if(DGA_GETCLIENT(stuff->screen) == client) if(DGA_GETCLIENT(stuff->screen) == client)
DGASelectInput(stuff->screen, client, stuff->mask); DGASelectInput(stuff->screen, client, stuff->mask);
return (client->noClientException); return Success;
} }
@ -483,7 +479,7 @@ ProcXDGAFillRectangle(ClientPtr client)
stuff->width, stuff->height, stuff->color)) stuff->width, stuff->height, stuff->color))
return BadMatch; return BadMatch;
return (client->noClientException); return Success;
} }
static int static int
@ -503,7 +499,7 @@ ProcXDGACopyArea(ClientPtr client)
stuff->width, stuff->height, stuff->dstx, stuff->dsty)) stuff->width, stuff->height, stuff->dstx, stuff->dsty))
return BadMatch; return BadMatch;
return (client->noClientException); return Success;
} }
@ -524,7 +520,7 @@ ProcXDGACopyTransparentArea(ClientPtr client)
stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key)) stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key))
return BadMatch; return BadMatch;
return (client->noClientException); return Success;
} }
@ -548,7 +544,7 @@ ProcXDGAGetViewportStatus(ClientPtr client)
rep.status = DGAGetViewportStatus(stuff->screen); rep.status = DGAGetViewportStatus(stuff->screen);
WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep); WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -571,7 +567,7 @@ ProcXDGASync(ClientPtr client)
DGASync(stuff->screen); DGASync(stuff->screen);
WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep); WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -592,7 +588,7 @@ ProcXDGASetClientVersion(ClientPtr client)
pPriv->major = stuff->major; pPriv->major = stuff->major;
pPriv->minor = stuff->minor; pPriv->minor = stuff->minor;
return (client->noClientException); return Success;
} }
static int static int
@ -623,7 +619,7 @@ ProcXDGAChangePixmapMode(ClientPtr client)
rep.y = y; rep.y = y;
WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep); WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -649,7 +645,7 @@ ProcXDGACreateColormap(ClientPtr client)
if(result != Success) if(result != Success)
return result; return result;
return (client->noClientException); return Success;
} }
/* /*
@ -707,7 +703,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client)
rep.ram_size = rep.bank_size >> 10; rep.ram_size = rep.bank_size >> 10;
WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -762,7 +758,7 @@ ProcXF86DGADirectVideo(ClientPtr client)
DGA_SETCLIENT(stuff->screen, NULL); DGA_SETCLIENT(stuff->screen, NULL);
} }
return (client->noClientException); return Success;
} }
static int static int
@ -793,7 +789,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client)
rep.height = mode.viewportHeight; rep.height = mode.viewportHeight;
WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -819,7 +815,7 @@ ProcXF86DGASetViewPort(ClientPtr client)
!= Success) != Success)
return DGAErrorBase + XF86DGADirectNotActivated; return DGAErrorBase + XF86DGADirectNotActivated;
return (client->noClientException); return Success;
} }
static int static int
@ -838,7 +834,7 @@ ProcXF86DGAGetVidPage(ClientPtr client)
rep.vpage = 0; /* silently fail */ rep.vpage = 0; /* silently fail */
WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -854,7 +850,7 @@ ProcXF86DGASetVidPage(ClientPtr client)
/* silently fail */ /* silently fail */
return (client->noClientException); return Success;
} }
@ -880,7 +876,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
client, DixInstallAccess); client, DixInstallAccess);
if (rc == Success) { if (rc == Success) {
DGAInstallCmap(pcmp); DGAInstallCmap(pcmp);
return (client->noClientException); return Success;
} else { } else {
return (rc == BadValue) ? BadColor : rc; return (rc == BadValue) ? BadColor : rc;
} }
@ -905,7 +901,7 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client)
rep.flags = XF86DGADirectPresent; rep.flags = XF86DGADirectPresent;
WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -931,7 +927,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
rep.result = 1; rep.result = 1;
WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep);
return (client->noClientException); return Success;
} }
#endif /* DGA_PROTOCOL_OLD_SUPPORT */ #endif /* DGA_PROTOCOL_OLD_SUPPORT */

View File

@ -394,7 +394,7 @@ ProcXF86VidModeQueryVersion(ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -495,7 +495,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply), WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply),
(char *)&rep); (char *)&rep);
} }
return (client->noClientException); return Success;
} }
static int static int
@ -590,7 +590,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
} while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
return (client->noClientException); return Success;
} }
#define MODEMATCH(mode,stuff) \ #define MODEMATCH(mode,stuff) \
@ -761,7 +761,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("AddModeLine - Succeeded\n"); ErrorF("AddModeLine - Succeeded\n");
return client->noClientException; return Success;
} }
static int static int
@ -874,7 +874,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
VidModeDeleteModeline(stuff->screen, mode); VidModeDeleteModeline(stuff->screen, mode);
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("DeleteModeLine - Succeeded\n"); ErrorF("DeleteModeLine - Succeeded\n");
return(client->noClientException); return Success;
} }
} while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
@ -1002,7 +1002,7 @@ ProcXF86VidModeModModeLine(ClientPtr client)
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("ModModeLine - Succeeded\n"); ErrorF("ModModeLine - Succeeded\n");
return(client->noClientException); return Success;
} }
static int static int
@ -1120,7 +1120,7 @@ status_reply:
WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep); WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status); ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
return(client->noClientException); return Success;
} }
static int static int
@ -1137,7 +1137,7 @@ ProcXF86VidModeSwitchMode(ClientPtr client)
VidModeZoomViewport(stuff->screen, (short)stuff->zoom); VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
return (client->noClientException); return Success;
} }
static int static int
@ -1201,7 +1201,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock)
&& MODEMATCH(mode, stuff)) && MODEMATCH(mode, stuff))
return (client->noClientException); return Success;
if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
return BadValue; return BadValue;
@ -1230,7 +1230,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("SwitchToMode - Succeeded\n"); ErrorF("SwitchToMode - Succeeded\n");
return(client->noClientException); return Success;
} }
} while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
@ -1252,7 +1252,7 @@ ProcXF86VidModeLockModeSwitch(ClientPtr client)
if (!VidModeLockZoom(stuff->screen, (short)stuff->lock)) if (!VidModeLockZoom(stuff->screen, (short)stuff->lock))
return VidModeErrorBase + XF86VidModeZoomLocked; return VidModeErrorBase + XF86VidModeZoomLocked;
return (client->noClientException); return Success;
} }
static int static int
@ -1339,7 +1339,7 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
free(hsyncdata); free(hsyncdata);
free(vsyncdata); free(vsyncdata);
return (client->noClientException); return Success;
} }
static int static int
@ -1371,7 +1371,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
swapl(&rep.y, n); swapl(&rep.y, n);
} }
WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -1389,7 +1389,7 @@ ProcXF86VidModeSetViewPort(ClientPtr client)
if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y)) if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
return BadValue; return BadValue;
return (client->noClientException); return Success;
} }
static int static int
@ -1453,7 +1453,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
} }
free(Clocks); free(Clocks);
return (client->noClientException); return Success;
} }
static int static int
@ -1472,7 +1472,7 @@ ProcXF86VidModeSetGamma(ClientPtr client)
((float)stuff->green)/10000., ((float)stuff->blue)/10000.)) ((float)stuff->green)/10000., ((float)stuff->blue)/10000.))
return BadValue; return BadValue;
return (client->noClientException); return Success;
} }
static int static int
@ -1506,7 +1506,7 @@ ProcXF86VidModeGetGamma(ClientPtr client)
swapl(&rep.blue, n); swapl(&rep.blue, n);
} }
WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep); WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -1533,7 +1533,7 @@ ProcXF86VidModeSetGammaRamp(ClientPtr client)
if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b)) if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
return BadValue; return BadValue;
return (client->noClientException); return Success;
} }
static int static int
@ -1584,7 +1584,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
free(ramp); free(ramp);
} }
return (client->noClientException); return Success;
} }
@ -1611,7 +1611,7 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
} }
WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep); WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -1641,7 +1641,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
} }
WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep); WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
return (client->noClientException); return Success;
} }
@ -1665,7 +1665,7 @@ ProcXF86VidModeSetClientVersion(ClientPtr client)
pPriv->major = stuff->major; pPriv->major = stuff->major;
pPriv->minor = stuff->minor; pPriv->minor = stuff->minor;
return (client->noClientException); return Success;
} }
static int static int

View File

@ -146,7 +146,7 @@ ProcXF86DRIQueryVersion(
swapl(&rep.patchVersion, n); swapl(&rep.patchVersion, n);
} }
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -185,7 +185,7 @@ ProcXF86DRIQueryDirectRenderingCapable(
WriteToClient(client, WriteToClient(client,
sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -228,7 +228,7 @@ ProcXF86DRIOpenConnection(
WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep);
if (rep.busIdStringLength) if (rep.busIdStringLength)
WriteToClient(client, rep.busIdStringLength, busIdString); WriteToClient(client, rep.busIdStringLength, busIdString);
return (client->noClientException); return Success;
} }
static int static int
@ -255,7 +255,7 @@ ProcXF86DRIAuthConnection(
rep.authenticated = 0; rep.authenticated = 0;
} }
WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -272,7 +272,7 @@ ProcXF86DRICloseConnection(
DRICloseConnection( screenInfo.screens[stuff->screen]); DRICloseConnection( screenInfo.screens[stuff->screen]);
return (client->noClientException); return Success;
} }
static int static int
@ -311,7 +311,7 @@ ProcXF86DRIGetClientDriverName(
WriteToClient(client, WriteToClient(client,
rep.clientDriverNameLength, rep.clientDriverNameLength,
clientDriverName); clientDriverName);
return (client->noClientException); return Success;
} }
static int static int
@ -343,7 +343,7 @@ ProcXF86DRICreateContext(
} }
WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -363,7 +363,7 @@ ProcXF86DRIDestroyContext(
return BadValue; return BadValue;
} }
return (client->noClientException); return Success;
} }
static int static int
@ -397,7 +397,7 @@ ProcXF86DRICreateDrawable(
} }
WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -425,7 +425,7 @@ ProcXF86DRIDestroyDrawable(
return BadValue; return BadValue;
} }
return (client->noClientException); return Success;
} }
static int static int
@ -533,7 +533,7 @@ ProcXF86DRIGetDrawableInfo(
(char *)pBackClipRects); (char *)pBackClipRects);
} }
return (client->noClientException); return Success;
} }
static int static int
@ -584,7 +584,7 @@ ProcXF86DRIGetDeviceInfo(
if (rep.length) { if (rep.length) {
WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate);
} }
return (client->noClientException); return Success;
} }
static int static int

View File

@ -91,7 +91,7 @@ ProcDRI2QueryVersion(ClientPtr client)
WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep); WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep);
return client->noClientException; return Success;
} }
static int static int
@ -129,7 +129,7 @@ ProcDRI2Connect(ClientPtr client)
WriteToClient(client, rep.driverNameLength, driverName); WriteToClient(client, rep.driverNameLength, driverName);
WriteToClient(client, rep.deviceNameLength, deviceName); WriteToClient(client, rep.deviceNameLength, deviceName);
return client->noClientException; return Success;
} }
static int static int
@ -151,7 +151,7 @@ ProcDRI2Authenticate(ClientPtr client)
rep.authenticated = DRI2Authenticate(pDraw->pScreen, stuff->magic); rep.authenticated = DRI2Authenticate(pDraw->pScreen, stuff->magic);
WriteToClient(client, sizeof(xDRI2AuthenticateReply), &rep); WriteToClient(client, sizeof(xDRI2AuthenticateReply), &rep);
return client->noClientException; return Success;
} }
static void static void
@ -188,7 +188,7 @@ ProcDRI2CreateDrawable(ClientPtr client)
if (status != Success) if (status != Success)
return status; return status;
return client->noClientException; return Success;
} }
static int static int
@ -203,7 +203,7 @@ ProcDRI2DestroyDrawable(ClientPtr client)
&pDrawable, &status)) &pDrawable, &status))
return status; return status;
return client->noClientException; return Success;
} }
@ -269,7 +269,7 @@ ProcDRI2GetBuffers(ClientPtr client)
return status; return status;
if (DRI2ThrottleClient(client, pDrawable)) if (DRI2ThrottleClient(client, pDrawable))
return client->noClientException; return Success;
attachments = (unsigned int *) &stuff[1]; attachments = (unsigned int *) &stuff[1];
buffers = DRI2GetBuffers(pDrawable, &width, &height, buffers = DRI2GetBuffers(pDrawable, &width, &height,
@ -278,7 +278,7 @@ ProcDRI2GetBuffers(ClientPtr client)
send_buffers_reply(client, pDrawable, buffers, count, width, height); send_buffers_reply(client, pDrawable, buffers, count, width, height);
return client->noClientException; return Success;
} }
static int static int
@ -296,7 +296,7 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client)
return status; return status;
if (DRI2ThrottleClient(client, pDrawable)) if (DRI2ThrottleClient(client, pDrawable))
return client->noClientException; return Success;
attachments = (unsigned int *) &stuff[1]; attachments = (unsigned int *) &stuff[1];
buffers = DRI2GetBuffersWithFormat(pDrawable, &width, &height, buffers = DRI2GetBuffersWithFormat(pDrawable, &width, &height,
@ -304,7 +304,7 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client)
send_buffers_reply(client, pDrawable, buffers, count, width, height); send_buffers_reply(client, pDrawable, buffers, count, width, height);
return client->noClientException; return Success;
} }
static int static int
@ -341,7 +341,7 @@ ProcDRI2CopyRegion(ClientPtr client)
WriteToClient(client, sizeof(xDRI2CopyRegionReply), &rep); WriteToClient(client, sizeof(xDRI2CopyRegionReply), &rep);
return client->noClientException; return Success;
} }
static void static void
@ -398,7 +398,7 @@ ProcDRI2SwapBuffers(ClientPtr client)
* also orders swaps. * also orders swaps.
*/ */
if (DRI2ThrottleClient(client, pDrawable)) if (DRI2ThrottleClient(client, pDrawable))
return client->noClientException; return Success;
target_msc = vals_to_card64(stuff->target_msc_lo, stuff->target_msc_hi); target_msc = vals_to_card64(stuff->target_msc_lo, stuff->target_msc_hi);
divisor = vals_to_card64(stuff->divisor_lo, stuff->divisor_hi); divisor = vals_to_card64(stuff->divisor_lo, stuff->divisor_hi);
@ -416,7 +416,7 @@ ProcDRI2SwapBuffers(ClientPtr client)
WriteToClient(client, sizeof(xDRI2SwapBuffersReply), &rep); WriteToClient(client, sizeof(xDRI2SwapBuffersReply), &rep);
return client->noClientException; return Success;
} }
static void static void
@ -456,7 +456,7 @@ ProcDRI2GetMSC(ClientPtr client)
WriteToClient(client, sizeof(xDRI2MSCReply), &rep); WriteToClient(client, sizeof(xDRI2MSCReply), &rep);
return client->noClientException; return Success;
} }
static int static int
@ -483,7 +483,7 @@ ProcDRI2WaitMSC(ClientPtr client)
if (status != Success) if (status != Success)
return status; return status;
return client->noClientException; return Success;
} }
int int
@ -498,7 +498,7 @@ ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, CARD64 msc, CARD64 sbc)
WriteToClient(client, sizeof(xDRI2MSCReply), &rep); WriteToClient(client, sizeof(xDRI2MSCReply), &rep);
return client->noClientException; return Success;
} }
static int static int
@ -518,7 +518,7 @@ ProcDRI2SwapInterval(ClientPtr client)
DRI2SwapInterval(pDrawable, stuff->interval); DRI2SwapInterval(pDrawable, stuff->interval);
return client->noClientException; return Success;
} }
static int static int
@ -548,7 +548,7 @@ ProcDRI2WaitSBC(ClientPtr client)
WriteToClient(client, sizeof(xDRI2MSCReply), &rep); WriteToClient(client, sizeof(xDRI2MSCReply), &rep);
return client->noClientException; return Success;
} }
static int static int
@ -613,7 +613,7 @@ SProcDRI2Connect(ClientPtr client)
rep.driverNameLength = 0; rep.driverNameLength = 0;
rep.deviceNameLength = 0; rep.deviceNameLength = 0;
return client->noClientException; return Success;
} }
static int static int

View File

@ -246,7 +246,7 @@ vgaInstallColormap(pmap)
for ( i=0; i<entries; i++) ppix[i] = i; for ( i=0; i<entries; i++) ppix[i] = i;
QueryColors( pmap, entries, ppix, prgb); QueryColors(pmap, entries, ppix, prgb, serverClient);
for ( i=0; i<entries; i++) /* convert xrgbs to xColorItems */ for ( i=0; i<entries; i++) /* convert xrgbs to xColorItems */
{ {

View File

@ -1867,7 +1867,7 @@ XAAWriteBitmapToCacheLinear(
){ ){
ScreenPtr pScreen = pScrn->pScreen; ScreenPtr pScreen = pScrn->pScreen;
PixmapPtr pScreenPix, pDstPix; PixmapPtr pScreenPix, pDstPix;
XID gcvals[2]; ChangeGCVal gcvals[2];
GCPtr pGC; GCPtr pGC;
pScreenPix = (*pScreen->GetScreenPixmap)(pScreen); pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
@ -1879,9 +1879,9 @@ XAAWriteBitmapToCacheLinear(
pScreenPix->devPrivate.ptr); pScreenPix->devPrivate.ptr);
pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen); pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
gcvals[0] = fg; gcvals[0].val = fg;
gcvals[1] = bg; gcvals[1].val = bg;
dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals, NULL); ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals);
ValidateGC((DrawablePtr)pDstPix, pGC); ValidateGC((DrawablePtr)pDstPix, pGC);
/* We've unwrapped already so these ops miss a sync */ /* We've unwrapped already so these ops miss a sync */

View File

@ -192,7 +192,7 @@ ProcAppleWMQueryVersion(
swapl(&rep.length, n); swapl(&rep.length, n);
} }
WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -383,7 +383,7 @@ ProcAppleWMDisableUpdate(
appleWMProcs->DisableUpdate(); appleWMProcs->DisableUpdate();
return (client->noClientException); return Success;
} }
static int static int
@ -395,7 +395,7 @@ ProcAppleWMReenableUpdate(
appleWMProcs->EnableUpdate(); appleWMProcs->EnableUpdate();
return (client->noClientException); return Success;
} }
@ -435,7 +435,7 @@ ProcAppleWMSetWindowMenu(
free(items); free(items);
free(shortcuts); free(shortcuts);
return (client->noClientException); return Success;
} }
static int static int
@ -447,7 +447,7 @@ ProcAppleWMSetWindowMenuCheck(
REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq); REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
X11ApplicationSetWindowMenuCheck(stuff->index); X11ApplicationSetWindowMenuCheck(stuff->index);
return (client->noClientException); return Success;
} }
static int static int
@ -458,7 +458,7 @@ ProcAppleWMSetFrontProcess(
REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq); REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
X11ApplicationSetFrontProcess(); X11ApplicationSetFrontProcess();
return (client->noClientException); return Success;
} }
static int static int
@ -483,7 +483,7 @@ ProcAppleWMSetWindowLevel(register ClientPtr client)
return err; return err;
} }
return (client->noClientException); return Success;
} }
static int static int
@ -502,7 +502,7 @@ ProcAppleWMSendPSN(register ClientPtr client)
return err; return err;
} }
return (client->noClientException); return Success;
} }
static int static int
@ -532,7 +532,7 @@ ProcAppleWMAttachTransient(register ClientPtr client)
return err; return err;
} }
return (client->noClientException); return Success;
} }
static int static int
@ -545,7 +545,7 @@ ProcAppleWMSetCanQuit(
REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq); REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
X11ApplicationSetCanQuit(stuff->state); X11ApplicationSetCanQuit(stuff->state);
return (client->noClientException); return Success;
} }
@ -581,7 +581,7 @@ ProcAppleWMFrameGetRect(
rep.h = rr.y2 - rr.y1; rep.h = rr.y2 - rr.y1;
WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep); WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -611,7 +611,7 @@ ProcAppleWMFrameHitTest(
rep.ret = ret; rep.ret = ret;
WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep); WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -649,7 +649,7 @@ ProcAppleWMFrameDraw(
return errno; return errno;
} }
return (client->noClientException); return Success;
} }

View File

@ -202,7 +202,7 @@ static int ProcPseudoramiXGetState(ClientPtr client)
swaps (&rep.state, n); swaps (&rep.state, n);
} }
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
return client->noClientException; return Success;
} }
@ -231,7 +231,7 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
swaps (&rep.ScreenCount, n); swaps (&rep.ScreenCount, n);
} }
WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
return client->noClientException; return Success;
} }
@ -265,7 +265,7 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
swaps (&rep.height, n); swaps (&rep.height, n);
} }
WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
return client->noClientException; return Success;
} }
@ -290,7 +290,7 @@ static int ProcPseudoramiXIsActive(ClientPtr client)
swapl (&rep.state, n); swapl (&rep.state, n);
} }
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
return client->noClientException; return Success;
} }
@ -337,7 +337,7 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }

View File

@ -128,7 +128,7 @@ ProcAppleDRIQueryVersion(
swapl(&rep.length, n); swapl(&rep.length, n);
} }
WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -159,7 +159,7 @@ ProcAppleDRIQueryDirectRenderingCapable(
WriteToClient(client, WriteToClient(client,
sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep); sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -182,7 +182,7 @@ ProcAppleDRIAuthConnection(
rep.authenticated = 0; rep.authenticated = 0;
} }
WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep); WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static void surface_notify( static void surface_notify(
@ -247,7 +247,7 @@ ProcAppleDRICreateSurface(
rep.uid = sid; rep.uid = sid;
WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep); WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int
@ -271,7 +271,7 @@ ProcAppleDRIDestroySurface(
return BadValue; return BadValue;
} }
return (client->noClientException); return Success;
} }
static int static int
@ -323,7 +323,7 @@ ProcAppleDRICreatePixmap(ClientPtr client)
WriteReplyToClient(client, sizeof(rep), &rep); WriteReplyToClient(client, sizeof(rep), &rep);
(void)WriteToClient(client, rep.stringLength, path); (void)WriteToClient(client, rep.stringLength, path);
return (client->noClientException); return Success;
} }
static int static int
@ -342,7 +342,7 @@ ProcAppleDRIDestroyPixmap(ClientPtr client)
DRIDestroyPixmap(pDrawable); DRIDestroyPixmap(pDrawable);
return (client->noClientException); return Success;
} }
/* dispatch */ /* dispatch */

View File

@ -124,7 +124,7 @@ ProcWindowsWMQueryVersion(register ClientPtr client)
swapl(&rep.length, n); swapl(&rep.length, n);
} }
WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -335,7 +335,7 @@ ProcWindowsWMDisableUpdate (register ClientPtr client)
//winDisableUpdate(); //winDisableUpdate();
return (client->noClientException); return Success;
} }
static int static int
@ -345,7 +345,7 @@ ProcWindowsWMReenableUpdate (register ClientPtr client)
//winEnableUpdate(); //winEnableUpdate();
return (client->noClientException); return Success;
} }
@ -358,7 +358,7 @@ ProcWindowsWMSetFrontProcess (register ClientPtr client)
//QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0); //QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0);
return (client->noClientException); return Success;
} }
@ -414,7 +414,7 @@ ProcWindowsWMFrameGetRect (register ClientPtr client)
#endif #endif
WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *)&rep); WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *)&rep);
return (client->noClientException); return Success;
} }
@ -507,7 +507,7 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
ErrorF ("ProcWindowsWMFrameDraw - done\n"); ErrorF ("ProcWindowsWMFrameDraw - done\n");
#endif #endif
return (client->noClientException); return Success;
} }
static int static int
@ -566,7 +566,7 @@ ProcWindowsWMFrameSetTitle(
ErrorF ("ProcWindowsWMFrameSetTitle - done\n"); ErrorF ("ProcWindowsWMFrameSetTitle - done\n");
#endif #endif
return (client->noClientException); return Success;
} }

View File

@ -135,7 +135,8 @@ extern _X_EXPORT int QueryColors(
ColormapPtr /*pmap*/, ColormapPtr /*pmap*/,
int /*count*/, int /*count*/,
Pixel* /*ppixIn*/, Pixel* /*ppixIn*/,
xrgb* /*prgbList*/); xrgb* /*prgbList*/,
ClientPtr client);
extern _X_EXPORT int FreeClientPixels( extern _X_EXPORT int FreeClientPixels(
pointer /*pcr*/, pointer /*pcr*/,
@ -173,7 +174,8 @@ extern _X_EXPORT int FreeColors(
extern _X_EXPORT int StoreColors( extern _X_EXPORT int StoreColors(
ColormapPtr /*pmap*/, ColormapPtr /*pmap*/,
int /*count*/, int /*count*/,
xColorItem* /*defs*/); xColorItem* /*defs*/,
ClientPtr client);
extern _X_EXPORT int IsMapInstalled( extern _X_EXPORT int IsMapInstalled(
Colormap /*map*/, Colormap /*map*/,

View File

@ -93,11 +93,16 @@ typedef union {
pointer ptr; pointer ptr;
} ChangeGCVal, *ChangeGCValPtr; } ChangeGCVal, *ChangeGCValPtr;
extern _X_EXPORT int dixChangeGC( extern int ChangeGCXIDs(
ClientPtr /*client*/,
GCPtr /*pGC*/,
BITS32 /*mask*/,
CARD32 * /*pval*/);
extern _X_EXPORT int ChangeGC(
ClientPtr /*client*/, ClientPtr /*client*/,
GCPtr /*pGC*/, GCPtr /*pGC*/,
BITS32 /*mask*/, BITS32 /*mask*/,
CARD32 * /*pval*/,
ChangeGCValPtr /*pCGCV*/); ChangeGCValPtr /*pCGCV*/);
extern _X_EXPORT GCPtr CreateGC( extern _X_EXPORT GCPtr CreateGC(

View File

@ -59,6 +59,8 @@ SOFTWARE.
#include "privates.h" #include "privates.h"
#include <X11/Xprotostr.h> #include <X11/Xprotostr.h>
#define GCAllBits ((1 << (GCLastBit + 1)) - 1)
/* /*
* functions which modify the state of the GC * functions which modify the state of the GC
*/ */

View File

@ -213,16 +213,6 @@ typedef struct _miPolyArc {
miArcJoinPtr joins; miArcJoinPtr joins;
} miPolyArcRec, *miPolyArcPtr; } miPolyArcRec, *miPolyArcPtr;
#define GCValsFunction 0
#define GCValsForeground 1
#define GCValsBackground 2
#define GCValsLineWidth 3
#define GCValsCapStyle 4
#define GCValsJoinStyle 5
#define GCValsMask (GCFunction | GCForeground | GCBackground | \
GCLineWidth | GCCapStyle | GCJoinStyle)
static CARD32 gcvals[6];
static void fillSpans(DrawablePtr pDrawable, GCPtr pGC); static void fillSpans(DrawablePtr pDrawable, GCPtr pGC);
static void newFinalSpan(int y, int xmin, int xmax); static void newFinalSpan(int y, int xmin, int xmax);
static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right, static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right,
@ -1045,13 +1035,18 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
pGCTo = GetScratchGC(1, pDraw->pScreen); pGCTo = GetScratchGC(1, pDraw->pScreen);
if (!pGCTo) if (!pGCTo)
return; return;
gcvals[GCValsFunction] = GXcopy; {
gcvals[GCValsForeground] = 1; ChangeGCVal gcvals[6];
gcvals[GCValsBackground] = 0; gcvals[0].val = GXcopy;
gcvals[GCValsLineWidth] = pGC->lineWidth; gcvals[1].val = 1;
gcvals[GCValsCapStyle] = pGC->capStyle; gcvals[2].val = 0;
gcvals[GCValsJoinStyle] = pGC->joinStyle; gcvals[3].val = pGC->lineWidth;
dixChangeGC(NullClient, pGCTo, GCValsMask, gcvals, NULL); gcvals[4].val = pGC->capStyle;
gcvals[5].val = pGC->joinStyle;
ChangeGC(NullClient, pGCTo, GCFunction |
GCForeground | GCBackground | GCLineWidth |
GCCapStyle | GCJoinStyle, gcvals);
}
/* allocate a 1 bit deep pixmap of the appropriate size, and /* allocate a 1 bit deep pixmap of the appropriate size, and
* validate it */ * validate it */
@ -1090,11 +1085,14 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
iphase >= 0; iphase >= 0;
iphase--) iphase--)
{ {
ChangeGCVal gcval;
if (iphase == 1) { if (iphase == 1) {
dixChangeGC (NullClient, pGC, GCForeground, &bg, NULL); gcval.val = bg;
ChangeGC (NullClient, pGC, GCForeground, &gcval);
ValidateGC (pDraw, pGC); ValidateGC (pDraw, pGC);
} else if (pGC->lineStyle == LineDoubleDash) { } else if (pGC->lineStyle == LineDoubleDash) {
dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL); gcval.val = fg;
ChangeGC (NullClient, pGC, GCForeground, &gcval);
ValidateGC (pDraw, pGC); ValidateGC (pDraw, pGC);
} }
for (i = 0; i < polyArcs[iphase].narcs; i++) { for (i = 0; i < polyArcs[iphase].narcs; i++) {

View File

@ -426,7 +426,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
} }
/* First set the whole pixmap to 0 */ /* First set the whole pixmap to 0 */
gcv[0].val = 0; gcv[0].val = 0;
dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv); ChangeGC(NullClient, pGCT, GCBackground, gcv);
ValidateGC((DrawablePtr)pPixmap, pGCT); ValidateGC((DrawablePtr)pPixmap, pGCT);
miClearDrawable((DrawablePtr)pPixmap, pGCT); miClearDrawable((DrawablePtr)pPixmap, pGCT);
ppt = pptFirst = malloc(h * sizeof(DDXPointRec)); ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
@ -477,9 +477,9 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
gcv[2].val = dstx - srcx; gcv[2].val = dstx - srcx;
gcv[3].val = dsty; gcv[3].val = dsty;
dixChangeGC(NullClient, pGC, ChangeGC(NullClient, pGC,
GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin, GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin,
NULL, gcv); gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
/* Fill the drawable with the stipple. This will draw the /* Fill the drawable with the stipple. This will draw the
@ -495,7 +495,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
/* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only
* within the clipping region, the part outside is still all 0s */ * within the clipping region, the part outside is still all 0s */
gcv[0].val = GXinvert; gcv[0].val = GXinvert;
dixChangeGC(NullClient, pGCT, GCFunction, NULL, gcv); ChangeGC(NullClient, pGCT, GCFunction, gcv);
ValidateGC((DrawablePtr)pPixmap, pGCT); ValidateGC((DrawablePtr)pPixmap, pGCT);
(*pGCT->ops->CopyArea)((DrawablePtr)pPixmap, (DrawablePtr)pPixmap, (*pGCT->ops->CopyArea)((DrawablePtr)pPixmap, (DrawablePtr)pPixmap,
pGCT, 0, 0, w + srcx, h, 0, 0); pGCT, 0, 0, w + srcx, h, 0, 0);
@ -507,8 +507,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
gcv[0].val = pGC->bgPixel; gcv[0].val = pGC->bgPixel;
gcv[1].val = oldfg; gcv[1].val = oldfg;
gcv[2].ptr = pPixmap; gcv[2].ptr = pPixmap;
dixChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple, ChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple, gcv);
NULL, gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
/* PolyFillRect might have bashed the rectangle */ /* PolyFillRect might have bashed the rectangle */
rect.x = dstx; rect.x = dstx;
@ -526,9 +525,9 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
gcv[3].ptr = pStipple; gcv[3].ptr = pStipple;
gcv[4].val = oldOrg.x; gcv[4].val = oldOrg.x;
gcv[5].val = oldOrg.y; gcv[5].val = oldOrg.y;
dixChangeGC(NullClient, pGC, ChangeGC(NullClient, pGC,
GCForeground | GCBackground | GCFillStyle | GCStipple | GCForeground | GCBackground | GCFillStyle | GCStipple |
GCTileStipXOrigin | GCTileStipYOrigin, NULL, gcv); GCTileStipXOrigin | GCTileStipYOrigin, gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
/* put what we hope is a smaller clip region back in the scratch gc */ /* put what we hope is a smaller clip region back in the scratch gc */
@ -646,7 +645,6 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
unsigned char depth; unsigned char depth;
int i, linelength, width, srcx, srcy; int i, linelength, width, srcx, srcy;
DDXPointRec pt = {0, 0}; DDXPointRec pt = {0, 0};
XID gcv[2];
PixmapPtr pPixmap = NULL; PixmapPtr pPixmap = NULL;
GCPtr pGC = NULL; GCPtr pGC = NULL;
@ -655,6 +653,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
{ {
if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 ) if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
{ {
ChangeGCVal gcv;
xPoint pt; xPoint pt;
pGC = GetScratchGC(depth, pDraw->pScreen); pGC = GetScratchGC(depth, pDraw->pScreen);
@ -678,8 +677,8 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
TRUE); TRUE);
/* alu is already GXCopy */ /* alu is already GXCopy */
gcv[0] = (XID)planeMask; gcv.val = (XID)planeMask;
dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL); ChangeGC(NullClient, pGC, GCPlaneMask, &gcv);
ValidateGC((DrawablePtr)pPixmap, pGC); ValidateGC((DrawablePtr)pPixmap, pGC);
} }
@ -747,7 +746,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
RegionPtr prgnSrc; RegionPtr prgnSrc;
BoxRec box; BoxRec box;
unsigned long oldFg, oldBg; unsigned long oldFg, oldBg;
XID gcv[3]; ChangeGCVal gcv[3];
unsigned long oldPlanemask; unsigned long oldPlanemask;
unsigned long i; unsigned long i;
long bytesPer; long bytesPer;
@ -774,26 +773,26 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
oldPlanemask = pGC->planemask; oldPlanemask = pGC->planemask;
oldFg = pGC->fgPixel; oldFg = pGC->fgPixel;
oldBg = pGC->bgPixel; oldBg = pGC->bgPixel;
gcv[0] = (XID)~0; gcv[0].val = (XID)~0;
gcv[1] = (XID)0; gcv[1].val = (XID)0;
dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL); ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv);
bytesPer = (long)h * BitmapBytePad(w + leftPad); bytesPer = (long)h * BitmapBytePad(w + leftPad);
for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer) for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
{ {
if (i & oldPlanemask) if (i & oldPlanemask)
{ {
gcv[0] = (XID)i; gcv[0].val = (XID)i;
dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL); ChangeGC(NullClient, pGC, GCPlaneMask, gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad, (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
XYBitmap, (char *)pImage); XYBitmap, (char *)pImage);
} }
} }
gcv[0] = (XID)oldPlanemask; gcv[0].val = (XID)oldPlanemask;
gcv[1] = (XID)oldFg; gcv[1].val = (XID)oldFg;
gcv[2] = (XID)oldBg; gcv[2].val = (XID)oldBg;
dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL); ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
break; break;

View File

@ -222,7 +222,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
{ {
miDCCursorPtr pPriv; miDCCursorPtr pPriv;
GCPtr pGC; GCPtr pGC;
XID gcvals[3]; ChangeGCVal gcvals;
pPriv = malloc(sizeof (miDCCursorRec)); pPriv = malloc(sizeof (miDCCursorRec));
if (!pPriv) if (!pPriv)
@ -305,22 +305,22 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1, (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height, 0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->source); 0, XYPixmap, (char *)pCursor->bits->source);
gcvals[0] = GXand; gcvals.val = GXand;
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL); ChangeGC (NullClient, pGC, GCFunction, &gcvals);
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC); ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1, (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height, 0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask); 0, XYPixmap, (char *)pCursor->bits->mask);
/* mask bits -- pCursor->mask & ~pCursor->source */ /* mask bits -- pCursor->mask & ~pCursor->source */
gcvals[0] = GXcopy; gcvals.val = GXcopy;
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL); ChangeGC (NullClient, pGC, GCFunction, &gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC); ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1, (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height, 0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask); 0, XYPixmap, (char *)pCursor->bits->mask);
gcvals[0] = GXandInverted; gcvals.val = GXandInverted;
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL); ChangeGC (NullClient, pGC, GCFunction, &gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC); ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1, (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height, 0, 0, pCursor->bits->width, pCursor->bits->height,
@ -365,13 +365,13 @@ miDCPutBits (
unsigned long source, unsigned long source,
unsigned long mask) unsigned long mask)
{ {
XID gcvals[1]; ChangeGCVal gcval;
int x, y; int x, y;
if (sourceGC->fgPixel != source) if (sourceGC->fgPixel != source)
{ {
gcvals[0] = source; gcval.val = source;
dixChangeGC (NullClient, sourceGC, GCForeground, gcvals, NULL); ChangeGC (NullClient, sourceGC, GCForeground, &gcval);
} }
if (sourceGC->serialNumber != pDrawable->serialNumber) if (sourceGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, sourceGC); ValidateGC (pDrawable, sourceGC);
@ -390,8 +390,8 @@ miDCPutBits (
(*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y); (*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
if (maskGC->fgPixel != mask) if (maskGC->fgPixel != mask)
{ {
gcvals[0] = mask; gcval.val = mask;
dixChangeGC (NullClient, maskGC, GCForeground, gcvals, NULL); ChangeGC (NullClient, maskGC, GCForeground, &gcval);
} }
if (maskGC->serialNumber != pDrawable->serialNumber) if (maskGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, maskGC); ValidateGC (pDrawable, maskGC);

View File

@ -657,7 +657,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
return; return;
} }
dixChangeGC (NullClient, pGC, gcmask, NULL, gcval); ChangeGC (NullClient, pGC, gcmask, gcval);
ValidateGC (drawable, pGC); ValidateGC (drawable, pGC);
numRects = REGION_NUM_RECTS(prgn); numRects = REGION_NUM_RECTS(prgn);
@ -683,17 +683,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
void void
miClearDrawable(DrawablePtr pDraw, GCPtr pGC) miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
{ {
XID fg = pGC->fgPixel; ChangeGCVal fg, bg;
XID bg = pGC->bgPixel;
xRectangle rect; xRectangle rect;
fg.val = pGC->fgPixel;
bg.val = pGC->bgPixel;
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
rect.width = pDraw->width; rect.width = pDraw->width;
rect.height = pDraw->height; rect.height = pDraw->height;
dixChangeGC(NullClient, pGC, GCForeground, &bg, NULL); ChangeGC(NullClient, pGC, GCForeground, &bg);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
dixChangeGC(NullClient, pGC, GCForeground, &fg, NULL); ChangeGC(NullClient, pGC, GCForeground, &fg);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }

View File

@ -107,7 +107,7 @@ miPolyGlyphBlt(
int nbyGlyphWidth; /* bytes per scanline of glyph */ int nbyGlyphWidth; /* bytes per scanline of glyph */
int nbyPadGlyph; /* server padded line of glyph */ int nbyPadGlyph; /* server padded line of glyph */
XID gcvals[3]; ChangeGCVal gcvals[3];
if (pGC->miTranslate) if (pGC->miTranslate)
{ {
@ -134,11 +134,11 @@ miPolyGlyphBlt(
return; return;
} }
gcvals[0] = GXcopy; gcvals[0].val = GXcopy;
gcvals[1] = 1; gcvals[1].val = 1;
gcvals[2] = 0; gcvals[2].val = 0;
dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, NULL); ChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals);
nbyLine = BitmapBytePad(width); nbyLine = BitmapBytePad(width);
pbits = malloc(height*nbyLine); pbits = malloc(height*nbyLine);
@ -209,7 +209,7 @@ miImageGlyphBlt(
) )
{ {
ExtentInfoRec info; /* used by QueryGlyphExtents() */ ExtentInfoRec info; /* used by QueryGlyphExtents() */
XID gcvals[3]; ChangeGCVal gcvals[3];
int oldAlu, oldFS; int oldAlu, oldFS;
unsigned long oldFG; unsigned long oldFG;
xRectangle backrect; xRectangle backrect;
@ -234,25 +234,25 @@ miImageGlyphBlt(
oldFS = pGC->fillStyle; oldFS = pGC->fillStyle;
/* fill in the background */ /* fill in the background */
gcvals[0] = GXcopy; gcvals[0].val = GXcopy;
gcvals[1] = pGC->bgPixel; gcvals[1].val = pGC->bgPixel;
gcvals[2] = FillSolid; gcvals[2].val = FillSolid;
dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL); ChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect); (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
/* put down the glyphs */ /* put down the glyphs */
gcvals[0] = oldFG; gcvals[0].val = oldFG;
dixChangeGC(NullClient, pGC, GCForeground, gcvals, NULL); ChangeGC(NullClient, pGC, GCForeground, gcvals);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci, (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
pglyphBase); pglyphBase);
/* put all the toys away when done playing */ /* put all the toys away when done playing */
gcvals[0] = oldAlu; gcvals[0].val = oldAlu;
gcvals[1] = oldFG; gcvals[1].val = oldFG;
gcvals[2] = oldFS; gcvals[2].val = oldFS;
dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL); ChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
} }

View File

@ -68,7 +68,7 @@ miPolyPoint(
int xorg; int xorg;
int yorg; int yorg;
int nptTmp; int nptTmp;
XID fsOld, fsNew; ChangeGCVal fsOld, fsNew;
int *pwidthInit, *pwidth; int *pwidthInit, *pwidth;
int i; int i;
xPoint *ppt; xPoint *ppt;
@ -103,11 +103,11 @@ miPolyPoint(
} }
} }
fsOld = pGC->fillStyle; fsOld.val = pGC->fillStyle;
fsNew = FillSolid; fsNew.val = FillSolid;
if(pGC->fillStyle != FillSolid) if(pGC->fillStyle != FillSolid)
{ {
dixChangeGC(NullClient, pGC, GCFillStyle, &fsNew, NULL); ChangeGC(NullClient, pGC, GCFillStyle, &fsNew);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
} }
pwidth = pwidthInit; pwidth = pwidthInit;
@ -115,9 +115,9 @@ miPolyPoint(
*pwidth++ = 1; *pwidth++ = 1;
(*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE); (*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE);
if(fsOld != FillSolid) if(fsOld.val != FillSolid)
{ {
dixChangeGC(NullClient, pGC, GCFillStyle, &fsOld, NULL); ChangeGC(NullClient, pGC, GCFillStyle, &fsOld);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
} }
free(pwidthInit); free(pwidthInit);

View File

@ -52,6 +52,21 @@ from The Open Group.
#include "miwideline.h" #include "miwideline.h"
#include "mi.h" #include "mi.h"
static Bool
InitSpans(Spans *spans, size_t nspans)
{
spans->points = malloc(nspans * sizeof (*spans->points));
if (!spans->points)
return FALSE;
spans->widths = malloc(nspans * sizeof (*spans->widths));
if (!spans->widths)
{
free(spans->points);
return FALSE;
}
return TRUE;
}
/* /*
* interface data to span-merging polygon filler * interface data to span-merging polygon filler
*/ */
@ -90,6 +105,32 @@ static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
* spans-based polygon filler * spans-based polygon filler
*/ */
static void
fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, SpanDataPtr spanData)
{
if (!spanData)
{
ChangeGCVal oldPixel, tmpPixel;
oldPixel.val = pGC->fgPixel;
if (pixel != oldPixel.val)
{
tmpPixel.val = (XID)pixel;
ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
ValidateGC (pDrawable, pGC);
}
(*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
free(spans->widths);
free(spans->points);
if (pixel != oldPixel.val)
{
ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
ValidateGC (pDrawable, pGC);
}
}
else
AppendSpanGroup (pGC, pixel, spans, spanData);
}
static void static void
miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
SpanDataPtr spanData, int y, int overall_height, SpanDataPtr spanData, int y, int overall_height,
@ -110,51 +151,14 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
int left_height = 0, right_height = 0; int left_height = 0, right_height = 0;
DDXPointPtr ppt; DDXPointPtr ppt;
DDXPointPtr pptInit = NULL;
int *pwidth; int *pwidth;
int *pwidthInit = NULL;
XID oldPixel;
int xorg; int xorg;
Spans spanRec; Spans spanRec;
left_height = 0; if (!InitSpans(&spanRec, overall_height))
right_height = 0; return;
ppt = spanRec.points;
if (!spanData) pwidth = spanRec.widths;
{
pptInit = malloc(overall_height * sizeof(*ppt));
if (!pptInit)
return;
pwidthInit = malloc(overall_height * sizeof(*pwidth));
if (!pwidthInit)
{
free(pptInit);
return;
}
ppt = pptInit;
pwidth = pwidthInit;
oldPixel = pGC->fgPixel;
if (pixel != oldPixel)
{
XID tmpPixel = (XID)pixel;
dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
ValidateGC (pDrawable, pGC);
}
}
else
{
spanRec.points = malloc(overall_height * sizeof (*ppt));
if (!spanRec.points)
return;
spanRec.widths = malloc(overall_height * sizeof (int));
if (!spanRec.widths)
{
free(spanRec.points);
return;
}
ppt = spanRec.points;
pwidth = spanRec.widths;
}
xorg = 0; xorg = 0;
if (pGC->miTranslate) if (pGC->miTranslate)
@ -226,22 +230,8 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
} }
} }
} }
if (!spanData) spanRec.count = ppt - spanRec.points;
{ fillSpans (pDrawable, pGC, pixel, &spanRec, spanData);
(*pGC->ops->FillSpans) (pDrawable, pGC, ppt - pptInit, pptInit, pwidthInit, TRUE);
free(pwidthInit);
free(pptInit);
if (pixel != oldPixel)
{
dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
ValidateGC (pDrawable, pGC);
}
}
else
{
spanRec.count = ppt - spanRec.points;
AppendSpanGroup (pGC, pixel, &spanRec, spanData);
}
} }
static void static void
@ -257,7 +247,7 @@ miFillRectPolyHelper (
{ {
DDXPointPtr ppt; DDXPointPtr ppt;
int *pwidth; int *pwidth;
XID oldPixel; ChangeGCVal oldPixel, tmpPixel;
Spans spanRec; Spans spanRec;
xRectangle rect; xRectangle rect;
@ -267,31 +257,24 @@ miFillRectPolyHelper (
rect.y = y; rect.y = y;
rect.width = w; rect.width = w;
rect.height = h; rect.height = h;
oldPixel = pGC->fgPixel; oldPixel.val = pGC->fgPixel;
if (pixel != oldPixel) if (pixel != oldPixel.val)
{ {
XID tmpPixel = (XID)pixel; tmpPixel.val = (XID)pixel;
dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL); ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect); (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
if (pixel != oldPixel) if (pixel != oldPixel.val)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }
else else
{ {
spanRec.points = malloc(h * sizeof (*ppt)); if (!InitSpans(&spanRec, h))
if (!spanRec.points)
return; return;
spanRec.widths = malloc(h * sizeof (int));
if (!spanRec.widths)
{
free(spanRec.points);
return;
}
ppt = spanRec.points; ppt = spanRec.points;
pwidth = spanRec.widths; pwidth = spanRec.widths;
@ -1058,10 +1041,7 @@ miLineArc (
double yorg, double yorg,
Bool isInt) Bool isInt)
{ {
DDXPointPtr points;
int *widths;
int xorgi = 0, yorgi = 0; int xorgi = 0, yorgi = 0;
XID oldPixel;
Spans spanRec; Spans spanRec;
int n; int n;
PolyEdgeRec edge1, edge2; PolyEdgeRec edge1, edge2;
@ -1105,62 +1085,16 @@ miLineArc (
} }
isInt = FALSE; isInt = FALSE;
} }
if (!spanData) if (!InitSpans(&spanRec, pGC->lineWidth))
{ return;
points = malloc(sizeof(DDXPointRec) * pGC->lineWidth);
if (!points)
return;
widths = malloc(sizeof(int) * pGC->lineWidth);
if (!widths)
{
free(points);
return;
}
oldPixel = pGC->fgPixel;
if (pixel != oldPixel)
{
XID tmpPixel = (XID)pixel;
dixChangeGC(NullClient, pGC, GCForeground, &tmpPixel, NULL);
ValidateGC (pDraw, pGC);
}
}
else
{
points = malloc(pGC->lineWidth * sizeof (DDXPointRec));
if (!points)
return;
widths = malloc(pGC->lineWidth * sizeof (int));
if (!widths)
{
free(points);
return;
}
spanRec.points = points;
spanRec.widths = widths;
}
if (isInt) if (isInt)
n = miLineArcI(pDraw, pGC, xorgi, yorgi, points, widths); n = miLineArcI(pDraw, pGC, xorgi, yorgi, spanRec.points, spanRec.widths);
else else
n = miLineArcD(pDraw, pGC, xorg, yorg, points, widths, n = miLineArcD(pDraw, pGC, xorg, yorg, spanRec.points, spanRec.widths,
&edge1, edgey1, edgeleft1, &edge1, edgey1, edgeleft1,
&edge2, edgey2, edgeleft2); &edge2, edgey2, edgeleft2);
spanRec.count = n;
if (!spanData) fillSpans (pDraw, pGC, pixel, &spanRec, spanData);
{
(*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, TRUE);
free(widths);
free(points);
if (pixel != oldPixel)
{
dixChangeGC(NullClient, pGC, GCForeground, &oldPixel, NULL);
ValidateGC (pDraw, pGC);
}
}
else
{
spanRec.count = n;
AppendSpanGroup (pGC, pixel, &spanRec, spanData);
}
} }
static void static void
@ -1565,20 +1499,19 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
{ {
if (pGC->lineStyle == LineDoubleDash) if (pGC->lineStyle == LineDoubleDash)
{ {
XID oldPixel, pixel; ChangeGCVal oldPixel, pixel;
pixel.val = pGC->bgPixel;
pixel = pGC->bgPixel; oldPixel.val = pGC->fgPixel;
oldPixel = pGC->fgPixel; if (pixel.val != oldPixel.val)
if (pixel != oldPixel)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &pixel, NULL); ChangeGC (NullClient, pGC, GCForeground, &pixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup); miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
miFreeSpanGroup (&spanData->bgGroup); miFreeSpanGroup (&spanData->bgGroup);
if (pixel != oldPixel) if (pixel.val != oldPixel.val)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }

View File

@ -78,13 +78,17 @@ typedef struct _LineFace {
#define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \ #define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
oldPixel = pGC->fgPixel; \ oldPixel = pGC->fgPixel; \
if (pixel != oldPixel) { \ if (pixel != oldPixel) { \
dixChangeGC (NullClient, pGC, GCForeground, (XID *) &pixel, NULL); \ ChangeGCVal gcval; \
gcval.val = pixel; \
ChangeGC (NullClient, pGC, GCForeground, &gcval); \
ValidateGC (pDrawable, pGC); \ ValidateGC (pDrawable, pGC); \
} \ } \
} }
#define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \ #define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
if (pixel != oldPixel) { \ if (pixel != oldPixel) { \
dixChangeGC (NullClient, pGC, GCForeground, (XID *) &oldPixel, NULL); \ ChangeGCVal gcval; \
gcval.val = oldPixel; \
ChangeGC (NullClient, pGC, GCForeground, &gcval); \
ValidateGC (pDrawable, pGC); \ ValidateGC (pDrawable, pGC); \
} \ } \
} }

View File

@ -803,7 +803,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) || if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled)) (pGC->fillStyle == FillStippled))
{ {
dixChangeGC(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel, NULL); ChangeGCVal gcval;
gcval.val = pGC->bgPixel;
ChangeGC(NullClient, pGC, GCForeground, &gcval);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }
pts = &points[numPts >> 1]; pts = &points[numPts >> 1];
@ -831,7 +833,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) || if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled)) (pGC->fillStyle == FillStippled))
{ {
dixChangeGC(NullClient, pGC, GCForeground, &fgPixel, NULL); ChangeGCVal gcval;
gcval.val = fgPixel;
ChangeGC(NullClient, pGC, GCForeground, &gcval);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }
} }

View File

@ -129,7 +129,7 @@ cwCreateBackingGC(GCPtr pGC, DrawablePtr pDrawable)
return FALSE; return FALSE;
pPriv->serialNumber = 0; pPriv->serialNumber = 0;
pPriv->stateChanges = (1 << (GCLastBit + 1)) - 1; pPriv->stateChanges = GCAllBits;
return TRUE; return TRUE;
} }
@ -188,7 +188,7 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if (pDrawable->serialNumber != pPriv->serialNumber || if (pDrawable->serialNumber != pPriv->serialNumber ||
(pPriv->stateChanges & (GCClipXOrigin|GCClipYOrigin|GCClipMask))) (pPriv->stateChanges & (GCClipXOrigin|GCClipYOrigin|GCClipMask)))
{ {
XID vals[2]; ChangeGCVal vals[2];
RegionPtr pCompositeClip; RegionPtr pCompositeClip;
pCompositeClip = REGION_CREATE (pScreen, NULL, 0); pCompositeClip = REGION_CREATE (pScreen, NULL, 0);
@ -202,10 +202,10 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
(*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION, (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
(pointer) pCompositeClip, 0); (pointer) pCompositeClip, 0);
vals[0] = x_off - pDrawable->x; vals[0].val = x_off - pDrawable->x;
vals[1] = y_off - pDrawable->y; vals[1].val = y_off - pDrawable->y;
dixChangeGC(NullClient, pBackingGC, ChangeGC(NullClient, pBackingGC,
(GCClipXOrigin | GCClipYOrigin), vals, NULL); (GCClipXOrigin | GCClipYOrigin), vals);
pPriv->serialNumber = pDrawable->serialNumber; pPriv->serialNumber = pDrawable->serialNumber;
/* /*
@ -223,11 +223,11 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x || if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x ||
(pGC->patOrg.y + y_off) != pBackingGC->patOrg.y) (pGC->patOrg.y + y_off) != pBackingGC->patOrg.y)
{ {
XID vals[2]; ChangeGCVal vals[2];
vals[0] = pGC->patOrg.x + x_off; vals[0].val = pGC->patOrg.x + x_off;
vals[1] = pGC->patOrg.y + y_off; vals[1].val = pGC->patOrg.y + y_off;
dixChangeGC(NullClient, pBackingGC, ChangeGC(NullClient, pBackingGC,
(GCTileStipXOrigin | GCTileStipYOrigin), vals, NULL); (GCTileStipXOrigin | GCTileStipYOrigin), vals);
} }
ValidateGC(pBackingDrawable, pBackingGC); ValidateGC(pBackingDrawable, pBackingGC);

View File

@ -752,7 +752,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
free(extra); free(extra);
} }
return client->noClientException; return Success;
} }
int int
@ -997,7 +997,7 @@ sendReply:
} }
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep);
return client->noClientException; return Success;
} }
int int
@ -1066,7 +1066,7 @@ ProcRRGetPanning (ClientPtr client)
swaps(&rep.border_bottom, n); swaps(&rep.border_bottom, n);
} }
WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep); WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep);
return client->noClientException; return Success;
} }
int int
@ -1145,7 +1145,7 @@ sendReply:
swaps(&rep.newTimestamp, n); swaps(&rep.newTimestamp, n);
} }
WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep); WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep);
return client->noClientException; return Success;
} }
int int
@ -1173,7 +1173,7 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
swaps (&reply.size, n); swaps (&reply.size, n);
} }
WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply); WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply);
return client->noClientException; return Success;
} }
int int
@ -1218,7 +1218,7 @@ ProcRRGetCrtcGamma (ClientPtr client)
WriteSwappedDataToClient (client, len, extra); WriteSwappedDataToClient (client, len, extra);
free(extra); free(extra);
} }
return client->noClientException; return Success;
} }
int int
@ -1383,5 +1383,5 @@ ProcRRGetCrtcTransform (ClientPtr client)
} }
WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply); WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
free(reply); free(reply);
return client->noClientException; return Success;
} }

View File

@ -65,7 +65,7 @@ ProcRRQueryVersion (ClientPtr client)
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static int static int

View File

@ -320,7 +320,7 @@ ProcRRCreateMode (ClientPtr client)
WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep); WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
/* Drop out reference to this mode */ /* Drop out reference to this mode */
RRModeDestroy (mode); RRModeDestroy (mode);
return client->noClientException; return Success;
} }
int int

View File

@ -527,7 +527,7 @@ ProcRRGetOutputInfo (ClientPtr client)
free(extra); free(extra);
} }
return client->noClientException; return Success;
} }
static void static void
@ -581,7 +581,7 @@ ProcRRSetOutputPrimary(ClientPtr client)
pScrPriv = rrGetScrPriv(pWin->drawable.pScreen); pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
return client->noClientException; return Success;
} }
int int
@ -617,5 +617,5 @@ ProcRRGetOutputPrimary(ClientPtr client)
WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep); WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
return client->noClientException; return Success;
} }

View File

@ -447,7 +447,7 @@ ProcRRListOutputProperties (ClientPtr client)
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
free(pAtoms); free(pAtoms);
} }
return(client->noClientException); return Success;
} }
int int
@ -493,7 +493,7 @@ ProcRRQueryOutputProperty (ClientPtr client)
extra); extra);
free(extra); free(extra);
} }
return(client->noClientException); return Success;
} }
int int
@ -566,7 +566,7 @@ ProcRRChangeOutputProperty (ClientPtr client)
if (err != Success) if (err != Success)
return err; return err;
else else
return client->noClientException; return Success;
} }
int int
@ -587,7 +587,7 @@ ProcRRDeleteOutputProperty (ClientPtr client)
RRDeleteOutputProperty(output, stuff->property); RRDeleteOutputProperty(output, stuff->property);
return client->noClientException; return Success;
} }
int int
@ -646,7 +646,7 @@ ProcRRGetOutputProperty (ClientPtr client)
swapl(&reply.nItems, n); swapl(&reply.nItems, n);
} }
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
return(client->noClientException); return Success;
} }
if (prop->immutable && stuff->delete) if (prop->immutable && stuff->delete)
@ -678,7 +678,7 @@ ProcRRGetOutputProperty (ClientPtr client)
swapl(&reply.nItems, n); swapl(&reply.nItems, n);
} }
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
return(client->noClientException); return Success;
} }
/* /*
@ -753,6 +753,6 @@ ProcRRGetOutputProperty (ClientPtr client)
*prev = prop->next; *prev = prop->next;
RRDestroyOutputProperty (prop); RRDestroyOutputProperty (prop);
} }
return(client->noClientException); return Success;
} }

View File

@ -244,7 +244,7 @@ ProcRRGetScreenSizeRange (ClientPtr client)
swaps(&rep.maxHeight, n); swaps(&rep.maxHeight, n);
} }
WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep); WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep);
return (client->noClientException); return Success;
} }
int int
@ -470,7 +470,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
WriteToClient (client, extraLen, (char *) extra); WriteToClient (client, extraLen, (char *) extra);
free(extra); free(extra);
} }
return client->noClientException; return Success;
} }
int int
@ -740,7 +740,7 @@ ProcRRGetScreenInfo (ClientPtr client)
WriteToClient (client, extraLen, (char *) extra); WriteToClient (client, extraLen, (char *) extra);
free(extra); free(extra);
} }
return (client->noClientException); return Success;
} }
int int
@ -975,7 +975,7 @@ sendReply:
} }
WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static CARD16 static CARD16

View File

@ -105,7 +105,7 @@ ProcRRXineramaQueryVersion(ClientPtr client)
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
int int
@ -143,7 +143,7 @@ ProcRRXineramaGetState(ClientPtr client)
swapl (&rep.window, n); swapl (&rep.window, n);
} }
WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
return client->noClientException; return Success;
} }
static Bool static Bool
@ -198,7 +198,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
swapl(&rep.window, n); swapl(&rep.window, n);
} }
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
return client->noClientException; return Success;
} }
int int
@ -234,7 +234,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
swapl(&rep.screen, n); swapl(&rep.screen, n);
} }
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
return client->noClientException; return Success;
} }
int int
@ -256,7 +256,7 @@ ProcRRXineramaIsActive(ClientPtr client)
swapl(&rep.state, n); swapl(&rep.state, n);
} }
WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
return client->noClientException; return Success;
} }
static void static void
@ -341,7 +341,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
static int static int

View File

@ -1903,7 +1903,7 @@ ProcRecordQueryVersion(ClientPtr client)
} }
(void)WriteToClient(client, sizeof(xRecordQueryVersionReply), (void)WriteToClient(client, sizeof(xRecordQueryVersionReply),
(char *)&rep); (char *)&rep);
return (client->noClientException); return Success;
} /* ProcRecordQueryVersion */ } /* ProcRecordQueryVersion */
@ -2347,7 +2347,7 @@ ProcRecordGetContext(ClientPtr client)
(char *)pri->pRanges); (char *)pri->pRanges);
} }
} }
err = client->noClientException; err = Success;
bailout: bailout:
for (i = 0; i < nRCAPs; i++) for (i = 0; i < nRCAPs; i++)

View File

@ -276,7 +276,7 @@ miInitIndexed (ScreenPtr pScreen,
/* /*
* Build mapping from pixel value to ARGB * Build mapping from pixel value to ARGB
*/ */
QueryColors (pColormap, num, pixels, rgb); QueryColors (pColormap, num, pixels, rgb, serverClient);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
p = pixels[i]; p = pixels[i];

View File

@ -45,7 +45,7 @@ miColorRects (PicturePtr pDst,
ScreenPtr pScreen = pDst->pDrawable->pScreen; ScreenPtr pScreen = pDst->pDrawable->pScreen;
CARD32 pixel; CARD32 pixel;
GCPtr pGC; GCPtr pGC;
CARD32 tmpval[5]; ChangeGCVal tmpval[5];
RegionPtr pClip; RegionPtr pClip;
unsigned long mask; unsigned long mask;
@ -54,14 +54,14 @@ miColorRects (PicturePtr pDst,
pGC = GetScratchGC (pDst->pDrawable->depth, pScreen); pGC = GetScratchGC (pDst->pDrawable->depth, pScreen);
if (!pGC) if (!pGC)
return; return;
tmpval[0] = GXcopy; tmpval[0].val = GXcopy;
tmpval[1] = pixel; tmpval[1].val = pixel;
tmpval[2] = pDst->subWindowMode; tmpval[2].val = pDst->subWindowMode;
mask = GCFunction | GCForeground | GCSubwindowMode; mask = GCFunction | GCForeground | GCSubwindowMode;
if (pClipPict->clientClipType == CT_REGION) if (pClipPict->clientClipType == CT_REGION)
{ {
tmpval[3] = pDst->clipOrigin.x - xoff; tmpval[3].val = pDst->clipOrigin.x - xoff;
tmpval[4] = pDst->clipOrigin.y - yoff; tmpval[4].val = pDst->clipOrigin.y - yoff;
mask |= GCClipXOrigin|GCClipYOrigin; mask |= GCClipXOrigin|GCClipYOrigin;
pClip = REGION_CREATE (pScreen, NULL, 1); pClip = REGION_CREATE (pScreen, NULL, 1);
@ -70,7 +70,7 @@ miColorRects (PicturePtr pDst,
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
} }
dixChangeGC (NullClient, pGC, mask, tmpval, NULL); ChangeGC (NullClient, pGC, mask, tmpval);
ValidateGC (pDst->pDrawable, pGC); ValidateGC (pDst->pDrawable, pGC);
if (xoff || yoff) if (xoff || yoff)
{ {
@ -129,7 +129,8 @@ miCompositeRects (CARD8 op,
int error; int error;
Pixel pixel; Pixel pixel;
GCPtr pGC; GCPtr pGC;
CARD32 tmpval[2]; ChangeGCVal gcvals[2];
XID tmpval[1];
rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!rgbaFormat) if (!rgbaFormat)
@ -145,10 +146,10 @@ miCompositeRects (CARD8 op,
pGC = GetScratchGC (rgbaFormat->depth, pScreen); pGC = GetScratchGC (rgbaFormat->depth, pScreen);
if (!pGC) if (!pGC)
goto bail3; goto bail3;
tmpval[0] = GXcopy; gcvals[0].val = GXcopy;
tmpval[1] = pixel; gcvals[1].val = pixel;
dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL); ChangeGC (NullClient, pGC, GCFunction | GCForeground, gcvals);
ValidateGC (&pPixmap->drawable, pGC); ValidateGC (&pPixmap->drawable, pGC);
one.x = 0; one.x = 0;
one.y = 0; one.y = 0;

View File

@ -290,7 +290,7 @@ ProcRenderQueryVersion (ClientPtr client)
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
return (client->noClientException); return Success;
} }
static VisualPtr static VisualPtr
@ -513,7 +513,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
} }
WriteToClient(client, rlength, (char *) reply); WriteToClient(client, rlength, (char *) reply);
free(reply); free(reply);
return client->noClientException; return Success;
} }
static int static int
@ -572,7 +572,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
WriteToClient(client, rlength, (char *) reply); WriteToClient(client, rlength, (char *) reply);
free(reply); free(reply);
return (client->noClientException); return Success;
} }
static int static int
@ -647,7 +647,6 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
REQUEST(xRenderSetPictureClipRectanglesReq); REQUEST(xRenderSetPictureClipRectanglesReq);
PicturePtr pPicture; PicturePtr pPicture;
int nr; int nr;
int result;
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess); VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess);
@ -658,13 +657,9 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
if (nr & 4) if (nr & 4)
return BadLength; return BadLength;
nr >>= 3; nr >>= 3;
result = SetPictureClipRects (pPicture, return SetPictureClipRects (pPicture,
stuff->xOrigin, stuff->yOrigin, stuff->xOrigin, stuff->yOrigin,
nr, (xRectangle *) &stuff[1]); nr, (xRectangle *) &stuff[1]);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
static int static int
@ -677,7 +672,7 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess); VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess);
FreeResource (stuff->picture, RT_NONE); FreeResource (stuff->picture, RT_NONE);
return(client->noClientException); return Success;
} }
static Bool static Bool
@ -772,7 +767,7 @@ ProcRenderTrapezoids (ClientPtr client)
CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat,
stuff->xSrc, stuff->ySrc, stuff->xSrc, stuff->ySrc,
ntraps, (xTrapezoid *) &stuff[1]); ntraps, (xTrapezoid *) &stuff[1]);
return client->noClientException; return Success;
} }
static int static int
@ -812,7 +807,7 @@ ProcRenderTriangles (ClientPtr client)
CompositeTriangles (stuff->op, pSrc, pDst, pFormat, CompositeTriangles (stuff->op, pSrc, pDst, pFormat,
stuff->xSrc, stuff->ySrc, stuff->xSrc, stuff->ySrc,
ntris, (xTriangle *) &stuff[1]); ntris, (xTriangle *) &stuff[1]);
return client->noClientException; return Success;
} }
static int static int
@ -852,7 +847,7 @@ ProcRenderTriStrip (ClientPtr client)
CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, CompositeTriStrip (stuff->op, pSrc, pDst, pFormat,
stuff->xSrc, stuff->ySrc, stuff->xSrc, stuff->ySrc,
npoints, (xPointFixed *) &stuff[1]); npoints, (xPointFixed *) &stuff[1]);
return client->noClientException; return Success;
} }
static int static int
@ -892,7 +887,7 @@ ProcRenderTriFan (ClientPtr client)
CompositeTriFan (stuff->op, pSrc, pDst, pFormat, CompositeTriFan (stuff->op, pSrc, pDst, pFormat,
stuff->xSrc, stuff->ySrc, stuff->xSrc, stuff->ySrc,
npoints, (xPointFixed *) &stuff[1]); npoints, (xPointFixed *) &stuff[1]);
return client->noClientException; return Success;
} }
static int static int
@ -984,7 +979,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
glyphSet->refcnt++; glyphSet->refcnt++;
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
return BadAlloc; return BadAlloc;
return client->noClientException; return Success;
} }
#define NLOCALDELTA 64 #define NLOCALDELTA 64
@ -1006,7 +1001,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
} }
FreeResource (stuff->glyphset, RT_NONE); FreeResource (stuff->glyphset, RT_NONE);
return client->noClientException; return Success;
} }
typedef struct _GlyphNew { typedef struct _GlyphNew {
@ -1201,7 +1196,7 @@ ProcRenderAddGlyphs (ClientPtr client)
if (glyphsBase != glyphsLocal) if (glyphsBase != glyphsLocal)
free(glyphsBase); free(glyphsBase);
return client->noClientException; return Success;
bail: bail:
if (pSrc) if (pSrc)
FreePicture ((pointer) pSrc, 0); FreePicture ((pointer) pSrc, 0);
@ -1249,7 +1244,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
return RenderErrBase + BadGlyph; return RenderErrBase + BadGlyph;
} }
} }
return client->noClientException; return Success;
} }
static int static int
@ -1426,7 +1421,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
if (listsBase != listsLocal) if (listsBase != listsLocal)
free(listsBase); free(listsBase);
return client->noClientException; return Success;
} }
static int static int
@ -1457,7 +1452,7 @@ ProcRenderFillRectangles (ClientPtr client)
things, things,
(xRectangle *) &stuff[1]); (xRectangle *) &stuff[1]);
return client->noClientException; return Success;
} }
static void static void
@ -1682,7 +1677,7 @@ ProcRenderCreateCursor (ClientPtr client)
if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
return BadAlloc; return BadAlloc;
return client->noClientException; return Success;
} }
static int static int
@ -1690,15 +1685,10 @@ ProcRenderSetPictureTransform (ClientPtr client)
{ {
REQUEST(xRenderSetPictureTransformReq); REQUEST(xRenderSetPictureTransformReq);
PicturePtr pPicture; PicturePtr pPicture;
int result;
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess); VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess);
result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); return SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
static int static int
@ -1808,7 +1798,7 @@ ProcRenderQueryFilters (ClientPtr client)
WriteToClient(client, total_bytes, (char *) reply); WriteToClient(client, total_bytes, (char *) reply);
free(reply); free(reply);
return(client->noClientException); return Success;
} }
static int static int
@ -1871,7 +1861,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
return ret; return ret;
if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor))
return client->noClientException; return Success;
return BadAlloc; return BadAlloc;
} }
@ -1894,7 +1884,7 @@ ProcRenderAddTraps (ClientPtr client)
AddTraps (pPicture, AddTraps (pPicture,
stuff->xOff, stuff->yOff, stuff->xOff, stuff->yOff,
ntraps, (xTrap *) &stuff[1]); ntraps, (xTrap *) &stuff[1]);
return client->noClientException; return Success;
} }
static int ProcRenderCreateSolidFill(ClientPtr client) static int ProcRenderCreateSolidFill(ClientPtr client)

View File

@ -424,7 +424,7 @@ ProcXFixesGetCursorImage (ClientPtr client)
WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + WriteToClient(client, sizeof (xXFixesGetCursorImageReply) +
(npixels << 2), (char *) rep); (npixels << 2), (char *) rep);
free(rep); free(rep);
return client->noClientException; return Success;
} }
int int
@ -452,7 +452,7 @@ ProcXFixesSetCursorName (ClientPtr client)
return BadAlloc; return BadAlloc;
pCursor->name = atom; pCursor->name = atom;
return(client->noClientException); return Success;
} }
int int
@ -501,7 +501,7 @@ ProcXFixesGetCursorName (ClientPtr client)
WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply);
WriteToClient(client, len, str); WriteToClient(client, len, str);
return(client->noClientException); return Success;
} }
int int
@ -584,7 +584,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) +
(npixels << 2) + nbytesRound, (char *) rep); (npixels << 2) + nbytesRound, (char *) rep);
free(rep); free(rep);
return client->noClientException; return Success;
} }
int int
@ -719,7 +719,7 @@ ProcXFixesChangeCursor (ClientPtr client)
DixWriteAccess|DixSetAttrAccess); DixWriteAccess|DixSetAttrAccess);
ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); ReplaceCursor (pSource, TestForCursor, (pointer) pDestination);
return (client->noClientException); return Success;
} }
int int
@ -757,7 +757,7 @@ ProcXFixesChangeCursorByName (ClientPtr client)
name = MakeAtom (tchar, stuff->nbytes, FALSE); name = MakeAtom (tchar, stuff->nbytes, FALSE);
if (name) if (name)
ReplaceCursor (pSource, TestForCursorName, &name); ReplaceCursor (pSource, TestForCursorName, &name);
return (client->noClientException); return Success;
} }
int int
@ -895,7 +895,7 @@ ProcXFixesHideCursor (ClientPtr client)
pChc = findCursorHideCount(client, pWin->drawable.pScreen); pChc = findCursorHideCount(client, pWin->drawable.pScreen);
if (pChc != NULL) { if (pChc != NULL) {
pChc->hideCount++; pChc->hideCount++;
return client->noClientException; return Success;
} }
/* /*
@ -969,7 +969,7 @@ ProcXFixesShowCursor (ClientPtr client)
FreeResource(pChc->resource, 0); FreeResource(pChc->resource, 0);
} }
return (client->noClientException); return Success;
} }
int int

View File

@ -87,7 +87,7 @@ ProcXFixesCreateRegion (ClientPtr client)
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
int int
@ -132,7 +132,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
int int
@ -194,7 +194,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client)
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
int int
@ -244,7 +244,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
int int
@ -291,7 +291,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
int int
@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client)
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
FreeResource (stuff->region, RT_NONE); FreeResource (stuff->region, RT_NONE);
return(client->noClientException); return Success;
} }
int int
@ -355,7 +355,7 @@ ProcXFixesSetRegion (ClientPtr client)
return BadAlloc; return BadAlloc;
} }
REGION_DESTROY (0, pNew); REGION_DESTROY (0, pNew);
return(client->noClientException); return Success;
} }
int int
@ -383,7 +383,7 @@ ProcXFixesCopyRegion (ClientPtr client)
if (!REGION_COPY(pScreen, pDestination, pSource)) if (!REGION_COPY(pScreen, pDestination, pSource))
return BadAlloc; return BadAlloc;
return(client->noClientException); return Success;
} }
int int
@ -403,7 +403,6 @@ int
ProcXFixesCombineRegion (ClientPtr client) ProcXFixesCombineRegion (ClientPtr client)
{ {
RegionPtr pSource1, pSource2, pDestination; RegionPtr pSource1, pSource2, pDestination;
int ret = Success;
REQUEST (xXFixesCombineRegionReq); REQUEST (xXFixesCombineRegionReq);
REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq);
@ -414,21 +413,19 @@ ProcXFixesCombineRegion (ClientPtr client)
switch (stuff->xfixesReqType) { switch (stuff->xfixesReqType) {
case X_XFixesUnionRegion: case X_XFixesUnionRegion:
if (!REGION_UNION (0, pDestination, pSource1, pSource2)) if (!REGION_UNION (0, pDestination, pSource1, pSource2))
ret = BadAlloc; return BadAlloc;
break; break;
case X_XFixesIntersectRegion: case X_XFixesIntersectRegion:
if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2)) if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2))
ret = BadAlloc; return BadAlloc;
break; break;
case X_XFixesSubtractRegion: case X_XFixesSubtractRegion:
if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2)) if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2))
ret = BadAlloc; return BadAlloc;
break; break;
} }
if (ret == Success) return Success;
ret = client->noClientException;
return ret;
} }
int int
@ -450,7 +447,6 @@ ProcXFixesInvertRegion (ClientPtr client)
{ {
RegionPtr pSource, pDestination; RegionPtr pSource, pDestination;
BoxRec bounds; BoxRec bounds;
int ret = Success;
REQUEST(xXFixesInvertRegionReq); REQUEST(xXFixesInvertRegionReq);
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
@ -471,11 +467,9 @@ ProcXFixesInvertRegion (ClientPtr client)
bounds.y2 = stuff->y + stuff->height; bounds.y2 = stuff->y + stuff->height;
if (!REGION_INVERSE(0, pDestination, pSource, &bounds)) if (!REGION_INVERSE(0, pDestination, pSource, &bounds))
ret = BadAlloc; return BadAlloc;
if (ret == Success) return Success;
ret = client->noClientException;
return ret;
} }
int int
@ -505,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client)
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy);
return (client->noClientException); return Success;
} }
int int
@ -534,7 +528,7 @@ ProcXFixesRegionExtents (ClientPtr client)
REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource));
return (client->noClientException); return Success;
} }
int int
@ -602,7 +596,7 @@ ProcXFixesFetchRegion (ClientPtr client)
(void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) +
nBox * sizeof (xRectangle), (char *) reply); nBox * sizeof (xRectangle), (char *) reply);
free(reply); free(reply);
return (client->noClientException); return Success;
} }
int int
@ -622,7 +616,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
{ {
GCPtr pGC; GCPtr pGC;
RegionPtr pRegion; RegionPtr pRegion;
XID vals[2]; ChangeGCVal vals[2];
int rc; int rc;
REQUEST(xXFixesSetGCClipRegionReq); REQUEST(xXFixesSetGCClipRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
@ -640,12 +634,12 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
return BadAlloc; return BadAlloc;
} }
vals[0] = stuff->xOrigin; vals[0].val = stuff->xOrigin;
vals[1] = stuff->yOrigin; vals[1].val = stuff->yOrigin;
dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals, NULL); ChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals);
(*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0);
return (client->noClientException); return Success;
} }
int int
@ -741,7 +735,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
*pDestRegion = pRegion; *pDestRegion = pRegion;
(*pScreen->SetShape) (pWin); (*pScreen->SetShape) (pWin);
SendShapeNotify (pWin, stuff->destKind); SendShapeNotify (pWin, stuff->destKind);
return (client->noClientException); return Success;
} }
int int
@ -797,7 +791,6 @@ int
ProcXFixesExpandRegion (ClientPtr client) ProcXFixesExpandRegion (ClientPtr client)
{ {
RegionPtr pSource, pDestination; RegionPtr pSource, pDestination;
int ret = Success;
REQUEST (xXFixesExpandRegionReq); REQUEST (xXFixesExpandRegionReq);
BoxPtr pTmp; BoxPtr pTmp;
BoxPtr pSrc; BoxPtr pSrc;
@ -831,9 +824,7 @@ ProcXFixesExpandRegion (ClientPtr client)
} }
free(pTmp); free(pTmp);
} }
if (ret == Success) return Success;
ret = client->noClientException;
return ret;
} }
int int

View File

@ -57,11 +57,7 @@ ProcXFixesChangeSaveSet(ClientPtr client)
} }
toRoot = (stuff->target == SaveSetRoot); toRoot = (stuff->target == SaveSetRoot);
map = (stuff->map == SaveSetMap); map = (stuff->map == SaveSetMap);
result = AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map); return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
} }
int int

View File

@ -92,7 +92,7 @@ ProcXFixesQueryVersion(ClientPtr client)
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion, n);
} }
WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep);
return(client->noClientException); return Success;
} }
/* Major version controls available requests */ /* Major version controls available requests */

View File

@ -194,7 +194,7 @@ ProcXkbUseExtension(ClientPtr client)
swaps(&rep.serverMinor, n); swaps(&rep.serverMinor, n);
} }
WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep);
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -219,7 +219,7 @@ ProcXkbSelectEvents(ClientPtr client)
client->mapNotifyMask|= (stuff->affectMap&stuff->map); client->mapNotifyMask|= (stuff->affectMap&stuff->map);
} }
if ((stuff->affectWhich&(~XkbMapNotifyMask))==0) if ((stuff->affectWhich&(~XkbMapNotifyMask))==0)
return client->noClientException; return Success;
masks = XkbFindClientResource((DevicePtr)dev,client); masks = XkbFindClientResource((DevicePtr)dev,client);
if (!masks){ if (!masks){
@ -343,7 +343,7 @@ ProcXkbSelectEvents(ClientPtr client)
ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",dataLeft); ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",dataLeft);
return BadLength; return BadLength;
} }
return client->noClientException; return Success;
} }
return BadAlloc; return BadAlloc;
} }
@ -578,7 +578,7 @@ ProcXkbGetState(ClientPtr client)
swaps(&rep.ptrBtnState,n); swaps(&rep.ptrBtnState,n);
} }
WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep);
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -646,7 +646,7 @@ ProcXkbLatchLockState(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -722,7 +722,7 @@ ProcXkbGetControls(ClientPtr client)
swaps(&rep.axOptions, n); swaps(&rep.axOptions, n);
} }
WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep);
return(client->noClientException); return Success;
} }
int int
@ -942,7 +942,7 @@ ProcXkbSetControls(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -1406,7 +1406,7 @@ char *desc,*start;
WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep);
WriteToClient(client, len, start); WriteToClient(client, len, start);
free((char *)start); free((char *)start);
return client->noClientException; return Success;
} }
int int
@ -2594,7 +2594,7 @@ ProcXkbSetMap(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -2682,7 +2682,7 @@ int size;
WriteToClient(client, size, data); WriteToClient(client, size, data);
free((char *)data); free((char *)data);
} }
return client->noClientException; return Success;
} }
int int
@ -2923,7 +2923,7 @@ ProcXkbSetCompatMap(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -2960,7 +2960,7 @@ ProcXkbGetIndicatorState(ClientPtr client)
swapl(&rep.state,i); swapl(&rep.state,i);
} }
WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep);
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -3036,7 +3036,7 @@ register unsigned bit;
WriteToClient(client, length, (char *)map); WriteToClient(client, length, (char *)map);
free((char *)map); free((char *)map);
} }
return client->noClientException; return Success;
} }
int int
@ -3130,7 +3130,7 @@ ProcXkbSetIndicatorMap(ClientPtr client)
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
if (stuff->which==0) if (stuff->which==0)
return client->noClientException; return Success;
for (nIndicators=i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) { for (nIndicators=i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
if (stuff->which&bit) if (stuff->which&bit)
@ -3257,7 +3257,7 @@ ProcXkbGetNamedIndicator(ClientPtr client)
} }
WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep);
return client->noClientException; return Success;
} }
@ -3467,7 +3467,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -3757,7 +3757,7 @@ register int n;
WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep);
WriteToClient(client, length, start); WriteToClient(client, length, start);
free((char *)start); free((char *)start);
return client->noClientException; return Success;
} }
int int
@ -4286,7 +4286,7 @@ ProcXkbSetNames(ClientPtr client)
/* everything is okay -- update names */ /* everything is okay -- update names */
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -4787,7 +4787,7 @@ XkbSendGeometry( ClientPtr client,
free((char *)start); free((char *)start);
if (freeGeom) if (freeGeom)
XkbFreeGeometry(geom,XkbGeomAllMask,TRUE); XkbFreeGeometry(geom,XkbGeomAllMask,TRUE);
return client->noClientException; return Success;
} }
int int
@ -5414,7 +5414,7 @@ ProcXkbPerClientFlags(ClientPtr client)
swapl(&rep.autoCtrlValues,n); swapl(&rep.autoCtrlValues,n);
} }
WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep);
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -5548,7 +5548,7 @@ ProcXkbListComponents(ClientPtr client)
free(list.pool); free(list.pool);
list.pool= NULL; list.pool= NULL;
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -5891,7 +5891,7 @@ ProcXkbGetKbdByName(ClientPtr client)
if (names.compat) { free(names.compat); names.compat= NULL; } if (names.compat) { free(names.compat); names.compat= NULL; }
if (names.symbols) { free(names.symbols); names.symbols= NULL; } if (names.symbols) { free(names.symbols); names.symbols= NULL; }
if (names.geometry) { free(names.geometry); names.geometry= NULL; } if (names.geometry) { free(names.geometry); names.geometry= NULL; }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -6231,7 +6231,7 @@ char * str;
ErrorF("[xkb] Wrote %d fewer bytes than expected\n",length); ErrorF("[xkb] Wrote %d fewer bytes than expected\n",length);
return BadLength; return BadLength;
} }
return client->noClientException; return Success;
} }
static char * static char *
@ -6556,7 +6556,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
} }
} }
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/
@ -6619,7 +6619,7 @@ int rc;
swapl(&rep.supportedCtrls, n); swapl(&rep.supportedCtrls, n);
} }
WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep);
return client->noClientException; return Success;
} }
/***====================================================================***/ /***====================================================================***/