Skip to content

Commit

Permalink
[clang-tidy] enclose macro arguments in parentheses
Browse files Browse the repository at this point in the history
Found with bugprone-macro-parentheses

Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb authored and pevik committed Apr 13, 2020
1 parent 25f750a commit a333cb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ void iputils_MD5Final(unsigned char digest[IPUTILS_MD5LENGTH],
/* The four core functions - F1 is optimized somewhat */

/* #define F1(x, y, z) (x & y | ~x & z) */
# define F1(x, y, z) (z ^ (x & (y ^ z)))
# define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
# define F2(x, y, z) F1(z, x, y)
# define F3(x, y, z) (x ^ y ^ z)
# define F4(x, y, z) (y ^ (x | ~z))
# define F3(x, y, z) ((x) ^ (y) ^ (z))
# define F4(x, y, z) ((y) ^ ((x) | ~(z)))

/* This is the central step in the MD5 algorithm. */
# define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
( (w) += f(x, y, z) + (data), (w) = (w)<<(s) | (w)>>(32-(s)), (w) += (x) )

/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to reflect
Expand Down
8 changes: 4 additions & 4 deletions ping/node_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ struct niquery_option {

#define NIQUERY_OPTION(_name, _has_arg, _data, _handler) \
{ \
.name = _name, \
.name = (_name), \
.namelen = sizeof(_name) - 1, \
.has_arg = _has_arg, \
.data = _data, \
.handler = _handler \
.has_arg = (_has_arg), \
.data = (_data), \
.handler = (_handler) \
}

static int niquery_option_name_handler(struct ping_ni *ni, int index __attribute__((__unused__)), const char *arg __attribute__((__unused__)));
Expand Down

0 comments on commit a333cb9

Please sign in to comment.