From 230d095fc58e0fabfd8026e06e505b2ff62d6ec2 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Tue, 18 Apr 2000 07:24:24 +0000 Subject: [PATCH] Fixed some SCM/scm_bits_t mixups and initialization problems. --- libguile/ChangeLog | 11 +++++++++++ libguile/print.c | 19 ++++++++++--------- libguile/srcprop.c | 4 ++-- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index d4e757a37..48eaff30c 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,14 @@ +2000-04-18 Dirk Herrmann + + * print.c (ENTER_NESTED_DATA, print_circref, scm_iprlist): + Compare SCM's with SCM_EQ_P. + + * print.c (scm_make_print_state), srcprop.c + (scm_source_properties): Use valid scheme object to initialize + SCM variable. + + * print.c (scm_iprin1): Remove redundant calls to SCM_UNPACK. + 2000-04-17 Dirk Herrmann * struct.c (scm_alloc_struct, scm_struct_free_0, diff --git a/libguile/print.c b/libguile/print.c index 73f75a419..e92cd7835 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -166,7 +166,7 @@ do { \ do { \ register unsigned long i; \ for (i = 0; i < pstate->top; ++i) \ - if (pstate->ref_stack[i] == (obj)) \ + if (SCM_EQ_P (pstate->ref_stack[i], (obj))) \ goto label; \ if (pstate->fancyp) \ { \ @@ -218,7 +218,7 @@ make_print_state (void) SCM scm_make_print_state () { - SCM answer = 0; + SCM answer = SCM_BOOL_F; /* First try to allocate a print state from the pool */ SCM_DEFER_INTS; @@ -229,7 +229,7 @@ scm_make_print_state () } SCM_ALLOW_INTS; - return answer ? answer : make_print_state (); + return SCM_FALSEP (answer) ? make_print_state () : answer; } void @@ -273,14 +273,15 @@ print_circref (SCM port,scm_print_state *pstate,SCM ref) while (i > 0) { if (SCM_NCONSP (pstate->ref_stack[i - 1]) - || SCM_CDR (pstate->ref_stack[i - 1]) != pstate->ref_stack[i]) + || !SCM_EQ_P (SCM_CDR (pstate->ref_stack[i - 1]), + pstate->ref_stack[i])) break; --i; } self = i; } for (i = pstate->top - 1; 1; --i) - if (pstate->ref_stack[i] == ref) + if (SCM_EQ_P (pstate->ref_stack[i], ref)) break; scm_putc ('#', port); scm_intprint (i - self, 10, port); @@ -327,9 +328,9 @@ taloop: else if (SCM_ILOCP (exp)) { scm_puts ("#@", port); - scm_intprint (SCM_UNPACK (SCM_IFRAME (exp)), 10, port); + scm_intprint (SCM_IFRAME (exp), 10, port); scm_putc (SCM_ICDRP (exp) ? '-' : '+', port); - scm_intprint (SCM_UNPACK (SCM_IDIST (exp)), 10, port); + scm_intprint (SCM_IDIST (exp), 10, port); } else goto idef; @@ -819,7 +820,7 @@ scm_iprlist (char *hdr,SCM exp,int tlr,SCM port,scm_print_state *pstate) if (SCM_NECONSP (exp)) break; for (i = floor; i >= 0; --i) - if (pstate->ref_stack[i] == exp) + if (SCM_EQ_P (pstate->ref_stack[i], exp)) goto circref; PUSH_REF (pstate, exp); scm_putc (' ', port); @@ -850,7 +851,7 @@ fancy_printing: if (SCM_NECONSP (exp)) break; for (i = 0; i < pstate->top; ++i) - if (pstate->ref_stack[i] == exp) + if (SCM_EQ_P (pstate->ref_stack[i], exp)) goto fancy_circref; if (pstate->fancyp) { diff --git a/libguile/srcprop.c b/libguile/srcprop.c index 6dd200b1d..6dce8a90f 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -177,8 +177,8 @@ SCM_DEFINE (scm_source_properties, "source-properties", 1, 0, 0, else if (SCM_NCONSP (obj)) SCM_WRONG_TYPE_ARG (1, obj); #endif - p = scm_hashq_ref (scm_source_whash, obj, (SCM) NULL); - if (p != (SCM) NULL && SRCPROPSP (p)) + p = scm_hashq_ref (scm_source_whash, obj, SCM_BOOL_F); + if (SRCPROPSP (p)) return scm_srcprops_to_plist (p); return SCM_EOL; } -- 2.20.1