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 1cfa5ad..65f7ef8 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 fddc5c4..c977b89 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 f86c986..8b999aa 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 feead46..6186807 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