emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/igc 8c9cccc32f1 3/4: Always typecheck igc_assertions


From: Pip Cet
Subject: scratch/igc 8c9cccc32f1 3/4: Always typecheck igc_assertions
Date: Tue, 16 Jul 2024 14:30:26 -0400 (EDT)

branch: scratch/igc
commit 8c9cccc32f19bf62b5bfcef670519c0e997cd6f3
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Pip Cet <pipcet@protonmail.com>

    Always typecheck igc_assertions
    
    * src/igc.c (igc_assert) [!IGC_DEBUG]: Typecheck the expression even if
    it is always true.
    (set_state, weak_vector_p): Remove some ifdefs.
---
 src/igc.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/igc.c b/src/igc.c
index 51fc7f26917..2cdf884f4ee 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -218,7 +218,7 @@ igc_assert_fail (const char *file, unsigned line, const 
char *msg)
     }                                                  \
   while (0)
 #else
-# define igc_assert(expr) (void) 0
+# define igc_assert(expr) ((void) (true || (expr)))
 #endif
 
 #define IGC_NOT_IMPLEMENTED() \
@@ -814,9 +814,7 @@ arena_release (struct igc *gc)
 static void
 set_state (enum igc_state state)
 {
-#ifdef IGC_DEBUG
   enum igc_state old_state = igc_state;
-#endif
   igc_state = state;
   switch (igc_state)
     {
@@ -4171,7 +4169,6 @@ igc_remove_all_markers (struct buffer *b)
     }
 }
 
-#ifdef IGC_DEBUG
 static bool
 weak_vector_p (Lisp_Object x)
 {
@@ -4186,7 +4183,6 @@ weak_vector_p (Lisp_Object x)
   else
     return false;
 }
-#endif
 
 void
 igc_resurrect_markers (struct buffer *b)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]