diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-07-01 17:32:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-07-02 11:19:51 +0200 |
commit | 6922d92f966a593e01dded92020a132ab15a71f6 (patch) | |
tree | d59fba8bb6151c6ba83694bff50e493b5a3f89ca | |
parent | bd5dea489bd02caa503ba57e1b799c90fa409fe9 (diff) |
Use `void *' instead of `GC_PTR' internally.
* 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'.
-rw-r--r-- | libguile/finalizers.c | 2 | ||||
-rw-r--r-- | libguile/foreign.c | 2 | ||||
-rw-r--r-- | libguile/guardians.c | 11 | ||||
-rw-r--r-- | libguile/hashtab.c | 6 | ||||
-rw-r--r-- | libguile/numbers.c | 2 | ||||
-rw-r--r-- | libguile/ports.c | 4 | ||||
-rw-r--r-- | libguile/smob.c | 2 | ||||
-rw-r--r-- | libguile/struct.c | 2 | ||||
-rw-r--r-- | libguile/vectors.c | 15 | ||||
-rw-r--r-- | libguile/weaks.c | 17 |
10 files changed, 30 insertions, 33 deletions
diff --git a/libguile/finalizers.c b/libguile/finalizers.c index 295f977b8..a179479f5 100644 --- a/libguile/finalizers.c +++ b/libguile/finalizers.c @@ -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); } diff --git a/libguile/foreign.c b/libguile/foreign.c index 355934962..320e20d8b 100644 --- a/libguile/foreign.c +++ b/libguile/foreign.c @@ -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))); diff --git a/libguile/guardians.c b/libguile/guardians.c index 81313df31..022f54e63 100644 --- a/libguile/guardians.c +++ b/libguile/guardians.c @@ -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++; diff --git a/libguile/hashtab.c b/libguile/hashtab.c index fe718b9c8..0abc7dc04 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -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); diff --git a/libguile/numbers.c b/libguile/numbers.c index 0173aeea5..3458847b5 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -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; diff --git a/libguile/ports.c b/libguile/ports.c index ccf658756..2f8c79217 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -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); diff --git a/libguile/smob.c b/libguile/smob.c index 215bb5913..c2e8f2481 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -378,7 +378,7 @@ scm_gc_mark (SCM o) /* 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); diff --git a/libguile/struct.c b/libguile/struct.c index e5d95fc44..326f306ac 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -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); diff --git a/libguile/vectors.c b/libguile/vectors.c index 2805278f0..b386debf4 100644 --- a/libguile/vectors.c +++ b/libguile/vectors.c @@ -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 diff --git a/libguile/weaks.c b/libguile/weaks.c index 92d351e51..79ae1fee5 100644 --- a/libguile/weaks.c +++ b/libguile/weaks.c @@ -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)); } |