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.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
......
......@@ -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) {
......
......@@ -66,6 +66,7 @@ XDrawArc(
arc->angle1 = angle1;
arc->angle2 = angle2;
UnlockDisplay(dpy);
SyncHandle();
return 1;
......
......@@ -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)
{
......
......@@ -63,3 +63,4 @@ XFillRectangles(
SyncHandle();
return 1;
}
......@@ -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) {
......
......@@ -47,3 +47,4 @@ XFreeGC (
Xfree ((char *) gc);
return 1;
}
......@@ -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;
......
......@@ -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;
......
......@@ -154,3 +154,4 @@ XHostAddress *XListHosts (
......@@ -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 */
}
......@@ -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 */
......
......@@ -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++;
......
......@@ -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;
}
......@@ -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
......
......@@ -57,3 +57,5 @@ XRestackWindows (
}
......@@ -78,3 +78,4 @@ XSetClipRectangles (
SyncHandle();
return 1;
}
......@@ -52,4 +52,4 @@ XSetDashes (
SyncHandle();
return 1;
}
......@@ -74,3 +74,4 @@ XChangeKeyboardMapping (
SyncHandle();
return 0;
}
......@@ -51,6 +51,7 @@ XStoreColor(
citem->blue = def->blue;
citem->flags = def->flags; /* do_red, do_green, do_blue */
UnlockDisplay(dpy);
SyncHandle();
return 1;
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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... */
......
......@@ -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
......@@ -24,7 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#define NEED_MAP_READERS
#ifdef HAVE_CONFIG_H
#include <config.h>
......
......@@ -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)
{
......
......@@ -213,7 +213,7 @@ extern int _XkbCopyFromReadBuffer(
);
#if defined(LONG64)
#ifdef LONG64
extern int _XkbReadCopyData32(
int * /* from */,
long * /* to */,
......
......@@ -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 */
);
......
......@@ -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)
......
......@@ -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' */
......
......@@ -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>
......
......@@ -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);
}
......
......@@ -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>
......
......@@ -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);
}
......
......@@ -6249,3 +6249,4 @@ big5hkscs_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_TOOSMALL;
}
/*
/*
Copyright 1992, 1998 The Open Group
......
......@@ -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){
......
......@@ -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;
......
......@@ -79,4 +79,3 @@ SOFTWARE.
#endif
#endif
#endif
......@@ -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);
......
......@@ -113,3 +113,4 @@ do {
for(el=head,tmp=el->next;el;el=tmp,tmp=(el) ? (el->next) : NULL)
#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