Commit e2e45b2b authored by Ulrich Sibiller's avatar Ulrich Sibiller

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.
parent 878040bf
...@@ -24,7 +24,6 @@ in this Software without prior written authorization from The Open Group. ...@@ -24,7 +24,6 @@ in this Software without prior written authorization from The Open Group.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
......
...@@ -65,7 +65,7 @@ XChangeProperty ( ...@@ -65,7 +65,7 @@ XChangeProperty (
Data (dpy, (_Xconst char *)data, nelements); Data (dpy, (_Xconst char *)data, nelements);
} /* else force BadLength */ } /* else force BadLength */
break; break;
case 16: case 16:
len = ((long)nelements + 1)>>1; len = ((long)nelements + 1)>>1;
if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
......
...@@ -66,6 +66,7 @@ XDrawArc( ...@@ -66,6 +66,7 @@ XDrawArc(
arc->angle1 = angle1; arc->angle1 = angle1;
arc->angle2 = angle2; arc->angle2 = angle2;
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return 1; return 1;
......
...@@ -29,12 +29,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,12 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
/* /*
* XErrorHandler - This procedure sets the X non-fatal error handler * XErrorHandler - This procedure sets the X non-fatal error handler
* (_XErrorFunction) to be the specified routine. If NULL is passed in * (_XErrorFunction) to be the specified routine. If NULL is passed in
* the original error handler is restored. * the original error handler is restored.
*/ */
XErrorHandler XErrorHandler
XSetErrorHandler(XErrorHandler handler) XSetErrorHandler(XErrorHandler handler)
{ {
...@@ -57,12 +57,12 @@ XSetErrorHandler(XErrorHandler handler) ...@@ -57,12 +57,12 @@ XSetErrorHandler(XErrorHandler handler)
return (XErrorHandler) oldhandler; return (XErrorHandler) oldhandler;
} }
/* /*
* XIOErrorHandler - This procedure sets the X fatal I/O error handler * 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. * the original error handler is restored.
*/ */
XIOErrorHandler XIOErrorHandler
XSetIOErrorHandler(XIOErrorHandler handler) XSetIOErrorHandler(XIOErrorHandler handler)
{ {
......
...@@ -63,3 +63,4 @@ XFillRectangles( ...@@ -63,3 +63,4 @@ XFillRectangles(
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -260,7 +260,6 @@ _XQueryFont ( ...@@ -260,7 +260,6 @@ _XQueryFont (
* If no characters in font, then it is a bad font, but * If no characters in font, then it is a bad font, but
* shouldn't try to read nothing. * shouldn't try to read nothing.
*/ */
/* have to unpack charinfos on some machines (CRAY) */
fs->per_char = NULL; fs->per_char = NULL;
if (reply.nCharInfos > 0){ if (reply.nCharInfos > 0){
/* nCharInfos is a CARD32 */ /* nCharInfos is a CARD32 */
...@@ -507,11 +506,11 @@ _XF86BigfontQueryFont ( ...@@ -507,11 +506,11 @@ _XF86BigfontQueryFont (
/* compares each part to half the maximum, which should be far more than /* 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 */ any real font needs, so the combined total doesn't overflow either */
if (reply.nUniqCharInfos > ((ULONG_MAX / 2) / SIZEOF(xCharInfo)) || if (reply.nUniqCharInfos > ((ULONG_MAX / 2) / SIZEOF(xCharInfo)) ||
reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) { reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) {
Xfree((char *) fs->properties); Xfree((char *) fs->properties);
Xfree((char *) fs); Xfree((char *) fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
#endif #endif
if (reply.nCharInfos > 0) { if (reply.nCharInfos > 0) {
......
...@@ -47,3 +47,4 @@ XFreeGC ( ...@@ -47,3 +47,4 @@ XFreeGC (
Xfree ((char *) gc); Xfree ((char *) gc);
return 1; return 1;
} }
...@@ -89,14 +89,14 @@ _XGetWindowAttributes( ...@@ -89,14 +89,14 @@ _XGetWindowAttributes(
register Display *dpy, register Display *dpy,
Window w, Window w,
XWindowAttributes *attr) XWindowAttributes *attr)
{ {
xGetGeometryReply rep; xGetGeometryReply rep;
register xResourceReq *req; register xResourceReq *req;
register int i; register int i;
register Screen *sp; register Screen *sp;
_XAsyncHandler async; _XAsyncHandler async;
_XWAttrsState async_state; _XWAttrsState async_state;
GetResReq(GetWindowAttributes, w, req); GetResReq(GetWindowAttributes, w, req);
async_state.attr_seq = dpy->request; async_state.attr_seq = dpy->request;
......
...@@ -543,8 +543,7 @@ static unsigned long _XGetPixel32 ( ...@@ -543,8 +543,7 @@ static unsigned long _XGetPixel32 (
[y * ximage->bytes_per_line + (x << 2)]; [y * ximage->bytes_per_line + (x << 2)];
if (*((const char *)&byteorderpixel) == ximage->byte_order) if (*((const char *)&byteorderpixel) == ximage->byte_order)
pixel = *((CARD32 *)addr); pixel = *((CARD32 *)addr);
else else if (ximage->byte_order == MSBFirst)
if (ximage->byte_order == MSBFirst)
pixel = ((unsigned long)addr[0] << 24 | pixel = ((unsigned long)addr[0] << 24 |
(unsigned long)addr[1] << 16 | (unsigned long)addr[1] << 16 |
(unsigned long)addr[2] << 8 | (unsigned long)addr[2] << 8 |
...@@ -732,8 +731,7 @@ static int _XPutPixel32 ( ...@@ -732,8 +731,7 @@ static int _XPutPixel32 (
[y * ximage->bytes_per_line + (x << 2)]; [y * ximage->bytes_per_line + (x << 2)];
if (*((const char *)&byteorderpixel) == ximage->byte_order) if (*((const char *)&byteorderpixel) == ximage->byte_order)
*((CARD32 *)addr) = pixel; *((CARD32 *)addr) = pixel;
else else if (ximage->byte_order == MSBFirst) {
if (ximage->byte_order == MSBFirst) {
addr[0] = pixel >> 24; addr[0] = pixel >> 24;
addr[1] = pixel >> 16; addr[1] = pixel >> 16;
addr[2] = pixel >> 8; addr[2] = pixel >> 8;
......
...@@ -154,3 +154,4 @@ XHostAddress *XListHosts ( ...@@ -154,3 +154,4 @@ XHostAddress *XListHosts (
...@@ -49,7 +49,7 @@ XLoadFont ( ...@@ -49,7 +49,7 @@ XLoadFont (
Data (dpy, name, nbytes); Data (dpy, name, nbytes);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return (fid); return (fid);
/* can't return (req->fid) since request may have already been sent */ /* can't return (req->fid) since request may have already been sent */
} }
...@@ -121,9 +121,9 @@ XDrawText( ...@@ -121,9 +121,9 @@ XDrawText(
{ {
int nb = SIZEOF(xTextElt); int nb = SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nb); BufAlloc (char *, tbuf, nb);
*tbuf = 0; /* elt->len */ *tbuf = 0; /* elt->len */
if (PartialDelta > 0 ) if (PartialDelta > 0 )
{ {
*(tbuf+1) = 127; /* elt->delta */ *(tbuf+1) = 127; /* elt->delta */
PartialDelta = PartialDelta - 127; PartialDelta = PartialDelta - 127;
...@@ -148,9 +148,9 @@ XDrawText( ...@@ -148,9 +148,9 @@ XDrawText(
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nbytes); BufAlloc (char *, tbuf, nbytes);
*(tbuf+1) = 0; /* elt->delta */ *(tbuf+1) = 0; /* elt->delta */
} }
else else
...@@ -179,9 +179,9 @@ XDrawText( ...@@ -179,9 +179,9 @@ XDrawText(
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nbytes); BufAlloc (char *, tbuf, nbytes);
*(tbuf+1) = 0; /* elt->delta */ *(tbuf+1) = 0; /* elt->delta */
} }
else else
...@@ -193,7 +193,7 @@ XDrawText( ...@@ -193,7 +193,7 @@ XDrawText(
else else
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nbytes); BufAlloc (char *, tbuf, nbytes);
*(tbuf+1) = 0; /* elt->delta */ *(tbuf+1) = 0; /* elt->delta */
} }
*tbuf = PartialNChars; /* elt->len */ *tbuf = PartialNChars; /* elt->len */
......
...@@ -120,9 +120,9 @@ XDrawText16( ...@@ -120,9 +120,9 @@ XDrawText16(
{ {
int nb = SIZEOF(xTextElt); int nb = SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nb); BufAlloc (xTextElt *, elt, nb);
elt->len = 0; elt->len = 0;
if (PartialDelta > 0 ) if (PartialDelta > 0 )
{ {
elt->delta = 127; elt->delta = 127;
PartialDelta = PartialDelta - 127; PartialDelta = PartialDelta - 127;
...@@ -146,9 +146,9 @@ XDrawText16( ...@@ -146,9 +146,9 @@ XDrawText16(
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
} }
else else
...@@ -180,9 +180,9 @@ XDrawText16( ...@@ -180,9 +180,9 @@ XDrawText16(
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
} }
else else
...@@ -197,13 +197,14 @@ XDrawText16( ...@@ -197,13 +197,14 @@ XDrawText16(
else else
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
} }
elt->len = PartialNChars; elt->len = PartialNChars;
memcpy ((char *) (elt + 1), (char *)CharacterOffset, memcpy ((char *) (elt + 1), (char *)CharacterOffset,
PartialNChars * 2); PartialNChars *
2);
} }
} }
item++; item++;
......
...@@ -75,26 +75,25 @@ int ...@@ -75,26 +75,25 @@ int
XQueryColors( XQueryColors(
register Display * const dpy, register Display * const dpy,
const Colormap cmap, const Colormap cmap,
XColor *defs, /* RETURN */ XColor *defs, /* RETURN */
int ncolors) int ncolors)
{ {
int n; int n;
if (dpy->bigreq_size > 0) if (dpy->bigreq_size > 0)
n = dpy->bigreq_size - (sizeof (xQueryColorsReq) >> 2) - 1; n = dpy->bigreq_size - (sizeof (xQueryColorsReq) >> 2) - 1;
else else
n = dpy->max_request_size - (sizeof (xQueryColorsReq) >> 2); n = dpy->max_request_size - (sizeof (xQueryColorsReq) >> 2);
LockDisplay(dpy); LockDisplay(dpy);
while (ncolors >= n) { while (ncolors >= n) {
_XQueryColors(dpy, cmap, defs, n); _XQueryColors(dpy, cmap, defs, n);
defs += n; defs += n;
ncolors -= n; ncolors -= n;
} }
if (ncolors > 0) if (ncolors > 0)
_XQueryColors(dpy, cmap, defs, ncolors); _XQueryColors(dpy, cmap, defs, ncolors);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * 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 * Author: Seiji Kuwari OMRON Corporation
* kuwa@omron.co.jp * kuwa@omron.co.jp
* kuwa%omron.co.jp@uunet.uu.net * kuwa%omron.co.jp@uunet.uu.net
*/ */
/* /*
Copyright 1990, 1991, 1998 The Open Group Copyright 1990, 1991, 1998 The Open Group
......
...@@ -57,3 +57,5 @@ XRestackWindows ( ...@@ -57,3 +57,5 @@ XRestackWindows (
} }
...@@ -78,3 +78,4 @@ XSetClipRectangles ( ...@@ -78,3 +78,4 @@ XSetClipRectangles (
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -52,4 +52,4 @@ XSetDashes ( ...@@ -52,4 +52,4 @@ XSetDashes (
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -74,3 +74,4 @@ XChangeKeyboardMapping ( ...@@ -74,3 +74,4 @@ XChangeKeyboardMapping (
SyncHandle(); SyncHandle();
return 0; return 0;
} }
...@@ -51,6 +51,7 @@ XStoreColor( ...@@ -51,6 +51,7 @@ XStoreColor(
citem->blue = def->blue; citem->blue = def->blue;
citem->flags = def->flags; /* do_red, do_green, do_blue */ citem->flags = def->flags; /* do_red, do_green, do_blue */
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return 1; return 1;
......
...@@ -38,7 +38,7 @@ XDrawString( ...@@ -38,7 +38,7 @@ XDrawString(
int y, int y,
_Xconst char *string, _Xconst char *string,
int length) int length)
{ {
int Datalength = 0; int Datalength = 0;
register xPolyText8Req *req; register xPolyText8Req *req;
...@@ -60,11 +60,11 @@ XDrawString( ...@@ -60,11 +60,11 @@ XDrawString(
req->length += (Datalength + 3)>>2; /* convert to number of 32-bit words */ 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 * 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 * 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 * 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) if (dpy->bufptr + Datalength > dpy->bufmax)
...@@ -92,11 +92,11 @@ XDrawString( ...@@ -92,11 +92,11 @@ XDrawString(
PartialNChars = PartialNChars - 254; PartialNChars = PartialNChars - 254;
CharacterOffset += 254; CharacterOffset += 254;
} }
if (PartialNChars) if (PartialNChars)
{ {
nbytes = PartialNChars + SIZEOF(xTextElt); nbytes = PartialNChars + SIZEOF(xTextElt);
BufAlloc (unsigned char *, tbuf, nbytes); BufAlloc (unsigned char *, tbuf, nbytes);
/* elt->delta = 0; /* elt->delta = 0;
* elt->len = PartialNChars; * elt->len = PartialNChars;
*/ */
...@@ -112,23 +112,23 @@ XDrawString( ...@@ -112,23 +112,23 @@ XDrawString(
if (Datalength &= 3) { if (Datalength &= 3) {
char *pad; char *pad;
/* /*
* BufAlloc is a macro that uses its last argument more than * 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; length = 4 - Datalength;
BufAlloc (char *, pad, length); BufAlloc (char *, pad, length);
/* /*
* if there are 3 bytes of padding, the first byte MUST be 0 * 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; *pad = 0;
} }
/* /*
* If the buffer pointer is not now pointing to a 32-bit boundary, * 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 * 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) if ((dpy->bufptr - dpy->buffer) & 3)
......
...@@ -41,7 +41,7 @@ from The Open Group. ...@@ -41,7 +41,7 @@ from The Open Group.
#define max_byte2 max_char_or_byte2 #define max_byte2 max_char_or_byte2
/* /*
* CI_GET_ROWZERO_CHAR_INFO_2D - do the same thing as CI_GET_CHAR_INFO_1D, * 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 * 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 * general version used in XTextExt16.c since row == 0. This is used when
...@@ -119,7 +119,7 @@ XTextExtents ( ...@@ -119,7 +119,7 @@ XTextExtents (
} else { } else {
overall->ascent = max (overall->ascent, cs->ascent); overall->ascent = max (overall->ascent, cs->ascent);
overall->descent = max (overall->descent, cs->descent); overall->descent = max (overall->descent, cs->descent);
overall->lbearing = min (overall->lbearing, overall->lbearing = min (overall->lbearing,
overall->width + cs->lbearing); overall->width + cs->lbearing);
overall->rbearing = max (overall->rbearing, overall->rbearing = max (overall->rbearing,
overall->width + cs->rbearing); overall->width + cs->rbearing);
...@@ -132,7 +132,7 @@ XTextExtents ( ...@@ -132,7 +132,7 @@ XTextExtents (
* if there were no characters, then set everything to 0 * if there were no characters, then set everything to 0
*/ */
if (nfound == 0) { if (nfound == 0) {
overall->width = overall->ascent = overall->descent = overall->width = overall->ascent = overall->descent =
overall->lbearing = overall->rbearing = 0; overall->lbearing = overall->rbearing = 0;
} }
...@@ -141,7 +141,7 @@ XTextExtents ( ...@@ -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. * subset of XTextExtents.
*/ */
int int
......
...@@ -41,7 +41,7 @@ from The Open Group. ...@@ -41,7 +41,7 @@ from The Open Group.
#define max_byte2 max_char_or_byte2 #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. * XChar2bs.
*/ */
int int
...@@ -94,7 +94,7 @@ XTextExtents16 ( ...@@ -94,7 +94,7 @@ XTextExtents16 (
} else { } else {
overall->ascent = max (overall->ascent, cs->ascent); overall->ascent = max (overall->ascent, cs->ascent);
overall->descent = max (overall->descent, cs->descent); overall->descent = max (overall->descent, cs->descent);
overall->lbearing = min (overall->lbearing, overall->lbearing = min (overall->lbearing,
overall->width + cs->lbearing); overall->width + cs->lbearing);
overall->rbearing = max (overall->rbearing, overall->rbearing = max (overall->rbearing,
overall->width + cs->rbearing); overall->width + cs->rbearing);
...@@ -107,7 +107,7 @@ XTextExtents16 ( ...@@ -107,7 +107,7 @@ XTextExtents16 (
* if there were no characters, then set everything to 0 * if there were no characters, then set everything to 0
*/ */
if (nfound == 0) { if (nfound == 0) {
overall->width = overall->ascent = overall->descent = overall->width = overall->ascent = overall->descent =
overall->lbearing = overall->rbearing = 0; overall->lbearing = overall->rbearing = 0;
} }
...@@ -116,7 +116,7 @@ XTextExtents16 ( ...@@ -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. * subset of XTextExtents16.
*/ */
int int
......
...@@ -72,13 +72,13 @@ XWMGeometry ( ...@@ -72,13 +72,13 @@ XWMGeometry (
* Get the base sizes and increments. Section 4.1.2.3 of the ICCCM * 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. * 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 * 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: * window according to the following formulae:
* *
* width = base_width + (i * width_inc) * width = base_width + (i * width_inc)
* height = base_height + (j * height_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)); ((hints->flags & PMinSize) ? hints->min_width : 0));
base_height = ((hints->flags & PBaseSize) ? hints->base_height : base_height = ((hints->flags & PBaseSize) ? hints->base_height :
((hints->flags & PMinSize) ? hints->min_height : 0)); ((hints->flags & PMinSize) ? hints->min_height : 0));
...@@ -103,11 +103,11 @@ XWMGeometry ( ...@@ -103,11 +103,11 @@ XWMGeometry (
* 4. multiply by the size increment * 4. multiply by the size increment
* 5. and add to the base size * 5. and add to the base size
*/ */
rwidth = ((((umask & WidthValue) ? uwidth : rwidth = ((((umask & WidthValue) ? uwidth :
((dmask & WidthValue) ? dwidth : 1)) * width_inc) + ((dmask & WidthValue) ? dwidth : 1)) * width_inc) +
base_width); base_width);
rheight = ((((umask & HeightValue) ? uheight : rheight = ((((umask & HeightValue) ? uheight :
((dmask & HeightValue) ? dheight : 1)) * height_inc) + ((dmask & HeightValue) ? dheight : 1)) * height_inc) +
base_height); base_height);
/* /*
...@@ -135,7 +135,7 @@ XWMGeometry ( ...@@ -135,7 +135,7 @@ XWMGeometry (
if (dmask & XNegative) { if (dmask & XNegative) {
rx = (DisplayWidth (dpy, screen) + dx - rwidth - 2 * bwidth); rx = (DisplayWidth (dpy, screen) + dx - rwidth - 2 * bwidth);
rmask |= XNegative; rmask |= XNegative;
} else } else
rx = dx; rx = dx;
} else { } else {
rx = 0; /* gotta choose something... */ rx = 0; /* gotta choose something... */
...@@ -148,7 +148,7 @@ XWMGeometry ( ...@@ -148,7 +148,7 @@ XWMGeometry (
if (dmask & YNegative) { if (dmask & YNegative) {
ry = (DisplayHeight(dpy, screen) + dy - rheight - 2 * bwidth); ry = (DisplayHeight(dpy, screen) + dy - rheight - 2 * bwidth);
rmask |= YNegative; rmask |= YNegative;
} else } else
ry = dy; ry = dy;
} else { } else {
ry = 0; /* gotta choose something... */ ry = 0; /* gotta choose something... */
......
...@@ -1014,9 +1014,9 @@ XRequest.DRI2.3: DRI2CreateDrawable ...@@ -1014,9 +1014,9 @@ XRequest.DRI2.3: DRI2CreateDrawable
XRequest.DRI2.4: DRI2DestroyDrawable XRequest.DRI2.4: DRI2DestroyDrawable
XRequest.DRI2.5: DRI2GetBuffers XRequest.DRI2.5: DRI2GetBuffers
XRequest.DRI2.6: DRI2CopyRegion XRequest.DRI2.6: DRI2CopyRegion
XRequest.DRI2.7: DRI2GetBuffersWithFormat XRequest.DRI2.7: DRI2GetBuffersWithFormat
XRequest.DRI2.8: DRI2SwapBuffers XRequest.DRI2.8: DRI2SwapBuffers
XRequest.DRI2.9: DRI2GetMSC XRequest.DRI2.9: DRI2GetMSC
XRequest.DRI2.10: DRI2WaitMSC XRequest.DRI2.10: DRI2WaitMSC
XRequest.DRI2.11: DRI2WaitSBC XRequest.DRI2.11: DRI2WaitSBC
XRequest.DRI2.12: DRI2SwapInterval XRequest.DRI2.12: DRI2SwapInterval
...@@ -24,7 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -24,7 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/ ********************************************************/
#define NEED_MAP_READERS #define NEED_MAP_READERS
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
......
...@@ -116,9 +116,7 @@ _XkbReadCopyData32(int *wire,long *to,int num_words) ...@@ -116,9 +116,7 @@ _XkbReadCopyData32(int *wire,long *to,int num_words)
} }
return 1; return 1;
} }
#endif
#if defined(LONG64)
int int
_XkbReadBufferCopy32(XkbReadBufferPtr from,long *to,int num_words) _XkbReadBufferCopy32(XkbReadBufferPtr from,long *to,int num_words)
{ {
...@@ -128,9 +126,7 @@ _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); from->data+= (4*num_words);
return True; return True;
} }
#endif
#ifdef LONG64
int int
_XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len) _XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len)
{ {
...@@ -142,6 +138,7 @@ _XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len) ...@@ -142,6 +138,7 @@ _XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len)
} }
#endif /* LONG64 */ #endif /* LONG64 */
char * char *
_XkbPeekAtReadBuffer(XkbReadBufferPtr from,int size) _XkbPeekAtReadBuffer(XkbReadBufferPtr from,int size)
{ {
......
...@@ -213,7 +213,7 @@ extern int _XkbCopyFromReadBuffer( ...@@ -213,7 +213,7 @@ extern int _XkbCopyFromReadBuffer(
); );
#if defined(LONG64) #ifdef LONG64
extern int _XkbReadCopyData32( extern int _XkbReadCopyData32(
int * /* from */, int * /* from */,
long * /* to */, long * /* to */,
......
...@@ -243,10 +243,6 @@ struct _XDisplay ...@@ -243,10 +243,6 @@ struct _XDisplay
#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) #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_ #ifndef _XEVENT_
/* /*
* _QEvent datatype for use in input queueing. * _QEvent datatype for use in input queueing.
...@@ -445,6 +441,9 @@ extern LockInfoPtr _Xglobal_lock; ...@@ -445,6 +441,9 @@ extern LockInfoPtr _Xglobal_lock;
* X Protocol packetizing macros. * 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 * Return a len-sized request buffer for the request type. This function may
* flush the output queue. * flush the output queue.
...@@ -593,7 +592,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc); ...@@ -593,7 +592,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc);
* 32 bit word alignment. Transmit if the buffer fills. * 32 bit word alignment. Transmit if the buffer fills.
* *
* "dpy" is a pointer to a Display. * "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. * "len" is the length of the data buffer.
*/ */
#ifndef DataRoutineIsProcedure #ifndef DataRoutineIsProcedure
...@@ -715,7 +714,6 @@ extern void _XRead32( ...@@ -715,7 +714,6 @@ extern void _XRead32(
} }
/* srcvar must be a variable for large architecture version */ /* srcvar must be a variable for large architecture version */
#define OneDataCard32(dpy,dstaddr,srcvar) \ #define OneDataCard32(dpy,dstaddr,srcvar) \
{ *(CARD32 *)(dstaddr) = (srcvar); } { *(CARD32 *)(dstaddr) = (srcvar); }
...@@ -894,7 +892,7 @@ extern int _XError( ...@@ -894,7 +892,7 @@ extern int _XError(
); );
extern int _XIOError( extern int _XIOError(
Display* /* dpy */ Display* /* dpy */
); ) _X_NORETURN;
extern int (*_XIOErrorFunction)( extern int (*_XIOErrorFunction)(
Display* /* dpy */ Display* /* dpy */
); );
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#include <nx-X11/Xlib.h> #include <nx-X11/Xlib.h>
extern void _XIDHandler(Display *dpy); extern _X_HIDDEN void _XIDHandler(Display *dpy);
extern void _XSeqSyncFunction(Display *dpy); extern _X_HIDDEN void _XSeqSyncFunction(Display *dpy);
extern void _XSetPrivSyncFunction(Display *dpy); extern _X_HIDDEN void _XSetPrivSyncFunction(Display *dpy);
extern void _XSetSeqSyncFunction(Display *dpy); extern _X_HIDDEN void _XSetSeqSyncFunction(Display *dpy);
#ifdef XTHREADS #ifdef XTHREADS
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
......
...@@ -1595,13 +1595,13 @@ ReadInFile(_Xconst char *filename) ...@@ -1595,13 +1595,13 @@ ReadInFile(_Xconst char *filename)
* to the size returned by fstat. * to the size returned by fstat.
*/ */
{ {
struct stat status_buffer; struct stat status_buffer;
if ( ((fstat(fd, &status_buffer)) == -1 ) || if ( ((fstat(fd, &status_buffer)) == -1 ) ||
(status_buffer.st_size >= INT_MAX) ) { (status_buffer.st_size >= INT_MAX) ) {
close (fd); close (fd);
return (char *)NULL; return (char *)NULL;
} else } else
size = (int) status_buffer.st_size; size = (int) status_buffer.st_size;
} }
if (!(filebuf = Xmalloc(size + 1))) { /* leave room for '\0' */ if (!(filebuf = Xmalloc(size + 1))) { /* leave room for '\0' */
......
...@@ -50,7 +50,7 @@ SOFTWARE. ...@@ -50,7 +50,7 @@ SOFTWARE.
#define _X11_XUTIL_H_ #define _X11_XUTIL_H_
#define _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/Xlib.h>
#include <nx-X11/keysym.h> #include <nx-X11/keysym.h>
......
...@@ -128,11 +128,11 @@ _XcmsGetProperty( ...@@ -128,11 +128,11 @@ _XcmsGetProperty(
int xgwp_ret; int xgwp_ret;
while (True) { while (True) {
xgwp_ret = XGetWindowProperty (pDpy, w, property, 0, len, False, xgwp_ret = XGetWindowProperty (pDpy, w, property, 0, len, False,
XA_INTEGER, &atom_ret, &format_ret, XA_INTEGER, &atom_ret, &format_ret,
&nitems_ret, &after_ret, &nitems_ret, &after_ret,
(unsigned char **)&prop_ret); (unsigned char **)&prop_ret);
if (xgwp_ret == Success && after_ret > 0) { if (xgwp_ret == Success && after_ret > 0) {
len += nitems_ret * (format_ret >> 3); len += nitems_ret * (format_ret >> 3);
XFree (prop_ret); XFree (prop_ret);
} else { } else {
...@@ -140,7 +140,7 @@ _XcmsGetProperty( ...@@ -140,7 +140,7 @@ _XcmsGetProperty(
} }
} }
if (xgwp_ret != Success || format_ret == 0 || nitems_ret == 0) { 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 */ getting window property failed */
return(XcmsFailure); return(XcmsFailure);
} }
......
...@@ -36,9 +36,7 @@ THIS SOFTWARE. ...@@ -36,9 +36,7 @@ THIS SOFTWARE.
#include <config.h> #include <config.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
/*
#include <nx-X11/Xlib.h>
*/
#include <nx-X11/Xmd.h> #include <nx-X11/Xmd.h>
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
......
...@@ -635,53 +635,53 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name) ...@@ -635,53 +635,53 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name)
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
if ((2 + (args[i] ? strlen(args[i]) : 0) + if ((2 + (args[i] ? strlen(args[i]) : 0) +
strlen(locale_alias)) < PATH_MAX) { strlen(locale_alias)) < PATH_MAX) {
sprintf (buf, "%s/%s", args[i], locale_alias); sprintf (buf, "%s/%s", args[i], locale_alias);
name = resolve_name(lc_name, buf, LtoR); name = resolve_name(lc_name, buf, LtoR);
if (!name) { if (!name) {
if (!nlc_name) if (!nlc_name)
nlc_name = normalize_lcname(lc_name); nlc_name = normalize_lcname(lc_name);
if (nlc_name) if (nlc_name)
name = resolve_name (nlc_name, buf, LtoR); name = resolve_name (nlc_name, buf, LtoR);
} }
} }
/* If name is not an alias, use lc_name for locale.dir search */ /* If name is not an alias, use lc_name for locale.dir search */
if (name == NULL) if (name == NULL)
name = lc_name; name = lc_name;
/* look at locale.dir */ /* look at locale.dir */
target_dir = args[i]; target_dir = args[i];
if (!target_dir) { if (!target_dir) {
/* something wrong */ /* something wrong */
if (name != lc_name) if (name != lc_name)
Xfree(name); Xfree(name);
continue; 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); sprintf(buf, "%s/locale.dir", target_dir);
target_name = resolve_name(name, buf, RtoL); target_name = resolve_name(name, buf, RtoL);
} }
if (name != lc_name) if (name != lc_name)
Xfree(name); Xfree(name);
if (target_name != NULL) { if (target_name != NULL) {
char *p = 0; char *p = 0;
if ((p = strstr(target_name, "/XLC_LOCALE"))) { if ((p = strstr(target_name, "/XLC_LOCALE"))) {
*p = '\0'; *p = '\0';
break; break;
} }
Xfree(target_name); Xfree(target_name);
target_name = NULL; target_name = NULL;
} }
name = NULL; name = NULL;
} }
if (nlc_name) Xfree(nlc_name); if (nlc_name) Xfree(nlc_name);
if (target_name == NULL) { if (target_name == NULL) {
/* vendor locale name == Xlocale name, no expansion of alias */ /* vendor locale name == Xlocale name, no expansion of alias */
target_dir = args[0]; target_dir = args[0];
target_name = lc_name; target_name = lc_name;
} }
/* snprintf(dir_name, dir_len, "%s/%", target_dir, target_name); */ /* snprintf(dir_name, dir_len, "%s/%", target_dir, target_name); */
strncpy(dir_name, target_dir, dir_len - 1); strncpy(dir_name, target_dir, dir_len - 1);
...@@ -694,7 +694,7 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name) ...@@ -694,7 +694,7 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name)
dir_name[dir_len - 1] = '\0'; dir_name[dir_len - 1] = '\0';
} }
if (target_name != lc_name) if (target_name != lc_name)
Xfree(target_name); Xfree(target_name);
if (last_dir_name != 0) if (last_dir_name != 0)
Xfree (last_dir_name); Xfree (last_dir_name);
...@@ -757,7 +757,7 @@ _XlcLocaleLibDirName(char *dir_name, size_t dir_len, char *lc_name) ...@@ -757,7 +757,7 @@ _XlcLocaleLibDirName(char *dir_name, size_t dir_len, char *lc_name)
Xfree(name); Xfree(name);
continue; 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); sprintf(buf, "%s/locale.dir", target_dir);
target_name = resolve_name(name, buf, RtoL); target_name = resolve_name(name, buf, RtoL);
} }
......
...@@ -6249,3 +6249,4 @@ big5hkscs_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) ...@@ -6249,3 +6249,4 @@ big5hkscs_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
} }
return RET_TOOSMALL; return RET_TOOSMALL;
} }
/* /*
Copyright 1992, 1998 The Open Group Copyright 1992, 1998 The Open Group
......
...@@ -317,7 +317,7 @@ _XomConvert( ...@@ -317,7 +317,7 @@ _XomConvert(
XlcCharSet charset; XlcCharSet charset;
int length, cs_left, ret; int length, cs_left, ret;
FontSet font_set; FontSet font_set;
cs = *to; cs = *to;
cs_left = *to_left; cs_left = *to_left;
lc_args[0] = (XPointer) &charset; lc_args[0] = (XPointer) &charset;
...@@ -335,20 +335,18 @@ _XomConvert( ...@@ -335,20 +335,18 @@ _XomConvert(
length = *to_left - cs_left; length = *to_left - cs_left;
{ if (font_set->side != charset->side) {
if (font_set->side != charset->side) { if (font_set->side == XlcGL)
if (font_set->side == XlcGL) shift_to_gl(*to, length);
shift_to_gl(*to, length); else if (font_set->side == XlcGR)
else if (font_set->side == XlcGR) shift_to_gr(*to, length);
shift_to_gr(*to, length);
}
if (font_set->is_xchar2b)
length >>= 1;
*to = cs;
*to_left -= length;
} }
if (font_set->is_xchar2b)
length >>= 1;
*to = cs;
*to_left -= length;
*((XFontStruct **) args[0]) = font_set->font; *((XFontStruct **) args[0]) = font_set->font;
*((Bool *) args[1]) = font_set->is_xchar2b; *((Bool *) args[1]) = font_set->is_xchar2b;
if(num_args >= 3){ if(num_args >= 3){
......
...@@ -3,26 +3,26 @@ ...@@ -3,26 +3,26 @@
* <marineau@genie.uottawa.ca> * <marineau@genie.uottawa.ca>
* <Holger.Veit@gmd.de> * <Holger.Veit@gmd.de>
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation * to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, * the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the * 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: * Software is furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * 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 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
* *
* Except as contained in this notice, the name of Sebastien Marineau or Holger Veit * 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 * 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 * dealings in this Software without prior written authorization from Holger Veit or
* Sebastien Marineau. * Sebastien Marineau.
* *
...@@ -66,7 +66,7 @@ char *__XOS2RedirRoot(char *fname) ...@@ -66,7 +66,7 @@ char *__XOS2RedirRoot(char *fname)
return fname; return fname;
root = (char*)getenv("X11ROOT"); root = (char*)getenv("X11ROOT");
if (root==0 || if (root==0 ||
(fname[1]==':' && isalpha(fname[0])) || (fname[1]==':' && isalpha(fname[0])) ||
(strlen(fname)+strlen(root)+2) > 300) (strlen(fname)+strlen(root)+2) > 300)
return fname; return fname;
...@@ -131,7 +131,7 @@ BOOL any_ready; ...@@ -131,7 +131,7 @@ BOOL any_ready;
int np,ns, i,ready_handles,n; int np,ns, i,ready_handles,n;
APIRET rc; 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.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0;
sd.max_fds=31; ready_handles=0; any_ready=FALSE; sd.max_fds=31; ready_handles=0; any_ready=FALSE;
sd.pipe_ntotal=0; sd.pipe_have_write=FALSE; sd.pipe_ntotal=0; sd.pipe_have_write=FALSE;
...@@ -149,7 +149,7 @@ if(FirstTime){ ...@@ -149,7 +149,7 @@ if(FirstTime){
} }
/* Call these a first time to set the semaphore */ /* Call these a first time to set the semaphore */
rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE); rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE);
if(rc) { if(rc) {
fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc); fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc);
return(-1); return(-1);
} }
...@@ -238,7 +238,7 @@ if(FirstTime){ ...@@ -238,7 +238,7 @@ if(FirstTime){
ready_handles+=np; ready_handles+=np;
any_ready = TRUE; any_ready = TRUE;
} }
else if (np == -1) { else if (np == -1) {
return(-1); } return(-1); }
} }
...@@ -249,7 +249,7 @@ if(FirstTime){ ...@@ -249,7 +249,7 @@ if(FirstTime){
} }
else if (ns == -1) {return(-1);} else if (ns == -1) {return(-1);}
if (i%8 == 0) { if (i%8 == 0) {
now_millis = os2_get_sys_millis(); now_millis = os2_get_sys_millis();
if((now_millis-start_millis) > timeout_ms) timeout_ms = 0; if((now_millis-start_millis) > timeout_ms) timeout_ms = 0;
} }
...@@ -349,7 +349,7 @@ fd_set *readfds,*writefds; ...@@ -349,7 +349,7 @@ fd_set *readfds,*writefds;
int j,n; int j,n;
memcpy(sd->tcp_select_copy,sd->tcp_select_mask, memcpy(sd->tcp_select_copy,sd->tcp_select_mask,
sd->socket_ntotal*sizeof(int)); sd->socket_ntotal*sizeof(int));
e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread, e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread,
sd->socket_nwrite, 0, 0); sd->socket_nwrite, 0, 0);
...@@ -370,7 +370,7 @@ fd_set *readfds,*writefds; ...@@ -370,7 +370,7 @@ fd_set *readfds,*writefds;
n ++; n ++;
} }
errno = 0; errno = 0;
return n; return n;
} }
if(e<0){ if(e<0){
...@@ -393,7 +393,7 @@ PIPESEMSTATE pipeSemState[128]; ...@@ -393,7 +393,7 @@ PIPESEMSTATE pipeSemState[128];
APIRET rc; APIRET rc;
e = 0; e = 0;
rc = DosResetEventSem(hPipeSem,&ulPostCount); rc = DosResetEventSem(hPipeSem,&ulPostCount);
rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState, rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState,
sizeof(pipeSemState)); sizeof(pipeSemState));
if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc); if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc);
i=0; i=0;
......
...@@ -79,4 +79,3 @@ SOFTWARE. ...@@ -79,4 +79,3 @@ SOFTWARE.
#endif #endif
#endif #endif
#endif #endif
...@@ -46,7 +46,7 @@ from The Open Group. ...@@ -46,7 +46,7 @@ from The Open Group.
#include <XomGeneric.h> #include <XomGeneric.h>
/* /*
external symbols external symbols
*/ */
extern FontData read_EncodingInfo(); extern FontData read_EncodingInfo();
extern int _xudc_get_codeset(); extern int _xudc_get_codeset();
...@@ -145,11 +145,11 @@ int *num_codeset; ...@@ -145,11 +145,11 @@ int *num_codeset;
if(!_XlcCompareISOLatin1(charset_str,buf)){ if(!_XlcCompareISOLatin1(charset_str,buf)){
num_ret += 1; num_ret += 1;
if(num_ret == 1){ if(num_ret == 1){
ret = Xmalloc(sizeof(int)); ret = Xmalloc(sizeof(int));
} else { } else {
int *prev_ret = ret; int *prev_ret = ret;
ret = Xrealloc(ret, num_ret * sizeof(int)); ret = Xrealloc(ret, num_ret * sizeof(int));
if (ret == NULL){ if (ret == NULL){
Xfree(prev_ret); Xfree(prev_ret);
} }
...@@ -306,9 +306,9 @@ int *num_gr; ...@@ -306,9 +306,9 @@ int *num_gr;
return 0; return 0;
} }
/* /*
* Code convert wo tomonau UDC area no kakutoku * Code convert wo tomonau UDC area no kakutoku
* GetUDCCPArea() / glyph_to_code() * GetUDCCPArea() / glyph_to_code()
* *
*/ */
...@@ -372,7 +372,7 @@ XlcCharSet charset; ...@@ -372,7 +372,7 @@ XlcCharSet charset;
sprintf(buf, "csd%d.charset_name", i); sprintf(buf, "csd%d.charset_name", i);
_XlcGetLocaleDataBase(lcd, "XLC_CHARSET_DEFINE", buf, &value, &count); _XlcGetLocaleDataBase(lcd, "XLC_CHARSET_DEFINE", buf, &value, &count);
if(count > 0){ if(count > 0){
if(!_XlcNCompareISOLatin1(value[0], if(!_XlcNCompareISOLatin1(value[0],
charset->name,strlen(value[0])) ){ charset->name,strlen(value[0])) ){
return(True); return(True);
} }
...@@ -403,7 +403,7 @@ int size; ...@@ -403,7 +403,7 @@ int size;
strcpy(&from[seq_len + name_len],src); strcpy(&from[seq_len + name_len],src);
return True; return True;
} }
int int
_xudc_glyph_to_code(locale,charset_str,codeset,glyph_index,codepoint) _xudc_glyph_to_code(locale,charset_str,codeset,glyph_index,codepoint)
char *locale; char *locale;
char *charset_str; char *charset_str;
...@@ -429,7 +429,7 @@ unsigned long *codepoint; ...@@ -429,7 +429,7 @@ unsigned long *codepoint;
dst = (unsigned char *)to32; dst = (unsigned char *)to32;
memset(dst,0,25); memset(dst,0,25);
lcd = (XLCd)_XlcGenericLoader(locale); lcd = (XLCd)_XlcGenericLoader(locale);
if (!_xudc_gi_to_vgi(lcd,locale,charset_str,codeset, if (!_xudc_gi_to_vgi(lcd,locale,charset_str,codeset,
...@@ -557,7 +557,7 @@ int *num_cr; ...@@ -557,7 +557,7 @@ int *num_cr;
/* /*
* code_to_glyph() * code_to_glyph()
* *
*/ */
typedef struct __XUDCGIInf { typedef struct __XUDCGIInf {
char *charset_str; char *charset_str;
...@@ -586,7 +586,7 @@ FontScope scope; ...@@ -586,7 +586,7 @@ FontScope scope;
* *
* *
*/ */
static Bool static Bool
_xudc_vgi_to_gi(lcd,locale,vglyph,glyph,charset,charsetname,size) _xudc_vgi_to_gi(lcd,locale,vglyph,glyph,charset,charsetname,size)
XLCd lcd; XLCd lcd;
char *locale; char *locale;
...@@ -602,7 +602,7 @@ int size; ...@@ -602,7 +602,7 @@ int size;
FontData font_data; FontData font_data;
CodeSet cs; CodeSet cs;
for(i=0;;i++){ for(i=0;;i++){
sprintf(buf, "fs%d.charset.name",i); sprintf(buf, "fs%d.charset.name",i);
_XlcGetLocaleDataBase(lcd, "XLC_FONTSET", buf, &value, &count); _XlcGetLocaleDataBase(lcd, "XLC_FONTSET", buf, &value, &count);
......
...@@ -113,3 +113,4 @@ do { ...@@ -113,3 +113,4 @@ do {
for(el=head,tmp=el->next;el;el=tmp,tmp=(el) ? (el->next) : NULL) for(el=head,tmp=el->next;el;el=tmp,tmp=(el) ? (el->next) : NULL)
#endif /* UTLIST_H */ #endif /* UTLIST_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment