summaryrefslogtreecommitdiff
path: root/libguile/print.c
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-12-05 14:07:03 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-12-05 14:07:03 +0000
commite34f941a3ae0ae86d7fd6a78fe6087a3d9d7ebf1 (patch)
tree6d3ae7d481a742ee2183352d8b9fc7cc71e78e37 /libguile/print.c
parent01449aa511158bc6f2639dfeff67eec56fc1b696 (diff)
downloadguile-e34f941a3ae0ae86d7fd6a78fe6087a3d9d7ebf1.tar.gz
* Use scm_tc3_* codes instead of hardcoded values.
Diffstat (limited to 'libguile/print.c')
-rw-r--r--libguile/print.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/libguile/print.c b/libguile/print.c
index ecdc40d27..6ec1f11d7 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -312,16 +312,24 @@ scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate)
taloop:
switch (SCM_ITAG3 (exp))
{
- case 2:
- case 6:
+ case scm_tc3_closure:
+ case scm_tc3_tc7_1:
+ case scm_tc3_tc7_2:
+ /* These tc3 tags should never occur in an immediate value. They are
+ * only used in cell types of non-immediates, i. e. the value returned
+ * by SCM_CELL_TYPE (exp) can use these tags.
+ */
+ scm_ipruk ("immediate", exp, port);
+ break;
+ case scm_tc3_int_1:
+ case scm_tc3_int_2:
scm_intprint (SCM_INUM (exp), 10, port);
break;
- case 4:
+ case scm_tc3_imm24:
if (SCM_CHARP (exp))
{
- register long i;
+ long i = SCM_CHAR (exp);
- i = SCM_CHAR (exp);
if (SCM_WRITINGP (pstate))
{
scm_puts ("#\\", port);
@@ -350,18 +358,17 @@ taloop:
scm_intprint (SCM_IDIST (exp), 10, port);
}
else
- goto idef;
+ {
+ /* unknown immediate value */
+ scm_ipruk ("immediate", exp, port);
+ }
break;
- case 1:
+ case scm_tc3_cons_gloc:
/* gloc */
scm_puts ("#@", port);
exp = SCM_GLOC_SYM (exp);
goto taloop;
- default:
- idef:
- scm_ipruk ("immediate", exp, port);
- break;
- case 0:
+ case scm_tc3_cons:
switch (SCM_TYP7 (exp))
{
case scm_tcs_cons_gloc: