+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
(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
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
{
{
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);
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);
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);
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);
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;
}