1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

* arbiters.c (prinarb),

async.c (print_async),
debug.c (prindebugobj, prinmemoized),
eval.c (prinprom, prinmacro),
filesys.c (scm_fd_print, scm_dir_print),
kw.c (print_kw),
mallocs.c (prinmalloc),
numbers.c, numbers.h (scm_floprint, scm_bigprint),
smob.h (scm_smobfuns),
srcprop.c (prinsrcprops),
throw.c (prinjb),
unif.c, unif.h (scm_raprin1, rapr1),
variable.c (prin_var): Changed argument `int writing' to
`scm_print_state *pstate'.
This commit is contained in:
Mikael Djurfeldt 1996-09-22 22:41:40 +00:00
parent 1940267936
commit 9882ea1991
9 changed files with 65 additions and 60 deletions

View file

@ -58,19 +58,19 @@ static long scm_tc16_arbiter;
#ifdef __STDC__ #ifdef __STDC__
static int static int
prinarb (SCM exp, SCM port, int writing) prinarb (SCM exp, SCM port, scm_print_state *pstate)
#else #else
static int static int
prinarb (exp, port, writing) prinarb (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, "#<arbiter ", port); scm_gen_puts (scm_regular_string, "#<arbiter ", port);
if (SCM_CAR (exp) & (1L << 16)) if (SCM_CAR (exp) & (1L << 16))
scm_gen_puts (scm_regular_string, "locked ", port); scm_gen_puts (scm_regular_string, "locked ", port);
scm_iprin1 (SCM_CDR (exp), port, writing); scm_iprin1 (SCM_CDR (exp), port, pstate);
scm_gen_putc ('>', port); scm_gen_putc ('>', port);
return !0; return !0;
} }

View file

@ -302,13 +302,13 @@ scm_deliver_signal (num)
#ifdef __STDC__ #ifdef __STDC__
static int static int
print_async (SCM exp, SCM port, int writing) print_async (SCM exp, SCM port, scm_print_state *pstate)
#else #else
static int static int
print_async (exp, port, writing) print_async (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, "#<async ", port); scm_gen_puts (scm_regular_string, "#<async ", port);

View file

@ -143,17 +143,20 @@ long scm_tc16_memoized;
#ifdef __STDC__ #ifdef __STDC__
static int static int
prinmemoized (SCM obj, SCM port, int writing) prinmemoized (SCM obj, SCM port, scm_print_state *pstate)
#else #else
static int static int
prinmemoized (obj, port, writing) prinmemoized (obj, port, pstate)
SCM obj; SCM obj;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
int writingp = SCM_WRITINGP (pstate);
scm_gen_puts (scm_regular_string, "#<memoized ", port); scm_gen_puts (scm_regular_string, "#<memoized ", port);
scm_iprin1 (scm_unmemoize (obj), port, 1); SCM_SET_WRITINGP (pstate, 1);
scm_iprin1 (scm_unmemoize (obj), port, pstate);
SCM_SET_WRITINGP (pstate, writingp);
scm_gen_putc ('>', port); scm_gen_putc ('>', port);
return 1; return 1;
} }
@ -379,11 +382,13 @@ long scm_tc16_debugobj;
#ifdef __STDC__ #ifdef __STDC__
static int static int
prindebugobj (SCM obj, SCM port, int writing) prindebugobj (SCM obj, SCM port, scm_print_state *pstate)
#else #else
static int static int
prindebugobj (writing) prindebugobj (pstate)
SCM obj, SCM port, int writing; SCM obj;
SCM port;
scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, "#<debug-object ", port); scm_gen_puts (scm_regular_string, "#<debug-object ", port);

View file

@ -240,13 +240,13 @@ long scm_tc16_fd;
#ifdef __STDC__ #ifdef __STDC__
static int static int
scm_fd_print (SCM sexp, SCM port, int writing) scm_fd_print (SCM sexp, SCM port, scm_print_state *pstate)
#else #else
static int static int
scm_fd_print (sexp, port, writing) scm_fd_print (sexp, port, pstate)
SCM sexp; SCM sexp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, "#<fd ", port); scm_gen_puts (scm_regular_string, "#<fd ", port);
@ -872,13 +872,13 @@ scm_sys_closedir (port)
#ifdef __STDC__ #ifdef __STDC__
static int static int
scm_dir_print (SCM sexp, SCM port, int writing) scm_dir_print (SCM sexp, SCM port, scm_print_state *pstate)
#else #else
static int static int
scm_dir_print (sexp, port, writing) scm_dir_print (sexp, port, pstate)
SCM sexp; SCM sexp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_prinport (sexp, port, "directory"); scm_prinport (sexp, port, "directory");

View file

@ -63,13 +63,13 @@ free_kw (obj)
#ifdef __STDC__ #ifdef __STDC__
static int static int
prin_kw (SCM exp, SCM port, int writing) prin_kw (SCM exp, SCM port, scm_print_state *pstate)
#else #else
static int static int
prin_kw (exp, port, writing) prin_kw (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, ":", port); scm_gen_puts (scm_regular_string, ":", port);

View file

@ -53,13 +53,13 @@ fmalloc(ptr)
#ifdef __STDC__ #ifdef __STDC__
static int static int
prinmalloc (SCM exp, SCM port, int writing) prinmalloc (SCM exp, SCM port, scm_print_state *pstate)
#else #else
static int static int
prinmalloc (exp, port, writing) prinmalloc (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts(scm_regular_string, "#<malloc ", port); scm_gen_puts(scm_regular_string, "#<malloc ", port);

View file

@ -92,13 +92,13 @@ freejb (jbsmob)
#ifdef __STDC__ #ifdef __STDC__
static int static int
printjb (SCM exp, SCM port, int writing) printjb (SCM exp, SCM port, scm_print_state *pstate)
#else #else
static int static int
printjb (exp, port, writing) printjb (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, "#<jmpbuffer ", port); scm_gen_puts (scm_regular_string, "#<jmpbuffer ", port);

View file

@ -2287,15 +2287,15 @@ l2ra (lst, ra, base, k)
#ifdef __STDC__ #ifdef __STDC__
static void static void
rapr1 (SCM ra, scm_sizet j, scm_sizet k, SCM port, int writing) rapr1 (SCM ra, scm_sizet j, scm_sizet k, SCM port, scm_print_state *pstate)
#else #else
static void static void
rapr1 (ra, j, k, port, writing) rapr1 (ra, j, k, port, pstate)
SCM ra; SCM ra;
scm_sizet j; scm_sizet j;
scm_sizet k; scm_sizet k;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
long inc = 1; long inc = 1;
@ -2310,12 +2310,12 @@ tail:
{ {
SCM_ARRAY_BASE (ra) = j; SCM_ARRAY_BASE (ra) = j;
if (n-- > 0) if (n-- > 0)
scm_iprin1 (ra, port, writing); scm_iprin1 (ra, port, pstate);
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
{ {
scm_gen_putc (' ', port); scm_gen_putc (' ', port);
SCM_ARRAY_BASE (ra) = j; SCM_ARRAY_BASE (ra) = j;
scm_iprin1 (ra, port, writing); scm_iprin1 (ra, port, pstate);
} }
break; break;
} }
@ -2326,14 +2326,14 @@ tail:
for (i = SCM_ARRAY_DIMS (ra)[k].lbnd; i < SCM_ARRAY_DIMS (ra)[k].ubnd; i++) for (i = SCM_ARRAY_DIMS (ra)[k].lbnd; i < SCM_ARRAY_DIMS (ra)[k].ubnd; i++)
{ {
scm_gen_putc ('(', port); scm_gen_putc ('(', port);
rapr1 (ra, j, k + 1, port, writing); rapr1 (ra, j, k + 1, port, pstate);
scm_gen_puts (scm_regular_string, ") ", port); scm_gen_puts (scm_regular_string, ") ", port);
j += inc; j += inc;
} }
if (i == SCM_ARRAY_DIMS (ra)[k].ubnd) if (i == SCM_ARRAY_DIMS (ra)[k].ubnd)
{ /* could be zero size. */ { /* could be zero size. */
scm_gen_putc ('(', port); scm_gen_putc ('(', port);
rapr1 (ra, j, k + 1, port, writing); rapr1 (ra, j, k + 1, port, pstate);
scm_gen_putc (')', port); scm_gen_putc (')', port);
} }
break; break;
@ -2350,21 +2350,21 @@ tail:
goto tail; goto tail;
default: default:
if (n-- > 0) if (n-- > 0)
scm_iprin1 (scm_uniform_vector_ref (ra, SCM_MAKINUM (j)), port, writing); scm_iprin1 (scm_uniform_vector_ref (ra, SCM_MAKINUM (j)), port, pstate);
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
{ {
scm_gen_putc (' ', port); scm_gen_putc (' ', port);
scm_iprin1 (scm_cvref (ra, j, SCM_UNDEFINED), port, writing); scm_iprin1 (scm_cvref (ra, j, SCM_UNDEFINED), port, pstate);
} }
break; break;
case scm_tc7_string: case scm_tc7_string:
if (n-- > 0) if (n-- > 0)
scm_iprin1 (SCM_MAKICHR (SCM_CHARS (ra)[j]), port, writing); scm_iprin1 (SCM_MAKICHR (SCM_CHARS (ra)[j]), port, pstate);
if (writing) if (SCM_WRITINGP (pstate))
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
{ {
scm_gen_putc (' ', port); scm_gen_putc (' ', port);
scm_iprin1 (SCM_MAKICHR (SCM_CHARS (ra)[j]), port, writing); scm_iprin1 (SCM_MAKICHR (SCM_CHARS (ra)[j]), port, pstate);
} }
else else
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
@ -2408,12 +2408,12 @@ tail:
{ {
SCM z = scm_makflo (1.0); SCM z = scm_makflo (1.0);
SCM_FLO (z) = ((float *) SCM_VELTS (ra))[j]; SCM_FLO (z) = ((float *) SCM_VELTS (ra))[j];
scm_floprint (z, port, writing); scm_floprint (z, port, pstate);
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
{ {
scm_gen_putc (' ', port); scm_gen_putc (' ', port);
SCM_FLO (z) = ((float *) SCM_VELTS (ra))[j]; SCM_FLO (z) = ((float *) SCM_VELTS (ra))[j];
scm_floprint (z, port, writing); scm_floprint (z, port, pstate);
} }
} }
break; break;
@ -2423,12 +2423,12 @@ tail:
{ {
SCM z = scm_makdbl (1.0 / 3.0, 0.0); SCM z = scm_makdbl (1.0 / 3.0, 0.0);
SCM_REAL (z) = ((double *) SCM_VELTS (ra))[j]; SCM_REAL (z) = ((double *) SCM_VELTS (ra))[j];
scm_floprint (z, port, writing); scm_floprint (z, port, pstate);
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
{ {
scm_gen_putc (' ', port); scm_gen_putc (' ', port);
SCM_REAL (z) = ((double *) SCM_VELTS (ra))[j]; SCM_REAL (z) = ((double *) SCM_VELTS (ra))[j];
scm_floprint (z, port, writing); scm_floprint (z, port, pstate);
} }
} }
break; break;
@ -2438,13 +2438,13 @@ tail:
SCM cz = scm_makdbl (0.0, 1.0), z = scm_makdbl (1.0 / 3.0, 0.0); SCM cz = scm_makdbl (0.0, 1.0), z = scm_makdbl (1.0 / 3.0, 0.0);
SCM_REAL (z) = SCM_REAL (cz) = (((double *) SCM_VELTS (ra))[2 * j]); SCM_REAL (z) = SCM_REAL (cz) = (((double *) SCM_VELTS (ra))[2 * j]);
SCM_IMAG (cz) = ((double *) SCM_VELTS (ra))[2 * j + 1]; SCM_IMAG (cz) = ((double *) SCM_VELTS (ra))[2 * j + 1];
scm_floprint ((0.0 == SCM_IMAG (cz) ? z : cz), port, writing); scm_floprint ((0.0 == SCM_IMAG (cz) ? z : cz), port, pstate);
for (j += inc; n-- > 0; j += inc) for (j += inc; n-- > 0; j += inc)
{ {
scm_gen_putc (' ', port); scm_gen_putc (' ', port);
SCM_REAL (z) = SCM_REAL (cz) = ((double *) SCM_VELTS (ra))[2 * j]; SCM_REAL (z) = SCM_REAL (cz) = ((double *) SCM_VELTS (ra))[2 * j];
SCM_IMAG (cz) = ((double *) SCM_VELTS (ra))[2 * j + 1]; SCM_IMAG (cz) = ((double *) SCM_VELTS (ra))[2 * j + 1];
scm_floprint ((0.0 == SCM_IMAG (cz) ? z : cz), port, writing); scm_floprint ((0.0 == SCM_IMAG (cz) ? z : cz), port, pstate);
} }
} }
break; break;
@ -2455,13 +2455,13 @@ tail:
#ifdef __STDC__ #ifdef __STDC__
int int
scm_raprin1 (SCM exp, SCM port, int writing) scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate)
#else #else
int int
scm_raprin1 (exp, port, writing) scm_raprin1 (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
SCM v = exp; SCM v = exp;
@ -2480,7 +2480,7 @@ tail:
{ {
scm_gen_puts (scm_regular_string, "<enclosed-array ", port); scm_gen_puts (scm_regular_string, "<enclosed-array ", port);
rapr1 (exp, base, 0, port, writing); rapr1 (exp, base, 0, port, pstate);
scm_gen_putc ('>', port); scm_gen_putc ('>', port);
return 1; return 1;
} }
@ -2554,7 +2554,7 @@ tail:
#endif /*SCM_FLOATS*/ #endif /*SCM_FLOATS*/
} }
scm_gen_putc ('(', port); scm_gen_putc ('(', port);
rapr1 (exp, base, 0, port, writing); rapr1 (exp, base, 0, port, pstate);
scm_gen_putc (')', port); scm_gen_putc (')', port);
return 1; return 1;
} }
@ -2664,13 +2664,13 @@ scm_init_unif ()
#ifdef __STDC__ #ifdef __STDC__
int int
scm_raprin1 (SCM exp, SCM port, int writing) scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate)
#else #else
int int
scm_raprin1 (exp, port, writing) scm_raprin1 (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
return 0; return 0;

View file

@ -62,13 +62,13 @@ free_var (obj)
#ifdef __STDC__ #ifdef __STDC__
static int static int
prin_var (SCM exp, SCM port, int writing) prin_var (SCM exp, SCM port, scm_print_state *pstate)
#else #else
static int static int
prin_var (exp, port, writing) prin_var (exp, port, pstate)
SCM exp; SCM exp;
SCM port; SCM port;
int writing; scm_print_state *pstate;
#endif #endif
{ {
scm_gen_puts (scm_regular_string, "#<variable ", port); scm_gen_puts (scm_regular_string, "#<variable ", port);
@ -79,10 +79,10 @@ prin_var (exp, port, writing)
if (SCM_CAR (val_cell) != SCM_UNDEFINED) if (SCM_CAR (val_cell) != SCM_UNDEFINED)
{ {
scm_gen_puts (scm_regular_string, " name: ", port); scm_gen_puts (scm_regular_string, " name: ", port);
scm_iprin1 (SCM_CAR (val_cell), port, writing); scm_iprin1 (SCM_CAR (val_cell), port, pstate);
} }
scm_gen_puts (scm_regular_string, " binding: ", port); scm_gen_puts (scm_regular_string, " binding: ", port);
scm_iprin1 (SCM_CDR (val_cell), port, writing); scm_iprin1 (SCM_CDR (val_cell), port, pstate);
} }
scm_gen_putc('>', port); scm_gen_putc('>', port);
return 1; return 1;