summaryrefslogtreecommitdiff
path: root/src/Glyph.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Glyph.c')
-rw-r--r--src/Glyph.c188
1 files changed, 94 insertions, 94 deletions
diff --git a/src/Glyph.c b/src/Glyph.c
index 9e1c2b3..77041a7 100644
--- a/src/Glyph.c
+++ b/src/Glyph.c
@@ -37,10 +37,10 @@ XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format)
RenderCheckExtension (dpy, info, 0);
LockDisplay(dpy);
GetReq(RenderCreateGlyphSet, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCreateGlyphSet;
- req->gsid = gsid = XAllocID(dpy);
- req->format = format->id;
+ req->gsid = (CARD32) (gsid = XAllocID(dpy));
+ req->format = (CARD32) format->id;
UnlockDisplay(dpy);
SyncHandle();
return gsid;
@@ -56,10 +56,10 @@ XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing)
RenderCheckExtension (dpy, info, 0);
LockDisplay(dpy);
GetReq(RenderReferenceGlyphSet, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderReferenceGlyphSet;
- req->gsid = gsid = XAllocID(dpy);
- req->existing = existing;
+ req->gsid = (CARD32) (gsid = XAllocID(dpy));
+ req->existing = (CARD32) existing;
UnlockDisplay(dpy);
SyncHandle();
return gsid;
@@ -74,9 +74,9 @@ XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset)
RenderSimpleCheckExtension (dpy, info);
LockDisplay(dpy);
GetReq(RenderFreeGlyphSet, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderFreeGlyphSet;
- req->glyphset = glyphset;
+ req->glyphset = (CARD32) glyphset;
UnlockDisplay(dpy);
SyncHandle();
}
@@ -99,10 +99,10 @@ XRenderAddGlyphs (Display *dpy,
RenderSimpleCheckExtension (dpy, info);
LockDisplay(dpy);
GetReq(RenderAddGlyphs, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderAddGlyphs;
- req->glyphset = glyphset;
- req->nglyphs = nglyphs;
+ req->glyphset = (CARD32) glyphset;
+ req->nglyphs = (CARD32) nglyphs;
len = (nglyphs * (SIZEOF (xGlyphInfo) + 4) + nbyte_images) >> 2;
SetReqLen(req, len, len);
Data32 (dpy, (long *) gids, nglyphs * 4);
@@ -125,9 +125,9 @@ XRenderFreeGlyphs (Display *dpy,
RenderSimpleCheckExtension (dpy, info);
LockDisplay(dpy);
GetReq(RenderFreeGlyphs, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderFreeGlyphs;
- req->glyphset = glyphset;
+ req->glyphset = (CARD32) glyphset;
len = nglyphs;
SetReqLen(req, len, len);
len <<= 2;
@@ -163,15 +163,15 @@ XRenderCompositeString8 (Display *dpy,
LockDisplay(dpy);
GetReq(RenderCompositeGlyphs8, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCompositeGlyphs8;
- req->op = op;
- req->src = src;
- req->dst = dst;
- req->maskFormat = maskFormat ? maskFormat->id : None;
- req->glyphset = glyphset;
- req->xSrc = xSrc;
- req->ySrc = ySrc;
+ req->op = (CARD8) op;
+ req->src = (CARD32) src;
+ req->dst = (CARD32) dst;
+ req->maskFormat = (CARD32) (maskFormat ? maskFormat->id : None);
+ req->glyphset = (CARD32) glyphset;
+ req->xSrc = (INT16) xSrc;
+ req->ySrc = (INT16) ySrc;
/*
* xGlyphElt must be aligned on a 32-bit boundary; this is
@@ -183,7 +183,7 @@ XRenderCompositeString8 (Display *dpy,
len = SIZEOF(xGlyphElt) * ((nchar + MAX_8-1) / MAX_8) + nchar;
- req->length += (len + 3)>>2; /* convert to number of 32-bit words */
+ req->length = (CARD16) (req->length + ((len + 3)>>2)); /* convert to number of 32-bit words */
/*
* If the entire request does not fit into the remaining space in the
@@ -198,8 +198,8 @@ XRenderCompositeString8 (Display *dpy,
nbytes = MAX_8 + SIZEOF(xGlyphElt);
BufAlloc (xGlyphElt *, elt, nbytes);
elt->len = MAX_8;
- elt->deltax = xDst;
- elt->deltay = yDst;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
xDst = 0;
yDst = 0;
memcpy ((char *) (elt + 1), string, MAX_8);
@@ -211,10 +211,10 @@ XRenderCompositeString8 (Display *dpy,
{
nbytes = (nchar + SIZEOF(xGlyphElt) + 3) & ~3;
BufAlloc (xGlyphElt *, elt, nbytes);
- elt->len = nchar;
- elt->deltax = xDst;
- elt->deltay = yDst;
- memcpy ((char *) (elt + 1), string, nchar);
+ elt->len = (CARD8) nchar;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
+ memcpy ((char *) (elt + 1), string, (size_t) nchar);
}
#undef MAX_8
@@ -248,21 +248,21 @@ XRenderCompositeString16 (Display *dpy,
LockDisplay(dpy);
GetReq(RenderCompositeGlyphs16, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCompositeGlyphs16;
- req->op = op;
- req->src = src;
- req->dst = dst;
- req->maskFormat = maskFormat ? maskFormat->id : None;
- req->glyphset = glyphset;
- req->xSrc = xSrc;
- req->ySrc = ySrc;
+ req->op = (CARD8) op;
+ req->src = (CARD32) src;
+ req->dst = (CARD32) dst;
+ req->maskFormat = (CARD32) (maskFormat ? maskFormat->id : None);
+ req->glyphset = (CARD32) glyphset;
+ req->xSrc = (INT16) xSrc;
+ req->ySrc = (INT16) ySrc;
#define MAX_16 254
len = SIZEOF(xGlyphElt) * ((nchar + MAX_16-1) / MAX_16) + nchar * 2;
- req->length += (len + 3)>>2; /* convert to number of 32-bit words */
+ req->length = (CARD16) (req->length + ((len + 3)>>2)); /* convert to number of 32-bit words */
/*
* If the entire request does not fit into the remaining space in the
@@ -277,8 +277,8 @@ XRenderCompositeString16 (Display *dpy,
nbytes = MAX_16 * 2 + SIZEOF(xGlyphElt);
BufAlloc (xGlyphElt *, elt, nbytes);
elt->len = MAX_16;
- elt->deltax = xDst;
- elt->deltay = yDst;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
xDst = 0;
yDst = 0;
memcpy ((char *) (elt + 1), (char *) string, MAX_16 * 2);
@@ -290,10 +290,10 @@ XRenderCompositeString16 (Display *dpy,
{
nbytes = (nchar * 2 + SIZEOF(xGlyphElt) + 3) & ~3;
BufAlloc (xGlyphElt *, elt, nbytes);
- elt->len = nchar;
- elt->deltax = xDst;
- elt->deltay = yDst;
- memcpy ((char *) (elt + 1), (char *) string, nchar * 2);
+ elt->len = (CARD8) nchar;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
+ memcpy ((char *) (elt + 1), (char *) string, (size_t) (nchar * 2));
}
#undef MAX_16
@@ -328,21 +328,21 @@ XRenderCompositeString32 (Display *dpy,
LockDisplay(dpy);
GetReq(RenderCompositeGlyphs32, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCompositeGlyphs32;
- req->op = op;
- req->src = src;
- req->dst = dst;
- req->maskFormat = maskFormat ? maskFormat->id : None;
- req->glyphset = glyphset;
- req->xSrc = xSrc;
- req->ySrc = ySrc;
+ req->op = (CARD8) op;
+ req->src = (CARD32) src;
+ req->dst = (CARD32) dst;
+ req->maskFormat = (CARD32) (maskFormat ? maskFormat->id : None);
+ req->glyphset = (CARD32) glyphset;
+ req->xSrc = (INT16) xSrc;
+ req->ySrc = (INT16) ySrc;
#define MAX_32 254
len = SIZEOF(xGlyphElt) * ((nchar + MAX_32-1) / MAX_32) + nchar * 4;
- req->length += (len + 3)>>2; /* convert to number of 32-bit words */
+ req->length = (CARD16) (req->length + ((len + 3)>>2)); /* convert to number of 32-bit words */
/*
* If the entire request does not fit into the remaining space in the
@@ -357,8 +357,8 @@ XRenderCompositeString32 (Display *dpy,
nbytes = MAX_32 * 4 + SIZEOF(xGlyphElt);
BufAlloc (xGlyphElt *, elt, nbytes);
elt->len = MAX_32;
- elt->deltax = xDst;
- elt->deltay = yDst;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
xDst = 0;
yDst = 0;
memcpy ((char *) (elt + 1), (char *) string, MAX_32 * 4);
@@ -370,10 +370,10 @@ XRenderCompositeString32 (Display *dpy,
{
nbytes = nchar * 4 + SIZEOF(xGlyphElt);
BufAlloc (xGlyphElt *, elt, nbytes);
- elt->len = nchar;
- elt->deltax = xDst;
- elt->deltay = yDst;
- memcpy ((char *) (elt + 1), (char *) string, nchar * 4);
+ elt->len = (CARD8) nchar;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
+ memcpy ((char *) (elt + 1), (char *) string, (size_t) (nchar * 4));
}
#undef MAX_32
@@ -407,15 +407,15 @@ XRenderCompositeText8 (Display *dpy,
LockDisplay(dpy);
GetReq(RenderCompositeGlyphs8, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCompositeGlyphs8;
- req->op = op;
- req->src = src;
- req->dst = dst;
- req->maskFormat = maskFormat ? maskFormat->id : None;
- req->glyphset = elts[0].glyphset;
- req->xSrc = xSrc;
- req->ySrc = ySrc;
+ req->op = (CARD8) op;
+ req->src = (CARD32) src;
+ req->dst = (CARD32) dst;
+ req->maskFormat = (CARD32) (maskFormat ? maskFormat->id : None);
+ req->glyphset = (CARD32) elts[0].glyphset;
+ req->xSrc = (INT16) xSrc;
+ req->ySrc = (INT16) ySrc;
/*
* Compute the space necessary
@@ -448,7 +448,7 @@ XRenderCompositeText8 (Display *dpy,
len += (elen + 3) >> 2;
}
- req->length += len;
+ req->length = (CARD16) (req->length + len);
/*
* Send the glyphs
@@ -481,9 +481,9 @@ XRenderCompositeText8 (Display *dpy,
int this_chars = nchars > MAX_8 ? MAX_8 : nchars;
BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
- elt->len = this_chars;
- elt->deltax = xDst;
- elt->deltay = yDst;
+ elt->len = (CARD8) this_chars;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
xDst = 0;
yDst = 0;
Data (dpy, chars, this_chars);
@@ -523,15 +523,15 @@ XRenderCompositeText16 (Display *dpy,
LockDisplay(dpy);
GetReq(RenderCompositeGlyphs16, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCompositeGlyphs16;
- req->op = op;
- req->src = src;
- req->dst = dst;
- req->maskFormat = maskFormat ? maskFormat->id : None;
- req->glyphset = elts[0].glyphset;
- req->xSrc = xSrc;
- req->ySrc = ySrc;
+ req->op = (CARD8) op;
+ req->src = (CARD32) src;
+ req->dst = (CARD32) dst;
+ req->maskFormat = (CARD32) (maskFormat ? maskFormat->id : None);
+ req->glyphset = (CARD32) elts[0].glyphset;
+ req->xSrc = (INT16) xSrc;
+ req->ySrc = (INT16) ySrc;
/*
* Compute the space necessary
@@ -564,7 +564,7 @@ XRenderCompositeText16 (Display *dpy,
len += (elen + 3) >> 2;
}
- req->length += len;
+ req->length = (CARD16) (req->length + len);
glyphset = elts[0].glyphset;
for (i = 0; i < nelt; i++)
@@ -595,9 +595,9 @@ XRenderCompositeText16 (Display *dpy,
int this_bytes = this_chars * 2;
BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
- elt->len = this_chars;
- elt->deltax = xDst;
- elt->deltay = yDst;
+ elt->len = (CARD8) this_chars;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
xDst = 0;
yDst = 0;
Data16 (dpy, chars, this_bytes);
@@ -638,15 +638,15 @@ XRenderCompositeText32 (Display *dpy,
GetReq(RenderCompositeGlyphs32, req);
- req->reqType = info->codes->major_opcode;
+ req->reqType = (CARD8) info->codes->major_opcode;
req->renderReqType = X_RenderCompositeGlyphs32;
- req->op = op;
- req->src = src;
- req->dst = dst;
- req->maskFormat = maskFormat ? maskFormat->id : None;
- req->glyphset = elts[0].glyphset;
- req->xSrc = xSrc;
- req->ySrc = ySrc;
+ req->op = (CARD8) op;
+ req->src = (CARD32) src;
+ req->dst = (CARD32) dst;
+ req->maskFormat = (CARD32) (maskFormat ? maskFormat->id : None);
+ req->glyphset = (CARD32) elts[0].glyphset;
+ req->xSrc = (INT16) xSrc;
+ req->ySrc = (INT16) ySrc;
/*
* Compute the space necessary
@@ -674,7 +674,7 @@ XRenderCompositeText32 (Display *dpy,
len += (elen + 3) >> 2;
}
- req->length += len;
+ req->length = (CARD16) (req->length + len);
glyphset = elts[0].glyphset;
for (i = 0; i < nelt; i++)
@@ -704,9 +704,9 @@ XRenderCompositeText32 (Display *dpy,
int this_chars = nchars > MAX_32 ? MAX_32 : nchars;
int this_bytes = this_chars * 4;
BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
- elt->len = this_chars;
- elt->deltax = xDst;
- elt->deltay = yDst;
+ elt->len = (CARD8) this_chars;
+ elt->deltax = (INT16) xDst;
+ elt->deltay = (INT16) yDst;
xDst = 0;
yDst = 0;
DataInt32 (dpy, chars, this_bytes);