[PATCH:x11proto] Remove WORD64, MUSTCOPY, and other CRAY leftovers
Alan Coopersmith
alan.coopersmith at oracle.com
Sat Sep 7 19:18:21 PDT 2013
Leaves behind several no-op macros for compatibility with existing
code that uses them.
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
Xmd.h | 81 ++++++++++++++------------------------------------------------
Xproto.h | 13 ----------
2 files changed, 18 insertions(+), 76 deletions(-)
diff --git a/Xmd.h b/Xmd.h
index 96cc08f..492465e 100644
--- a/Xmd.h
+++ b/Xmd.h
@@ -70,15 +70,6 @@ SOFTWARE.
# endif
/*
- * Stuff to handle large architecture machines; the constants were generated
- * on a 32-bit machine and must correspond to the protocol.
- */
-# ifdef WORD64
-# define MUSTCOPY
-# endif /* WORD64 */
-
-
-/*
* Definition of macro used to set constants for size of network structures;
* machines with preprocessors that can't handle all of the sz_ symbols
* can define this macro to be sizeof(x) if and only if their compiler doesn't
@@ -100,29 +91,15 @@ SOFTWARE.
* need them. Note that bitfields are not guaranteed to be signed
* (or even unsigned) according to ANSI C.
*/
-# ifdef WORD64
-typedef long INT64;
-typedef unsigned long CARD64;
-# define B32 :32
-# define B16 :16
-# ifdef UNSIGNEDBITFIELDS
-typedef unsigned int INT32;
-typedef unsigned int INT16;
-# else
-typedef signed int INT32;
-typedef signed int INT16;
-# endif
-# else
-# define B32
-# define B16
-# ifdef LONG64
+# define B32 /* bitfield not needed on architectures with native 32-bit type */
+# define B16 /* bitfield not needed on architectures with native 16-bit type */
+# ifdef LONG64
typedef long INT64;
typedef int INT32;
-# else
+# else
typedef long INT32;
-# endif
-typedef short INT16;
# endif
+typedef short INT16;
typedef signed char INT8;
@@ -130,10 +107,8 @@ typedef signed char INT8;
typedef unsigned long CARD64;
typedef unsigned int CARD32;
# else
-typedef unsigned long CARD32;
-# endif
-# if !defined(WORD64) && !defined(LONG64)
typedef unsigned long long CARD64;
+typedef unsigned long CARD32;
# endif
typedef unsigned short CARD16;
typedef unsigned char CARD8;
@@ -145,43 +120,23 @@ typedef CARD8 BYTE;
typedef CARD8 BOOL;
/*
- * definitions for sign-extending bitfields on 64-bit architectures
+ * was definitions for sign-extending bitfields on architectures without
+ * native types smaller than 64-bit, now just backwards compatibility
*/
-# if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
-# define cvtINT8toInt(val) (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
-# define cvtINT16toInt(val) (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
-# define cvtINT32toInt(val) (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
-# define cvtINT8toShort(val) cvtINT8toInt(val)
-# define cvtINT16toShort(val) cvtINT16toInt(val)
-# define cvtINT32toShort(val) cvtINT32toInt(val)
-# define cvtINT8toLong(val) cvtINT8toInt(val)
-# define cvtINT16toLong(val) cvtINT16toInt(val)
-# define cvtINT32toLong(val) cvtINT32toInt(val)
-# else
-# define cvtINT8toInt(val) (val)
-# define cvtINT16toInt(val) (val)
-# define cvtINT32toInt(val) (val)
-# define cvtINT8toShort(val) (val)
-# define cvtINT16toShort(val) (val)
-# define cvtINT32toShort(val) (val)
-# define cvtINT8toLong(val) (val)
-# define cvtINT16toLong(val) (val)
-# define cvtINT32toLong(val) (val)
-# endif /* WORD64 and UNSIGNEDBITFIELDS */
+# define cvtINT8toInt(val) (val)
+# define cvtINT16toInt(val) (val)
+# define cvtINT32toInt(val) (val)
+# define cvtINT8toShort(val) (val)
+# define cvtINT16toShort(val) (val)
+# define cvtINT32toShort(val) (val)
+# define cvtINT8toLong(val) (val)
+# define cvtINT16toLong(val) (val)
+# define cvtINT32toLong(val) (val)
-
-
-# ifdef MUSTCOPY
-/*
- * This macro must not cast or else pointers will get aligned and be wrong
- */
-# define NEXTPTR(p,t) (((char *) p) + SIZEOF(t))
-# else /* else not MUSTCOPY, this is used for 32-bit machines */
/*
* this version should leave result of type (t *), but that should only be
* used when not in MUSTCOPY
*/
-# define NEXTPTR(p,t) (((t *)(p)) + 1)
-# endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
+# define NEXTPTR(p,t) (((t *)(p)) + 1)
#endif /* XMD_H */
diff --git a/Xproto.h b/Xproto.h
index 495d441..76e2c99 100644
--- a/Xproto.h
+++ b/Xproto.h
@@ -625,13 +625,9 @@ typedef struct _xQueryFontReply {
CARD16 sequenceNumber B16;
CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */
xCharInfo minBounds;
-#ifndef WORD64
CARD32 walign1 B32;
-#endif
xCharInfo maxBounds;
-#ifndef WORD64
CARD32 walign2 B32;
-#endif
CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
CARD16 defaultChar B16;
CARD16 nFontProps B16; /* followed by this many xFontProp structures */
@@ -674,13 +670,9 @@ typedef struct {
CARD16 sequenceNumber B16;
CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */
xCharInfo minBounds;
-#ifndef WORD64
CARD32 walign1 B32;
-#endif
xCharInfo maxBounds;
-#ifndef WORD64
CARD32 walign2 B32;
-#endif
CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
CARD16 defaultChar B16;
CARD16 nFontProps B16; /* followed by this many xFontProp structures */
@@ -1447,12 +1439,7 @@ typedef struct {
CARD16 length B16;
Window destination B32;
CARD32 eventMask B32;
-#ifdef WORD64
- /* the structure should have been quad-aligned */
- BYTE eventdata[SIZEOF(xEvent)];
-#else
xEvent event;
-#endif /* WORD64 */
} xSendEventReq;
typedef struct {
--
1.7.9.2
More information about the xorg-devel
mailing list