Add outermost parentheses to HCE definition
authorIvan Maidanski <ivmai@mail.ru>
Wed, 25 Jul 2018 09:28:40 +0000 (12:28 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 25 Jul 2018 09:31:02 +0000 (12:31 +0300)
(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

index 03889fe..94f29e9 100644 (file)
@@ -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)