mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
Some cleanups with regard to the use of SCM2PTR and casts to SCM_CELLPTR.
This commit is contained in:
parent
9e882eeca8
commit
195e620170
2 changed files with 16 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
|||
2000-04-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* gc.c (which_seg): Use SCM2PTR to convert a non immediate SCM
|
||||
variable into a pointer to a heap cell.
|
||||
|
||||
* gc.c (scm_mark_locations, scm_cellp, init_heap_seg,
|
||||
scm_unhash_name): Remove redundant cast to SCM_CELLPTR.
|
||||
|
||||
2000-04-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* print.c (scm_iprin1): Don't assign zero to SCM values, use
|
||||
|
|
|
@ -319,8 +319,8 @@ which_seg (SCM cell)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < scm_n_heap_segs; i++)
|
||||
if (SCM_PTR_LE (scm_heap_table[i].bounds[0], (SCM_CELLPTR) cell)
|
||||
&& SCM_PTR_GT (scm_heap_table[i].bounds[1], (SCM_CELLPTR) cell))
|
||||
if (SCM_PTR_LE (scm_heap_table[i].bounds[0], SCM2PTR (cell))
|
||||
&& SCM_PTR_GT (scm_heap_table[i].bounds[1], SCM2PTR (cell)))
|
||||
return i;
|
||||
fprintf (stderr, "which_seg: can't find segment containing cell %lx\n",
|
||||
SCM_UNPACK (cell));
|
||||
|
@ -1391,7 +1391,7 @@ scm_mark_locations (SCM_STACKITEM x[], scm_sizet n)
|
|||
while (0 <= --m)
|
||||
if (SCM_CELLP (* (SCM *) &x[m]))
|
||||
{
|
||||
ptr = (SCM_CELLPTR) SCM2PTR (* (SCM *) &x[m]);
|
||||
ptr = SCM2PTR (* (SCM *) &x[m]);
|
||||
i = 0;
|
||||
j = scm_n_heap_segs - 1;
|
||||
if ( SCM_PTR_LE (scm_heap_table[i].bounds[0], ptr)
|
||||
|
@ -1458,7 +1458,7 @@ scm_cellp (SCM value)
|
|||
|
||||
if (SCM_CELLP (value))
|
||||
{
|
||||
ptr = (SCM_CELLPTR) SCM2PTR (value);
|
||||
ptr = SCM2PTR (value);
|
||||
i = 0;
|
||||
j = scm_n_heap_segs - 1;
|
||||
if ( SCM_PTR_LE (scm_heap_table[i].bounds[0], ptr)
|
||||
|
@ -2197,8 +2197,8 @@ init_heap_seg (SCM_CELLPTR seg_org, scm_sizet size, scm_freelist_t *freelist)
|
|||
scm_heap_table[new_seg_index].valid = 0;
|
||||
scm_heap_table[new_seg_index].span = span;
|
||||
scm_heap_table[new_seg_index].freelist = freelist;
|
||||
scm_heap_table[new_seg_index].bounds[0] = (SCM_CELLPTR)ptr;
|
||||
scm_heap_table[new_seg_index].bounds[1] = (SCM_CELLPTR)seg_end;
|
||||
scm_heap_table[new_seg_index].bounds[0] = ptr;
|
||||
scm_heap_table[new_seg_index].bounds[1] = seg_end;
|
||||
|
||||
|
||||
/* Compute the least valid object pointer w/in this segment
|
||||
|
@ -2425,8 +2425,8 @@ SCM_DEFINE (scm_unhash_name, "unhash-name", 1, 0, 0,
|
|||
{
|
||||
SCM_CELLPTR p;
|
||||
SCM_CELLPTR pbound;
|
||||
p = (SCM_CELLPTR)scm_heap_table[x].bounds[0];
|
||||
pbound = (SCM_CELLPTR)scm_heap_table[x].bounds[1];
|
||||
p = scm_heap_table[x].bounds[0];
|
||||
pbound = scm_heap_table[x].bounds[1];
|
||||
while (p < pbound)
|
||||
{
|
||||
SCM cell = PTR2SCM (p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue