From 3ade78e09e2bd328b8056f1e58c0a594a30b88f2 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 25 Jul 2018 12:28:40 +0300 Subject: [PATCH] Add outermost parentheses to HCE definition (code refactoring) * include/private/gc_hdrs.h [COUNT_HDR_CACHE_HITS] (HC_HIT, HC_MISS): Cast result to void. * include/private/gc_hdrs.h (HCE): Wrap the whole expression into parentheses. --- include/private/gc_hdrs.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/private/gc_hdrs.h b/include/private/gc_hdrs.h index 03889fe..94f29e9 100644 --- a/include/private/gc_hdrs.h +++ b/include/private/gc_hdrs.h @@ -63,11 +63,11 @@ typedef struct hblkhdr hdr; #ifdef COUNT_HDR_CACHE_HITS extern word GC_hdr_cache_hits; /* used for debugging/profiling */ extern word GC_hdr_cache_misses; -# define HC_HIT() ++GC_hdr_cache_hits -# define HC_MISS() ++GC_hdr_cache_misses +# define HC_HIT() (void)(++GC_hdr_cache_hits) +# define HC_MISS() (void)(++GC_hdr_cache_misses) #else -# define HC_HIT() -# define HC_MISS() +# define HC_HIT() /* empty */ +# define HC_MISS() /* empty */ #endif typedef struct hce { @@ -82,9 +82,10 @@ typedef struct hce { #define INIT_HDR_CACHE BZERO(hdr_cache, sizeof(hdr_cache)) -#define HCE(h) hdr_cache + (((word)(h) >> LOG_HBLKSIZE) & (HDR_CACHE_SIZE-1)) +#define HCE(h) \ + (hdr_cache + (((word)(h) >> LOG_HBLKSIZE) & (HDR_CACHE_SIZE-1))) -#define HCE_VALID_FOR(hce,h) ((hce) -> block_addr == \ +#define HCE_VALID_FOR(hce, h) ((hce) -> block_addr == \ ((word)(h) >> LOG_HBLKSIZE)) #define HCE_HDR(h) ((hce) -> hce_hdr) -- 2.7.4