]> granicus.if.org Git - gc/commitdiff
Eliminate 'value of NEED_FIXUP_POINTER unknown' cppcheck info messages
authorIvan Maidanski <ivmai@mail.ru>
Fri, 21 Oct 2016 17:27:51 +0000 (20:27 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 21 Oct 2016 17:27:51 +0000 (20:27 +0300)
* include/private/gc_pmark.h: Replace #if NEED_FIXUP_POINTER
to #ifdef NEED_FIXUP_POINTER.
* include/private/gcconfig.h (NEED_FIXUP_POINTER): If FIXUP_POINTER
then define to empty else leave undefined.
* mark.c (GC_push_all_stack): Replace if(!NEED_FIXUP_POINTER)
to #ifndef NEED_FIXUP_POINTER.
* mark_rts.c (GC_push_all_stack_partially_eager): Likewise.

include/private/gc_pmark.h
include/private/gcconfig.h
mark.c
mark_rts.c

index 1cfa5adc86278a3879a30ea59ab4bca27e8eff21..65f7ef82921947542259d8665c31ba3683229687 100644 (file)
@@ -359,7 +359,7 @@ GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp);
  * if the mark stack overflows.
  */
 
-#if NEED_FIXUP_POINTER
+#ifdef NEED_FIXUP_POINTER
     /* Try both the raw version and the fixed up one.   */
 # define GC_PUSH_ONE_STACK(p, source) \
     do { \
index fddc5c4ae4b6f30c1a36d1b88d357f9add0ec7c3..c977b8962ad78c457ff373900b7c6ab3ab3e8296 100644 (file)
 #endif
 
 #if defined(FIXUP_POINTER)
-# define NEED_FIXUP_POINTER 1
+# define NEED_FIXUP_POINTER
 #else
-# define NEED_FIXUP_POINTER 0
 # define FIXUP_POINTER(p)
 #endif
 
diff --git a/mark.c b/mark.c
index f86c98642cb2e190dca85f5f1add58bdd8b4a7a1..8b999aac4f415a6272cda0fd86e51ce51edbe3d0 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -1558,9 +1558,12 @@ GC_INNER void GC_push_all_stack(ptr_t bottom, ptr_t top)
 # if defined(THREADS) && defined(MPROTECT_VDB)
     GC_push_all_eager(bottom, top);
 # else
-    if (!NEED_FIXUP_POINTER && GC_all_interior_pointers) {
-      GC_push_all(bottom, top);
-    } else {
+#   ifndef NEED_FIXUP_POINTER
+      if (GC_all_interior_pointers) {
+        GC_push_all(bottom, top);
+      } else
+#   endif
+    /* else */ {
       GC_push_all_eager(bottom, top);
     }
 # endif
index feead46802780797e3fcc4a81bce714bcf0b006d..6186807f82b4f90dc09ef375aace9683147df77d 100644 (file)
@@ -591,7 +591,8 @@ GC_INNER void GC_push_all_stack_sections(ptr_t lo, ptr_t hi,
 STATIC void GC_push_all_stack_partially_eager(ptr_t bottom, ptr_t top,
                                               ptr_t cold_gc_frame)
 {
-  if (!NEED_FIXUP_POINTER && GC_all_interior_pointers) {
+#ifndef NEED_FIXUP_POINTER
+  if (GC_all_interior_pointers) {
     /* Push the hot end of the stack eagerly, so that register values   */
     /* saved inside GC frames are marked before they disappear.         */
     /* The rest of the marking can be deferred until later.             */
@@ -608,7 +609,9 @@ STATIC void GC_push_all_stack_partially_eager(ptr_t bottom, ptr_t top,
         GC_push_all(bottom, cold_gc_frame + sizeof(ptr_t));
         GC_push_all_eager(cold_gc_frame, top);
 #   endif /* STACK_GROWS_UP */
-  } else {
+  } else
+#endif
+  /* else */ {
     GC_push_all_eager(bottom, top);
   }
 # ifdef TRACE_BUF