Eliminate 'boolean result used in bitwise operation' cppcheck warning
authorIvan Maidanski <ivmai@mail.ru>
Thu, 19 Apr 2018 23:19:19 +0000 (02:19 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 19 Apr 2018 23:20:35 +0000 (02:20 +0300)
* finalize.c (GC_push_finalizer_structures): Replace (word)&sym to
(word)(&sym).
* typd_mlc.c (GC_add_ext_descriptor): Likewise.

finalize.c
typd_mlc.c

index c76b31b..cefdf60 100644 (file)
@@ -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);
index e7df05b..7fb964a 100644 (file)
@@ -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;