mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 08:20:20 +02:00
* gh.h: Don't take the address of a SCM value.
* sort.c: Don't take the address of SCM_CAR, use SCM_CARLOC instead.
This commit is contained in:
parent
9a09deb1c3
commit
4b479d9818
3 changed files with 18 additions and 9 deletions
|
@ -1,3 +1,12 @@
|
|||
2000-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* gc.h (SCM_CARLOC, SCM_CDRLOC): Don't take the address of a SCM
|
||||
value.
|
||||
|
||||
* sort.c (scm_sorted_p, scm_merge, scm_merge_list_x,
|
||||
scm_merge_list_step): Don't take the address of SCM_CAR. Use
|
||||
SCM_CARLOC instead. Thanks to Bernard Urban for the bug report.
|
||||
|
||||
2000-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* boolean.h (SCM_TRUE_P): Removed, as people might use it as a
|
||||
|
|
|
@ -134,8 +134,8 @@ typedef scm_cell * SCM_CELLPTR;
|
|||
(SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y))))
|
||||
|
||||
#define SCM_CELL_WORD_LOC(x, n) (&SCM_CELL_WORD (x, n))
|
||||
#define SCM_CARLOC(x) (&SCM_PACK (((scm_bits_t *) SCM2PTR (x)) [0]))
|
||||
#define SCM_CDRLOC(x) (&SCM_PACK (((scm_bits_t *) SCM2PTR (x)) [1]))
|
||||
#define SCM_CARLOC(x) ((SCM *) (&(((scm_bits_t *) SCM2PTR (x)) [0])))
|
||||
#define SCM_CDRLOC(x) ((SCM *) (&(((scm_bits_t *) SCM2PTR (x)) [1])))
|
||||
|
||||
|
||||
/* SCM_PTR_LT and friends define how to compare two SCM_CELLPTRs (which may
|
||||
|
|
|
@ -485,7 +485,7 @@ SCM_DEFINE (scm_sorted_p, "sorted?", 2, 0, 0,
|
|||
j = len - 1;
|
||||
while (j > 0)
|
||||
{
|
||||
if ((*cmp) (less, &SCM_CAR(rest), &item))
|
||||
if ((*cmp) (less, SCM_CARLOC(rest), &item))
|
||||
return SCM_BOOL_F;
|
||||
else
|
||||
{
|
||||
|
@ -555,7 +555,7 @@ SCM_DEFINE (scm_merge, "merge", 3, 0, 0,
|
|||
{
|
||||
SCM_VALIDATE_NONEMPTYLIST_COPYLEN (1,alist,alen);
|
||||
SCM_VALIDATE_NONEMPTYLIST_COPYLEN (2,blist,blen);
|
||||
if ((*cmp) (less, &SCM_CAR (blist), &SCM_CAR (alist)))
|
||||
if ((*cmp) (less, SCM_CARLOC (blist), SCM_CARLOC (alist)))
|
||||
{
|
||||
build = scm_cons (SCM_CAR (blist), SCM_EOL);
|
||||
blist = SCM_CDR (blist);
|
||||
|
@ -570,7 +570,7 @@ SCM_DEFINE (scm_merge, "merge", 3, 0, 0,
|
|||
last = build;
|
||||
while ((alen > 0) && (blen > 0))
|
||||
{
|
||||
if ((*cmp) (less, &SCM_CAR (blist), &SCM_CAR (alist)))
|
||||
if ((*cmp) (less, SCM_CARLOC (blist), SCM_CARLOC (alist)))
|
||||
{
|
||||
SCM_SETCDR (last, scm_cons (SCM_CAR (blist), SCM_EOL));
|
||||
blist = SCM_CDR (blist);
|
||||
|
@ -607,7 +607,7 @@ scm_merge_list_x (SCM alist, SCM blist,
|
|||
return alist;
|
||||
else
|
||||
{
|
||||
if ((*cmp) (less, &SCM_CAR (blist), &SCM_CAR (alist)))
|
||||
if ((*cmp) (less, SCM_CARLOC (blist), SCM_CARLOC (alist)))
|
||||
{
|
||||
build = blist;
|
||||
blist = SCM_CDR (blist);
|
||||
|
@ -622,7 +622,7 @@ scm_merge_list_x (SCM alist, SCM blist,
|
|||
last = build;
|
||||
while ((alen > 0) && (blen > 0))
|
||||
{
|
||||
if ((*cmp) (less, &SCM_CAR (blist), &SCM_CAR (alist)))
|
||||
if ((*cmp) (less, SCM_CARLOC (blist), SCM_CARLOC (alist)))
|
||||
{
|
||||
SCM_SETCDR (last, blist);
|
||||
blist = SCM_CDR (blist);
|
||||
|
@ -698,8 +698,8 @@ scm_merge_list_step (SCM * seq,
|
|||
SCM_SETCDR (rest, SCM_EOL);
|
||||
if ((*cmp) (less, &y, &x))
|
||||
{
|
||||
SCM_CAR (p) = y;
|
||||
SCM_CAR (rest) = x;
|
||||
SCM_SETCAR (p, y);
|
||||
SCM_SETCAR (rest, x);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue