1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 08:20:20 +02:00

* variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,

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.
This commit is contained in:
Marius Vollmer 2004-10-22 15:13:12 +00:00
parent f27d205727
commit 0345e278f4
17 changed files with 26 additions and 27 deletions

View 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;
}

View 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);

View 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;
}

View 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;

View 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))
{

View 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;
}

View 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))
{

View 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;
}

View 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;
}

View 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);
}

View 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;
}

View 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;
}

View 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);
}

View 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);
}
}

View 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;
}

View 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 ;
}

View 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);