* variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,
authorMarius Vollmer <mvo@zagadka.de>
Fri, 22 Oct 2004 15:13:12 +0000 (15:13 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Fri, 22 Oct 2004 15:13:12 +0000 (15:13 +0000)
print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c,
guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use
scm_uintprint to print unsigned integers, raw heap words, and
adresses, using a cast to scm_t_bits to turn pointers into
integers.

17 files changed:
libguile/continuations.c
libguile/coop-pthreads.c
libguile/filesys.c
libguile/fports.c
libguile/guardians.c
libguile/hashtab.c
libguile/hooks.c
libguile/mallocs.c
libguile/ports.c
libguile/print.c
libguile/root.c
libguile/smob.c
libguile/stackchk.c
libguile/struct.c
libguile/threads.c
libguile/throw.c
libguile/variable.c

index c638662..e5c8c02 100644 (file)
@@ -83,7 +83,7 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED)
   scm_puts ("#<continuation ", port);
   scm_intprint (continuation->num_stack_items, 10, port);
   scm_puts (" @ ", port);
-  scm_intprint (SCM_CELL_WORD_1 (obj), 16, port);
+  scm_uintprint (SCM_CELL_WORD_1 (obj), 16, port);
   scm_putc ('>', port);
   return 1;
 }
index f994170..844db74 100644 (file)
@@ -142,7 +142,7 @@ thread_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   scm_copt_thread *t = SCM_THREAD_DATA (exp);
   scm_puts ("#<thread ", port);
-  scm_intprint ((unsigned long)t, 16, port);
+  scm_uintprint ((scm_t_bits)t, 16, port);
   if (t->pthread != -1)
     {
       scm_putc (' ', port);
index f2f35aa..9e01901 100644 (file)
@@ -922,7 +922,7 @@ scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
   if (!SCM_DIR_OPEN_P (exp))
     scm_puts ("closed: ", port);
   scm_puts ("directory stream ", port);
-  scm_intprint (SCM_CELL_WORD_1 (exp), 16, port);
+  scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
   scm_putc ('>', port);
   return 1;
 }
index 35789ff..9d8d1f4 100644 (file)
@@ -519,7 +519,7 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
     {
       scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
       scm_putc (' ', port);
-      scm_intprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port);
+      scm_uintprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port);
     }
   scm_putc ('>', port);
   return 1;
index f36a988..e3977e9 100644 (file)
@@ -172,7 +172,7 @@ guardian_print (SCM guardian, SCM port, scm_print_state *pstate SCM_UNUSED)
     scm_puts ("sharing", port);
 
   scm_puts (" guardian 0x", port);
-  scm_intprint ((long) g, 16, port);
+  scm_uintprint ((scm_t_bits) g, 16, port);
 
   if (! DESTROYED_P (g))
     {
index f74526d..a2d4c33 100644 (file)
@@ -193,10 +193,9 @@ hashtable_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
   else if (SCM_HASHTABLE_DOUBLY_WEAK_P (exp))
     scm_puts ("doubly-weak-", port);
   scm_puts ("hash-table ", port);
-  scm_intprint ((unsigned long) t->n_items, 10, port);
+  scm_uintprint (t->n_items, 10, port);
   scm_putc ('/', port);
-  scm_intprint ((unsigned long) SCM_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)),
-               10, port);
+  scm_uintprint (SCM_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)), 10, port);
   scm_puts (">", port);
   return 1;
 }
index 0e7749e..af317d9 100644 (file)
@@ -130,7 +130,7 @@ hook_print (SCM hook, SCM port, scm_print_state *pstate)
   scm_puts ("#<hook ", port);
   scm_intprint (SCM_HOOK_ARITY (hook), 10, port);
   scm_putc (' ', port);
-  scm_intprint (SCM_UNPACK (hook), 16, port);
+  scm_uintprint (SCM_UNPACK (hook), 16, port);
   ls = SCM_HOOK_PROCEDURES (hook);
   while (SCM_NIMP (ls))
     {
index c1fe4c9..da36c39 100644 (file)
@@ -54,7 +54,7 @@ static int
 malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   scm_puts("#<malloc ", port);
-  scm_intprint (SCM_SMOB_DATA (exp), 16, port);
+  scm_uintprint (SCM_SMOB_DATA (exp), 16, port);
   scm_putc('>', port);
   return 1;
 }
index 4ad51bc..d628f47 100644 (file)
@@ -1604,7 +1604,7 @@ scm_port_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
   scm_print_port_mode (exp, port);
   scm_puts (type, port);
   scm_putc (' ', port);
-  scm_intprint (SCM_CELL_WORD_1 (exp), 16, port);
+  scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
   scm_putc ('>', port);
   return 1;
 }
index 1d13326..7cd7307 100644 (file)
@@ -553,7 +553,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
                                     scm_i_symbol_length (exp),
                                     port);
              scm_putc (' ', port);
-             scm_intprint ((long)exp, 16, port);
+             scm_uintprint (SCM_UNPACK (exp), 16, port);
              scm_putc ('>', port);
            }
          break;
@@ -765,13 +765,13 @@ scm_ipruk (char *hdr, SCM ptr, SCM port)
   if (scm_in_heap_p (ptr))
     {
       scm_puts (" (0x", port);
-      scm_intprint (SCM_CELL_WORD_0 (ptr), 16, port);
+      scm_uintprint (SCM_CELL_WORD_0 (ptr), 16, port);
       scm_puts (" . 0x", port);
-      scm_intprint (SCM_CELL_WORD_1 (ptr), 16, port);
+      scm_uintprint (SCM_CELL_WORD_1 (ptr), 16, port);
       scm_puts (") @", port);
     }
   scm_puts (" 0x", port);
-  scm_intprint (SCM_UNPACK (ptr), 16, port);
+  scm_uintprint (SCM_UNPACK (ptr), 16, port);
   scm_putc ('>', port);
 }
 
index 1a60995..dfe0ae3 100644 (file)
@@ -62,7 +62,7 @@ static int
 root_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   scm_puts ("#<root ", port);
-  scm_intprint(SCM_SEQ (SCM_ROOT_STATE (exp) -> rootcont), 16, port);
+  scm_uintprint(SCM_SEQ (SCM_ROOT_STATE (exp) -> rootcont), 16, port);
   scm_putc('>', port);
   return 1;
 }
index e447737..0778491 100644 (file)
@@ -119,9 +119,9 @@ scm_smob_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
   scm_puts (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
   scm_putc (' ', port);
   if (scm_smobs[n].size)
-    scm_intprint (SCM_CELL_WORD_1 (exp), 16, port);
+    scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
   else
-    scm_intprint (SCM_UNPACK (exp), 16, port);
+    scm_uintprint (SCM_UNPACK (exp), 16, port);
   scm_putc ('>', port);
   return 1;
 }
index 27da77d..eaedd1c 100644 (file)
@@ -62,12 +62,12 @@ void
 scm_stack_report ()
 {
   SCM_STACKITEM stack;
-  scm_intprint (scm_stack_size (SCM_BASE (scm_rootcont)) * sizeof (SCM_STACKITEM),
+  scm_uintprint (scm_stack_size (SCM_BASE (scm_rootcont)) * sizeof (SCM_STACKITEM),
                16, scm_cur_errp);
   scm_puts (" of stack: 0x", scm_cur_errp);
-  scm_intprint ((long) SCM_BASE (scm_rootcont), 16, scm_cur_errp);
+  scm_uintprint ((scm_t_bits) SCM_BASE (scm_rootcont), 16, scm_cur_errp);
   scm_puts (" - 0x", scm_cur_errp);
-  scm_intprint ((long) &stack, 16, scm_cur_errp);
+  scm_uintprint ((scm_t_bits) &stack, 16, scm_cur_errp);
   scm_puts ("\n", scm_cur_errp);
 }
 
index 16bea01..44bdd51 100644 (file)
@@ -777,9 +777,9 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
       else
        scm_puts ("struct", port);
       scm_putc (' ', port);
-      scm_intprint (SCM_UNPACK (vtable), 16, port);
+      scm_uintprint (SCM_UNPACK (vtable), 16, port);
       scm_putc (':', port);
-      scm_intprint (SCM_UNPACK (exp), 16, port);
+      scm_uintprint (SCM_UNPACK (exp), 16, port);
       scm_putc ('>', port);
     }
 }
index 297fce5..e6d23dc 100644 (file)
@@ -164,9 +164,9 @@ thread_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   scm_thread *t = SCM_THREAD_DATA (exp);
   scm_puts ("#<thread ", port);
-  scm_intprint ((unsigned long)t->thread, 10, port);
+  scm_uintprint (t->thread, 10, port);
   scm_puts (" (", port);
-  scm_intprint ((unsigned long)t, 16, port);
+  scm_uintprint ((scm_t_bits)t, 16, port);
   scm_puts (")>", port);
   return 1;
 }
index 2ff8140..b5bbbae 100644 (file)
@@ -59,7 +59,7 @@ jmpbuffer_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   scm_puts ("#<jmpbuffer ", port);
   scm_puts (JBACTIVE(exp) ? "(active) " : "(inactive) ", port);
-  scm_intprint((long) JBJMPBUF (exp), 16, port);
+  scm_uintprint((scm_t_bits) JBJMPBUF (exp), 16, port);
   scm_putc ('>', port);
   return 1 ;
 }
index c63d1db..18da683 100644 (file)
@@ -33,7 +33,7 @@ void
 scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate)
 {
   scm_puts ("#<variable ", port);
-  scm_intprint (SCM_UNPACK (exp), 16, port);
+  scm_uintprint (SCM_UNPACK (exp), 16, port);
   scm_puts (" value: ", port);
   scm_iprin1 (SCM_VARIABLE_REF (exp), port, pstate);
   scm_putc('>', port);