diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2016-10-07 23:46:05 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:27 +0200 |
commit | e2e45b2b3abf46e4e5c27d7c655769f2b693446e (patch) | |
tree | 265fd610e8f45563804c32228df9ebafe3076c96 /nx-X11/lib | |
parent | 878040bf0bdb5d791cbe2ac6e07899c149517a79 (diff) | |
download | nx-libs-e2e45b2b3abf46e4e5c27d7c655769f2b693446e.tar.gz nx-libs-e2e45b2b3abf46e4e5c27d7c655769f2b693446e.tar.bz2 nx-libs-e2e45b2b3abf46e4e5c27d7c655769f2b693446e.zip |
Align files with upstream libX11-1.6.0
This commit looks a bit crazy at first glance. It (re-)introduces lots
of whitespaces and bad formatting.
Explanation: Backporting upstream changes lead to commits being
applied out of order. This meant a lot of manual intervention which in
turn lead to slight differences between upstream and NX.
With this commit these slight differences are minimized which will be
of great help when adding further upstream patches.
Diffstat (limited to 'nx-X11/lib')
42 files changed, 190 insertions, 194 deletions
diff --git a/nx-X11/lib/X11/AllCells.c b/nx-X11/lib/X11/AllCells.c index 6d9548f0d..6e97e1181 100644 --- a/nx-X11/lib/X11/AllCells.c +++ b/nx-X11/lib/X11/AllCells.c @@ -24,7 +24,6 @@ in this Software without prior written authorization from The Open Group. */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif diff --git a/nx-X11/lib/X11/ChProp.c b/nx-X11/lib/X11/ChProp.c index 1721168b4..190a224f8 100644 --- a/nx-X11/lib/X11/ChProp.c +++ b/nx-X11/lib/X11/ChProp.c @@ -65,7 +65,7 @@ XChangeProperty ( Data (dpy, (_Xconst char *)data, nelements); } /* else force BadLength */ break; - + case 16: len = ((long)nelements + 1)>>1; if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { diff --git a/nx-X11/lib/X11/DrArc.c b/nx-X11/lib/X11/DrArc.c index 61102e9b2..d72fac9d7 100644 --- a/nx-X11/lib/X11/DrArc.c +++ b/nx-X11/lib/X11/DrArc.c @@ -66,6 +66,7 @@ XDrawArc( arc->angle1 = angle1; arc->angle2 = angle2; + UnlockDisplay(dpy); SyncHandle(); return 1; diff --git a/nx-X11/lib/X11/ErrHndlr.c b/nx-X11/lib/X11/ErrHndlr.c index 4785ca157..167a68b1e 100644 --- a/nx-X11/lib/X11/ErrHndlr.c +++ b/nx-X11/lib/X11/ErrHndlr.c @@ -29,12 +29,12 @@ in this Software without prior written authorization from The Open Group. #endif #include "Xlibint.h" -/* +/* * XErrorHandler - This procedure sets the X non-fatal error handler * (_XErrorFunction) to be the specified routine. If NULL is passed in * the original error handler is restored. */ - + XErrorHandler XSetErrorHandler(XErrorHandler handler) { @@ -57,12 +57,12 @@ XSetErrorHandler(XErrorHandler handler) return (XErrorHandler) oldhandler; } -/* +/* * XIOErrorHandler - This procedure sets the X fatal I/O error handler - * (_XIOErrorFunction) to be the specified routine. If NULL is passed in + * (_XIOErrorFunction) to be the specified routine. If NULL is passed in * the original error handler is restored. */ - + XIOErrorHandler XSetIOErrorHandler(XIOErrorHandler handler) { diff --git a/nx-X11/lib/X11/FillRcts.c b/nx-X11/lib/X11/FillRcts.c index 7d9569124..ad334244f 100644 --- a/nx-X11/lib/X11/FillRcts.c +++ b/nx-X11/lib/X11/FillRcts.c @@ -63,3 +63,4 @@ XFillRectangles( SyncHandle(); return 1; } + diff --git a/nx-X11/lib/X11/Font.c b/nx-X11/lib/X11/Font.c index 298d96c63..d48b7d0ff 100644 --- a/nx-X11/lib/X11/Font.c +++ b/nx-X11/lib/X11/Font.c @@ -260,7 +260,6 @@ _XQueryFont ( * If no characters in font, then it is a bad font, but * shouldn't try to read nothing. */ - /* have to unpack charinfos on some machines (CRAY) */ fs->per_char = NULL; if (reply.nCharInfos > 0){ /* nCharInfos is a CARD32 */ @@ -507,11 +506,11 @@ _XF86BigfontQueryFont ( /* compares each part to half the maximum, which should be far more than any real font needs, so the combined total doesn't overflow either */ if (reply.nUniqCharInfos > ((ULONG_MAX / 2) / SIZEOF(xCharInfo)) || - reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) { - Xfree((char *) fs->properties); - Xfree((char *) fs); - _XEatDataWords(dpy, reply_left); - return (XFontStruct *)NULL; + reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) { + Xfree((char *) fs->properties); + Xfree((char *) fs); + _XEatDataWords(dpy, reply_left); + return (XFontStruct *)NULL; } #endif if (reply.nCharInfos > 0) { diff --git a/nx-X11/lib/X11/FreeGC.c b/nx-X11/lib/X11/FreeGC.c index cc9765551..ab994bc64 100644 --- a/nx-X11/lib/X11/FreeGC.c +++ b/nx-X11/lib/X11/FreeGC.c @@ -47,3 +47,4 @@ XFreeGC ( Xfree ((char *) gc); return 1; } + diff --git a/nx-X11/lib/X11/GetWAttrs.c b/nx-X11/lib/X11/GetWAttrs.c index 4d51893d6..c10824cf4 100644 --- a/nx-X11/lib/X11/GetWAttrs.c +++ b/nx-X11/lib/X11/GetWAttrs.c @@ -89,14 +89,14 @@ _XGetWindowAttributes( register Display *dpy, Window w, XWindowAttributes *attr) -{ +{ xGetGeometryReply rep; register xResourceReq *req; register int i; register Screen *sp; _XAsyncHandler async; _XWAttrsState async_state; - + GetResReq(GetWindowAttributes, w, req); async_state.attr_seq = dpy->request; diff --git a/nx-X11/lib/X11/ImUtil.c b/nx-X11/lib/X11/ImUtil.c index f9a21f839..16dd0fa79 100644 --- a/nx-X11/lib/X11/ImUtil.c +++ b/nx-X11/lib/X11/ImUtil.c @@ -543,8 +543,7 @@ static unsigned long _XGetPixel32 ( [y * ximage->bytes_per_line + (x << 2)]; if (*((const char *)&byteorderpixel) == ximage->byte_order) pixel = *((CARD32 *)addr); - else - if (ximage->byte_order == MSBFirst) + else if (ximage->byte_order == MSBFirst) pixel = ((unsigned long)addr[0] << 24 | (unsigned long)addr[1] << 16 | (unsigned long)addr[2] << 8 | @@ -732,8 +731,7 @@ static int _XPutPixel32 ( [y * ximage->bytes_per_line + (x << 2)]; if (*((const char *)&byteorderpixel) == ximage->byte_order) *((CARD32 *)addr) = pixel; - else - if (ximage->byte_order == MSBFirst) { + else if (ximage->byte_order == MSBFirst) { addr[0] = pixel >> 24; addr[1] = pixel >> 16; addr[2] = pixel >> 8; diff --git a/nx-X11/lib/X11/LiHosts.c b/nx-X11/lib/X11/LiHosts.c index 202deee02..83cf3c791 100644 --- a/nx-X11/lib/X11/LiHosts.c +++ b/nx-X11/lib/X11/LiHosts.c @@ -154,3 +154,4 @@ XHostAddress *XListHosts ( + diff --git a/nx-X11/lib/X11/LoadFont.c b/nx-X11/lib/X11/LoadFont.c index 88171a633..f547976ba 100644 --- a/nx-X11/lib/X11/LoadFont.c +++ b/nx-X11/lib/X11/LoadFont.c @@ -49,7 +49,7 @@ XLoadFont ( Data (dpy, name, nbytes); UnlockDisplay(dpy); SyncHandle(); - return (fid); + return (fid); /* can't return (req->fid) since request may have already been sent */ } diff --git a/nx-X11/lib/X11/PolyTxt.c b/nx-X11/lib/X11/PolyTxt.c index 2f43c43d3..471383b57 100644 --- a/nx-X11/lib/X11/PolyTxt.c +++ b/nx-X11/lib/X11/PolyTxt.c @@ -121,9 +121,9 @@ XDrawText( { 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; @@ -148,9 +148,9 @@ XDrawText( { FirstTimeThrough = False; if (!item->delta) - { + { nbytes += SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nbytes); + BufAlloc (char *, tbuf, nbytes); *(tbuf+1) = 0; /* elt->delta */ } else @@ -179,9 +179,9 @@ XDrawText( { FirstTimeThrough = False; if (!item->delta) - { + { nbytes += SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nbytes); + BufAlloc (char *, tbuf, nbytes); *(tbuf+1) = 0; /* elt->delta */ } else @@ -193,7 +193,7 @@ XDrawText( else { nbytes += SIZEOF(xTextElt); - BufAlloc (char *, tbuf, nbytes); + BufAlloc (char *, tbuf, nbytes); *(tbuf+1) = 0; /* elt->delta */ } *tbuf = PartialNChars; /* elt->len */ diff --git a/nx-X11/lib/X11/PolyTxt16.c b/nx-X11/lib/X11/PolyTxt16.c index 6c7cc49ec..2e4be1673 100644 --- a/nx-X11/lib/X11/PolyTxt16.c +++ b/nx-X11/lib/X11/PolyTxt16.c @@ -120,9 +120,9 @@ XDrawText16( { int nb = SIZEOF(xTextElt); - BufAlloc (xTextElt *, elt, nb); + BufAlloc (xTextElt *, elt, nb); elt->len = 0; - if (PartialDelta > 0 ) + if (PartialDelta > 0 ) { elt->delta = 127; PartialDelta = PartialDelta - 127; @@ -146,9 +146,9 @@ XDrawText16( { FirstTimeThrough = False; if (!item->delta) - { + { nbytes += SIZEOF(xTextElt); - BufAlloc (xTextElt *, elt, nbytes); + BufAlloc (xTextElt *, elt, nbytes); elt->delta = 0; } else @@ -180,9 +180,9 @@ XDrawText16( { FirstTimeThrough = False; if (!item->delta) - { + { nbytes += SIZEOF(xTextElt); - BufAlloc (xTextElt *, elt, nbytes); + BufAlloc (xTextElt *, elt, nbytes); elt->delta = 0; } else @@ -197,13 +197,14 @@ XDrawText16( else { nbytes += SIZEOF(xTextElt); - BufAlloc (xTextElt *, elt, nbytes); + BufAlloc (xTextElt *, elt, nbytes); elt->delta = 0; } elt->len = PartialNChars; memcpy ((char *) (elt + 1), (char *)CharacterOffset, - PartialNChars * 2); + PartialNChars * +2); } } item++; diff --git a/nx-X11/lib/X11/QuColors.c b/nx-X11/lib/X11/QuColors.c index 7937f5e5a..13a63eb25 100644 --- a/nx-X11/lib/X11/QuColors.c +++ b/nx-X11/lib/X11/QuColors.c @@ -75,26 +75,25 @@ int XQueryColors( register Display * const dpy, const Colormap cmap, - XColor *defs, /* RETURN */ + XColor *defs, /* RETURN */ int ncolors) { int n; if (dpy->bigreq_size > 0) - n = dpy->bigreq_size - (sizeof (xQueryColorsReq) >> 2) - 1; + n = dpy->bigreq_size - (sizeof (xQueryColorsReq) >> 2) - 1; else - n = dpy->max_request_size - (sizeof (xQueryColorsReq) >> 2); + n = dpy->max_request_size - (sizeof (xQueryColorsReq) >> 2); LockDisplay(dpy); while (ncolors >= n) { - _XQueryColors(dpy, cmap, defs, n); - defs += n; - ncolors -= n; + _XQueryColors(dpy, cmap, defs, n); + defs += n; + ncolors -= n; } if (ncolors > 0) - _XQueryColors(dpy, cmap, defs, ncolors); + _XQueryColors(dpy, cmap, defs, ncolors); UnlockDisplay(dpy); SyncHandle(); return 1; } - diff --git a/nx-X11/lib/X11/RegstFlt.c b/nx-X11/lib/X11/RegstFlt.c index cbc93ba43..5a1faa7e9 100644 --- a/nx-X11/lib/X11/RegstFlt.c +++ b/nx-X11/lib/X11/RegstFlt.c @@ -18,12 +18,12 @@ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * PERFORMANCE OF THIS SOFTWARE. * * Author: Seiji Kuwari OMRON Corporation * kuwa@omron.co.jp * kuwa%omron.co.jp@uunet.uu.net - */ + */ /* Copyright 1990, 1991, 1998 The Open Group diff --git a/nx-X11/lib/X11/RestackWs.c b/nx-X11/lib/X11/RestackWs.c index b2a77fcdf..52391ecd2 100644 --- a/nx-X11/lib/X11/RestackWs.c +++ b/nx-X11/lib/X11/RestackWs.c @@ -57,3 +57,5 @@ XRestackWindows ( } + + diff --git a/nx-X11/lib/X11/SetCRects.c b/nx-X11/lib/X11/SetCRects.c index 21b68f8a2..c7ad3fcf2 100644 --- a/nx-X11/lib/X11/SetCRects.c +++ b/nx-X11/lib/X11/SetCRects.c @@ -78,3 +78,4 @@ XSetClipRectangles ( SyncHandle(); return 1; } + diff --git a/nx-X11/lib/X11/SetDashes.c b/nx-X11/lib/X11/SetDashes.c index a2d537bc5..ffe4a95ff 100644 --- a/nx-X11/lib/X11/SetDashes.c +++ b/nx-X11/lib/X11/SetDashes.c @@ -52,4 +52,4 @@ XSetDashes ( SyncHandle(); return 1; } - + diff --git a/nx-X11/lib/X11/SetPntMap.c b/nx-X11/lib/X11/SetPntMap.c index 5dd9beef8..14e104d6d 100644 --- a/nx-X11/lib/X11/SetPntMap.c +++ b/nx-X11/lib/X11/SetPntMap.c @@ -74,3 +74,4 @@ XChangeKeyboardMapping ( SyncHandle(); return 0; } + diff --git a/nx-X11/lib/X11/StColor.c b/nx-X11/lib/X11/StColor.c index b19f0a5dc..d5a217fb0 100644 --- a/nx-X11/lib/X11/StColor.c +++ b/nx-X11/lib/X11/StColor.c @@ -51,6 +51,7 @@ XStoreColor( citem->blue = def->blue; citem->flags = def->flags; /* do_red, do_green, do_blue */ + UnlockDisplay(dpy); SyncHandle(); return 1; diff --git a/nx-X11/lib/X11/Text.c b/nx-X11/lib/X11/Text.c index 645aa283f..223b1cf8b 100644 --- a/nx-X11/lib/X11/Text.c +++ b/nx-X11/lib/X11/Text.c @@ -38,7 +38,7 @@ XDrawString( int y, _Xconst char *string, int length) -{ +{ int Datalength = 0; register xPolyText8Req *req; @@ -60,11 +60,11 @@ XDrawString( req->length += (Datalength + 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 + Datalength > dpy->bufmax) @@ -92,11 +92,11 @@ XDrawString( PartialNChars = PartialNChars - 254; CharacterOffset += 254; } - + if (PartialNChars) { nbytes = PartialNChars + SIZEOF(xTextElt); - BufAlloc (unsigned char *, tbuf, nbytes); + BufAlloc (unsigned char *, tbuf, nbytes); /* elt->delta = 0; * elt->len = PartialNChars; */ @@ -112,23 +112,23 @@ XDrawString( if (Datalength &= 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 - Datalength; 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) diff --git a/nx-X11/lib/X11/TextExt.c b/nx-X11/lib/X11/TextExt.c index 910bb3d7b..b883b01b4 100644 --- a/nx-X11/lib/X11/TextExt.c +++ b/nx-X11/lib/X11/TextExt.c @@ -41,7 +41,7 @@ from The Open Group. #define max_byte2 max_char_or_byte2 -/* +/* * CI_GET_ROWZERO_CHAR_INFO_2D - do the same thing as CI_GET_CHAR_INFO_1D, * except that the font has more than one row. This is special case of more * general version used in XTextExt16.c since row == 0. This is used when @@ -119,7 +119,7 @@ XTextExtents ( } else { overall->ascent = max (overall->ascent, cs->ascent); overall->descent = max (overall->descent, cs->descent); - overall->lbearing = min (overall->lbearing, + overall->lbearing = min (overall->lbearing, overall->width + cs->lbearing); overall->rbearing = max (overall->rbearing, overall->width + cs->rbearing); @@ -132,7 +132,7 @@ XTextExtents ( * if there were no characters, then set everything to 0 */ if (nfound == 0) { - overall->width = overall->ascent = overall->descent = + overall->width = overall->ascent = overall->descent = overall->lbearing = overall->rbearing = 0; } @@ -141,7 +141,7 @@ XTextExtents ( /* - * XTextWidth - compute the width of a string of eightbit bytes. This is a + * XTextWidth - compute the width of a string of eightbit bytes. This is a * subset of XTextExtents. */ int diff --git a/nx-X11/lib/X11/TextExt16.c b/nx-X11/lib/X11/TextExt16.c index 643aa5e30..01a0f32e4 100644 --- a/nx-X11/lib/X11/TextExt16.c +++ b/nx-X11/lib/X11/TextExt16.c @@ -41,7 +41,7 @@ from The Open Group. #define max_byte2 max_char_or_byte2 /* - * XTextExtents16 - compute the extents of string given as a sequence of + * XTextExtents16 - compute the extents of string given as a sequence of * XChar2bs. */ int @@ -94,7 +94,7 @@ XTextExtents16 ( } else { overall->ascent = max (overall->ascent, cs->ascent); overall->descent = max (overall->descent, cs->descent); - overall->lbearing = min (overall->lbearing, + overall->lbearing = min (overall->lbearing, overall->width + cs->lbearing); overall->rbearing = max (overall->rbearing, overall->width + cs->rbearing); @@ -107,7 +107,7 @@ XTextExtents16 ( * if there were no characters, then set everything to 0 */ if (nfound == 0) { - overall->width = overall->ascent = overall->descent = + overall->width = overall->ascent = overall->descent = overall->lbearing = overall->rbearing = 0; } @@ -116,7 +116,7 @@ XTextExtents16 ( /* - * XTextWidth16 - compute the width of sequence of XChar2bs. This is a + * XTextWidth16 - compute the width of sequence of XChar2bs. This is a * subset of XTextExtents16. */ int diff --git a/nx-X11/lib/X11/WMGeom.c b/nx-X11/lib/X11/WMGeom.c index 68187b583..7947536f5 100644 --- a/nx-X11/lib/X11/WMGeom.c +++ b/nx-X11/lib/X11/WMGeom.c @@ -72,13 +72,13 @@ XWMGeometry ( * Get the base sizes and increments. Section 4.1.2.3 of the ICCCM * states that the base and minimum sizes are defaults for each other. * If neither is given, then the base sizes should be 0. These parameters - * control the sets of sizes that window managers should allow for the + * control the sets of sizes that window managers should allow for the * window according to the following formulae: * * width = base_width + (i * width_inc) * height = base_height + (j * height_inc) */ - base_width = ((hints->flags & PBaseSize) ? hints->base_width : + base_width = ((hints->flags & PBaseSize) ? hints->base_width : ((hints->flags & PMinSize) ? hints->min_width : 0)); base_height = ((hints->flags & PBaseSize) ? hints->base_height : ((hints->flags & PMinSize) ? hints->min_height : 0)); @@ -103,11 +103,11 @@ XWMGeometry ( * 4. multiply by the size increment * 5. and add to the base size */ - rwidth = ((((umask & WidthValue) ? uwidth : + rwidth = ((((umask & WidthValue) ? uwidth : ((dmask & WidthValue) ? dwidth : 1)) * width_inc) + base_width); - rheight = ((((umask & HeightValue) ? uheight : - ((dmask & HeightValue) ? dheight : 1)) * height_inc) + + rheight = ((((umask & HeightValue) ? uheight : + ((dmask & HeightValue) ? dheight : 1)) * height_inc) + base_height); /* @@ -135,7 +135,7 @@ XWMGeometry ( if (dmask & XNegative) { rx = (DisplayWidth (dpy, screen) + dx - rwidth - 2 * bwidth); rmask |= XNegative; - } else + } else rx = dx; } else { rx = 0; /* gotta choose something... */ @@ -148,7 +148,7 @@ XWMGeometry ( if (dmask & YNegative) { ry = (DisplayHeight(dpy, screen) + dy - rheight - 2 * bwidth); rmask |= YNegative; - } else + } else ry = dy; } else { ry = 0; /* gotta choose something... */ diff --git a/nx-X11/lib/X11/XErrorDB b/nx-X11/lib/X11/XErrorDB index c2efa1044..7b6d46513 100644 --- a/nx-X11/lib/X11/XErrorDB +++ b/nx-X11/lib/X11/XErrorDB @@ -1014,9 +1014,9 @@ XRequest.DRI2.3: DRI2CreateDrawable XRequest.DRI2.4: DRI2DestroyDrawable XRequest.DRI2.5: DRI2GetBuffers XRequest.DRI2.6: DRI2CopyRegion -XRequest.DRI2.7: DRI2GetBuffersWithFormat -XRequest.DRI2.8: DRI2SwapBuffers -XRequest.DRI2.9: DRI2GetMSC -XRequest.DRI2.10: DRI2WaitMSC -XRequest.DRI2.11: DRI2WaitSBC -XRequest.DRI2.12: DRI2SwapInterval +XRequest.DRI2.7: DRI2GetBuffersWithFormat +XRequest.DRI2.8: DRI2SwapBuffers +XRequest.DRI2.9: DRI2GetMSC +XRequest.DRI2.10: DRI2WaitMSC +XRequest.DRI2.11: DRI2WaitSBC +XRequest.DRI2.12: DRI2SwapInterval diff --git a/nx-X11/lib/X11/XKBGetMap.c b/nx-X11/lib/X11/XKBGetMap.c index 391d7aa89..bfba747aa 100644 --- a/nx-X11/lib/X11/XKBGetMap.c +++ b/nx-X11/lib/X11/XKBGetMap.c @@ -24,7 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ - #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H #include <config.h> diff --git a/nx-X11/lib/X11/XKBRdBuf.c b/nx-X11/lib/X11/XKBRdBuf.c index ca8f8e722..694d579f7 100644 --- a/nx-X11/lib/X11/XKBRdBuf.c +++ b/nx-X11/lib/X11/XKBRdBuf.c @@ -116,9 +116,7 @@ _XkbReadCopyData32(int *wire,long *to,int num_words) } return 1; } -#endif -#if defined(LONG64) int _XkbReadBufferCopy32(XkbReadBufferPtr from,long *to,int num_words) { @@ -128,9 +126,7 @@ _XkbReadBufferCopy32(XkbReadBufferPtr from,long *to,int num_words) from->data+= (4*num_words); return True; } -#endif -#ifdef LONG64 int _XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len) { @@ -142,6 +138,7 @@ _XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len) } #endif /* LONG64 */ + char * _XkbPeekAtReadBuffer(XkbReadBufferPtr from,int size) { diff --git a/nx-X11/lib/X11/XKBlibint.h b/nx-X11/lib/X11/XKBlibint.h index 34cdf9aaf..94b8ac077 100644 --- a/nx-X11/lib/X11/XKBlibint.h +++ b/nx-X11/lib/X11/XKBlibint.h @@ -213,7 +213,7 @@ extern int _XkbCopyFromReadBuffer( ); -#if defined(LONG64) +#ifdef LONG64 extern int _XkbReadCopyData32( int * /* from */, long * /* to */, diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index ee39c7cf0..31bec58f9 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -243,10 +243,6 @@ struct _XDisplay #define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) -/* - * define the following if you want the Data macro to be a procedure instead - */ - #ifndef _XEVENT_ /* * _QEvent datatype for use in input queueing. @@ -445,6 +441,9 @@ extern LockInfoPtr _Xglobal_lock; * X Protocol packetizing macros. */ +/* Leftover from CRAY support - was defined empty on all non-Cray systems */ +#define WORD64ALIGN + /** * Return a len-sized request buffer for the request type. This function may * flush the output queue. @@ -593,7 +592,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc); * 32 bit word alignment. Transmit if the buffer fills. * * "dpy" is a pointer to a Display. - * "data" is a pinter to a data buffer. + * "data" is a pointer to a data buffer. * "len" is the length of the data buffer. */ #ifndef DataRoutineIsProcedure @@ -715,7 +714,6 @@ extern void _XRead32( } - /* srcvar must be a variable for large architecture version */ #define OneDataCard32(dpy,dstaddr,srcvar) \ { *(CARD32 *)(dstaddr) = (srcvar); } @@ -894,7 +892,7 @@ extern int _XError( ); extern int _XIOError( Display* /* dpy */ -); +) _X_NORETURN; extern int (*_XIOErrorFunction)( Display* /* dpy */ ); diff --git a/nx-X11/lib/X11/Xprivate.h b/nx-X11/lib/X11/Xprivate.h index bc8dbf4d9..2dd62ce7d 100644 --- a/nx-X11/lib/X11/Xprivate.h +++ b/nx-X11/lib/X11/Xprivate.h @@ -10,10 +10,10 @@ #include <nx-X11/Xlib.h> -extern void _XIDHandler(Display *dpy); -extern void _XSeqSyncFunction(Display *dpy); -extern void _XSetPrivSyncFunction(Display *dpy); -extern void _XSetSeqSyncFunction(Display *dpy); +extern _X_HIDDEN void _XIDHandler(Display *dpy); +extern _X_HIDDEN void _XSeqSyncFunction(Display *dpy); +extern _X_HIDDEN void _XSetPrivSyncFunction(Display *dpy); +extern _X_HIDDEN void _XSetSeqSyncFunction(Display *dpy); #ifdef XTHREADS #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c index 6adbc0dda..e83b28428 100644 --- a/nx-X11/lib/X11/Xrm.c +++ b/nx-X11/lib/X11/Xrm.c @@ -1595,13 +1595,13 @@ ReadInFile(_Xconst char *filename) * to the size returned by fstat. */ { - struct stat status_buffer; - if ( ((fstat(fd, &status_buffer)) == -1 ) || + struct stat status_buffer; + if ( ((fstat(fd, &status_buffer)) == -1 ) || (status_buffer.st_size >= INT_MAX) ) { - close (fd); - return (char *)NULL; - } else - size = (int) status_buffer.st_size; + close (fd); + return (char *)NULL; + } else + size = (int) status_buffer.st_size; } if (!(filebuf = Xmalloc(size + 1))) { /* leave room for '\0' */ diff --git a/nx-X11/lib/X11/Xutil.h b/nx-X11/lib/X11/Xutil.h index 55bedc96d..48fa23cf5 100644 --- a/nx-X11/lib/X11/Xutil.h +++ b/nx-X11/lib/X11/Xutil.h @@ -50,7 +50,7 @@ SOFTWARE. #define _X11_XUTIL_H_ #define _XUTIL_H_ -/* You must include <nx-X11/Xlib.h> before including this file */ +/* You must include <X11/Xlib.h> before including this file */ #include <nx-X11/Xlib.h> #include <nx-X11/keysym.h> diff --git a/nx-X11/lib/X11/cmsProp.c b/nx-X11/lib/X11/cmsProp.c index 7e1a70310..a7aa5b5c5 100644 --- a/nx-X11/lib/X11/cmsProp.c +++ b/nx-X11/lib/X11/cmsProp.c @@ -128,11 +128,11 @@ _XcmsGetProperty( int xgwp_ret; while (True) { - xgwp_ret = XGetWindowProperty (pDpy, w, property, 0, len, False, - XA_INTEGER, &atom_ret, &format_ret, - &nitems_ret, &after_ret, - (unsigned char **)&prop_ret); - if (xgwp_ret == Success && after_ret > 0) { + xgwp_ret = XGetWindowProperty (pDpy, w, property, 0, len, False, + XA_INTEGER, &atom_ret, &format_ret, + &nitems_ret, &after_ret, + (unsigned char **)&prop_ret); + if (xgwp_ret == Success && after_ret > 0) { len += nitems_ret * (format_ret >> 3); XFree (prop_ret); } else { @@ -140,7 +140,7 @@ _XcmsGetProperty( } } if (xgwp_ret != Success || format_ret == 0 || nitems_ret == 0) { - /* the property does not exist or is of an unexpected type or + /* the property does not exist or is of an unexpected type or getting window property failed */ return(XcmsFailure); } diff --git a/nx-X11/lib/X11/imLcIm.c b/nx-X11/lib/X11/imLcIm.c index 70a71591c..15e5bee4d 100644 --- a/nx-X11/lib/X11/imLcIm.c +++ b/nx-X11/lib/X11/imLcIm.c @@ -36,9 +36,7 @@ THIS SOFTWARE. #include <config.h> #endif #include <stdio.h> -/* -#include <nx-X11/Xlib.h> -*/ + #include <nx-X11/Xmd.h> #include <nx-X11/Xatom.h> #include <nx-X11/Xos.h> diff --git a/nx-X11/lib/X11/lcFile.c b/nx-X11/lib/X11/lcFile.c index 36f0ddf5a..aeaae245d 100644 --- a/nx-X11/lib/X11/lcFile.c +++ b/nx-X11/lib/X11/lcFile.c @@ -635,53 +635,53 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name) for (i = 0; i < n; ++i) { if ((2 + (args[i] ? strlen(args[i]) : 0) + - strlen(locale_alias)) < PATH_MAX) { - sprintf (buf, "%s/%s", args[i], locale_alias); - name = resolve_name(lc_name, buf, LtoR); + strlen(locale_alias)) < PATH_MAX) { + sprintf (buf, "%s/%s", args[i], locale_alias); + name = resolve_name(lc_name, buf, LtoR); if (!name) { if (!nlc_name) nlc_name = normalize_lcname(lc_name); if (nlc_name) name = resolve_name (nlc_name, buf, LtoR); } - } + } - /* If name is not an alias, use lc_name for locale.dir search */ - if (name == NULL) - name = lc_name; + /* If name is not an alias, use lc_name for locale.dir search */ + if (name == NULL) + name = lc_name; - /* look at locale.dir */ + /* look at locale.dir */ - target_dir = args[i]; - if (!target_dir) { - /* something wrong */ - if (name != lc_name) - Xfree(name); - continue; - } - if ((1 + strlen (target_dir) + strlen("locale.dir")) < PATH_MAX) { - sprintf(buf, "%s/locale.dir", target_dir); - target_name = resolve_name(name, buf, RtoL); - } - if (name != lc_name) - Xfree(name); - if (target_name != NULL) { - char *p = 0; - if ((p = strstr(target_name, "/XLC_LOCALE"))) { - *p = '\0'; - break; - } - Xfree(target_name); - target_name = NULL; - } - name = NULL; + target_dir = args[i]; + if (!target_dir) { + /* something wrong */ + if (name != lc_name) + Xfree(name); + continue; + } + if ((1 + strlen (target_dir) + strlen("locale.dir")) < PATH_MAX) { + sprintf(buf, "%s/locale.dir", target_dir); + target_name = resolve_name(name, buf, RtoL); + } + if (name != lc_name) + Xfree(name); + if (target_name != NULL) { + char *p = 0; + if ((p = strstr(target_name, "/XLC_LOCALE"))) { + *p = '\0'; + break; + } + Xfree(target_name); + target_name = NULL; + } + name = NULL; } if (nlc_name) Xfree(nlc_name); if (target_name == NULL) { - /* vendor locale name == Xlocale name, no expansion of alias */ - target_dir = args[0]; - target_name = lc_name; + /* vendor locale name == Xlocale name, no expansion of alias */ + target_dir = args[0]; + target_name = lc_name; } /* snprintf(dir_name, dir_len, "%s/%", target_dir, target_name); */ strncpy(dir_name, target_dir, dir_len - 1); @@ -694,7 +694,7 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name) dir_name[dir_len - 1] = '\0'; } if (target_name != lc_name) - Xfree(target_name); + Xfree(target_name); if (last_dir_name != 0) Xfree (last_dir_name); @@ -757,7 +757,7 @@ _XlcLocaleLibDirName(char *dir_name, size_t dir_len, char *lc_name) Xfree(name); continue; } - if ((1 + strlen (target_dir) + strlen("locale.dir")) < PATH_MAX) { + if ((1 + strlen (target_dir) + strlen("locale.dir")) < PATH_MAX) { sprintf(buf, "%s/locale.dir", target_dir); target_name = resolve_name(name, buf, RtoL); } diff --git a/nx-X11/lib/X11/lcUniConv/big5hkscs.h b/nx-X11/lib/X11/lcUniConv/big5hkscs.h index 29eab938f..721d1228e 100644 --- a/nx-X11/lib/X11/lcUniConv/big5hkscs.h +++ b/nx-X11/lib/X11/lcUniConv/big5hkscs.h @@ -6249,3 +6249,4 @@ big5hkscs_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) } return RET_TOOSMALL; } + diff --git a/nx-X11/lib/X11/locking.h b/nx-X11/lib/X11/locking.h index 0942b95aa..277c9afc8 100644 --- a/nx-X11/lib/X11/locking.h +++ b/nx-X11/lib/X11/locking.h @@ -1,4 +1,4 @@ -/* +/* Copyright 1992, 1998 The Open Group diff --git a/nx-X11/lib/X11/omXChar.c b/nx-X11/lib/X11/omXChar.c index 85d2f15b7..c9bbb8e88 100644 --- a/nx-X11/lib/X11/omXChar.c +++ b/nx-X11/lib/X11/omXChar.c @@ -317,7 +317,7 @@ _XomConvert( XlcCharSet charset; int length, cs_left, ret; FontSet font_set; - + cs = *to; cs_left = *to_left; lc_args[0] = (XPointer) &charset; @@ -335,20 +335,18 @@ _XomConvert( length = *to_left - cs_left; - { - if (font_set->side != charset->side) { - if (font_set->side == XlcGL) - shift_to_gl(*to, length); - else if (font_set->side == XlcGR) - shift_to_gr(*to, length); - } - - if (font_set->is_xchar2b) - length >>= 1; - *to = cs; - *to_left -= length; + if (font_set->side != charset->side) { + if (font_set->side == XlcGL) + shift_to_gl(*to, length); + else if (font_set->side == XlcGR) + shift_to_gr(*to, length); } + if (font_set->is_xchar2b) + length >>= 1; + *to = cs; + *to_left -= length; + *((XFontStruct **) args[0]) = font_set->font; *((Bool *) args[1]) = font_set->is_xchar2b; if(num_args >= 3){ diff --git a/nx-X11/lib/X11/os2Stubs.c b/nx-X11/lib/X11/os2Stubs.c index d01b85b46..5ffc4824c 100644 --- a/nx-X11/lib/X11/os2Stubs.c +++ b/nx-X11/lib/X11/os2Stubs.c @@ -3,26 +3,26 @@ * <marineau@genie.uottawa.ca> * <Holger.Veit@gmd.de> * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * - * Except as contained in this notice, the name of Sebastien Marineau or Holger Veit - * shall not be used in advertising or otherwise to promote the sale, use or other + * + * Except as contained in this notice, the name of Sebastien Marineau or Holger Veit + * shall not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from Holger Veit or * Sebastien Marineau. * @@ -66,7 +66,7 @@ char *__XOS2RedirRoot(char *fname) return fname; root = (char*)getenv("X11ROOT"); - if (root==0 || + if (root==0 || (fname[1]==':' && isalpha(fname[0])) || (strlen(fname)+strlen(root)+2) > 300) return fname; @@ -131,7 +131,7 @@ BOOL any_ready; int np,ns, i,ready_handles,n; APIRET rc; -sd.have_read=FALSE; sd.have_write=FALSE; +sd.have_read=FALSE; sd.have_write=FALSE; sd.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0; sd.max_fds=31; ready_handles=0; any_ready=FALSE; sd.pipe_ntotal=0; sd.pipe_have_write=FALSE; @@ -149,7 +149,7 @@ if(FirstTime){ } /* Call these a first time to set the semaphore */ rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE); - if(rc) { + if(rc) { fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc); return(-1); } @@ -238,7 +238,7 @@ if(FirstTime){ ready_handles+=np; any_ready = TRUE; } - else if (np == -1) { + else if (np == -1) { return(-1); } } @@ -249,7 +249,7 @@ if(FirstTime){ } else if (ns == -1) {return(-1);} - if (i%8 == 0) { + if (i%8 == 0) { now_millis = os2_get_sys_millis(); if((now_millis-start_millis) > timeout_ms) timeout_ms = 0; } @@ -349,7 +349,7 @@ fd_set *readfds,*writefds; int j,n; memcpy(sd->tcp_select_copy,sd->tcp_select_mask, sd->socket_ntotal*sizeof(int)); - + e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread, sd->socket_nwrite, 0, 0); @@ -370,7 +370,7 @@ fd_set *readfds,*writefds; n ++; } errno = 0; - + return n; } if(e<0){ @@ -393,7 +393,7 @@ PIPESEMSTATE pipeSemState[128]; APIRET rc; e = 0; rc = DosResetEventSem(hPipeSem,&ulPostCount); - rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState, + rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState, sizeof(pipeSemState)); if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc); i=0; diff --git a/nx-X11/lib/X11/pathmax.h b/nx-X11/lib/X11/pathmax.h index ffec295e0..86e65fadf 100644 --- a/nx-X11/lib/X11/pathmax.h +++ b/nx-X11/lib/X11/pathmax.h @@ -79,4 +79,3 @@ SOFTWARE. #endif #endif #endif - diff --git a/nx-X11/lib/X11/udcInf.c b/nx-X11/lib/X11/udcInf.c index 9acf0fb3f..9ecf1566e 100644 --- a/nx-X11/lib/X11/udcInf.c +++ b/nx-X11/lib/X11/udcInf.c @@ -46,7 +46,7 @@ from The Open Group. #include <XomGeneric.h> /* - external symbols + external symbols */ extern FontData read_EncodingInfo(); extern int _xudc_get_codeset(); @@ -145,11 +145,11 @@ int *num_codeset; if(!_XlcCompareISOLatin1(charset_str,buf)){ num_ret += 1; if(num_ret == 1){ - ret = Xmalloc(sizeof(int)); + ret = Xmalloc(sizeof(int)); } else { int *prev_ret = ret; - ret = Xrealloc(ret, num_ret * sizeof(int)); + ret = Xrealloc(ret, num_ret * sizeof(int)); if (ret == NULL){ Xfree(prev_ret); } @@ -306,9 +306,9 @@ int *num_gr; return 0; } -/* +/* * Code convert wo tomonau UDC area no kakutoku - * GetUDCCPArea() / glyph_to_code() + * GetUDCCPArea() / glyph_to_code() * */ @@ -372,7 +372,7 @@ XlcCharSet charset; sprintf(buf, "csd%d.charset_name", i); _XlcGetLocaleDataBase(lcd, "XLC_CHARSET_DEFINE", buf, &value, &count); if(count > 0){ - if(!_XlcNCompareISOLatin1(value[0], + if(!_XlcNCompareISOLatin1(value[0], charset->name,strlen(value[0])) ){ return(True); } @@ -403,7 +403,7 @@ int size; strcpy(&from[seq_len + name_len],src); return True; } -int +int _xudc_glyph_to_code(locale,charset_str,codeset,glyph_index,codepoint) char *locale; char *charset_str; @@ -429,7 +429,7 @@ unsigned long *codepoint; dst = (unsigned char *)to32; memset(dst,0,25); - + lcd = (XLCd)_XlcGenericLoader(locale); if (!_xudc_gi_to_vgi(lcd,locale,charset_str,codeset, @@ -557,7 +557,7 @@ int *num_cr; /* * code_to_glyph() - * + * */ typedef struct __XUDCGIInf { char *charset_str; @@ -586,7 +586,7 @@ FontScope scope; * * */ -static Bool +static Bool _xudc_vgi_to_gi(lcd,locale,vglyph,glyph,charset,charsetname,size) XLCd lcd; char *locale; @@ -602,7 +602,7 @@ int size; FontData font_data; CodeSet cs; - + for(i=0;;i++){ sprintf(buf, "fs%d.charset.name",i); _XlcGetLocaleDataBase(lcd, "XLC_FONTSET", buf, &value, &count); diff --git a/nx-X11/lib/X11/utlist.h b/nx-X11/lib/X11/utlist.h index 0ce06f2b5..215c2c62e 100644 --- a/nx-X11/lib/X11/utlist.h +++ b/nx-X11/lib/X11/utlist.h @@ -113,3 +113,4 @@ do { for(el=head,tmp=el->next;el;el=tmp,tmp=(el) ? (el->next) : NULL) #endif /* UTLIST_H */ + |