Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions os/WaitFor.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ TimerInit(void)
#ifdef DPMSExtension

#define DPMS_CHECK_MODE(mode,time)\
if (time > 0 && DPMSPowerLevel < mode && timeout >= time)\
DPMSSet(serverClient, mode);
if ((time) > 0 && DPMSPowerLevel < (mode) && timeout >= (time))\
DPMSSet(serverClient, (mode));

#define DPMS_CHECK_TIMEOUT(time)\
if (time > 0 && (time - timeout) > 0)\
return time - timeout;
if ((time) > 0 && ((time) - timeout) > 0)\
return (time) - timeout;

static CARD32
NextDPMSTimeout(INT32 timeout)
Expand Down
2 changes: 1 addition & 1 deletion os/Xtransutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ int _XSERVTransConvertAddress(int *familyp, int *addrlenp, Xtransaddr **addrp)

#if !defined(S_IFLNK) && !defined(S_ISLNK)
#undef lstat
#define lstat(a,b) stat(a,b)
#define lstat(a,b) stat((a),(b))
#endif

#define FAIL_IF_NOMODE 1
Expand Down
12 changes: 6 additions & 6 deletions os/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Bool defeatAccessControl = FALSE;
#define addrEqual(fam, address, length, host) \
((fam) == (host)->family &&\
(length) == (host)->len &&\
!memcmp (address, (host)->addr, length))
!memcmp ((address), (host)->addr, (length)))

static int ConvertAddr(struct sockaddr * /*saddr */ ,
int * /*len */ ,
Expand Down Expand Up @@ -221,11 +221,11 @@ typedef struct _host {
} HOST;

#define MakeHost(h,l) (h)=calloc(1, sizeof *(h)+(l));\
if (h) { \
if ((h)) { \
(h)->addr=(unsigned char *) ((h) + 1);\
(h)->requested = FALSE; \
}
#define FreeHost(h) free(h)
#define FreeHost(h) free((h))
static HOST *selfhosts = NULL;
static HOST *validhosts = NULL;
static int AccessEnabled = TRUE;
Expand Down Expand Up @@ -526,9 +526,9 @@ DefineSelf(int fd)

#ifdef VARIABLE_IFREQ
#define ifr_size(p) (sizeof (struct ifreq) + \
(p->ifr_addr.sa_len > sizeof (p->ifr_addr) ? \
p->ifr_addr.sa_len - sizeof (p->ifr_addr) : 0))
#define ifraddr_size(a) (a.sa_len)
((p)->ifr_addr.sa_len > sizeof ((p)->ifr_addr) ? \
(p)->ifr_addr.sa_len - sizeof ((p)->ifr_addr) : 0))
#define ifraddr_size(a) ((a).sa_len)
#else
#define ifr_size(p) (sizeof (ifr_type))
#define ifraddr_size(a) (sizeof (a))
Expand Down
12 changes: 6 additions & 6 deletions os/bug_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
xorg_backtrace(); \
} } while(0)

#define BUG_WARN_MSG(cond, ...) __BUG_WARN_MSG(cond, 1, __VA_ARGS__)
#define BUG_WARN_MSG(cond, ...) __BUG_WARN_MSG((cond), 1, __VA_ARGS__)

#define BUG_WARN(cond) __BUG_WARN_MSG(cond, 0, NULL)
#define BUG_WARN(cond) __BUG_WARN_MSG((cond), 0, NULL)

#define BUG_RETURN(cond) \
do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return; } } while(0)
do { if (cond) { __BUG_WARN_MSG((cond), 0, NULL); return; } } while(0)

#define BUG_RETURN_MSG(cond, ...) \
do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return; } } while(0)
do { if (cond) { __BUG_WARN_MSG((cond), 1, __VA_ARGS__); return; } } while(0)

#define BUG_RETURN_VAL(cond, val) \
do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return (val); } } while(0)
do { if (cond) { __BUG_WARN_MSG((cond), 0, NULL); return (val); } } while(0)

#define BUG_RETURN_VAL_MSG(cond, val, ...) \
do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return (val); } } while(0)
do { if (cond) { __BUG_WARN_MSG((cond), 1, __VA_ARGS__); return (val); } } while(0)

#endif /* _XSERVER_OS_BUG_H_ */
2 changes: 1 addition & 1 deletion os/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "include/os.h"

#define CHECK_FOR_REQUIRED_ARGUMENTS(num) \
do if (((i + num) >= argc) || (!argv[i + num])) { \
do if (((i + (num)) >= argc) || (!argv[i + (num)])) { \
UseMsg(); \
FatalError("Required argument to %s not specified\n", argv[i]); \
} while (0)
Expand Down
6 changes: 3 additions & 3 deletions os/xdmauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ XdmAuthenticationAddAuth(int name_len, const char *name,
return ret;
}

#define atox(c) ('0' <= c && c <= '9' ? c - '0' : \
'a' <= c && c <= 'f' ? c - 'a' + 10 : \
'A' <= c && c <= 'F' ? c - 'A' + 10 : -1)
#define atox(c) ('0' <= (c) && (c) <= '9' ? (c) - '0' : \
'a' <= (c) && (c) <= 'f' ? (c) - 'a' + 10 : \
'A' <= (c) && (c) <= 'F' ? (c) - 'A' + 10 : -1)

static int
HexToBinary(const char *in, char *out, int len)
Expand Down
2 changes: 1 addition & 1 deletion os/xserver_poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#ifdef HAVE_POLL
#include <poll.h>
#define xserver_poll(fds, nfds, timeout) poll(fds, nfds, timeout)
#define xserver_poll(fds, nfds, timeout) poll((fds), (nfds), (timeout))
#else

#ifdef WIN32
Expand Down
Loading