Use `void *' instead of `GC_PTR' internally.
authorLudovic Courtès <ludo@gnu.org>
Sun, 1 Jul 2012 15:32:03 +0000 (17:32 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 2 Jul 2012 09:19:51 +0000 (11:19 +0200)
* libguile/finalizers.c, libguile/foreign.c, libguile/guardians.c,
  libguile/hashtab.c, libguile/numbers.c, libguile/ports.c,
  libguile/smob.c, libguile/struct.c, libguile/vectors.c,
  libguile/weaks.c: Use `void *' instead of `GC_PTR'.

libguile/finalizers.c
libguile/foreign.c
libguile/guardians.c
libguile/hashtab.c
libguile/numbers.c
libguile/ports.c
libguile/smob.c
libguile/struct.c
libguile/vectors.c
libguile/weaks.c

index 295f977..a179479 100644 (file)
@@ -40,7 +40,7 @@ void
 scm_i_set_finalizer (void *obj, scm_t_finalizer_proc proc, void *data)
 {
   GC_finalization_proc prev;
-  GC_PTR prev_data;
+  void *prev_data;
   GC_REGISTER_FINALIZER_NO_ORDER (obj, proc, data, &prev, &prev_data);
 }
 
index 3559349..320e20d 100644 (file)
@@ -99,7 +99,7 @@ register_weak_reference (SCM from, SCM to)
 }
 
 static void
-pointer_finalizer_trampoline (GC_PTR ptr, GC_PTR data)
+pointer_finalizer_trampoline (void *ptr, void *data)
 {
   scm_t_pointer_finalizer finalizer = data;
   finalizer (SCM_POINTER_VALUE (PTR2SCM (ptr)));
index 81313df..022f54e 100644 (file)
@@ -1,5 +1,6 @@
-/* Copyright (C) 1998,1999,2000,2001, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
- * 
+/* Copyright (C) 1998,1999,2000,2001, 2006, 2008, 2009, 2011,
+ *   2012 Free Software Foundation, Inc.
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; either version 3 of
@@ -104,7 +105,7 @@ guardian_print (SCM guardian, SCM port, scm_print_state *pstate SCM_UNUSED)
 /* Handle finalization of OBJ which is guarded by the guardians listed in
    GUARDIAN_LIST.  */
 static void
-finalize_guarded (GC_PTR ptr, GC_PTR finalizer_data)
+finalize_guarded (void *ptr, void *finalizer_data)
 {
   SCM cell_pool;
   SCM obj, guardian_list, proxied_finalizer;
@@ -164,7 +165,7 @@ finalize_guarded (GC_PTR ptr, GC_PTR finalizer_data)
       /* Re-register the finalizer that was in place before we installed this
         one.  */
       GC_finalization_proc finalizer, prev_finalizer;
-      GC_PTR finalizer_data, prev_finalizer_data;
+      void *finalizer_data, *prev_finalizer_data;
 
       finalizer = (GC_finalization_proc) SCM2PTR (SCM_CAR (proxied_finalizer));
       finalizer_data = SCM2PTR (SCM_CDR (proxied_finalizer));
@@ -204,7 +205,7 @@ scm_i_guard (SCM guardian, SCM obj)
         the very beginning of an object's lifetime (e.g., see `SCM_NEWSMOB')
         or by this function.  */
       GC_finalization_proc prev_finalizer;
-      GC_PTR prev_data;
+      void *prev_data;
       SCM guardians_for_obj, finalizer_data;
 
       g->live++;
index fe718b9..0abc7dc 100644 (file)
@@ -814,10 +814,10 @@ scm_hash_fn_set_x (SCM table, SCM obj, SCM val,
           SCM_SETCDR (pair, val);
 
           if (SCM_NIMP (prev) && !SCM_NIMP (val))
-            GC_unregister_disappearing_link ((GC_PTR) SCM_CDRLOC (pair));
+            GC_unregister_disappearing_link ((void **) SCM_CDRLOC (pair));
           else
-            SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) SCM_CDRLOC (pair),
-                                              (GC_PTR) SCM2PTR (val));
+            SCM_I_REGISTER_DISAPPEARING_LINK ((void **) SCM_CDRLOC (pair),
+                                              SCM2PTR (val));
         }
       else
         SCM_SETCDR (pair, val);
index 0173aee..3458847 100644 (file)
@@ -179,7 +179,7 @@ static mpz_t z_negative_one;
 
 /* Clear the `mpz_t' embedded in bignum PTR.  */
 static void
-finalize_bignum (GC_PTR ptr, GC_PTR data)
+finalize_bignum (void *ptr, void *data)
 {
   SCM bignum;
 
index ccf6587..2f8c792 100644 (file)
@@ -543,7 +543,7 @@ scm_i_pthread_mutex_t scm_i_port_table_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER;
 /* Port finalization.  */
 
 
-static void finalize_port (GC_PTR, GC_PTR);
+static void finalize_port (void *, void *);
 
 /* Register a finalizer for PORT.  */
 static SCM_C_INLINE_KEYWORD void
@@ -556,7 +556,7 @@ register_finalizer_for_port (SCM port)
 
 /* Finalize the object (a port) pointed to by PTR.  */
 static void
-finalize_port (GC_PTR ptr, GC_PTR data)
+finalize_port (void *ptr, void *data)
 {
   long port_type;
   SCM port = PTR2SCM (ptr);
index 215bb59..c2e8f24 100644 (file)
@@ -378,7 +378,7 @@ scm_gc_mark (SCM o)
 \f
 /* Finalize SMOB by calling its SMOB type's free function, if any.  */
 static void
-finalize_smob (GC_PTR ptr, GC_PTR data)
+finalize_smob (void *ptr, void *data)
 {
   SCM smob;
   size_t (* free_smob) (SCM);
index e5d95fc..326f306 100644 (file)
@@ -410,7 +410,7 @@ SCM_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
 
 /* Finalization: invoke the finalizer of the struct pointed to by PTR.  */
 static void
-struct_finalizer_trampoline (GC_PTR ptr, GC_PTR unused_data)
+struct_finalizer_trampoline (void *ptr, void *unused_data)
 {
   SCM obj = PTR2SCM (ptr);
   scm_t_struct_finalize finalize = SCM_STRUCT_FINALIZER (obj);
index 2805278..b386deb 100644 (file)
@@ -1,5 +1,6 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
- * 
+/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2006, 2008, 2009, 2010,
+ *   2011, 2012 Free Software Foundation, Inc.
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; either version 3 of
@@ -277,9 +278,8 @@ scm_c_vector_set_x (SCM v, size_t k, SCM obj)
       if (SCM_I_WVECTP (v))
        {
          /* Make it a weak pointer.  */
-         GC_PTR link = (GC_PTR) & ((SCM_I_VECTOR_WELTS (v))[k]);
-         SCM_I_REGISTER_DISAPPEARING_LINK (link,
-                                            (GC_PTR) SCM2PTR (obj));
+         SCM *link = & SCM_I_VECTOR_WELTS (v)[k];
+         SCM_I_REGISTER_DISAPPEARING_LINK ((void **) link, SCM2PTR (obj));
        }
     }
   else if (SCM_I_ARRAYP (v) && SCM_I_ARRAY_NDIM (v) == 1)
@@ -296,9 +296,8 @@ scm_c_vector_set_x (SCM v, size_t k, SCM obj)
          if (SCM_I_WVECTP (vv))
            {
              /* Make it a weak pointer.  */
-             GC_PTR link = (GC_PTR) & ((SCM_I_VECTOR_WELTS (vv))[k]);
-             SCM_I_REGISTER_DISAPPEARING_LINK (link,
-                                                (GC_PTR) SCM2PTR (obj));
+             SCM *link = & SCM_I_VECTOR_WELTS (vv)[k];
+             SCM_I_REGISTER_DISAPPEARING_LINK ((void **) link, SCM2PTR (obj));
            }
        }
       else
index 92d351e..79ae1fe 100644 (file)
@@ -1,5 +1,6 @@
-/* Copyright (C) 1995,1996,1998,2000,2001, 2003, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
- * 
+/* Copyright (C) 1995, 1996, 1998, 2000, 2001, 2003, 2006, 2008, 2009, 2010,
+ *   2011, 2012 Free Software Foundation, Inc.
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; either version 3 of
@@ -63,8 +64,7 @@ scm_weak_car_pair (SCM car, SCM cdr)
 
   if (SCM_NIMP (car))
     /* Weak car cells make sense iff the car is non-immediate.  */
-    SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_0,
-                                      (GC_PTR) SCM2PTR (car));
+    SCM_I_REGISTER_DISAPPEARING_LINK ((void **) &cell->word_0, SCM2PTR (car));
 
   return (SCM_PACK (cell));
 }
@@ -82,8 +82,7 @@ scm_weak_cdr_pair (SCM car, SCM cdr)
 
   if (SCM_NIMP (cdr))
     /* Weak cdr cells make sense iff the cdr is non-immediate.  */
-    SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_1,
-                                      (GC_PTR) SCM2PTR (cdr));
+    SCM_I_REGISTER_DISAPPEARING_LINK ((void **) &cell->word_1, SCM2PTR (cdr));
 
   return (SCM_PACK (cell));
 }
@@ -99,11 +98,9 @@ scm_doubly_weak_pair (SCM car, SCM cdr)
   cell->word_1 = cdr;
 
   if (SCM_NIMP (car))
-    SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_0,
-                                      (GC_PTR) SCM2PTR (car));
+    SCM_I_REGISTER_DISAPPEARING_LINK ((void **) &cell->word_0, SCM2PTR (car));
   if (SCM_NIMP (cdr))
-    SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_1,
-                                      (GC_PTR) SCM2PTR (cdr));
+    SCM_I_REGISTER_DISAPPEARING_LINK ((void **) &cell->word_1, SCM2PTR (cdr));
 
   return (SCM_PACK (cell));
 }