summaryrefslogtreecommitdiff
path: root/xserver/Xext/xres.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/Xext/xres.c')
-rw-r--r--xserver/Xext/xres.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/xserver/Xext/xres.c b/xserver/Xext/xres.c
index 445abcab8..546b942a1 100644
--- a/xserver/Xext/xres.c
+++ b/xserver/Xext/xres.c
@@ -193,7 +193,6 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
static int
ProcXResQueryVersion(ClientPtr client)
{
- REQUEST(xXResQueryVersionReq);
xXResQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
@@ -268,7 +267,7 @@ ProcXResQueryClients(ClientPtr client)
}
static void
-ResFindAllRes(pointer value, XID id, RESTYPE type, pointer cdata)
+ResFindAllRes(void *value, XID id, RESTYPE type, void *cdata)
{
int *counts = (int *) cdata;
@@ -354,9 +353,9 @@ static unsigned long
ResGetApproxPixmapBytes(PixmapPtr pix)
{
unsigned long nPixels;
- int bytesPerPixel;
+ float bytesPerPixel;
- bytesPerPixel = pix->drawable.bitsPerPixel >> 3;
+ bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0;
nPixels = pix->drawable.width * pix->drawable.height;
/* Divide by refcnt as pixmap could be shared between clients,
@@ -366,7 +365,7 @@ ResGetApproxPixmapBytes(PixmapPtr pix)
}
static void
-ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata)
+ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata)
{
SizeType sizeFunc = GetResourceTypeSizeFunc(type);
ResourceSizeRec size = { 0, 0, 0 };
@@ -377,7 +376,7 @@ ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata)
}
static void
-ResFindPixmaps(pointer value, XID id, pointer cdata)
+ResFindPixmaps(void *value, XID id, void *cdata)
{
unsigned long *bytes = (unsigned long *) cdata;
PixmapPtr pix = (PixmapPtr) value;
@@ -386,7 +385,7 @@ ResFindPixmaps(pointer value, XID id, pointer cdata)
}
static void
-ResFindWindowPixmaps(pointer value, XID id, pointer cdata)
+ResFindWindowPixmaps(void *value, XID id, void *cdata)
{
unsigned long *bytes = (unsigned long *) cdata;
WindowPtr pWin = (WindowPtr) value;
@@ -399,7 +398,7 @@ ResFindWindowPixmaps(pointer value, XID id, pointer cdata)
}
static void
-ResFindGCPixmaps(pointer value, XID id, pointer cdata)
+ResFindGCPixmaps(void *value, XID id, void *cdata)
{
unsigned long *bytes = (unsigned long *) cdata;
GCPtr pGC = (GCPtr) value;
@@ -412,7 +411,7 @@ ResFindGCPixmaps(pointer value, XID id, pointer cdata)
}
static void
-ResFindPicturePixmaps(pointer value, XID id, pointer cdata)
+ResFindPicturePixmaps(void *value, XID id, void *cdata)
{
#ifdef RENDER
ResFindResourcePixmaps(value, id, PictureType, cdata);
@@ -420,7 +419,7 @@ ResFindPicturePixmaps(pointer value, XID id, pointer cdata)
}
static void
-ResFindCompositeClientWindowPixmaps (pointer value, XID id, pointer cdata)
+ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
{
#ifdef COMPOSITE
ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata);
@@ -447,32 +446,32 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
bytes = 0;
FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
- (pointer) (&bytes));
+ (void *) (&bytes));
/*
* Make sure win background pixmaps also held to account.
*/
FindClientResourcesByType(clients[clientID], RT_WINDOW,
- ResFindWindowPixmaps, (pointer) (&bytes));
+ ResFindWindowPixmaps, (void *) (&bytes));
/*
* GC Tile & Stipple pixmaps too.
*/
FindClientResourcesByType(clients[clientID], RT_GC,
- ResFindGCPixmaps, (pointer) (&bytes));
+ ResFindGCPixmaps, (void *) (&bytes));
#ifdef RENDER
/* Render extension picture pixmaps. */
FindClientResourcesByType(clients[clientID], PictureType,
ResFindPicturePixmaps,
- (pointer)(&bytes));
+ (void *)(&bytes));
#endif
#ifdef COMPOSITE
/* Composite extension client window pixmaps. */
FindClientResourcesByType(clients[clientID], CompositeClientWindowType,
ResFindCompositeClientWindowPixmaps,
- (pointer)(&bytes));
+ (void *)(&bytes));
#endif
rep = (xXResQueryClientPixmapBytesReply) {
@@ -754,10 +753,10 @@ SwapXResQueryResourceBytes(struct xorg_list *response)
FindRes
*/
static void
-AddSubResourceSizeSpec(pointer value,
+AddSubResourceSizeSpec(void *value,
XID id,
RESTYPE type,
- pointer cdata)
+ void *cdata)
{
ConstructResourceBytesCtx *ctx = cdata;
@@ -819,7 +818,7 @@ AddSubResourceSizeSpec(pointer value,
FindRes
*/
static void
-AddResourceSizeValue(pointer ptr, XID id, RESTYPE type, pointer cdata)
+AddResourceSizeValue(void *ptr, XID id, RESTYPE type, void *cdata)
{
ConstructResourceBytesCtx *ctx = cdata;
if (ctx->status == Success &&
@@ -889,7 +888,7 @@ AddResourceSizeValue(pointer ptr, XID id, RESTYPE type, pointer cdata)
@param[in/out] cdata The context object that contains the resource type
*/
static void
-AddResourceSizeValueWithResType(pointer ptr, XID id, pointer cdata)
+AddResourceSizeValueWithResType(void *ptr, XID id, void *cdata)
{
ConstructResourceBytesCtx *ctx = cdata;
AddResourceSizeValue(ptr, id, ctx->resType, cdata);
@@ -907,7 +906,7 @@ AddResourceSizeValueWithResType(pointer ptr, XID id, pointer cdata)
type FindAllRes
*/
static void
-AddResourceSizeValueByResource(pointer ptr, XID id, RESTYPE type, pointer cdata)
+AddResourceSizeValueByResource(void *ptr, XID id, RESTYPE type, void *cdata)
{
ConstructResourceBytesCtx *ctx = cdata;
xXResResourceIdSpec *spec = ctx->curSpec;
@@ -1103,7 +1102,6 @@ ProcResDispatch(ClientPtr client)
static int
SProcXResQueryVersion(ClientPtr client)
{
- REQUEST(xXResQueryVersionReq);
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
return ProcXResQueryVersion(client);
}