21.5
Marcus, your opinion would be appreciated on this one. Seems
"obviously correct" to me, but ....
GCC 4 whines about unused values, and it's right. I think this patch
actually makes the code clearer, as well.
diff --git a/src/ChangeLog b/src/ChangeLog
index b9f6993..3fa529a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,4 @@
+2006-06-24 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * gc.c (gc_mark_root_set): Quiet GCC 4 whining about unused values.
+
diff --git a/src/gc.c b/src/gc.c
index 972821a..18f0944 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -1623,29 +1623,25 @@ gc_mark_root_set (
{ /* staticpro() */
Lisp_Object **p = Dynarr_begin (staticpros);
Elemcount count;
- for (count = Dynarr_length (staticpros); count; count--)
+ for (count = Dynarr_length (staticpros); count; count--, p++)
/* Need to check if the pointer in the staticpro array is not
NULL. A gc can occur after variable is added to the staticpro
array and _before_ it is correctly initialized. In this case
its value is NULL, which we have to catch here. */
if (*p)
- mark_object (**p++);
- else
- **p++;
+ mark_object (**p);
}
{ /* staticpro_nodump() */
Lisp_Object **p = Dynarr_begin (staticpros_nodump);
Elemcount count;
- for (count = Dynarr_length (staticpros_nodump); count; count--)
+ for (count = Dynarr_length (staticpros_nodump); count; count--, p++)
/* Need to check if the pointer in the staticpro array is not
NULL. A gc can occur after variable is added to the staticpro
array and _before_ it is correctly initialized. In this case
its value is NULL, which we have to catch here. */
if (*p)
- mark_object (**p++);
- else
- **p++;
+ mark_object (**p);
}
#ifdef NEW_GC
--
Graduate School of Systems and Information Engineering University of Tsukuba
http://turnbull.sk.tsukuba.ac.jp/ Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Economics of Information Communication and Computation Systems
Experimental Economics, Microeconomic Theory, Game Theory