1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-20 02:30:23 +02:00

correct use of SCM2PTR in SCM_I_REGISTER_DISAPPEARING_LINK forms

* libguile/hashtab.c (set_weak_cdr):
* libguile/vectors.c (scm_c_vector_set_x):
* libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair):
  (scm_doubly_weak_pair): Use SCM2PTR for the target of
  SCM_I_REGISTER_DISAPPEARING_LINK calls.
This commit is contained in:
Andy Wingo 2011-05-13 13:18:11 +02:00
parent 393baa8a44
commit d3464bb6e2
3 changed files with 18 additions and 24 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1998,2000,2001, 2003, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
/* Copyright (C) 1995,1996,1998,2000,2001, 2003, 2006, 2008, 2009, 2010, 2011 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
@ -62,11 +62,9 @@ scm_weak_car_pair (SCM car, SCM cdr)
cell->word_1 = 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) SCM_UNPACK (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));
return (SCM_PACK (cell));
}
@ -83,11 +81,9 @@ scm_weak_cdr_pair (SCM car, SCM cdr)
cell->word_1 = 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) SCM_UNPACK (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));
return (SCM_PACK (cell));
}
@ -103,15 +99,11 @@ 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) SCM_UNPACK (car));
}
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_0,
(GC_PTR) SCM2PTR (car));
if (SCM_NIMP (cdr))
{
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_1,
(GC_PTR) SCM_UNPACK (cdr));
}
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &cell->word_1,
(GC_PTR) SCM2PTR (cdr));
return (SCM_PACK (cell));
}