diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-12 08:32:04 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-12 08:32:04 +0200 |
commit | 051d521f6e20761ba6831cecd91883da960fa931 (patch) | |
tree | b28abba7818115d2fed80eb360a79a0f9183948e /nx-X11/lib/X11/PolyTxt.c | |
parent | 6dce607bad8711dd06a5a7b69ad1930386b4123b (diff) | |
parent | b8de7bf654929c823080b211aeac56cd213f5a32 (diff) | |
download | nx-libs-051d521f6e20761ba6831cecd91883da960fa931.tar.gz nx-libs-051d521f6e20761ba6831cecd91883da960fa931.tar.bz2 nx-libs-051d521f6e20761ba6831cecd91883da960fa931.zip |
Merge branch 'uli42-pr/upgrade_libX11' into 3.6.x
Attributes GH PR #214: https://github.com/ArcticaProject/nx-libs/pull/214
Fixes ArcticaProject/nx-libs#157.
Diffstat (limited to 'nx-X11/lib/X11/PolyTxt.c')
-rw-r--r-- | nx-X11/lib/X11/PolyTxt.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/nx-X11/lib/X11/PolyTxt.c b/nx-X11/lib/X11/PolyTxt.c index 39beefe92..2f43c43d3 100644 --- a/nx-X11/lib/X11/PolyTxt.c +++ b/nx-X11/lib/X11/PolyTxt.c @@ -30,14 +30,15 @@ in this Software without prior written authorization from The Open Group. #include "Xlibint.h" int -XDrawText(dpy, d, gc, x, y, items, nitems) - register Display *dpy; - Drawable d; - GC gc; - int x, y; - XTextItem *items; - int nitems; -{ +XDrawText( + register Display *dpy, + Drawable d, + GC gc, + int x, + int y, + XTextItem *items, + int nitems) +{ register int i; register XTextItem *item; int length = 0; @@ -78,11 +79,11 @@ XDrawText(dpy, d, gc, x, y, items, nitems) req->length += (length + 3)>>2; /* convert to number of 32-bit words */ - /* + /* * If the entire request does not fit into the remaining space in the * buffer, flush the buffer first. If the request does fit into the * empty buffer, then we won't have to flush it at the end to keep - * the buffer 32-bit aligned. + * the buffer 32-bit aligned. */ if (dpy->bufptr + length > dpy->bufmax) @@ -120,9 +121,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems) { int nb = SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nb); + BufAlloc (char *, tbuf, nb); *tbuf = 0; /* elt->len */ - if (PartialDelta > 0 ) + if (PartialDelta > 0 ) { *(tbuf+1) = 127; /* elt->delta */ PartialDelta = PartialDelta - 127; @@ -136,7 +137,7 @@ XDrawText(dpy, d, gc, x, y, items, nitems) } if (PartialDelta) { - BufAlloc (char *, tbuf , nbytes); + BufAlloc (char *, tbuf , nbytes); *tbuf = 0; /* elt->len */ *(tbuf+1) = PartialDelta; /* elt->delta */ } @@ -147,9 +148,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems) { FirstTimeThrough = False; if (!item->delta) - { + { nbytes += SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nbytes); + BufAlloc (char *, tbuf, nbytes); *(tbuf+1) = 0; /* elt->delta */ } else @@ -178,9 +179,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems) { FirstTimeThrough = False; if (!item->delta) - { + { nbytes += SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nbytes); + BufAlloc (char *, tbuf, nbytes); *(tbuf+1) = 0; /* elt->delta */ } else @@ -192,7 +193,7 @@ XDrawText(dpy, d, gc, x, y, items, nitems) else { nbytes += SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nbytes); + BufAlloc (char *, tbuf, nbytes); *(tbuf+1) = 0; /* elt->delta */ } *tbuf = PartialNChars; /* elt->len */ @@ -206,23 +207,23 @@ XDrawText(dpy, d, gc, x, y, items, nitems) if (length &= 3) { char *pad; - /* + /* * BufAlloc is a macro that uses its last argument more than - * once, otherwise I'd write "BufAlloc (char *, pad, 4-length)" + * once, otherwise I'd write "BufAlloc (char *, pad, 4-length)" */ length = 4 - length; BufAlloc (char *, pad, length); - /* + /* * if there are 3 bytes of padding, the first byte MUST be 0 - * so the pad bytes aren't mistaken for a final xTextElt + * so the pad bytes aren't mistaken for a final xTextElt */ *pad = 0; } - /* + /* * If the buffer pointer is not now pointing to a 32-bit boundary, * we must flush the buffer so that it does point to a 32-bit boundary - * at the end of this routine. + * at the end of this routine. */ if ((dpy->bufptr - dpy->buffer) & 3) |