diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1996-10-20 03:28:34 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1996-10-20 03:28:34 +0000 |
commit | 898a256f9156643b4ceb275776372ee4380b8df1 (patch) | |
tree | fad48588aa635930dd21135883d0db9bcf6fab91 /libguile/init.c | |
parent | 3f46d9597804cda1f9d92ef239007b3b8b35ddb8 (diff) | |
download | guile-898a256f9156643b4ceb275776372ee4380b8df1.tar.gz |
* pairs.h, eval.c, gc.c, init.c, ioext.c, ports.c, ports.h,
srcprop.h, tags.h, throw.c, unif.c: Added new selectors
SCM_SETAND_CAR, SCM_SETAND_CDR, SCM_SETOR_CAR and SCM_SETOR_CDR.
Motivation: Safer use. Some other macros are defined in terms of
these operations. If these are defined using the SCM_SETCXR
(<e1>, SCM_CXR (<e1>) <op> <e2>) pattern a complex <e1> will lead
to inefficiency and an <e1> with side-effects could potentially
break. Also, these particular operations are heavily utilized in
the garbage collector. In unoptimized code there will be a
measurable speedup.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
Diffstat (limited to 'libguile/init.c')
-rw-r--r-- | libguile/init.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/init.c b/libguile/init.c index 229402dd1..0c071e42b 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -145,13 +145,13 @@ scm_start_stack (base, in, out, err) { SCM_NEWCELL (scm_def_inp); pt = scm_add_to_port_table (scm_def_inp); - SCM_CAR (scm_def_inp) = (scm_tc16_fport | SCM_OPN | SCM_RDNG); + SCM_SETCAR (scm_def_inp, (scm_tc16_fport | SCM_OPN | SCM_RDNG)); SCM_SETPTAB_ENTRY (scm_def_inp, pt); SCM_SETSTREAM (scm_def_inp, (SCM)in); if (isatty (fileno (in))) { scm_setbuf0 (scm_def_inp); /* turn off stdin buffering */ - SCM_CAR (scm_def_inp) |= SCM_BUF0; + SCM_SETOR_CAR (scm_def_inp, SCM_BUF0); } scm_set_port_revealed_x (scm_def_inp, SCM_MAKINUM (1)); } @@ -164,7 +164,7 @@ scm_start_stack (base, in, out, err) { SCM_NEWCELL (scm_def_outp); pt = scm_add_to_port_table (scm_def_outp); - SCM_CAR (scm_def_outp) = (scm_tc16_fport | SCM_OPN | SCM_WRTNG); + SCM_SETCAR (scm_def_outp, (scm_tc16_fport | SCM_OPN | SCM_WRTNG)); SCM_SETPTAB_ENTRY (scm_def_outp, pt); SCM_SETSTREAM (scm_def_outp, (SCM)out); scm_set_port_revealed_x (scm_def_outp, SCM_MAKINUM (1)); @@ -178,7 +178,7 @@ scm_start_stack (base, in, out, err) { SCM_NEWCELL (scm_def_errp); pt = scm_add_to_port_table (scm_def_errp); - SCM_CAR (scm_def_errp) = (scm_tc16_fport | SCM_OPN | SCM_WRTNG); + SCM_SETCAR (scm_def_errp, (scm_tc16_fport | SCM_OPN | SCM_WRTNG)); SCM_SETPTAB_ENTRY (scm_def_errp, pt); SCM_SETSTREAM (scm_def_errp, (SCM)err); scm_set_port_revealed_x (scm_def_errp, SCM_MAKINUM (1)); @@ -199,7 +199,7 @@ scm_start_stack (base, in, out, err) */ SCM_NEWCELL (scm_rootcont); SCM_SETJMPBUF (scm_rootcont, scm_must_malloc ((long) sizeof (scm_contregs), "continuation")); - SCM_CAR (scm_rootcont) = scm_tc7_contin; + SCM_SETCAR (scm_rootcont, scm_tc7_contin); SCM_SEQ (scm_rootcont) = 0; /* The root continuation if further initialized by scm_restart_stack. */ |