From 02dad70a8dc920d25aa1c9b61a343310fe112e5b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 17 Oct 2011 09:45:15 +1000 Subject: Add _XGetRequest as substitute for GetReq/GetReqExtra Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 69561f401..5adde76ed 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -437,6 +437,19 @@ extern LockInfoPtr _Xglobal_lock; * X Protocol packetizing macros. */ +/** + * Return a len-sized request buffer for the request type. This function may + * flush the output queue. + * + * @param dpy The display connection + * @param type The request type + * @param len Length of the request in bytes + * + * @returns A pointer to the request buffer with a few default values + * initialized. + */ +extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); + /* * GetReq - Get the next available X request packet in the buffer and * return it. @@ -448,23 +461,10 @@ extern LockInfoPtr _Xglobal_lock; #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReq(name, req) \ - if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req))>>2;\ - dpy->bufptr += SIZEOF(x##name##Req);\ - dpy->request++ - + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req)) #else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ #define GetReq(name, req) \ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req))>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req);\ - dpy->request++ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req)) #endif /* GetReqExtra is the same as GetReq, but allocates "n" additional @@ -472,22 +472,10 @@ extern LockInfoPtr _Xglobal_lock; #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReqExtra(name, n, req) \ - if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x##name##Req) + n;\ - dpy->request++ + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req) + n) #else #define GetReqExtra(name, n, req) \ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ - dpy->request++ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req) + n) #endif -- cgit v1.2.3 From 3155b9bb225656eb1d3871b65110210a342e8c70 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 27 Oct 2011 13:53:22 +1000 Subject: Use GetReqSized for GetReq and GetReqExtra GetEmptyReq and GetResReq cannot do this due to the final typecast - typically requests that need either of those do not have their own typedef in the protocol headers. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 5adde76ed..8d7291d01 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -461,10 +461,10 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReq(name, req) \ - req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req)) + GetReqSized(name, SIZEOF(x##name##Req), req) #else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ #define GetReq(name, req) \ - req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req)) + GetReqSized(name, SIZEOF(x/**/name/**/Req), req) #endif /* GetReqExtra is the same as GetReq, but allocates "n" additional @@ -472,10 +472,10 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReqExtra(name, n, req) \ - req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req) + n) + GetReqSized(name, SIZEOF(x##name##Req) + n, req) #else #define GetReqExtra(name, n, req) \ - req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req) + n) + GetReqSized(name, SIZEOF(x/**/name/**/Req) + n, req) #endif -- cgit v1.2.3 From 3597915f64c44552c16ce6e0acff9165e6009f9a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 14 Oct 2011 14:51:06 +1000 Subject: include: Add GetReqSized() for request buffers of specific size Some XI2 requests change in size over different versions and libXi would need to hack around GetReq and GetReqExtra. Add a new GetReqSized so the library can explicitly specify the size of the request in 4-byte units. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 8d7291d01..f4c648634 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -450,6 +450,18 @@ extern LockInfoPtr _Xglobal_lock; */ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); +/* GetReqSized is the same as GetReq but allows the caller to specify the + * size in bytes. 'sz' must be a multiple of 4! */ + +#if !defined(UNIXCPP) || defined(ANSICPP) +#define GetReqSized(name, sz, req) \ + req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz) +#else +#define GetReqSized(name, sz, req) \ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, sz) +#endif + + /* * GetReq - Get the next available X request packet in the buffer and * return it. -- cgit v1.2.3 From 3bf350742fe2c828d4e348a797050743ed55a4ac Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 27 Oct 2011 13:24:10 +1000 Subject: Switch GetEmptyReq and GetResReq to call _XGetRequest Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index f4c648634..ae5d8c182 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -499,24 +499,12 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); #if !defined(UNIXCPP) || defined(ANSICPP) #define GetResReq(name, rid, req) \ - if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = 2;\ - req->id = (rid);\ - dpy->bufptr += SIZEOF(xResourceReq);\ - dpy->request++ + req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \ + req->id = (rid) #else #define GetResReq(name, rid, req) \ - if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = 2;\ - req->id = (rid);\ - dpy->bufptr += SIZEOF(xResourceReq);\ - dpy->request++ + req = (xResourceReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xResourceReq)); \ + req->id = (rid) #endif /* @@ -525,22 +513,10 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); */ #if !defined(UNIXCPP) || defined(ANSICPP) #define GetEmptyReq(name, req) \ - if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = 1;\ - dpy->bufptr += SIZEOF(xReq);\ - dpy->request++ + req = (xReq *) _XGetRequest(dpy, X_##name, SIZEOF(xReq)) #else #define GetEmptyReq(name, req) \ - if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = 1;\ - dpy->bufptr += SIZEOF(xReq);\ - dpy->request++ + req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq)) #endif /* -- cgit v1.2.3 From c300a430d36e1f35335896bb7a8a47f3ca8ba863 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 17 May 2011 20:49:59 -0700 Subject: Fix man page and comment references to use XFreeModifiermap (lowercase map) Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index ae5d8c182..8a7144959 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -760,7 +760,7 @@ typedef int (*FreeModmapType) ( */ typedef struct _XFreeFuncs { FreeFuncType atoms; /* _XFreeAtomTable */ - FreeModmapType modifiermap; /* XFreeModifierMap */ + FreeModmapType modifiermap; /* XFreeModifiermap */ FreeFuncType key_bindings; /* _XFreeKeyBindings */ FreeFuncType context_db; /* _XFreeContextDB */ FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */ -- cgit v1.2.3 From c19cda6d6c63d1889b0d7fd97794ac45cd4e5fca Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sun, 8 May 2011 09:08:07 -0700 Subject: Silence clang static analysis warnings for SetReqLen This provides a simplified version of the SetReqLen macro when using clang for static analysis. Prior to this change, we would see many Idempotent operation warnings inside this macro due to the common case of calling with arg2 and arg3 being the same variable. This has no effect on code produced during compilation, but it silences a number of false positives in static analysis. XIPassiveGrab.c:170:5: warning: Assigned value is always the same as the existing value SetReqLen(req, num_modifiers, num_modifiers); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from XIPassiveGrab.c:26: .../nx-X11/lib/X11/Xlibint.h:580:8: note: instantiated from: n = badlen; \ ^ Signed-off-by: Jeremy Huddleston Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 8a7144959..cd42913f0 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -558,6 +558,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); * Do not use SetReqLen if "req" does not already have data after the * xReq header. req->length must already be >= 2. */ +#ifndef __clang_analyzer__ #define SetReqLen(req,n,badlen) \ if ((req->length + n) > (unsigned)65535) { \ if (dpy->bigreq_size) { \ @@ -568,6 +569,10 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); } \ } else \ req->length += n +#else +#define SetReqLen(req,n,badlen) \ + req->length += n +#endif #define SyncHandle() \ if (dpy->synchandler) (*dpy->synchandler)(dpy) -- cgit v1.2.3 From 5062342d464eecc35cd39df7dd303dcda86d57cc Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 3 May 2011 09:32:53 -0700 Subject: clang analyzer: Don't warn about Xmalloc(0) This will prevent a number of false positives in where clang's static analysis reports about calls to malloc(0). Signed-off-by: Jeremy Huddleston Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index cd42913f0..603139fd6 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -367,7 +367,7 @@ extern LockInfoPtr _Xglobal_lock; * define MALLOC_0_RETURNS_NULL. This is necessary because some * Xlib code expects malloc(0) to return a valid pointer to storage. */ -#ifdef MALLOC_0_RETURNS_NULL +#if defined(MALLOC_0_RETURNS_NULL) || defined(__clang_analyzer__) # define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) # define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) -- cgit v1.2.3 From 5e0584c43d3511a5544246a0f82c759ce860a0c2 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 15 Feb 2013 23:34:40 -0800 Subject: Preserve constness in casting arguments through the Data*() routines Casts were annoying gcc by dropping constness when changing types, when routines simply either copy data into the request buffer or send it directly to the X server, and never modify the input. Fixes gcc warnings including: ChProp.c: In function 'XChangeProperty': ChProp.c:65:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:65:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:74:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:74:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:83:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] SetHints.c: In function 'XSetStandardProperties': SetHints.c:262:20: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] SetPntMap.c: In function 'XSetPointerMapping': SetPntMap.c:46:5: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] SetPntMap.c:46:5: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] StBytes.c: In function 'XStoreBuffer': StBytes.c:97:33: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] StName.c: In function 'XStoreName': StName.c:40:27: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] StName.c: In function 'XSetIconName': StName.c:51:27: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 603139fd6..e3d63f29a 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -620,14 +620,14 @@ extern void _XFlushGCCache(Display *dpy, GC gc); (void)ptr; \ dpy->bufptr += (n); -#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len)) +#define Data16(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len)) #define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) #define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) #ifdef LONG64 -#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) +#define Data32(dpy, data, len) _XData32(dpy, (_Xconst long *)data, len) extern int _XData32( Display *dpy, - register long *data, + register _Xconst long *data, unsigned len ); extern void _XRead32( @@ -636,7 +636,7 @@ extern void _XRead32( long len ); #else -#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len)) +#define Data32(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len)) #define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) #endif -- cgit v1.2.3 From 9b5f99c37b4c48406eda5af2e58eb57b9a33c164 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 8 Sep 2010 10:44:23 -0400 Subject: Zero buffer data in BufAlloc() Inspired by a pattern in NoMachine's NX. Consistently zeroed buffers compress better with ssh and friends. Note that you'll need to rebuild all your protocol libraries to take advantage of this. Signed-off-by: Adam Jackson Reviewed-by: Jeremy Huddleston Reviewed-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index e3d63f29a..ead343eae 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -617,7 +617,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc); if (dpy->bufptr + (n) > dpy->bufmax) \ _XFlush (dpy); \ ptr = (type) dpy->bufptr; \ - (void)ptr; \ + memset(ptr, '\0', n); \ dpy->bufptr += (n); #define Data16(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len)) -- cgit v1.2.3 From 878040bf0bdb5d791cbe2ac6e07899c149517a79 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 16 Dec 2012 17:44:42 -0800 Subject: Tell clang not to report -Wpadded warnings on public headers we can't fix Better to silence the compiler warning than break ABI. Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index ead343eae..ee39c7cf0 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -67,6 +67,14 @@ from The Open Group. #include /* to declare xEvent */ #include /* for configured options like XTHREADS */ +/* The Xlib structs are full of implicit padding to properly align members. + We can't clean that up without breaking ABI, so tell clang not to bother + complaining about it. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + #ifdef NX_TRANS_SOCKET #include @@ -1386,6 +1394,10 @@ extern void xlocaledir( int buf_len ); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _XFUNCPROTOEND #endif /* !defined(_X11_XLIBINT_H_) && !defined(_XLIBINT_H_) */ -- cgit v1.2.3 From e2e45b2b3abf46e4e5c27d7c655769f2b693446e Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 7 Oct 2016 23:46:05 +0200 Subject: 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. --- nx-X11/lib/X11/Xlibint.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') 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 */ ); -- cgit v1.2.3 From 88edf80838c182ec5a533e2ffec429747b128355 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 24 Jun 2013 23:02:05 -0700 Subject: Require ANSI C89 pre-processor, drop pre-C89 token pasting support Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 31bec58f9..d4767ecfc 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -460,14 +460,8 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); /* GetReqSized is the same as GetReq but allows the caller to specify the * size in bytes. 'sz' must be a multiple of 4! */ -#if !defined(UNIXCPP) || defined(ANSICPP) #define GetReqSized(name, sz, req) \ req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz) -#else -#define GetReqSized(name, sz, req) \ - req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, sz) -#endif - /* * GetReq - Get the next available X request packet in the buffer and @@ -478,25 +472,14 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); * */ -#if !defined(UNIXCPP) || defined(ANSICPP) #define GetReq(name, req) \ GetReqSized(name, SIZEOF(x##name##Req), req) -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ -#define GetReq(name, req) \ - GetReqSized(name, SIZEOF(x/**/name/**/Req), req) -#endif /* GetReqExtra is the same as GetReq, but allocates "n" additional bytes after the request. "n" must be a multiple of 4! */ -#if !defined(UNIXCPP) || defined(ANSICPP) #define GetReqExtra(name, n, req) \ GetReqSized(name, SIZEOF(x##name##Req) + n, req) -#else -#define GetReqExtra(name, n, req) \ - GetReqSized(name, SIZEOF(x/**/name/**/Req) + n, req) -#endif - /* * GetResReq is for those requests that have a resource ID @@ -504,27 +487,16 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); * "rid" is the name of the resource. */ -#if !defined(UNIXCPP) || defined(ANSICPP) #define GetResReq(name, rid, req) \ req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \ req->id = (rid) -#else -#define GetResReq(name, rid, req) \ - req = (xResourceReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xResourceReq)); \ - req->id = (rid) -#endif /* * GetEmptyReq is for those requests that have no arguments * at all. */ -#if !defined(UNIXCPP) || defined(ANSICPP) #define GetEmptyReq(name, req) \ req = (xReq *) _XGetRequest(dpy, X_##name, SIZEOF(xReq)) -#else -#define GetEmptyReq(name, req) \ - req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq)) -#endif /* * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32 -- cgit v1.2.3 From 8339e680375bec533005bc5a2e8e01d3ec5a3fe6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 28 Nov 2015 13:18:11 -0800 Subject: Remove unused definition of XCONN_CHECK_FREQ The only use of XCONN_CHECK_FREQ was removed in commit 15e5eaf62897b3179 when we dropped the old Xlib connection handling in favor of xcb's. Signed-off-by: Alan Coopersmith Reviewed-by: Mark Kettenis Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'nx-X11/lib/X11/Xlibint.h') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index d4767ecfc..056b4d8f9 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -88,14 +88,6 @@ from The Open Group. #define _XFlush _XFlushIt #endif -/* - * If your BytesReadable correctly detects broken connections, then - * you should NOT define XCONN_CHECK_FREQ. - */ -#ifndef XCONN_CHECK_FREQ -#define XCONN_CHECK_FREQ 256 -#endif - struct _XGC { XExtData *ext_data; /* hook for extension to hang data */ -- cgit v1.2.3