diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-08 22:16:32 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-05-13 17:14:07 -0700 |
commit | 11c69880c7c48ef9e755c4e09fadef7a629d7bc7 (patch) | |
tree | 94bf24f9b96a26c421c37739dfafb18cddf4c3b8 /dix | |
parent | a3d948ddbb54b9e831e67f22d5031922a3c44107 (diff) |
Quit using clientErrorValue in dix/colormap.c.
And that's it! No more clientErrorValue kludge.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/colormap.c | 26 | ||||
-rw-r--r-- | dix/dispatch.c | 22 | ||||
-rw-r--r-- | dix/window.c | 2 |
3 files changed, 16 insertions, 34 deletions
diff --git a/dix/colormap.c b/dix/colormap.c index 9a4ff2845..f75eefe14 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -65,8 +65,6 @@ SOFTWARE. #include "privates.h" #include "xace.h" -extern XID clientErrorValue; - static Pixel FindBestPixel( EntryPtr /*pentFirst*/, int /*size*/, @@ -1415,7 +1413,7 @@ BlueComp (EntryPtr pent, xrgb *prgb) /* Read the color value of a cell */ int -QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) +QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList, ClientPtr client) { Pixel *ppix, pixel; xrgb *prgb; @@ -1438,14 +1436,14 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) { pixel = *ppix; if (pixel & rgbbad) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } i = (pixel & pVisual->redMask) >> pVisual->offsetRed; if (i >= numred) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } @@ -1453,7 +1451,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (i >= numgreen) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } @@ -1461,7 +1459,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (i >= numblue) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } @@ -1475,7 +1473,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) pixel = *ppix; if (pixel >= pVisual->ColormapEntries) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; } else @@ -2238,7 +2236,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask) } if ((mask != rmask) && count) { - clientErrorValue = *pixels | mask; + clients[client]->errorValue = *pixels | mask; result = BadValue; } /* 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; if ((pixTest >= numents) || (*pptr & rgbbad)) { - clientErrorValue = *pptr | bits; + clients[client]->errorValue = *pptr | bits; errVal = BadValue; continue; } @@ -2401,7 +2399,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe /* Redefine color values */ int -StoreColors (ColormapPtr pmap, int count, xColorItem *defs) +StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client) { Pixel pix; xColorItem *pdef; @@ -2439,7 +2437,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs) if (pdef->pixel & rgbbad) { errVal = BadValue; - clientErrorValue = pdef->pixel; + client->errorValue = pdef->pixel; continue; } pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed; @@ -2511,7 +2509,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs) defs[idef] = defs[n]; idef++; } else - clientErrorValue = pdef->pixel; + client->errorValue = pdef->pixel; } } else @@ -2522,7 +2520,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs) ok = TRUE; if (pdef->pixel >= pVisual->ColormapEntries) { - clientErrorValue = pdef->pixel; + client->errorValue = pdef->pixel; errVal = BadValue; ok = FALSE; } diff --git a/dix/dispatch.c b/dix/dispatch.c index fddfb709c..aee9143e9 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -176,13 +176,6 @@ CallbackListPtr ClientStateCallback; volatile char dispatchException = 0; 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) (\ (a.pScreen == b.pScreen)) @@ -2833,10 +2826,7 @@ ProcFreeColors(ClientPtr client) if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return rc; - } } else @@ -2864,14 +2854,11 @@ ProcStoreColors (ClientPtr client) if (count % sizeof(xColorItem)) return(BadLength); count /= sizeof(xColorItem); - rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); + rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1], client); if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return rc; - } } else { @@ -2899,7 +2886,7 @@ ProcStoreNamedColor (ClientPtr client) { def.flags = stuff->flags; def.pixel = stuff->pixel; - rc = StoreColors(pcmp, 1, &def); + rc = StoreColors(pcmp, 1, &def, client); if (client->noClientException != Success) return(client->noClientException); else @@ -2934,16 +2921,13 @@ ProcQueryColors(ClientPtr client) prgbs = calloc(1, count * sizeof(xrgb)); if(!prgbs && count) 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 (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return rc; - } } memset(&qcr, 0, sizeof(xQueryColorsReply)); qcr.type = X_Reply; diff --git a/dix/window.c b/dix/window.c index 57cebf46a..20cf45204 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3743,7 +3743,7 @@ DrawLogo(WindowPtr pWin) querypixels[0] = fore[0].val; querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb); + QueryColors(cmap, 2, querypixels, rgb, serverClient); if ((rgb[0].red == rgb[1].red) && (rgb[0].green == rgb[1].green) && (rgb[0].blue == rgb[1].blue)) { |