Wrap more macro definitions in (parentheses)

To avoid surprises, good coding practice suggests parenthesizing every
macro definition -- or at the very least, all those involving an
expression.
This commit is contained in:
Nick Mathewson 2013-02-09 00:14:45 -05:00
parent 561e9becbd
commit d86a45f991
4 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@
#define TOR_ONION_FAST_H #define TOR_ONION_FAST_H
#define CREATE_FAST_LEN DIGEST_LEN #define CREATE_FAST_LEN DIGEST_LEN
#define CREATED_FAST_LEN DIGEST_LEN*2 #define CREATED_FAST_LEN (DIGEST_LEN*2)
typedef struct fast_handshake_state_t { typedef struct fast_handshake_state_t {
uint8_t state[DIGEST_LEN]; uint8_t state[DIGEST_LEN];

View File

@ -4586,12 +4586,12 @@ typedef struct rend_encoded_v2_service_descriptor_t {
* sooner.) * sooner.)
* *
* XXX023 Should this be configurable? */ * XXX023 Should this be configurable? */
#define INTRO_POINT_LIFETIME_MIN_SECONDS 18*60*60 #define INTRO_POINT_LIFETIME_MIN_SECONDS (18*60*60)
/** The maximum number of seconds that an introduction point will last /** The maximum number of seconds that an introduction point will last
* before expiring due to old age. * before expiring due to old age.
* *
* XXX023 Should this be configurable? */ * XXX023 Should this be configurable? */
#define INTRO_POINT_LIFETIME_MAX_SECONDS 24*60*60 #define INTRO_POINT_LIFETIME_MAX_SECONDS (24*60*60)
/** Introduction point information. Used both in rend_service_t (on /** Introduction point information. Used both in rend_service_t (on
* the service side) and in rend_service_descriptor_t (on both the * the service side) and in rend_service_descriptor_t (on both the

View File

@ -88,7 +88,7 @@ typedef struct rend_service_port_config_t {
/** How many seconds should we wait for new HS descriptors to reach /** How many seconds should we wait for new HS descriptors to reach
* our clients before we close an expiring intro point? */ * our clients before we close an expiring intro point? */
#define INTRO_POINT_EXPIRATION_GRACE_PERIOD 5*60 #define INTRO_POINT_EXPIRATION_GRACE_PERIOD (5*60)
/** Represents a single hidden service running at this OP. */ /** Represents a single hidden service running at this OP. */
typedef struct rend_service_t { typedef struct rend_service_t {

View File

@ -1549,7 +1549,7 @@ rep_hist_get_bandwidth_lines(void)
/* [dirreq-](read|write)-history yyyy-mm-dd HH:MM:SS (n s) n,n,n... */ /* [dirreq-](read|write)-history yyyy-mm-dd HH:MM:SS (n s) n,n,n... */
/* The n,n,n part above. Largest representation of a uint64_t is 20 chars /* The n,n,n part above. Largest representation of a uint64_t is 20 chars
* long, plus the comma. */ * long, plus the comma. */
#define MAX_HIST_VALUE_LEN 21*NUM_TOTALS #define MAX_HIST_VALUE_LEN (21*NUM_TOTALS)
len = (67+MAX_HIST_VALUE_LEN)*4; len = (67+MAX_HIST_VALUE_LEN)*4;
buf = tor_malloc_zero(len); buf = tor_malloc_zero(len);
cp = buf; cp = buf;