Go to the documentation of this file.
42 #ifndef X_NOT_STDC_ENV
50 #define MAXCLIENTS 128
52 #define MAXVISUALS_PER_SCREEN 50
66 #define NullBox ((BoxPtr)0)
67 #define MILLI_PER_MIN (1000 * 60)
68 #define MILLI_PER_SECOND (1000)
74 #define USE_BACKGROUND_PIXEL 3
75 #define USE_BORDER_PIXEL 3
79 #define lswapl(x) ((((x) & 0xff) << 24) |\
80 (((x) & 0xff00) << 8) |\
81 (((x) & 0xff0000) >> 8) |\
85 #define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
87 #define min(a, b) (((a) < (b)) ? (a) : (b))
88 #define max(a, b) (((a) > (b)) ? (a) : (b))
90 #define abs(a) ((a) > 0 ? (a) : -(a))
93 #define fabs(a) ((a) > 0.0 ? (a) : -(a))
95 #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
97 #define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
105 #define lowbit(x) ((x) & (~(x) + 1))
107 #define MAXSHORT 32767
108 #define MINSHORT -MAXSHORT
113 #define LengthRestB(stuff) \
114 (((uint32_t)stuff->length << 2) - sizeof(*stuff))
116 #define LengthRestS(stuff) \
117 (((uint32_t)stuff->length << 1) - (sizeof(*stuff) >> 1))
119 #define LengthRestL(stuff) \
120 ((uint32_t)stuff->length - (sizeof(*stuff) >> 2))
122 #define SwapRestS(stuff) \
123 SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
125 #define SwapRestL(stuff) \
126 SwapLongs((int32_t *)(stuff + 1), LengthRestL(stuff))
129 #define swapl(x, n) n = ((char *) (x))[0];\
130 ((char *) (x))[0] = ((char *) (x))[3];\
131 ((char *) (x))[3] = n;\
132 n = ((char *) (x))[1];\
133 ((char *) (x))[1] = ((char *) (x))[2];\
134 ((char *) (x))[2] = n;
137 #define swaps(x, n) n = ((char *) (x))[0];\
138 ((char *) (x))[0] = ((char *) (x))[1];\
139 ((char *) (x))[1] = n
142 #define cpswapl(src, dst) \
143 ((char *)&(dst))[0] = ((char *) &(src))[3];\
144 ((char *)&(dst))[1] = ((char *) &(src))[2];\
145 ((char *)&(dst))[2] = ((char *) &(src))[1];\
146 ((char *)&(dst))[3] = ((char *) &(src))[0];
149 #define cpswaps(src, dst)\
150 ((char *) &(dst))[0] = ((char *) &(src))[1];\
151 ((char *) &(dst))[1] = ((char *) &(src))[0];
157 typedef struct _Box *BoxPtr;
uint32_t serverGeneration
uint32_t globalSerialNumber