summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-08 22:16:32 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-13 17:14:07 -0700
commit11c69880c7c48ef9e755c4e09fadef7a629d7bc7 (patch)
tree94bf24f9b96a26c421c37739dfafb18cddf4c3b8
parenta3d948ddbb54b9e831e67f22d5031922a3c44107 (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>
-rw-r--r--dix/colormap.c26
-rw-r--r--dix/dispatch.c22
-rw-r--r--dix/window.c2
-rw-r--r--hw/kdrive/src/kcmap.c2
-rw-r--r--hw/vfb/InitOutput.c2
-rw-r--r--hw/xfree86/vgahw/vgaCmap.c2
-rw-r--r--include/colormap.h6
-rw-r--r--render/miindex.c2
8 files changed, 24 insertions, 40 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)) {
diff --git a/hw/kdrive/src/kcmap.c b/hw/kdrive/src/kcmap.c
index 40697e091..9bfdd78b6 100644
--- a/hw/kdrive/src/kcmap.c
+++ b/hw/kdrive/src/kcmap.c
@@ -58,7 +58,7 @@ KdSetColormap (ScreenPtr pScreen)
for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); 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++)
{
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 7af5f9335..0f0edb2a9 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -445,7 +445,7 @@ vfbInstallColormap(ColormapPtr pmap)
for (i = 0; i < entries; i++) ppix[i] = i;
/* XXX truecolor */
- QueryColors(pmap, entries, ppix, prgb);
+ QueryColors(pmap, entries, ppix, prgb, serverClient);
for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c
index dad71b93e..4720f4db8 100644
--- a/hw/xfree86/vgahw/vgaCmap.c
+++ b/hw/xfree86/vgahw/vgaCmap.c
@@ -246,7 +246,7 @@ vgaInstallColormap(pmap)
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 */
{
diff --git a/include/colormap.h b/include/colormap.h
index de48ce8d8..1b1574839 100644
--- a/include/colormap.h
+++ b/include/colormap.h
@@ -135,7 +135,8 @@ extern _X_EXPORT int QueryColors(
ColormapPtr /*pmap*/,
int /*count*/,
Pixel* /*ppixIn*/,
- xrgb* /*prgbList*/);
+ xrgb* /*prgbList*/,
+ ClientPtr client);
extern _X_EXPORT int FreeClientPixels(
pointer /*pcr*/,
@@ -173,7 +174,8 @@ extern _X_EXPORT int FreeColors(
extern _X_EXPORT int StoreColors(
ColormapPtr /*pmap*/,
int /*count*/,
- xColorItem* /*defs*/);
+ xColorItem* /*defs*/,
+ ClientPtr client);
extern _X_EXPORT int IsMapInstalled(
Colormap /*map*/,
diff --git a/render/miindex.c b/render/miindex.c
index c42a15b5e..5e2e06c35 100644
--- a/render/miindex.c
+++ b/render/miindex.c
@@ -276,7 +276,7 @@ miInitIndexed (ScreenPtr pScreen,
/*
* Build mapping from pixel value to ARGB
*/
- QueryColors (pColormap, num, pixels, rgb);
+ QueryColors (pColormap, num, pixels, rgb, serverClient);
for (i = 0; i < num; i++)
{
p = pixels[i];