From 02f010579487aa9e0b51a9c0322bf8edf57a7c95 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 20 Apr 2018 02:19:19 +0300 Subject: [PATCH] Eliminate 'boolean result used in bitwise operation' cppcheck warning * finalize.c (GC_push_finalizer_structures): Replace (word)&sym to (word)(&sym). * typd_mlc.c (GC_add_ext_descriptor): Likewise. --- finalize.c | 6 +++--- typd_mlc.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/finalize.c b/finalize.c index c76b31bc..cefdf601 100644 --- a/finalize.c +++ b/finalize.c @@ -89,10 +89,10 @@ STATIC struct fnlz_roots_s { GC_API void GC_CALL GC_push_finalizer_structures(void) { - GC_ASSERT((word)&GC_dl_hashtbl.head % sizeof(word) == 0); - GC_ASSERT((word)&GC_fnlz_roots % sizeof(word) == 0); + GC_ASSERT((word)(&GC_dl_hashtbl.head) % sizeof(word) == 0); + GC_ASSERT((word)(&GC_fnlz_roots) % sizeof(word) == 0); # ifndef GC_LONG_REFS_NOT_NEEDED - GC_ASSERT((word)&GC_ll_hashtbl.head % sizeof(word) == 0); + GC_ASSERT((word)(&GC_ll_hashtbl.head) % sizeof(word) == 0); GC_PUSH_ALL_SYM(GC_ll_hashtbl.head); # endif GC_PUSH_ALL_SYM(GC_dl_hashtbl.head); diff --git a/typd_mlc.c b/typd_mlc.c index e7df05b3..7fb964a8 100644 --- a/typd_mlc.c +++ b/typd_mlc.c @@ -137,7 +137,7 @@ STATIC signed_word GC_add_ext_descriptor(const word * bm, word nbits) word ed_size = GC_ed_size; if (ed_size == 0) { - GC_ASSERT((word)&GC_ext_descriptors % sizeof(word) == 0); + GC_ASSERT((word)(&GC_ext_descriptors) % sizeof(word) == 0); GC_push_typed_structures = GC_push_typed_structures_proc; UNLOCK(); new_size = ED_INITIAL_SIZE; -- 2.50.1