From 1cc91f1b2937a230a2dc80dd25cc6003b7b8f2b5 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 14 Oct 1996 01:33:50 +0000 Subject: [PATCH] * __scm.h, alist.c, alist.h, append.c, append.h, appinit.c, arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h, chars.c, chars.h, continuations.c, continuations.h, debug.c, debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c, eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c, filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c, gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h, hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h, kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c, markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h, objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h, ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h, root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c, simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h, stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h, strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h, struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c, unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c, version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to declare functions with prototypes. (Patch thanks to Marius Vollmer.) --- libguile/ChangeLog | 36 +++ libguile/__scm.h | 6 - libguile/alist.c | 102 ++----- libguile/alist.h | 62 ++-- libguile/append.c | 17 +- libguile/append.h | 19 +- libguile/appinit.c | 7 +- libguile/arbiters.c | 30 +- libguile/arbiters.h | 20 +- libguile/async.c | 189 ++++-------- libguile/async.h | 47 +-- libguile/boolean.c | 18 +- libguile/boolean.h | 15 +- libguile/chars.c | 150 ++-------- libguile/chars.h | 86 ++---- libguile/continuations.c | 32 +- libguile/continuations.h | 16 +- libguile/debug.c | 122 ++------ libguile/debug.h | 76 ++--- libguile/dynwind.c | 18 +- libguile/dynwind.h | 18 +- libguile/eq.c | 24 +- libguile/eq.h | 16 +- libguile/error.c | 2 + libguile/eval.c | 379 +++++------------------- libguile/eval.h | 173 ++++------- libguile/extchrs.c | 20 +- libguile/extchrs.h | 19 +- libguile/filesys.c | 230 ++++----------- libguile/filesys.h | 97 ++---- libguile/fports.h | 25 +- libguile/gc.c | 15 +- libguile/gdbint.c | 46 +-- libguile/gdbint.h | 6 +- libguile/genio.h | 23 +- libguile/gscm.c | 136 +++------ libguile/gsubr.c | 18 +- libguile/gsubr.h | 16 +- libguile/hash.c | 48 +-- libguile/hash.h | 33 +-- libguile/hashtab.c | 185 +++--------- libguile/hashtab.h | 96 ++---- libguile/init.c | 9 +- libguile/ioext.c | 78 +---- libguile/ioext.h | 45 +-- libguile/kw.c | 40 +-- libguile/kw.h | 15 +- libguile/libguile.h | 8 - libguile/mallocs.c | 28 +- libguile/mallocs.h | 12 +- libguile/markers.c | 18 +- libguile/markers.h | 15 +- libguile/mbstrings.c | 102 ++----- libguile/mbstrings.h | 56 ++-- libguile/numbers.c | 623 +++++++-------------------------------- libguile/numbers.h | 294 ++++++------------ libguile/objprop.c | 30 +- libguile/objprop.h | 21 +- libguile/options.c | 18 +- libguile/options.h | 13 +- libguile/pairs.c | 45 +-- libguile/pairs.h | 25 +- libguile/ports.c | 266 ++++------------- libguile/posix.c | 248 +++------------- libguile/posix.h | 258 +++++++--------- libguile/print.c | 94 ++---- libguile/print.h | 37 +-- libguile/procprop.c | 30 +- libguile/procprop.h | 21 +- libguile/procs.c | 36 +-- libguile/procs.h | 28 +- libguile/ramap.c | 225 ++++---------- libguile/ramap.h | 70 ++--- libguile/read.c | 73 +---- libguile/read.h | 36 +-- libguile/root.c | 27 +- libguile/scmsigs.c | 54 +--- libguile/scmsigs.h | 37 +-- libguile/sequences.c | 24 +- libguile/sequences.h | 19 +- libguile/simpos.c | 24 +- libguile/simpos.h | 20 +- libguile/smob.c | 12 +- libguile/socket.c | 92 ++---- libguile/socket.h | 47 +-- libguile/srcprop.c | 66 +---- libguile/srcprop.h | 28 +- libguile/stackchk.c | 18 +- libguile/stackchk.h | 23 +- libguile/strings.c | 102 ++----- libguile/strings.h | 68 ++--- libguile/strop.c | 72 +---- libguile/strop.h | 48 +-- libguile/strorder.c | 66 +---- libguile/strorder.h | 39 +-- libguile/strports.c | 84 ++---- libguile/strports.h | 26 +- libguile/struct.c | 68 +---- libguile/struct.h | 41 +-- libguile/symbols.c | 148 ++-------- libguile/symbols.h | 84 ++---- libguile/tag.c | 12 +- libguile/tag.h | 9 +- libguile/unif.c | 279 ++++-------------- libguile/unif.h | 116 +++----- libguile/variable.c | 80 ++--- libguile/variable.h | 32 +- libguile/vectors.c | 72 +---- libguile/vectors.h | 43 +-- libguile/version.c | 24 +- libguile/version.h | 15 +- libguile/vports.c | 82 ++---- libguile/vports.h | 15 +- libguile/weaks.c | 60 +--- libguile/weaks.h | 35 +-- 115 files changed, 1851 insertions(+), 5970 deletions(-) rewrite libguile/posix.h (60%) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4cf28910f..2e747586e 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,39 @@ +Sun Oct 13 20:14:53 1996 Jim Blandy + + * __scm.h, alist.c, alist.h, append.c, append.h, appinit.c, + arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h, + chars.c, chars.h, continuations.c, continuations.h, debug.c, + debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c, + eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c, + filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c, + gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h, + hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h, + kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c, + markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h, + objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h, + ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, + procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h, + root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c, + simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h, + stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h, + strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h, + struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c, + unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c, + version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to + declare functions with prototypes. (Patch thanks to Marius + Vollmer.) + + More prototype-related changes from Marius Vollmer: + * gdb_interface.h: Wrapped header file in #ifdef/#endif + * gscm.h (gscm_run_scm): Added prototype for `initfn' paramter. + * ports.h (ptobfuns): Added prototypes. This means some casting in + fports.c. + * fports.c: Added casts for initializations, since the functions + are defined to take FILE * as their stream argument, not SCM. + * fdsocket.c, fdsocket.h: Made `init_addr_buffer' static. + * genio.c (scm_gen_puts): Changed `unsigned char *str_data' parameter + to `char *str_data' to conform to prototype. + Sat Oct 12 21:49:29 1996 Gary Houston * error.c, eval.c, load.c, stackchk.c: use scm_error not lgh_error. diff --git a/libguile/__scm.h b/libguile/__scm.h index 8220d7e4c..5c6425c3c 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -406,11 +406,5 @@ extern struct errdesc scm_errmsgs[]; -#ifdef __STDC__ - -#else /* STDC */ - -#endif /* STDC */ - #endif /* __SCMH */ diff --git a/libguile/alist.c b/libguile/alist.c index 95a891809..21eae2c52 100644 --- a/libguile/alist.c +++ b/libguile/alist.c @@ -49,16 +49,12 @@ SCM_PROC(s_acons, "acons", 3, 0, 0, scm_acons); -#ifdef __STDC__ -SCM -scm_acons (SCM w, SCM x, SCM y) -#else + SCM scm_acons (w, x, y) SCM w; SCM x; SCM y; -#endif { register SCM z; SCM_NEWCELL (z); @@ -74,15 +70,11 @@ scm_acons (w, x, y) SCM_PROC (s_sloppy_assq, "sloppy-assq", 2, 0, 0, scm_sloppy_assq); -#ifdef __STDC__ -SCM -scm_sloppy_assq(SCM x, SCM alist) -#else + SCM scm_sloppy_assq(x, alist) SCM x; SCM alist; -#endif { SCM tmp; for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) @@ -100,15 +92,11 @@ scm_sloppy_assq(x, alist) SCM_PROC (s_sloppy_assv, "sloppy-assv", 2, 0, 0, scm_sloppy_assv); -#ifdef __STDC__ -SCM -scm_sloppy_assv(SCM x, SCM alist) -#else + SCM scm_sloppy_assv(x, alist) SCM x; SCM alist; -#endif { SCM tmp; for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) @@ -127,15 +115,11 @@ scm_sloppy_assv(x, alist) SCM_PROC (s_sloppy_assoc, "sloppy-assoc", 2, 0, 0, scm_sloppy_assoc); -#ifdef __STDC__ -SCM -scm_sloppy_assoc(SCM x, SCM alist) -#else + SCM scm_sloppy_assoc(x, alist) SCM x; SCM alist; -#endif { SCM tmp; for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) @@ -156,15 +140,11 @@ scm_sloppy_assoc(x, alist) SCM_PROC(s_assq, "assq", 2, 0, 0, scm_assq); -#ifdef __STDC__ -SCM -scm_assq(SCM x, SCM alist) -#else + SCM scm_assq(x, alist) SCM x; SCM alist; -#endif { SCM tmp; for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) { @@ -179,15 +159,11 @@ scm_assq(x, alist) SCM_PROC(s_assv, "assv", 2, 0, 0, scm_assv); -#ifdef __STDC__ -SCM -scm_assv(SCM x, SCM alist) -#else + SCM scm_assv(x, alist) SCM x; SCM alist; -#endif { SCM tmp; for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) { @@ -205,15 +181,11 @@ scm_assv(x, alist) SCM_PROC(s_assoc, "assoc", 2, 0, 0, scm_assoc); -#ifdef __STDC__ -SCM -scm_assoc(SCM x, SCM alist) -#else + SCM scm_assoc(x, alist) SCM x; SCM alist; -#endif { SCM tmp; for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) { @@ -230,15 +202,11 @@ scm_assoc(x, alist) SCM_PROC (s_assq_ref, "assq-ref", 2, 0, 0, scm_assq_ref); -#ifdef __STDC__ -SCM -scm_assq_ref (SCM alist, SCM key) -#else + SCM scm_assq_ref (alist, key) SCM alist; SCM key; -#endif { SCM handle; @@ -252,15 +220,11 @@ scm_assq_ref (alist, key) SCM_PROC (s_assv_ref, "assv-ref", 2, 0, 0, scm_assv_ref); -#ifdef __STDC__ -SCM -scm_assv_ref (SCM alist, SCM key) -#else + SCM scm_assv_ref (alist, key) SCM alist; SCM key; -#endif { SCM handle; @@ -274,15 +238,11 @@ scm_assv_ref (alist, key) SCM_PROC (s_assoc_ref, "assoc-ref", 2, 0, 0, scm_assoc_ref); -#ifdef __STDC__ -SCM -scm_assoc_ref (SCM alist, SCM key) -#else + SCM scm_assoc_ref (alist, key) SCM alist; SCM key; -#endif { SCM handle; @@ -300,16 +260,12 @@ scm_assoc_ref (alist, key) SCM_PROC (s_assq_set_x, "assq-set!", 3, 0, 0, scm_assq_set_x); -#ifdef __STDC__ -SCM -scm_assq_set_x (SCM alist, SCM key, SCM val) -#else + SCM scm_assq_set_x (alist, key, val) SCM alist; SCM key; SCM val; -#endif { SCM handle; @@ -324,16 +280,12 @@ scm_assq_set_x (alist, key, val) } SCM_PROC (s_assv_set_x, "assv-set!", 3, 0, 0, scm_assv_set_x); -#ifdef __STDC__ -SCM -scm_assv_set_x (SCM alist, SCM key, SCM val) -#else + SCM scm_assv_set_x (alist, key, val) SCM alist; SCM key; SCM val; -#endif { SCM handle; @@ -348,16 +300,12 @@ scm_assv_set_x (alist, key, val) } SCM_PROC (s_assoc_set_x, "assoc-set!", 3, 0, 0, scm_assoc_set_x); -#ifdef __STDC__ -SCM -scm_assoc_set_x (SCM alist, SCM key, SCM val) -#else + SCM scm_assoc_set_x (alist, key, val) SCM alist; SCM key; SCM val; -#endif { SCM handle; @@ -375,15 +323,11 @@ scm_assoc_set_x (alist, key, val) SCM_PROC (s_assq_remove_x, "assq-remove!", 2, 0, 0, scm_assq_remove_x); -#ifdef __STDC__ -SCM -scm_assq_remove_x (SCM alist, SCM key) -#else + SCM scm_assq_remove_x (alist, key) SCM alist; SCM key; -#endif { SCM handle; @@ -398,15 +342,11 @@ scm_assq_remove_x (alist, key) SCM_PROC (s_assv_remove_x, "assv-remove!", 2, 0, 0, scm_assv_remove_x); -#ifdef __STDC__ -SCM -scm_assv_remove_x (SCM alist, SCM key) -#else + SCM scm_assv_remove_x (alist, key) SCM alist; SCM key; -#endif { SCM handle; @@ -421,15 +361,11 @@ scm_assv_remove_x (alist, key) SCM_PROC (s_assoc_remove_x, "assoc-remove!", 2, 0, 0, scm_assoc_remove_x); -#ifdef __STDC__ -SCM -scm_assoc_remove_x (SCM alist, SCM key) -#else + SCM scm_assoc_remove_x (alist, key) SCM alist; SCM key; -#endif { SCM handle; @@ -446,13 +382,9 @@ scm_assoc_remove_x (alist, key) -#ifdef __STDC__ -void -scm_init_alist (void) -#else + void scm_init_alist () -#endif { #include "alist.x" } diff --git a/libguile/alist.h b/libguile/alist.h index 4d86e2a37..87e327fdd 100644 --- a/libguile/alist.h +++ b/libguile/alist.h @@ -48,50 +48,22 @@ - - - -#ifdef __STDC__ -extern SCM scm_acons (SCM w, SCM x, SCM y); -extern SCM scm_sloppy_assq(SCM x, SCM alist); -extern SCM scm_sloppy_assv(SCM x, SCM alist); -extern SCM scm_sloppy_assoc(SCM x, SCM alist); -extern SCM scm_assq(SCM x, SCM alist); -extern SCM scm_assv(SCM x, SCM alist); -extern SCM scm_assoc(SCM x, SCM alist); -extern SCM scm_assq_ref (SCM alist, SCM key); -extern SCM scm_assv_ref (SCM alist, SCM key); -extern SCM scm_assoc_ref (SCM alist, SCM key); -extern SCM scm_assq_set_x (SCM alist, SCM key, SCM val); -extern SCM scm_assv_set_x (SCM alist, SCM key, SCM val); -extern SCM scm_assoc_set_x (SCM alist, SCM key, SCM val); -extern SCM scm_assq_remove_x (SCM alist, SCM key); -extern SCM scm_assv_remove_x (SCM alist, SCM key); -extern SCM scm_assoc_remove_x (SCM alist, SCM key); -extern void scm_init_alist (void); - -#else /* STDC */ -extern SCM scm_acons (); -extern SCM scm_sloppy_assq(); -extern SCM scm_sloppy_assv(); -extern SCM scm_sloppy_assoc(); -extern SCM scm_assq(); -extern SCM scm_assv(); -extern SCM scm_assoc(); -extern SCM scm_assq_ref (); -extern SCM scm_assv_ref (); -extern SCM scm_assoc_ref (); -extern SCM scm_assq_set_x (); -extern SCM scm_assv_set_x (); -extern SCM scm_assoc_set_x (); -extern SCM scm_assq_remove_x (); -extern SCM scm_assv_remove_x (); -extern SCM scm_assoc_remove_x (); -extern void scm_init_alist (); - -#endif /* STDC */ - - - +extern SCM scm_acons SCM_P ((SCM w, SCM x, SCM y)); +extern SCM scm_sloppy_assq SCM_P ((SCM x, SCM alist)); +extern SCM scm_sloppy_assv SCM_P ((SCM x, SCM alist)); +extern SCM scm_sloppy_assoc SCM_P ((SCM x, SCM alist)); +extern SCM scm_assq SCM_P ((SCM x, SCM alist)); +extern SCM scm_assv SCM_P ((SCM x, SCM alist)); +extern SCM scm_assoc SCM_P ((SCM x, SCM alist)); +extern SCM scm_assq_ref SCM_P ((SCM alist, SCM key)); +extern SCM scm_assv_ref SCM_P ((SCM alist, SCM key)); +extern SCM scm_assoc_ref SCM_P ((SCM alist, SCM key)); +extern SCM scm_assq_set_x SCM_P ((SCM alist, SCM key, SCM val)); +extern SCM scm_assv_set_x SCM_P ((SCM alist, SCM key, SCM val)); +extern SCM scm_assoc_set_x SCM_P ((SCM alist, SCM key, SCM val)); +extern SCM scm_assq_remove_x SCM_P ((SCM alist, SCM key)); +extern SCM scm_assv_remove_x SCM_P ((SCM alist, SCM key)); +extern SCM scm_assoc_remove_x SCM_P ((SCM alist, SCM key)); +extern void scm_init_alist SCM_P ((void)); #endif /* ALISTH */ diff --git a/libguile/append.c b/libguile/append.c index 551d8d369..204d57ab8 100644 --- a/libguile/append.c +++ b/libguile/append.c @@ -49,28 +49,20 @@ SCM_PROC (s_append, "append", 0, 0, 1, scm_append); -#ifdef __STDC__ -SCM -scm_append (SCM objs) -#else + SCM scm_append (objs) SCM objs; -#endif { return scm_list_append (objs); } SCM_PROC (s_append_x, "append!", 0, 0, 1, scm_append_x); -#ifdef __STDC__ -SCM -scm_append_x (SCM objs) -#else + SCM scm_append_x (objs) SCM objs; -#endif { return scm_list_append_x (objs); } @@ -78,13 +70,8 @@ scm_append_x (objs) -#ifdef __STDC__ -void -scm_init_append (void) -#else void scm_init_append () -#endif { #include "append.x" } diff --git a/libguile/append.h b/libguile/append.h index 04b1a8a20..9c13d6356 100644 --- a/libguile/append.h +++ b/libguile/append.h @@ -48,21 +48,8 @@ - - - -#ifdef __STDC__ -extern SCM scm_append (SCM objs); -extern SCM scm_append_x (SCM objs); -extern void scm_init_append (void); - -#else /* STDC */ -extern SCM scm_append (); -extern SCM scm_append_x (); -extern void scm_init_append (); - -#endif /* STDC */ - - +extern SCM scm_append SCM_P ((SCM objs)); +extern SCM scm_append_x SCM_P ((SCM objs)); +extern void scm_init_append SCM_P ((void)); #endif /* APPENDH */ diff --git a/libguile/appinit.c b/libguile/appinit.c index 3af008123..1dff367f3 100644 --- a/libguile/appinit.c +++ b/libguile/appinit.c @@ -45,13 +45,8 @@ -#ifdef __STDC__ -void -scm_appinit (void) -#else + void scm_appinit () -#endif { } - diff --git a/libguile/arbiters.c b/libguile/arbiters.c index da7b5dccc..480ad7451 100644 --- a/libguile/arbiters.c +++ b/libguile/arbiters.c @@ -56,16 +56,12 @@ static long scm_tc16_arbiter; -#ifdef __STDC__ -static int -prinarb (SCM exp, SCM port, scm_print_state *pstate) -#else + static int prinarb (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { scm_gen_puts (scm_regular_string, "#thunk; } -#ifdef __STDC__ -static scm_sizet -free_async (SCM obj) -#else + +static scm_sizet free_async SCM_P ((SCM obj)); + static scm_sizet -free_async (SCM obj) +free_async (obj) SCM obj; -#endif { struct scm_async * it; it = SCM_ASYNC (obj); @@ -362,14 +343,10 @@ static scm_smobfuns async_smob = SCM_PROC(s_async, "async", 1, 0, 0, scm_async); -#ifdef __STDC__ -SCM -scm_async (SCM thunk) -#else + SCM scm_async (thunk) SCM thunk; -#endif { SCM it; struct scm_async * async; @@ -387,14 +364,10 @@ scm_async (thunk) } SCM_PROC(s_system_async, "system-async", 1, 0, 0, scm_system_async); -#ifdef __STDC__ -SCM -scm_system_async (SCM thunk) -#else + SCM scm_system_async (thunk) SCM thunk; -#endif { SCM it; SCM list; @@ -410,14 +383,10 @@ scm_system_async (thunk) } SCM_PROC(s_async_mark, "async-mark", 1, 0, 0, scm_async_mark); -#ifdef __STDC__ -SCM -scm_async_mark (SCM a) -#else + SCM scm_async_mark (a) SCM a; -#endif { struct scm_async * it; SCM_ASSERT (SCM_NIMP (a) && SCM_ASYNCP (a), a, SCM_ARG1, s_async_mark); @@ -428,14 +397,10 @@ scm_async_mark (a) SCM_PROC(s_system_async_mark, "system-async-mark", 1, 0, 0, scm_system_async_mark); -#ifdef __STDC__ -SCM -scm_system_async_mark (SCM a) -#else + SCM scm_system_async_mark (a) SCM a; -#endif { struct scm_async * it; SCM_ASSERT (SCM_NIMP (a) && SCM_ASYNCP (a), a, SCM_ARG1, s_async_mark); @@ -450,14 +415,10 @@ scm_system_async_mark (a) SCM_PROC(s_run_asyncs, "run-asyncs", 1, 0, 0, scm_run_asyncs); -#ifdef __STDC__ -SCM -scm_run_asyncs (SCM list_of_a) -#else + SCM scm_run_asyncs (list_of_a) SCM list_of_a; -#endif { SCM pos; @@ -488,14 +449,10 @@ scm_run_asyncs (list_of_a) SCM_PROC(s_noop, "noop", 0, 0, 1, scm_noop); -#ifdef __STDC__ -SCM -scm_noop (SCM args) -#else + SCM scm_noop (args) SCM args; -#endif { return (SCM_NULLP (args) ? SCM_BOOL_F @@ -506,14 +463,10 @@ scm_noop (args) SCM_PROC(s_set_tick_rate, "set-tick-rate", 1, 0, 0, scm_set_tick_rate); -#ifdef __STDC__ -SCM -scm_set_tick_rate (SCM n) -#else + SCM scm_set_tick_rate (n) SCM n; -#endif { unsigned int old_n; SCM_ASSERT (SCM_INUMP (n), n, SCM_ARG1, s_set_tick_rate); @@ -528,14 +481,10 @@ scm_set_tick_rate (n) SCM_PROC(s_set_switch_rate, "set-switch-rate", 1, 0, 0, scm_set_switch_rate); -#ifdef __STDC__ -SCM -scm_set_switch_rate (SCM n) -#else + SCM scm_set_switch_rate (n) SCM n; -#endif { unsigned int old_n; SCM_ASSERT (SCM_INUMP (n), n, SCM_ARG1, s_set_switch_rate); @@ -548,97 +497,81 @@ scm_set_switch_rate (n) -#ifdef __STDC__ -static SCM -scm_sys_hup_async_thunk (void) -#else + +static SCM scm_sys_hup_async_thunk SCM_P ((void)); + static SCM scm_sys_hup_async_thunk () -#endif { scm_deliver_signal (SCM_HUP_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_int_async_thunk (void) -#else + +static SCM scm_sys_int_async_thunk SCM_P ((void)); + static SCM scm_sys_int_async_thunk () -#endif { scm_deliver_signal (SCM_INT_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_fpe_async_thunk (void) -#else + +static SCM scm_sys_fpe_async_thunk SCM_P ((void)); + static SCM scm_sys_fpe_async_thunk () -#endif { scm_deliver_signal (SCM_FPE_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_bus_async_thunk (void) -#else + +static SCM scm_sys_bus_async_thunk SCM_P ((void)); + static SCM scm_sys_bus_async_thunk () -#endif { scm_deliver_signal (SCM_BUS_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_segv_async_thunk (void) -#else + +static SCM scm_sys_segv_async_thunk SCM_P ((void)); + static SCM scm_sys_segv_async_thunk () -#endif { scm_deliver_signal (SCM_SEGV_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_alrm_async_thunk (void) -#else + +static SCM scm_sys_alrm_async_thunk SCM_P ((void)); + static SCM scm_sys_alrm_async_thunk () -#endif { scm_deliver_signal (SCM_ALRM_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_gc_async_thunk (void) -#else + +static SCM scm_sys_gc_async_thunk SCM_P ((void)); + static SCM scm_sys_gc_async_thunk () -#endif { scm_deliver_signal (SCM_GC_SIGNAL); return SCM_BOOL_F; } -#ifdef __STDC__ -static SCM -scm_sys_tick_async_thunk (void) -#else + +static SCM scm_sys_tick_async_thunk SCM_P ((void)); + static SCM scm_sys_tick_async_thunk () -#endif { scm_deliver_signal (SCM_TICK_SIGNAL); return SCM_BOOL_F; @@ -648,14 +581,10 @@ scm_sys_tick_async_thunk () -#ifdef __STDC__ -SCM -scm_take_signal (int n) -#else + SCM scm_take_signal (n) int n; -#endif { SCM ignored; if (!scm_ints_disabled) @@ -680,13 +609,9 @@ scm_take_signal (n) SCM_PROC(s_unmask_signals, "unmask-signals", 0, 0, 0, scm_unmask_signals); -#ifdef __STDC__ -SCM -scm_unmask_signals (void) -#else + SCM scm_unmask_signals () -#endif { scm_mask_ints = 0; return SCM_UNSPECIFIED; @@ -694,13 +619,9 @@ scm_unmask_signals () SCM_PROC(s_mask_signals, "mask-signals", 0, 0, 0, scm_mask_signals); -#ifdef __STDC__ -SCM -scm_mask_signals (void) -#else + SCM scm_mask_signals () -#endif { scm_mask_ints = 1; return SCM_UNSPECIFIED; @@ -708,13 +629,9 @@ scm_mask_signals () -#ifdef __STDC__ -void -scm_init_async (void) -#else + void scm_init_async () -#endif { SCM a_thunk; scm_tc16_async = scm_newsmob (&async_smob); diff --git a/libguile/async.h b/libguile/async.h index 26ebee972..217603ba6 100644 --- a/libguile/async.h +++ b/libguile/async.h @@ -52,39 +52,20 @@ extern unsigned int scm_mask_ints; -#ifdef __STDC__ -extern void scm_async_click (void); -extern void scm_switch (void); -extern SCM scm_async (SCM thunk); -extern SCM scm_system_async (SCM thunk); -extern SCM scm_async_mark (SCM a); -extern SCM scm_system_async_mark (SCM a); -extern SCM scm_run_asyncs (SCM list_of_a); -extern SCM scm_noop (SCM args); -extern SCM scm_set_tick_rate (SCM n); -extern SCM scm_set_switch_rate (SCM n); -extern SCM scm_take_signal (int n); -extern SCM scm_unmask_signals (void); -extern SCM scm_mask_signals (void); -extern void scm_init_async (void); - -#else /* STDC */ -extern void scm_async_click (); -extern void scm_switch (); -extern SCM scm_async (); -extern SCM scm_system_async (); -extern SCM scm_async_mark (); -extern SCM scm_system_async_mark (); -extern SCM scm_run_asyncs (); -extern SCM scm_noop (); -extern SCM scm_set_tick_rate (); -extern SCM scm_set_switch_rate (); -extern SCM scm_take_signal (); -extern SCM scm_unmask_signals (); -extern SCM scm_mask_signals (); -extern void scm_init_async (); - -#endif /* STDC */ +extern void scm_async_click SCM_P ((void)); +extern void scm_switch SCM_P ((void)); +extern SCM scm_async SCM_P ((SCM thunk)); +extern SCM scm_system_async SCM_P ((SCM thunk)); +extern SCM scm_async_mark SCM_P ((SCM a)); +extern SCM scm_system_async_mark SCM_P ((SCM a)); +extern SCM scm_run_asyncs SCM_P ((SCM list_of_a)); +extern SCM scm_noop SCM_P ((SCM args)); +extern SCM scm_set_tick_rate SCM_P ((SCM n)); +extern SCM scm_set_switch_rate SCM_P ((SCM n)); +extern SCM scm_take_signal SCM_P ((int n)); +extern SCM scm_unmask_signals SCM_P ((void)); +extern SCM scm_mask_signals SCM_P ((void)); +extern void scm_init_async SCM_P ((void)); #endif /* ASYNCH */ diff --git a/libguile/boolean.c b/libguile/boolean.c index 36477c21a..3267f28eb 100644 --- a/libguile/boolean.c +++ b/libguile/boolean.c @@ -48,28 +48,20 @@ SCM_PROC(s_not, "not", 1, 0, 0, scm_not); -#ifdef __STDC__ -SCM -scm_not(SCM x) -#else + SCM scm_not(x) SCM x; -#endif { return SCM_FALSEP(x) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC(s_boolean_p, "boolean?", 1, 0, 0, scm_boolean_p); -#ifdef __STDC__ -SCM -scm_boolean_p(SCM obj) -#else + SCM scm_boolean_p(obj) SCM obj; -#endif { if (SCM_BOOL_F==obj) return SCM_BOOL_T; if (SCM_BOOL_T==obj) return SCM_BOOL_T; @@ -77,13 +69,9 @@ scm_boolean_p(obj) } -#ifdef __STDC__ -void -scm_init_boolean (void) -#else + void scm_init_boolean () -#endif { #include "boolean.x" } diff --git a/libguile/boolean.h b/libguile/boolean.h index 600c31966..c9945e566 100644 --- a/libguile/boolean.h +++ b/libguile/boolean.h @@ -60,17 +60,8 @@ -#ifdef __STDC__ -extern SCM scm_not(SCM x); -extern SCM scm_boolean_p(SCM obj); -extern void scm_init_boolean (void); - -#else /* STDC */ -extern SCM scm_not(); -extern SCM scm_boolean_p(); -extern void scm_init_boolean (); - -#endif /* STDC */ - +extern SCM scm_not SCM_P ((SCM x)); +extern SCM scm_boolean_p SCM_P ((SCM obj)); +extern void scm_init_boolean SCM_P ((void)); #endif /* BOOLEANH */ diff --git a/libguile/chars.c b/libguile/chars.c index 773be4d81..cc77d3d09 100644 --- a/libguile/chars.c +++ b/libguile/chars.c @@ -50,28 +50,20 @@ SCM_PROC(s_char_p, "char?", 1, 0, 0, scm_char_p); -#ifdef __STDC__ -SCM -scm_char_p(SCM x) -#else + SCM scm_char_p(x) SCM x; -#endif { return SCM_ICHRP(x) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC1 (s_char_eq_p, "char=?", scm_tc7_rpsubr, scm_char_eq_p); -#ifdef __STDC__ -SCM -scm_char_eq_p(SCM x, SCM y) -#else + SCM scm_char_eq_p(x, y) SCM x; SCM y; -#endif { SCM_ASSERT(SCM_ICHRP(x), x, SCM_ARG1, s_char_eq_p); SCM_ASSERT(SCM_ICHRP(y), y, SCM_ARG2, s_char_eq_p); @@ -80,15 +72,11 @@ scm_char_eq_p(x, y) SCM_PROC1 (s_char_less_p, "char?", scm_tc7_rpsubr, scm_char_gr_p); -#ifdef __STDC__ -SCM -scm_char_gr_p(SCM x, SCM y) -#else + SCM scm_char_gr_p(x, y) SCM x; SCM y; -#endif { SCM_ASSERT(SCM_ICHRP(x), x, SCM_ARG1, s_char_gr_p); SCM_ASSERT(SCM_ICHRP(y), y, SCM_ARG2, s_char_gr_p); @@ -128,15 +108,11 @@ scm_char_gr_p(x, y) } SCM_PROC1 (s_char_geq_p, "char>=?", scm_tc7_rpsubr, scm_char_geq_p); -#ifdef __STDC__ -SCM -scm_char_geq_p(SCM x, SCM y) -#else + SCM scm_char_geq_p(x, y) SCM x; SCM y; -#endif { SCM_ASSERT(SCM_ICHRP(x), x, SCM_ARG1, s_char_geq_p); SCM_ASSERT(SCM_ICHRP(y), y, SCM_ARG2, s_char_geq_p); @@ -144,15 +120,11 @@ scm_char_geq_p(x, y) } SCM_PROC1 (s_char_ci_eq_p, "char-ci=?", scm_tc7_rpsubr, scm_char_ci_eq_p); -#ifdef __STDC__ -SCM -scm_char_ci_eq_p(SCM x, SCM y) -#else + SCM scm_char_ci_eq_p(x, y) SCM x; SCM y; -#endif { SCM_ASSERT(SCM_ICHRP(x), x, SCM_ARG1, s_char_ci_eq_p); SCM_ASSERT(SCM_ICHRP(y), y, SCM_ARG2, s_char_ci_eq_p); @@ -160,15 +132,11 @@ scm_char_ci_eq_p(x, y) } SCM_PROC1 (s_char_ci_less_p, "char-ci?", scm_tc7_rpsubr, scm_char_ci_gr_p); -#ifdef __STDC__ -SCM -scm_char_ci_gr_p(SCM x, SCM y) -#else + SCM scm_char_ci_gr_p(x, y) SCM x; SCM y; -#endif { SCM_ASSERT(SCM_ICHRP(x), x, SCM_ARG1, s_char_ci_gr_p); SCM_ASSERT(SCM_ICHRP(y), y, SCM_ARG2, s_char_ci_gr_p); @@ -208,15 +168,11 @@ scm_char_ci_gr_p(x, y) } SCM_PROC1 (s_char_ci_geq_p, "char-ci>=?", scm_tc7_rpsubr, scm_char_ci_geq_p); -#ifdef __STDC__ -SCM -scm_char_ci_geq_p(SCM x, SCM y) -#else + SCM scm_char_ci_geq_p(x, y) SCM x; SCM y; -#endif { SCM_ASSERT(SCM_ICHRP(x), x, SCM_ARG1, s_char_ci_geq_p); SCM_ASSERT(SCM_ICHRP(y), y, SCM_ARG2, s_char_ci_geq_p); @@ -225,42 +181,30 @@ scm_char_ci_geq_p(x, y) SCM_PROC(s_char_alphabetic_p, "char-alphabetic?", 1, 0, 0, scm_char_alphabetic_p); -#ifdef __STDC__ -SCM -scm_char_alphabetic_p(SCM chr) -#else + SCM scm_char_alphabetic_p(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_alphabetic_p); return (isascii(SCM_ICHR(chr)) && isalpha(SCM_ICHR(chr))) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC(s_char_numeric_p, "char-numeric?", 1, 0, 0, scm_char_numeric_p); -#ifdef __STDC__ -SCM -scm_char_numeric_p(SCM chr) -#else + SCM scm_char_numeric_p(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_numeric_p); return (isascii(SCM_ICHR(chr)) && isdigit(SCM_ICHR(chr))) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC(s_char_whitespace_p, "char-whitespace?", 1, 0, 0, scm_char_whitespace_p); -#ifdef __STDC__ -SCM -scm_char_whitespace_p(SCM chr) -#else + SCM scm_char_whitespace_p(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_whitespace_p); return (isascii(SCM_ICHR(chr)) && isspace(SCM_ICHR(chr))) ? SCM_BOOL_T : SCM_BOOL_F; @@ -269,14 +213,10 @@ scm_char_whitespace_p(chr) SCM_PROC(s_char_upper_case_p, "char-upper-case?", 1, 0, 0, scm_char_upper_case_p); -#ifdef __STDC__ -SCM -scm_char_upper_case_p(SCM chr) -#else + SCM scm_char_upper_case_p(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_upper_case_p); return (isascii(SCM_ICHR(chr)) && isupper(SCM_ICHR(chr))) ? SCM_BOOL_T : SCM_BOOL_F; @@ -284,14 +224,10 @@ scm_char_upper_case_p(chr) SCM_PROC(s_char_lower_case_p, "char-lower-case?", 1, 0, 0, scm_char_lower_case_p); -#ifdef __STDC__ -SCM -scm_char_lower_case_p(SCM chr) -#else + SCM scm_char_lower_case_p(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_lower_case_p); return (isascii(SCM_ICHR(chr)) && islower(SCM_ICHR(chr))) ? SCM_BOOL_T : SCM_BOOL_F; @@ -300,14 +236,10 @@ scm_char_lower_case_p(chr) SCM_PROC (s_char_is_both_p, "char-is-both?", 1, 0, 0, scm_char_is_both_p); -#ifdef __STDC__ -SCM -scm_char_is_both_p (SCM chr) -#else + SCM scm_char_is_both_p (chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_upper_case_p); return ((isascii(SCM_ICHR(chr)) && (isupper(SCM_ICHR(chr)) || islower(SCM_ICHR(chr)))) @@ -319,14 +251,10 @@ scm_char_is_both_p (chr) SCM_PROC(s_char_to_integer, "char->integer", 1, 0, 0, scm_char_to_integer); -#ifdef __STDC__ -SCM -scm_char_to_integer(SCM chr) -#else + SCM scm_char_to_integer(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_to_integer); return scm_ulong2num((unsigned long)SCM_ICHR(chr)); @@ -335,14 +263,10 @@ scm_char_to_integer(chr) SCM_PROC(s_integer_to_char, "integer->char", 1, 0, 0, scm_integer_to_char); -#ifdef __STDC__ -SCM -scm_integer_to_char(SCM n) -#else + SCM scm_integer_to_char(n) SCM n; -#endif { unsigned long ni; @@ -352,14 +276,10 @@ scm_integer_to_char(n) SCM_PROC(s_char_upcase, "char-upcase", 1, 0, 0, scm_char_upcase); -#ifdef __STDC__ -SCM -scm_char_upcase(SCM chr) -#else + SCM scm_char_upcase(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_upcase); return SCM_MAKICHR(scm_upcase(SCM_ICHR(chr))); @@ -367,14 +287,10 @@ scm_char_upcase(chr) SCM_PROC(s_char_downcase, "char-downcase", 1, 0, 0, scm_char_downcase); -#ifdef __STDC__ -SCM -scm_char_downcase(SCM chr) -#else + SCM scm_char_downcase(chr) SCM chr; -#endif { SCM_ASSERT(SCM_ICHRP(chr), chr, SCM_ARG1, s_char_downcase); return SCM_MAKICHR(scm_downcase(SCM_ICHR(chr))); @@ -389,13 +305,9 @@ static unsigned char scm_downcase_table[SCM_CHAR_CODE_LIMIT]; static unsigned char scm_lowers[] = "abcdefghijklmnopqrstuvwxyz"; static unsigned char scm_uppers[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -#ifdef __STDC__ -void -scm_tables_prehistory (void) -#else + void scm_tables_prehistory () -#endif { int i; for (i = 0; i < SCM_CHAR_CODE_LIMIT; i++) @@ -407,14 +319,10 @@ scm_tables_prehistory () } } -#ifdef __STDC__ -int -scm_upcase (unsigned int c) -#else + int scm_upcase (c) unsigned int c; -#endif { if (c < sizeof (scm_upcase_table)) return scm_upcase_table[c]; @@ -422,14 +330,10 @@ scm_upcase (c) return c; } -#ifdef __STDC__ -int -scm_downcase (unsigned int c) -#else + int scm_downcase (c) unsigned int c; -#endif { if (c < sizeof (scm_downcase_table)) return scm_downcase_table[c]; @@ -495,13 +399,9 @@ int scm_n_charnames = sizeof (scm_charnames) / sizeof (char *); -#ifdef __STDC__ -void -scm_init_chars (void) -#else + void scm_init_chars () -#endif { #include "chars.x" } diff --git a/libguile/chars.h b/libguile/chars.h index f985a3509..8ad7672d3 100644 --- a/libguile/chars.h +++ b/libguile/chars.h @@ -60,67 +60,31 @@ extern int scm_n_charnames; extern char scm_charnums[]; -#ifdef __STDC__ -extern SCM scm_char_p(SCM x); -extern SCM scm_char_eq_p(SCM x, SCM y); -extern SCM scm_char_less_p(SCM x, SCM y); -extern SCM scm_char_leq_p(SCM x, SCM y); -extern SCM scm_char_gr_p(SCM x, SCM y); -extern SCM scm_char_geq_p(SCM x, SCM y); -extern SCM scm_char_ci_eq_p(SCM x, SCM y); -extern SCM scm_char_ci_less_p(SCM x, SCM y); -extern SCM scm_char_ci_leq_p(SCM x, SCM y); -extern SCM scm_char_ci_gr_p(SCM x, SCM y); -extern SCM scm_char_ci_geq_p(SCM x, SCM y); -extern SCM scm_char_alphabetic_p(SCM chr); -extern SCM scm_char_numeric_p(SCM chr); -extern SCM scm_char_whitespace_p(SCM chr); -extern SCM scm_char_upper_case_p(SCM chr); -extern SCM scm_char_lower_case_p(SCM chr); -extern SCM scm_char_is_both_p (SCM chr); -extern SCM scm_char_to_integer(SCM chr); -extern SCM scm_integer_to_char(SCM n); -extern SCM scm_char_upcase(SCM chr); -extern SCM scm_char_downcase(SCM chr); -extern void scm_tables_prehistory (void); -extern int scm_upcase (unsigned int c); -extern int scm_downcase (unsigned int c); -extern void scm_init_chars (void); - -#else /* STDC */ -extern SCM scm_char_p(); -extern SCM scm_char_eq_p(); -extern SCM scm_char_less_p(); -extern SCM scm_char_leq_p(); -extern SCM scm_char_gr_p(); -extern SCM scm_char_geq_p(); -extern SCM scm_char_ci_eq_p(); -extern SCM scm_char_ci_less_p(); -extern SCM scm_char_ci_leq_p(); -extern SCM scm_char_ci_gr_p(); -extern SCM scm_char_ci_geq_p(); -extern SCM scm_char_alphabetic_p(); -extern SCM scm_char_numeric_p(); -extern SCM scm_char_whitespace_p(); -extern SCM scm_char_upper_case_p(); -extern SCM scm_char_lower_case_p(); -extern SCM scm_char_is_both_p (); -extern SCM scm_char_to_integer(); -extern SCM scm_integer_to_char(); -extern SCM scm_char_upcase(); -extern SCM scm_char_downcase(); -extern void scm_tables_prehistory (); -extern int scm_upcase (); -extern int scm_downcase (); -extern void scm_init_chars (); - -#endif /* STDC */ - - - - - - +extern SCM scm_char_p SCM_P ((SCM x)); +extern SCM scm_char_eq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_less_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_leq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_gr_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_geq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_ci_eq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_ci_less_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_ci_leq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_ci_gr_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_ci_geq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_char_alphabetic_p SCM_P ((SCM chr)); +extern SCM scm_char_numeric_p SCM_P ((SCM chr)); +extern SCM scm_char_whitespace_p SCM_P ((SCM chr)); +extern SCM scm_char_upper_case_p SCM_P ((SCM chr)); +extern SCM scm_char_lower_case_p SCM_P ((SCM chr)); +extern SCM scm_char_is_both_p SCM_P ((SCM chr)); +extern SCM scm_char_to_integer SCM_P ((SCM chr)); +extern SCM scm_integer_to_char SCM_P ((SCM n)); +extern SCM scm_char_upcase SCM_P ((SCM chr)); +extern SCM scm_char_downcase SCM_P ((SCM chr)); +extern void scm_tables_prehistory SCM_P ((void)); +extern int scm_upcase SCM_P ((unsigned int c)); +extern int scm_downcase SCM_P ((unsigned int c)); +extern void scm_init_chars SCM_P ((void)); #endif /* SCM_CHARSH */ diff --git a/libguile/continuations.c b/libguile/continuations.c index 6acdb87a1..48d758b9d 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -56,14 +56,10 @@ static char s_cont[] = "continuation"; -#ifdef __STDC__ -SCM -scm_make_cont (SCM * answer) -#else + SCM scm_make_cont (answer) SCM * answer; -#endif { long j; SCM cont; @@ -126,14 +122,12 @@ scm_make_cont (answer) /* Grow the stack so that there is room */ /* to copy in the continuation. Then */ #ifndef CHEAP_CONTINUATIONS -#ifdef __STDC__ -static void -grow_throw (SCM *a) -#else + +static void grow_throw SCM_P ((SCM *a)); + static void grow_throw (a) SCM *a; -#endif { /* retry the throw. */ SCM growth[100]; growth[0] = a[0]; @@ -144,14 +138,10 @@ grow_throw (a) } #endif /* ndef CHEAP_CONTINUATIONS */ -#ifdef __STDC__ -void -scm_dynthrow (SCM *a) -#else + void scm_dynthrow (a) SCM *a; -#endif { SCM cont = a[0], val = a[1]; #ifndef CHEAP_CONTINUATIONS @@ -191,15 +181,11 @@ scm_dynthrow (a) longjmp (SCM_JMPBUF (cont), 1); } -#ifdef __STDC__ -SCM -scm_call_continuation (SCM cont, SCM val) -#else + SCM scm_call_continuation (cont, val) SCM cont; SCM val; -#endif { SCM a[3]; a[0] = cont; @@ -217,13 +203,9 @@ scm_call_continuation (cont, val) } -#ifdef __STDC__ -void -scm_init_continuations (void) -#else + void scm_init_continuations () -#endif { #include "continuations.x" } diff --git a/libguile/continuations.h b/libguile/continuations.h index 109a2998b..e34b17014 100644 --- a/libguile/continuations.h +++ b/libguile/continuations.h @@ -70,17 +70,9 @@ typedef struct -#ifdef __STDC__ -extern SCM scm_make_cont (SCM * answer); -extern void scm_dynthrow (SCM *a); -extern SCM scm_call_continuation (SCM cont, SCM val); -extern void scm_init_continuations (void); +extern SCM scm_make_cont SCM_P ((SCM * answer)); +extern void scm_dynthrow SCM_P ((SCM *a)); +extern SCM scm_call_continuation SCM_P ((SCM cont, SCM val)); +extern void scm_init_continuations SCM_P ((void)); -#else /* STDC */ -extern SCM scm_make_cont (); -extern void scm_dynthrow (); -extern SCM scm_call_continuation (); -extern void scm_init_continuations (); - -#endif /* STDC */ #endif /* CONTINUATIONSH */ diff --git a/libguile/debug.c b/libguile/debug.c index b6adab747..2209b0911 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -64,14 +64,10 @@ */ SCM_PROC (s_debug_options, "debug-options-interface", 0, 1, 0, scm_debug_options); -#ifdef __STDC__ -SCM -scm_debug_options (SCM setting) -#else + SCM scm_debug_options (setting) SCM setting; -#endif { SCM ans; SCM_DEFER_INTS; @@ -93,14 +89,10 @@ scm_debug_options (setting) } SCM_PROC (s_evaluator_traps, "evaluator-traps-interface", 0, 1, 0, scm_evaluator_traps); -#ifdef __STDC__ -SCM -scm_evaluator_traps (SCM setting) -#else + SCM scm_evaluator_traps (setting) SCM setting; -#endif { SCM ans; SCM_DEFER_INTS; @@ -114,14 +106,11 @@ scm_evaluator_traps (setting) } SCM_PROC (s_single_step, "single-step", 2, 0, 0, scm_single_step); -#ifdef __STDC__ -SCM -scm_single_step (SCM cont, SCM val) -#else + SCM scm_single_step (cont, val) - SCM cont, SCM val; -#endif + SCM cont; + SCM val; { SCM_DEFER_INTS; SCM_ENTER_FRAME_P = SCM_EXIT_FRAME_P = 1; @@ -141,16 +130,14 @@ static SCM scm_i_procname; long scm_tc16_memoized; -#ifdef __STDC__ -static int -prinmemoized (SCM obj, SCM port, scm_print_state *pstate) -#else + +static int prinmemoized SCM_P ((SCM obj, SCM port, scm_print_state *pstate)); + static int prinmemoized (obj, port, pstate) SCM obj; SCM port; scm_print_state *pstate; -#endif { int writingp = SCM_WRITINGP (pstate); scm_gen_puts (scm_regular_string, "#= 1, s_expression); } -#ifdef __STDC__ -SCM -scm_m_quote (SCM xorig, SCM env) -#else + SCM scm_m_quote (xorig, env) SCM xorig; SCM env; -#endif { ASSYNT (scm_ilength (SCM_CDR (xorig)) == 1, xorig, s_expression, "quote"); return scm_cons (SCM_IM_QUOTE, SCM_CDR (xorig)); } -#ifdef __STDC__ -SCM -scm_m_begin (SCM xorig, SCM env) -#else + SCM scm_m_begin (xorig, env) SCM xorig; SCM env; -#endif { ASSYNT (scm_ilength (SCM_CDR (xorig)) >= 1, xorig, s_expression, "begin"); return scm_cons (SCM_IM_BEGIN, SCM_CDR (xorig)); } -#ifdef __STDC__ -SCM -scm_m_if (SCM xorig, SCM env) -#else + SCM scm_m_if (xorig, env) SCM xorig; SCM env; -#endif { int len = scm_ilength (SCM_CDR (xorig)); ASSYNT (len >= 2 && len <= 3, xorig, s_expression, "if"); @@ -402,15 +372,11 @@ scm_m_if (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_set (SCM xorig, SCM env) -#else + SCM scm_m_set (xorig, env) SCM xorig; SCM env; -#endif { SCM x = SCM_CDR (xorig); ASSYNT (2 == scm_ilength (x), xorig, s_expression, "set!"); @@ -421,15 +387,11 @@ scm_m_set (xorig, env) #if 0 -#ifdef __STDC__ -SCM -scm_m_vref (SCM xorig, SCM env) -#else + SCM scm_m_vref (xorig, env) SCM xorig; SCM env; -#endif { SCM x = SCM_CDR (xorig); ASSYNT (1 == scm_ilength (x), xorig, s_expression, s_vref); @@ -449,15 +411,11 @@ scm_m_vref (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_vset (SCM xorig, SCM env) -#else + SCM scm_m_vset (xorig, env) SCM xorig; SCM env; -#endif { SCM x = SCM_CDR (xorig); ASSYNT (3 == scm_ilength (x), xorig, s_expression, s_vset); @@ -469,15 +427,11 @@ scm_m_vset (xorig, env) #endif -#ifdef __STDC__ -SCM -scm_m_and (SCM xorig, SCM env) -#else + SCM scm_m_and (xorig, env) SCM xorig; SCM env; -#endif { int len = scm_ilength (SCM_CDR (xorig)); ASSYNT (len >= 0, xorig, s_test, "and"); @@ -488,15 +442,11 @@ scm_m_and (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_or (SCM xorig, SCM env) -#else + SCM scm_m_or (xorig, env) SCM xorig; SCM env; -#endif { int len = scm_ilength (SCM_CDR (xorig)); ASSYNT (len >= 0, xorig, s_test, "or"); @@ -507,15 +457,11 @@ scm_m_or (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_case (SCM xorig, SCM env) -#else + SCM scm_m_case (xorig, env) SCM xorig; SCM env; -#endif { SCM proc, x = SCM_CDR (xorig); ASSYNT (scm_ilength (x) >= 2, xorig, s_clauses, "case"); @@ -530,15 +476,11 @@ scm_m_case (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_cond (SCM xorig, SCM env) -#else + SCM scm_m_cond (xorig, env) SCM xorig; SCM env; -#endif { SCM arg1, x = SCM_CDR (xorig); int len = scm_ilength (x); @@ -562,15 +504,11 @@ scm_m_cond (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_lambda (SCM xorig, SCM env) -#else + SCM scm_m_lambda (xorig, env) SCM xorig; SCM env; -#endif { SCM proc, x = SCM_CDR (xorig); if (scm_ilength (x) < 2) @@ -606,15 +544,11 @@ memlambda: } -#ifdef __STDC__ -SCM -scm_m_letstar (SCM xorig, SCM env) -#else + SCM scm_m_letstar (xorig, env) SCM xorig; SCM env; -#endif { SCM x = SCM_CDR (xorig), arg1, proc, vars = SCM_EOL, *varloc = &vars; int len = scm_ilength (x); @@ -650,15 +584,11 @@ scm_m_letstar (xorig, env) */ -#ifdef __STDC__ -SCM -scm_m_do (SCM xorig, SCM env) -#else + SCM scm_m_do (xorig, env) SCM xorig; SCM env; -#endif { SCM x = SCM_CDR (xorig), arg1, proc; SCM vars = SCM_EOL, inits = SCM_EOL, steps = SCM_EOL; @@ -697,16 +627,14 @@ scm_m_do (xorig, env) */ #define evalcar scm_eval_car -#ifdef __STDC__ -static SCM -iqq (SCM form, SCM env, int depth) -#else + +static SCM iqq SCM_P ((SCM form, SCM env, int depth)); + static SCM iqq (form, env, depth) SCM form; SCM env; int depth; -#endif { SCM tmp; int edepth = depth; @@ -752,30 +680,22 @@ iqq (form, env, depth) /* Here are acros which return values rather than code. */ -#ifdef __STDC__ -SCM -scm_m_quasiquote (SCM xorig, SCM env) -#else + SCM scm_m_quasiquote (xorig, env) SCM xorig; SCM env; -#endif { SCM x = SCM_CDR (xorig); ASSYNT (scm_ilength (x) == 1, xorig, s_expression, s_quasiquote); return iqq (SCM_CAR (x), env, 1); } -#ifdef __STDC__ -SCM -scm_m_delay (SCM xorig, SCM env) -#else + SCM scm_m_delay (xorig, env) SCM xorig; SCM env; -#endif { ASSYNT (scm_ilength (xorig) == 2, xorig, s_expression, s_delay); xorig = SCM_CDR (xorig); @@ -783,14 +703,12 @@ scm_m_delay (xorig, env) env)); } -#ifdef __STDC__ -static SCM -env_top_level (SCM env) -#else + +static SCM env_top_level SCM_P ((SCM env)); + static SCM env_top_level (env) SCM env; -#endif { while (SCM_NIMP(env)) { @@ -801,15 +719,11 @@ env_top_level (env) return SCM_BOOL_F; } -#ifdef __STDC__ -SCM -scm_m_define (SCM x, SCM env) -#else + SCM scm_m_define (x, env) SCM x; SCM env; -#endif { SCM proc, arg1 = x; x = SCM_CDR (x); @@ -885,15 +799,11 @@ scm_m_undefine (x, env) /* end of acros */ -#ifdef __STDC__ -SCM -scm_m_letrec (SCM xorig, SCM env) -#else + SCM scm_m_letrec (xorig, env) SCM xorig; SCM env; -#endif { SCM cdrx = SCM_CDR (xorig); /* locally mutable version of form */ char *what = SCM_CHARS (SCM_CAR (xorig)); @@ -922,15 +832,11 @@ scm_m_letrec (xorig, env) return scm_cons (SCM_IM_LETREC, cdrx); } -#ifdef __STDC__ -SCM -scm_m_let (SCM xorig, SCM env) -#else + SCM scm_m_let (xorig, env) SCM xorig; SCM env; -#endif { SCM cdrx = SCM_CDR (xorig); /* locally mutable version of form */ SCM x = cdrx, proc, arg1, name; /* structure traversers */ @@ -972,15 +878,11 @@ scm_m_let (xorig, env) } -#ifdef __STDC__ -SCM -scm_m_apply (SCM xorig, SCM env) -#else + SCM scm_m_apply (xorig, env) SCM xorig; SCM env; -#endif { ASSYNT (scm_ilength (SCM_CDR (xorig)) == 2, xorig, s_expression, "@apply"); return scm_cons (SCM_IM_APPLY, SCM_CDR (xorig)); @@ -988,15 +890,11 @@ scm_m_apply (xorig, env) #define s_atcall_cc (SCM_ISYMCHARS(SCM_IM_CONT)+1) -#ifdef __STDC__ -SCM -scm_m_cont (SCM xorig, SCM env) -#else + SCM scm_m_cont (xorig, env) SCM xorig; SCM env; -#endif { ASSYNT (scm_ilength (SCM_CDR (xorig)) == 1, xorig, s_expression, "@call-with-current-continuation"); return scm_cons (SCM_IM_CONT, SCM_CDR (xorig)); @@ -1010,15 +908,13 @@ scm_m_cont (xorig, env) * when generating the source for a stackframe. */ -#ifdef __STDC__ -static SCM -unmemocopy (SCM x, SCM env) -#else + +static SCM unmemocopy SCM_P ((SCM x, SCM env)); + static SCM unmemocopy (x, env) SCM x; SCM env; -#endif { SCM ls, z; #ifdef DEBUG_EXTENSIONS @@ -1187,15 +1083,11 @@ loop: return ls; } -#ifdef __STDC__ -SCM -scm_unmemocopy (SCM x, SCM env) -#else + SCM scm_unmemocopy (x, env) SCM x; SCM env; -#endif { if (SCM_NNULLP (env)) /* Make a copy of the lowest frame to protect it from @@ -1206,15 +1098,11 @@ scm_unmemocopy (x, env) } #ifndef RECKLESS -#ifdef __STDC__ -int -scm_badargsp (SCM formals, SCM args) -#else + int scm_badargsp (formals, args) SCM formals; SCM args; -#endif { while SCM_NIMP (formals) @@ -1234,15 +1122,11 @@ scm_badargsp (formals, args) long scm_tc16_macro; -#ifdef __STDC__ -SCM -scm_eval_args (SCM l, SCM env) -#else + SCM scm_eval_args (l, env) SCM l; SCM env; -#endif { SCM res = SCM_EOL, *lloc = &res; while (SCM_NIMP (l)) @@ -1318,11 +1202,8 @@ scm_eval_args (l, env) * current repl. */ -#ifdef __STDC__ -SCM (*scm_ceval_ptr) (SCM exp, SCM env); -#else -SCM (*scm_ceval_ptr) (); -#endif + +SCM (*scm_ceval_ptr) SCM_P ((SCM x, SCM env)); /* scm_last_debug_frame contains a pointer to the last debugging * information stack frame. It is accessed very often from the @@ -1401,39 +1282,27 @@ scm_deval_args (l, env, lloc) */ #if 0 -#ifdef __STDC__ -SCM -scm_ceval (SCM x, SCM env) -#else + SCM scm_ceval (x, env) SCM x; SCM env; -#endif {} #endif #if 0 -#ifdef __STDC__ -SCM -scm_deval (SCM x, SCM env) -#else + SCM scm_deval (x, env) SCM x; SCM env; -#endif {} #endif -#ifdef __STDC__ -SCM -SCM_CEVAL (SCM x, SCM env) -#else + SCM SCM_CEVAL (x, env) SCM x; SCM env; -#endif { union { @@ -2319,14 +2188,10 @@ ret: #ifndef DEVAL SCM_PROC(s_procedure_documentation, "procedure-documentation", 1, 0, 0, scm_procedure_documentation); -#ifdef __STDC__ -SCM -scm_procedure_documentation (SCM proc) -#else + SCM scm_procedure_documentation (proc) SCM proc; -#endif { SCM code; SCM_ASSERT (SCM_BOOL_T == scm_procedure_p (proc) && SCM_NIMP (proc) && SCM_TYP7 (proc) != scm_tc7_contin, @@ -2369,14 +2234,10 @@ scm_procedure_documentation (proc) me a patch to this comment. */ SCM_PROC(s_nconc2last, "apply:nconc2last", 1, 0, 0, scm_nconc2last); -#ifdef __STDC__ -SCM -scm_nconc2last (SCM lst) -#else + SCM scm_nconc2last (lst) SCM lst; -#endif { SCM *lloc; SCM_ASSERT (scm_ilength (lst) > 0, lst, SCM_ARG1, s_nconc2last); @@ -2396,43 +2257,31 @@ scm_nconc2last (lst) */ #if 0 -#ifdef __STDC__ -SCM -scm_apply (SCM proc, SCM arg1, SCM args) -#else + SCM scm_apply (proc, arg1, args) SCM proc; SCM arg1; SCM args; -#endif {} #endif #if 0 -#ifdef __STDC__ -SCM -scm_dapply (SCM proc, SCM arg1, SCM args) -#else + SCM scm_dapply (proc, arg1, args) SCM proc; SCM arg1; SCM args; -#endif {} #endif -#ifdef __STDC__ -SCM -SCM_APPLY (SCM proc, SCM arg1, SCM args) -#else + SCM SCM_APPLY (proc, arg1, args) SCM proc; SCM arg1; SCM args; -#endif { #ifdef DEBUG_EXTENSIONS #ifdef DEVAL @@ -2644,16 +2493,12 @@ ret: #ifndef DEVAL SCM_PROC(s_map, "map", 2, 0, 1, scm_map); -#ifdef __STDC__ -SCM -scm_map (SCM proc, SCM arg1, SCM args) -#else + SCM scm_map (proc, arg1, args) SCM proc; SCM arg1; SCM args; -#endif { long i; SCM res = SCM_EOL; @@ -2697,16 +2542,12 @@ scm_map (proc, arg1, args) SCM_PROC(s_for_each, "for-each", 2, 0, 1, scm_for_each); -#ifdef __STDC__ -SCM -scm_for_each (SCM proc, SCM arg1, SCM args) -#else + SCM scm_for_each (proc, arg1, args) SCM proc; SCM arg1; SCM args; -#endif { SCM *ve = &args; /* Keep args from being optimized away. */ long i; @@ -2744,15 +2585,11 @@ scm_for_each (proc, arg1, args) } -#ifdef __STDC__ -SCM -scm_closure (SCM code, SCM env) -#else + SCM scm_closure (code, env) SCM code; SCM env; -#endif { register SCM z; SCM_NEWCELL (z); @@ -2763,14 +2600,10 @@ scm_closure (code, env) long scm_tc16_promise; -#ifdef __STDC__ -SCM -scm_makprom (SCM code) -#else + SCM scm_makprom (code) SCM code; -#endif { register SCM z; SCM_NEWCELL (z); @@ -2780,16 +2613,14 @@ scm_makprom (code) } -#ifdef __STDC__ -static int -prinprom (SCM exp, SCM port, scm_print_state *pstate) -#else + +static int prinprom SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int prinprom (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { int writingp = SCM_WRITINGP (pstate); scm_gen_puts (scm_regular_string, "#syntax", 1, 0, 0, scm_makacro); -#ifdef __STDC__ -SCM -scm_makacro (SCM code) -#else + SCM scm_makacro (code) SCM code; -#endif { register SCM z; SCM_NEWCELL (z); @@ -2820,14 +2647,10 @@ scm_makacro (code) SCM_PROC(s_makmacro, "procedure->macro", 1, 0, 0, scm_makmacro); -#ifdef __STDC__ -SCM -scm_makmacro (SCM code) -#else + SCM scm_makmacro (code) SCM code; -#endif { register SCM z; SCM_NEWCELL (z); @@ -2838,14 +2661,10 @@ scm_makmacro (code) SCM_PROC(s_makmmacro, "procedure->memoizing-macro", 1, 0, 0, scm_makmmacro); -#ifdef __STDC__ -SCM -scm_makmmacro (SCM code) -#else + SCM scm_makmmacro (code) SCM code; -#endif { register SCM z; SCM_NEWCELL (z); @@ -2855,16 +2674,14 @@ scm_makmmacro (code) } -#ifdef __STDC__ -static int -prinmacro (SCM exp, SCM port, scm_print_state *pstate) -#else + +static int prinmacro SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int prinmacro (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { int writingp = SCM_WRITINGP (pstate); if (SCM_CAR (exp) & (3L << 16)) @@ -2882,14 +2699,10 @@ prinmacro (exp, port, pstate) } SCM_PROC(s_force, "force", 1, 0, 0, scm_force); -#ifdef __STDC__ -SCM -scm_force (SCM x) -#else + SCM scm_force (x) SCM x; -#endif { SCM_ASSERT ((SCM_TYP16 (x) == scm_tc16_promise), x, SCM_ARG1, s_force); if (!((1L << 16) & SCM_CAR (x))) @@ -2907,14 +2720,10 @@ scm_force (x) } SCM_PROC (s_promise_p, "promise?", 1, 0, 0, scm_promise_p); -#ifdef __STDC__ -SCM -scm_promise_p (SCM x) -#else + SCM scm_promise_p (x) SCM x; -#endif { return ((SCM_NIMP (x) && (SCM_TYP16 (x) == scm_tc16_promise)) ? SCM_BOOL_T @@ -2922,14 +2731,10 @@ scm_promise_p (x) } SCM_PROC(s_copy_tree, "copy-tree", 1, 0, 0, scm_copy_tree); -#ifdef __STDC__ -SCM -scm_copy_tree (SCM obj) -#else + SCM scm_copy_tree (obj) SCM obj; -#endif { SCM ans, tl; if SCM_IMP @@ -2952,16 +2757,12 @@ scm_copy_tree (obj) return ans; } -#ifdef __STDC__ -SCM -scm_eval_3 (SCM obj, int copyp, SCM env) -#else + SCM scm_eval_3 (obj, copyp, env) SCM obj; int copyp; SCM env; -#endif { if (SCM_NIMP (SCM_CDR (scm_system_transformer))) obj = scm_apply (SCM_CDR (scm_system_transformer), obj, scm_listofnull); @@ -2970,14 +2771,10 @@ scm_eval_3 (obj, copyp, env) return XEVAL (obj, env); } -#ifdef __STDC__ -SCM -scm_top_level_env (SCM thunk) -#else + SCM scm_top_level_env (thunk) SCM thunk; -#endif { if (SCM_IMP(thunk)) return SCM_EOL; @@ -2986,42 +2783,30 @@ scm_top_level_env (thunk) } SCM_PROC(s_eval2, "eval2", 2, 0, 0, scm_eval2); -#ifdef __STDC__ -SCM -scm_eval2 (SCM obj, SCM env_thunk) -#else + SCM scm_eval2 (obj, env_thunk) SCM obj; SCM env_thunk; -#endif { return scm_eval_3 (obj, 1, scm_top_level_env(env_thunk)); } SCM_PROC(s_eval, "eval", 1, 0, 0, scm_eval); -#ifdef __STDC__ -SCM -scm_eval (SCM obj) -#else + SCM scm_eval (obj) SCM obj; -#endif { return scm_eval_3(obj, 1, scm_top_level_env(SCM_CDR(scm_top_level_lookup_thunk_var))); } SCM_PROC(s_eval_x, "eval!", 1, 0, 0, scm_eval_x); -#ifdef __STDC__ -SCM -scm_eval_x (SCM obj) -#else + SCM scm_eval_x (obj) SCM obj; -#endif { return scm_eval_3(obj, @@ -3030,28 +2815,20 @@ scm_eval_x (obj) } SCM_PROC (s_macro_eval_x, "macro-eval!", 2, 0, 0, scm_macro_eval_x); -#ifdef __STDC__ -SCM -scm_macro_eval_x (SCM exp, SCM env) -#else + SCM scm_macro_eval_x (exp, env) SCM exp; SCM env; -#endif { return scm_eval_3 (exp, 0, env); } -#ifdef __STDC__ -SCM -scm_definedp (SCM x, SCM env) -#else + SCM scm_definedp (x, env) SCM x; SCM env; -#endif { SCM proc = SCM_CAR (x = SCM_CDR (x)); if (SCM_ISYMP (proc)) @@ -3071,16 +2848,12 @@ static scm_smobfuns promsmob = static scm_smobfuns macrosmob = {scm_markcdr, scm_free0, prinmacro}; -#ifdef __STDC__ -SCM -scm_make_synt (char *name, SCM (*macroizer) (), SCM (*fcn) ()) -#else + SCM scm_make_synt (name, macroizer, fcn) char *name; SCM (*macroizer) (); SCM (*fcn) (); -#endif { SCM symcell = scm_sysintern (name, SCM_UNDEFINED); long tmp = ((((SCM_CELLPTR) (SCM_CAR (symcell))) - scm_heap_org) << 8); @@ -3104,13 +2877,9 @@ scm_make_synt (name, macroizer, fcn) #endif -#ifdef __STDC__ -void -scm_init_eval (void) -#else + void scm_init_eval () -#endif { scm_tc16_promise = scm_newsmob (&promsmob); scm_tc16_macro = scm_newsmob (¯osmob); diff --git a/libguile/eval.h b/libguile/eval.h index fb40b7ece..8ea32b430 100644 --- a/libguile/eval.h +++ b/libguile/eval.h @@ -108,120 +108,63 @@ extern SCM scm_i_name; #define SCM_GLOC_VAL(x) (SCM_CDR((x)-1L)) -#ifdef __STDC__ -extern SCM * scm_ilookup (SCM iloc, SCM env); -extern SCM * scm_lookupcar (SCM vloc, SCM genv); -extern SCM scm_unmemocar (SCM form, SCM env); -extern SCM scm_unmemocopy (SCM form, SCM env); -extern SCM scm_eval_car (SCM pair, SCM env); -extern SCM scm_eval_args (SCM i, SCM env); -extern SCM scm_deval_args (SCM l, SCM env, SCM *lloc); -extern SCM scm_m_quote (SCM xorig, SCM env); -extern SCM scm_m_begin (SCM xorig, SCM env); -extern SCM scm_m_if (SCM xorig, SCM env); -extern SCM scm_m_set (SCM xorig, SCM env); -extern SCM scm_m_vref (SCM xorig, SCM env); -extern SCM scm_m_vset (SCM xorig, SCM env); -extern SCM scm_m_and (SCM xorig, SCM env); -extern SCM scm_m_or (SCM xorig, SCM env); -extern SCM scm_m_case (SCM xorig, SCM env); -extern SCM scm_m_cond (SCM xorig, SCM env); -extern SCM scm_m_lambda (SCM xorig, SCM env); -extern SCM scm_m_letstar (SCM xorig, SCM env); -extern SCM scm_m_do (SCM xorig, SCM env); -extern SCM scm_m_quasiquote (SCM xorig, SCM env); -extern SCM scm_m_delay (SCM xorig, SCM env); -extern SCM scm_m_define (SCM x, SCM env); -extern SCM scm_m_letrec (SCM xorig, SCM env); -extern SCM scm_m_let (SCM xorig, SCM env); -extern SCM scm_m_apply (SCM xorig, SCM env); -extern SCM scm_m_cont (SCM xorig, SCM env); -extern SCM scm_m_undefine (SCM x, SCM env); -extern int scm_badargsp (SCM formals, SCM args); -extern SCM scm_ceval (SCM x, SCM env); -extern SCM scm_deval (SCM x, SCM env); -extern SCM scm_procedure_documentation (SCM proc); -extern SCM scm_nconc2last (SCM lst); -extern SCM scm_apply (SCM proc, SCM arg1, SCM args); -extern SCM scm_dapply (SCM proc, SCM arg1, SCM args); -extern SCM SCM_APPLY (SCM proc, SCM arg1, SCM args); -extern SCM scm_map (SCM proc, SCM arg1, SCM args); -extern SCM scm_for_each (SCM proc, SCM arg1, SCM args); -extern SCM scm_closure (SCM code, SCM env); -extern SCM scm_makprom (SCM code); -extern SCM scm_makacro (SCM code); -extern SCM scm_makmacro (SCM code); -extern SCM scm_makmmacro (SCM code); -extern SCM scm_force (SCM x); -extern SCM scm_promise_p (SCM x); -extern SCM scm_copy_tree (SCM obj); -extern SCM scm_eval_3 (SCM obj, int copyp, SCM env); -extern SCM scm_top_level_env (SCM thunk); -extern SCM scm_eval2 (SCM obj, SCM env_thunk); -extern SCM scm_eval (SCM obj); -extern SCM scm_eval_x (SCM obj); -extern SCM scm_macro_eval_x (SCM exp, SCM env); -extern SCM scm_definedp (SCM x, SCM env); -extern SCM scm_make_synt (char *name, SCM (*macroizer) (), SCM (*fcn) ()); -extern void scm_init_eval (void); - -#else /* STDC */ -extern SCM * scm_ilookup (); -extern SCM * scm_lookupcar (); -extern SCM scm_unmemocar (); -extern SCM scm_unmemocopy (); -extern SCM scm_eval_car (); -extern SCM scm_eval_args (); -extern SCM scm_deval_args (); -extern SCM scm_m_quote (); -extern SCM scm_m_begin (); -extern SCM scm_m_if (); -extern SCM scm_m_set (); -extern SCM scm_m_vref (); -extern SCM scm_m_vset (); -extern SCM scm_m_and (); -extern SCM scm_m_or (); -extern SCM scm_m_case (); -extern SCM scm_m_cond (); -extern SCM scm_m_lambda (); -extern SCM scm_m_letstar (); -extern SCM scm_m_do (); -extern SCM scm_m_quasiquote (); -extern SCM scm_m_delay (); -extern SCM scm_m_define (); -extern SCM scm_m_letrec (); -extern SCM scm_m_let (); -extern SCM scm_m_apply (); -extern SCM scm_m_cont (); -extern SCM scm_m_undefine (); -extern int scm_badargsp (); -extern SCM scm_ceval (); -extern SCM scm_deval (); -extern SCM scm_procedure_documentation (); -extern SCM scm_nconc2last (); -extern SCM scm_apply (); -extern SCM scm_dapply (); -extern SCM SCM_APPLY (); -extern SCM scm_map (); -extern SCM scm_for_each (); -extern SCM scm_closure (); -extern SCM scm_makprom (); -extern SCM scm_makacro (); -extern SCM scm_makmacro (); -extern SCM scm_makmmacro (); -extern SCM scm_force (); -extern SCM scm_promise_p (); -extern SCM scm_copy_tree (); -extern SCM scm_eval_3 (); -extern SCM scm_top_level_env (); -extern SCM scm_eval2 (); -extern SCM scm_eval (); -extern SCM scm_eval_x (); -extern SCM scm_macro_eval_x (); -extern SCM scm_definedp (); -extern SCM scm_make_synt (); -extern void scm_init_eval (); - -#endif /* STDC */ + +extern SCM * scm_ilookup SCM_P ((SCM iloc, SCM env)); +extern SCM * scm_lookupcar SCM_P ((SCM vloc, SCM genv)); +extern SCM scm_unmemocar SCM_P ((SCM form, SCM env)); +extern SCM scm_unmemocopy SCM_P ((SCM form, SCM env)); +extern SCM scm_eval_car SCM_P ((SCM pair, SCM env)); +extern SCM scm_eval_args SCM_P ((SCM i, SCM env)); +extern SCM scm_deval_args SCM_P ((SCM l, SCM env, SCM *lloc)); +extern SCM scm_m_quote SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_begin SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_if SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_set SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_vref SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_vset SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_and SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_or SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_case SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_cond SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_lambda SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_letstar SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_do SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_quasiquote SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_delay SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_define SCM_P ((SCM x, SCM env)); +extern SCM scm_m_letrec SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_let SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_apply SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_cont SCM_P ((SCM xorig, SCM env)); +extern SCM scm_m_undefine SCM_P ((SCM x, SCM env)); +extern int scm_badargsp SCM_P ((SCM formals, SCM args)); +extern SCM scm_ceval SCM_P ((SCM x, SCM env)); +extern SCM scm_deval SCM_P ((SCM x, SCM env)); +extern SCM scm_procedure_documentation SCM_P ((SCM proc)); +extern SCM scm_nconc2last SCM_P ((SCM lst)); +extern SCM scm_apply SCM_P ((SCM proc, SCM arg1, SCM args)); +extern SCM scm_dapply SCM_P ((SCM proc, SCM arg1, SCM args)); +extern SCM SCM_APPLY SCM_P ((SCM proc, SCM arg1, SCM args)); +extern SCM scm_map SCM_P ((SCM proc, SCM arg1, SCM args)); +extern SCM scm_for_each SCM_P ((SCM proc, SCM arg1, SCM args)); +extern SCM scm_closure SCM_P ((SCM code, SCM env)); +extern SCM scm_makprom SCM_P ((SCM code)); +extern SCM scm_makacro SCM_P ((SCM code)); +extern SCM scm_makmacro SCM_P ((SCM code)); +extern SCM scm_makmmacro SCM_P ((SCM code)); +extern SCM scm_force SCM_P ((SCM x)); +extern SCM scm_promise_p SCM_P ((SCM x)); +extern SCM scm_copy_tree SCM_P ((SCM obj)); +extern SCM scm_eval_3 SCM_P ((SCM obj, int copyp, SCM env)); +extern SCM scm_top_level_env SCM_P ((SCM thunk)); +extern SCM scm_eval2 SCM_P ((SCM obj, SCM env_thunk)); +extern SCM scm_eval SCM_P ((SCM obj)); +extern SCM scm_eval_x SCM_P ((SCM obj)); +extern SCM scm_macro_eval_x SCM_P ((SCM exp, SCM env)); +extern SCM scm_definedp SCM_P ((SCM x, SCM env)); +extern SCM scm_make_synt SCM_P ((char *name, + SCM (*macroizer) (SCM), + SCM (*fcn) ())); +extern void scm_init_eval SCM_P ((void)); #endif /* EVALH */ diff --git a/libguile/extchrs.c b/libguile/extchrs.c index 1b7fb2bbb..6b063da8a 100644 --- a/libguile/extchrs.c +++ b/libguile/extchrs.c @@ -46,15 +46,11 @@ #ifdef SCM_FAKE_EXT_CHARS -#ifdef __STDC__ -int -xmblen (const char * str, size_t size) -#else + int xmblen (str, size) const char * str; size_t size; -#endif { if (!str) return 0; @@ -69,15 +65,11 @@ xmblen (str, size) return 1; } -#ifdef __STDC__ -int -xwctomb (char * _str, int c) -#else + int xwctomb (_str, c) char * _str; int c; -#endif { unsigned char * str; str = (unsigned char *)_str; @@ -104,16 +96,12 @@ xwctomb (_str, c) return 4; } -#ifdef __STDC__ -int -xmbtowc (xwchar_t * result, const unsigned char * _str, size_t size) -#else + int -xmbtowc (result, str, size) +xmbtowc (result, _str, size) xwchar_t * result; const unsigned char * _str; size_t size; -#endif { const unsigned char * str; str = (const unsigned char *)_str; diff --git a/libguile/extchrs.h b/libguile/extchrs.h index 6a4a3ceb8..3f1f02276 100644 --- a/libguile/extchrs.h +++ b/libguile/extchrs.h @@ -46,6 +46,8 @@ #include +#include "libguile/__scm.h" + #define SCM_FAKE_EXT_CHARS 1 #if !defined(SCM_FAKE_EXT_CHARS) @@ -63,21 +65,10 @@ typedef unsigned short xwchar_t; #endif - -#ifdef __STDC__ -extern int xmblen (const char * str, size_t size); -extern int xwctomb (char * _str, int c); -extern int xmbtowc (xwchar_t * result, const unsigned char * _str, size_t size); - -#else /* STDC */ -extern int xmblen (); -extern int xwctomb (); -extern int xmbtowc (); - -#endif /* STDC */ - - +extern int xmblen SCM_P ((const char * str, size_t size)); +extern int xwctomb SCM_P ((char * _str, int c)); +extern int xmbtowc SCM_P ((xwchar_t * result, const unsigned char * _str, size_t size)); #endif /* EXTCHRSH */ diff --git a/libguile/filesys.c b/libguile/filesys.c index b0ef9bb81..0e5408692 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -156,16 +156,12 @@ SCM_CONST_LONG (scm_O_SYNC, "O_SYNC", O_SYNC); */ SCM_PROC (s_sys_chown, "chown", 3, 0, 0, scm_sys_chown); -#ifdef __STDC__ -SCM -scm_sys_chown (SCM path, SCM owner, SCM group) -#else + SCM scm_sys_chown (path, owner, group) SCM path; SCM owner; SCM group; -#endif { int val; @@ -183,15 +179,11 @@ scm_sys_chown (path, owner, group) SCM_PROC (s_sys_chmod, "chmod", 2, 0, 0, scm_sys_chmod); -#ifdef __STDC__ -SCM -scm_sys_chmod (SCM port_or_path, SCM mode) -#else + SCM scm_sys_chmod (port_or_path, mode) SCM port_or_path; SCM mode; -#endif { int rv; SCM_ASSERT (SCM_INUMP (mode), mode, SCM_ARG2, s_sys_chmod); @@ -211,14 +203,10 @@ scm_sys_chmod (port_or_path, mode) } SCM_PROC (s_umask, "umask", 0, 1, 0, scm_umask); -#ifdef __STDC__ -SCM -scm_umask (SCM mode) -#else + SCM scm_umask (mode) SCM mode; -#endif { mode_t mask; if (SCM_UNBNDP (mode)) @@ -239,16 +227,14 @@ scm_umask (mode) */ long scm_tc16_fd; -#ifdef __STDC__ -static int -scm_fd_print (SCM sexp, SCM port, scm_print_state *pstate) -#else + +static int scm_fd_print SCM_P ((SCM sexp, SCM port, scm_print_state *pstate)); + static int scm_fd_print (sexp, port, pstate) SCM sexp; SCM port; scm_print_state *pstate; -#endif { scm_gen_puts (scm_regular_string, "#> 16) -#define SCM_FD(x) ((int)SCM_CDR (x)) +#define SCM_FD_P(x) (SCM_TYP16(x)==(scm_tc16_fd)) +#define SCM_FD_FLAGS(x) (SCM_CAR(x) >> 16) +#define SCM_FD(x) ((int)SCM_CDR (x)) enum scm_fd_flags { @@ -70,68 +70,35 @@ extern long scm_tc16_dir; -#ifdef __STDC__ -extern SCM scm_sys_chown (SCM path, SCM owner, SCM group); -extern SCM scm_sys_chmod (SCM port_or_path, SCM mode); -extern SCM scm_umask (SCM mode); -extern SCM scm_intern_fd (int fd, int flags); -extern SCM scm_sys_open (SCM path, SCM flags, SCM mode); -extern SCM scm_sys_create (SCM path, SCM mode); -extern SCM scm_sys_close (SCM sfd); -extern SCM scm_sys_write_fd (SCM sfd, SCM buf); -extern SCM scm_sys_read_fd (SCM sfd, SCM buf, SCM offset, SCM length); -extern SCM scm_sys_lseek (SCM sfd, SCM offset, SCM whence); -extern SCM scm_sys_dup (SCM oldfd, SCM newfd); -extern SCM scm_sys_stat (SCM fd_or_path); -extern SCM scm_sys_link (SCM oldpath, SCM newpath); -extern SCM scm_sys_rename (SCM oldname, SCM newname); -extern SCM scm_sys_delete_file (SCM str); -extern SCM scm_sys_mkdir (SCM path, SCM mode); -extern SCM scm_sys_rmdir (SCM path); -extern SCM scm_sys_opendir (SCM dirname); -extern SCM scm_sys_readdir (SCM port); -extern SCM scm_rewinddir (SCM port); -extern SCM scm_sys_closedir (SCM port); -extern SCM scm_sys_chdir (SCM str); -extern SCM scm_sys_getcwd (void); -extern SCM scm_sys_select (SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs); -extern SCM scm_sys_symlink(SCM oldpath, SCM newpath); -extern SCM scm_sys_readlink(SCM path); -extern SCM scm_sys_lstat(SCM str); -extern SCM scm_sys_copy_file (SCM oldfile, SCM newfile); -extern void scm_init_filesys (void); -#else /* STDC */ -extern SCM scm_sys_chown (); -extern SCM scm_sys_chmod (); -extern SCM scm_umask (); -extern SCM scm_intern_fd (); -extern SCM scm_sys_open (); -extern SCM scm_sys_create (); -extern SCM scm_sys_close (); -extern SCM scm_sys_write_fd (); -extern SCM scm_sys_read_fd (); -extern SCM scm_sys_lseek (); -extern SCM scm_sys_dup (); -extern SCM scm_sys_stat (); -extern SCM scm_sys_link (); -extern SCM scm_sys_rename (); -extern SCM scm_sys_delete_file (); -extern SCM scm_sys_mkdir (); -extern SCM scm_sys_rmdir (); -extern SCM scm_sys_opendir (); -extern SCM scm_sys_readdir (); -extern SCM scm_rewinddir (); -extern SCM scm_sys_closedir (); -extern SCM scm_sys_chdir (); -extern SCM scm_sys_getcwd (); -extern SCM scm_sys_select (); -extern SCM scm_sys_symlink(); -extern SCM scm_sys_readlink(); -extern SCM scm_sys_lstat(); -extern SCM scm_sys_copy_file (); -extern void scm_init_filesys (); - -#endif /* STDC */ +extern SCM scm_sys_chown SCM_P ((SCM path, SCM owner, SCM group)); +extern SCM scm_sys_chmod SCM_P ((SCM port_or_path, SCM mode)); +extern SCM scm_umask SCM_P ((SCM mode)); +extern SCM scm_intern_fd SCM_P ((int fd, int flags)); +extern SCM scm_sys_open SCM_P ((SCM path, SCM flags, SCM mode)); +extern SCM scm_sys_create SCM_P ((SCM path, SCM mode)); +extern SCM scm_sys_close SCM_P ((SCM sfd)); +extern SCM scm_sys_write_fd SCM_P ((SCM sfd, SCM buf)); +extern SCM scm_sys_read_fd SCM_P ((SCM sfd, SCM buf, SCM offset, SCM length)); +extern SCM scm_sys_lseek SCM_P ((SCM sfd, SCM offset, SCM whence)); +extern SCM scm_sys_dup SCM_P ((SCM oldfd, SCM newfd)); +extern SCM scm_sys_stat SCM_P ((SCM fd_or_path)); +extern SCM scm_sys_link SCM_P ((SCM oldpath, SCM newpath)); +extern SCM scm_sys_rename SCM_P ((SCM oldname, SCM newname)); +extern SCM scm_sys_delete_file SCM_P ((SCM str)); +extern SCM scm_sys_mkdir SCM_P ((SCM path, SCM mode)); +extern SCM scm_sys_rmdir SCM_P ((SCM path)); +extern SCM scm_sys_opendir SCM_P ((SCM dirname)); +extern SCM scm_sys_readdir SCM_P ((SCM port)); +extern SCM scm_rewinddir SCM_P ((SCM port)); +extern SCM scm_sys_closedir SCM_P ((SCM port)); +extern SCM scm_sys_chdir SCM_P ((SCM str)); +extern SCM scm_sys_getcwd SCM_P ((void)); +extern SCM scm_sys_select SCM_P ((SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs)); +extern SCM scm_sys_symlink SCM_P ((SCM oldpath, SCM newpath)); +extern SCM scm_sys_readlink SCM_P ((SCM path)); +extern SCM scm_sys_lstat SCM_P ((SCM str)); +extern SCM scm_sys_copy_file SCM_P ((SCM oldfile, SCM newfile)); +extern void scm_init_filesys SCM_P ((void)); #endif /* FILESYSH */ diff --git a/libguile/fports.h b/libguile/fports.h index 15ce0b588..0bb8db231 100644 --- a/libguile/fports.h +++ b/libguile/fports.h @@ -54,26 +54,11 @@ extern scm_ptobfuns scm_fptob; extern scm_ptobfuns scm_pipob; -#ifdef __STDC__ -extern SCM scm_setbuf0 (SCM port); -extern long scm_mode_bits (char *modes); -extern SCM scm_open_file (SCM filename, SCM modes); -extern SCM scm_port_mode (SCM port); -extern void scm_init_fports (void); - -#else /* STDC */ -extern SCM scm_setbuf0 (); -extern long scm_mode_bits (); -extern SCM scm_mkfile (); -extern SCM scm_open_file (); -extern SCM scm_port_mode (); -extern void scm_init_fports (); - -#endif /* STDC */ - - - - +extern SCM scm_setbuf0 SCM_P ((SCM port)); +extern long scm_mode_bits SCM_P ((char *modes)); +extern SCM scm_open_file SCM_P ((SCM filename, SCM modes)); +extern SCM scm_port_mode SCM_P ((SCM port)); +extern void scm_init_fports SCM_P ((void)); #endif /* FPORTSH */ diff --git a/libguile/gc.c b/libguile/gc.c index 3ab6104c2..28e86e4e0 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -60,6 +60,14 @@ #include #endif +#ifdef __STDC__ +#include +#define var_start(x, y) va_start(x, y) +#else +#include +#define var_start(x, y) va_start(x) +#endif + /* {heap tuning parameters} * @@ -798,14 +806,10 @@ scm_mark_locations (x, n) regarded as a pointer to a cell on the heap. The code is duplicated from scm_mark_locations. */ -#ifdef __STDC__ -int -scm_cellp (SCM value) -#else + int scm_cellp (value) SCM value; -#endif { register int i, j; register SCM_CELLPTR ptr; @@ -1586,6 +1590,7 @@ scm_remember (ptr) SCM * ptr; {} + #ifdef __STDC__ SCM scm_return_first (SCM elt, ...) diff --git a/libguile/gdbint.c b/libguile/gdbint.c index d3b27ec79..74e70fe13 100644 --- a/libguile/gdbint.c +++ b/libguile/gdbint.c @@ -128,14 +128,12 @@ static int tok_buf_mark_p; static SCM gdb_output_port; static int old_ints, old_gc; -#ifdef __STDC__ -static void -unmark_port (SCM port) -#else + +static void unmark_port SCM_P ((SCM port)); + static void unmark_port (port) SCM port; -#endif { SCM stream, string; port_mark_p = SCM_GC8MARKP (port); @@ -148,14 +146,12 @@ unmark_port (port) SCM_CLRGC8MARK (string); } -#ifdef __STDC__ -static void -remark_port (SCM port) -#else + +static void remark_port SCM_P ((SCM port)); + static void remark_port (port) SCM port; -#endif { SCM stream = SCM_STREAM (port); SCM string = SCM_CDR (stream); @@ -164,28 +160,20 @@ remark_port (port) if (port_mark_p) SCM_SETGC8MARK (port); } -#ifdef __STDC__ -int -gdb_maybe_valid_type_p (SCM value) -#else + int gdb_maybe_valid_type_p (value) SCM value; -#endif { if (SCM_IMP (value) || scm_cellp (value)) return scm_tag (value) != SCM_MAKINUM (-1); return 0; } -#ifdef __STDC__ -int -gdb_read (char *str) -#else + int gdb_read (str) char *str; -#endif { SCM ans; int status = 0; @@ -249,14 +237,10 @@ exit: return status; } -#ifdef __STDC__ -int -gdb_eval (SCM exp) -#else + int gdb_eval (exp) SCM exp; -#endif { RESET_STRING; if (SCM_IMP (exp)) @@ -278,14 +262,10 @@ gdb_eval (exp) return 0; } -#ifdef __STDC__ -int -gdb_print (SCM obj) -#else + int gdb_print (obj) SCM obj; -#endif { RESET_STRING; SCM_BEGIN_FOREIGN_BLOCK; @@ -298,15 +278,11 @@ gdb_print (obj) return 0; } -#ifdef __STDC__ -int -gdb_binding (SCM name, SCM value) -#else + int gdb_binding (name, value) SCM name; SCM value; -#endif { RESET_STRING; if (SCM_GC_P) diff --git a/libguile/gdbint.h b/libguile/gdbint.h index 5dec69262..bf12524f6 100644 --- a/libguile/gdbint.h +++ b/libguile/gdbint.h @@ -53,10 +53,6 @@ extern int scm_print_carefully_p; -#ifdef __STDC__ -extern void scm_init_gdbint (void); -#else -extern void scm_init_gdbint (); -#endif __STDC__ +extern void scm_init_gdbint SCM_P ((void)); #endif /* GDBINTH */ diff --git a/libguile/genio.h b/libguile/genio.h index ef2fc6b50..78d17fac5 100644 --- a/libguile/genio.h +++ b/libguile/genio.h @@ -47,22 +47,13 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern void scm_gen_putc (int c, SCM port); -extern void scm_gen_puts (enum scm_string_representation_type rep, - char *str_data, - SCM port); -extern void scm_gen_write (enum scm_string_representation_type rep, char *str_data, scm_sizet nitems, SCM port); -extern int scm_gen_getc (SCM port); -extern void scm_gen_ungetc (int c, SCM port); - -#else /* STDC */ -extern void scm_gen_putc (); -extern void scm_gen_puts (); -extern void scm_gen_write (); -extern int scm_gen_getc (); -extern void scm_gen_ungetc (); -#endif /* STDC */ +extern void scm_gen_putc SCM_P ((int c, SCM port)); +extern void scm_gen_puts SCM_P ((enum scm_string_representation_type rep, + char *str_data, + SCM port)); +extern void scm_gen_write SCM_P ((enum scm_string_representation_type rep, char *str_data, scm_sizet nitems, SCM port)); +extern int scm_gen_getc SCM_P ((SCM port)); +extern void scm_gen_ungetc SCM_P ((int c, SCM port)); #endif /* GENIOH */ diff --git a/libguile/gscm.c b/libguile/gscm.c index 994f10219..daf172730 100644 --- a/libguile/gscm.c +++ b/libguile/gscm.c @@ -71,15 +71,13 @@ extern char *getenv (); /* {Printing Objects to Strings} */ -#ifdef __STDC__ -static GSCM_status -gscm_portprint_obj (SCM port, SCM obj) -#else + +static GSCM_status gscm_portprint_obj SCM_P ((SCM port, SCM obj)); + static GSCM_status gscm_portprint_obj (port, obj) SCM port; SCM obj; -#endif { scm_prin1 (obj, port, 1); return GSCM_OK; @@ -94,14 +92,12 @@ struct seval_str_frame char * str; }; -#ifdef __STDC__ -static void -_seval_str_fn (void * vframe) -#else + +static void _seval_str_fn SCM_P ((void * vframe)); + static void _seval_str_fn (vframe) void * vframe; -#endif { struct seval_str_frame * frame; frame = (struct seval_str_frame *)vframe; @@ -110,15 +106,13 @@ _seval_str_fn (vframe) -#ifdef __STDC__ -static GSCM_status -gscm_strprint_obj (SCM * answer, SCM obj) -#else + +static GSCM_status gscm_strprint_obj SCM_P ((SCM * answer, SCM obj)); + static GSCM_status gscm_strprint_obj (answer, obj) SCM * answer; SCM obj; -#endif { SCM str; SCM port; @@ -133,15 +127,13 @@ gscm_strprint_obj (answer, obj) return stat; } -#ifdef __STDC__ -static GSCM_status -gscm_cstr (char ** answer, SCM obj) -#else + +static GSCM_status gscm_cstr SCM_P ((char ** answer, SCM obj)); + static GSCM_status gscm_cstr (answer, obj) char ** answer; SCM obj; -#endif { GSCM_status stat; @@ -158,14 +150,12 @@ gscm_cstr (answer, obj) /* {Invoking The Interpreter} */ -#ifdef __STDC__ -static SCM -gscm_silent_repl (SCM env) -#else + +static SCM gscm_silent_repl SCM_P ((SCM env)); + static SCM gscm_silent_repl (env) SCM env; -#endif { SCM source; SCM answer; @@ -182,17 +172,15 @@ typedef int setjmp_type; typedef long setjmp_type; #endif -#ifdef __STDC__ -static GSCM_status -_eval_port (SCM * answer, GSCM_top_level toplvl, SCM port, int printp) -#else + +static GSCM_status _eval_port SCM_P ((SCM * answer, GSCM_top_level toplvl, SCM port, int printp)); + static GSCM_status _eval_port (answer, toplvl, port, printp) SCM * answer; GSCM_top_level toplvl; SCM port; int printp; -#endif { SCM saved_inp; GSCM_status status; @@ -259,16 +247,14 @@ _eval_port (answer, toplvl, port, printp) return status; } -#ifdef __STDC__ -static GSCM_status -seval_str (SCM *answer, GSCM_top_level toplvl, char * str) -#else + +static GSCM_status seval_str SCM_P ((SCM *answer, GSCM_top_level toplvl, char * str)); + static GSCM_status seval_str (answer, toplvl, str) SCM *answer; GSCM_top_level toplvl; char * str; -#endif { SCM scheme_str; SCM port; @@ -281,16 +267,12 @@ seval_str (answer, toplvl, str) } -#ifdef __STDC__ -GSCM_status -gscm_seval_str (SCM *answer, GSCM_top_level toplvl, char * str) -#else + GSCM_status gscm_seval_str (answer, toplvl, str) SCM *answer; GSCM_top_level toplvl; char * str; -#endif { SCM_STACKITEM i; GSCM_status status; @@ -300,15 +282,11 @@ gscm_seval_str (answer, toplvl, str) return status; } -#ifdef __STDC__ -void -format_load_command (char * buf, char *file_name) -#else + void format_load_command (buf, file_name) char * buf; char *file_name; -#endif { char quoted_name[MAXPATHLEN + 1]; int source; @@ -324,16 +302,12 @@ format_load_command (buf, file_name) sprintf (buf, "(%%try-load \"%s\")", quoted_name); } -#ifdef __STDC__ -GSCM_status -gscm_seval_file (SCM *answer, GSCM_top_level toplvl, char * file_name) -#else + GSCM_status gscm_seval_file (answer, toplvl, file_name) SCM *answer; GSCM_top_level toplvl; char * file_name; -#endif { char command[MAXPATHLEN * 3]; format_load_command (command, file_name); @@ -341,16 +315,14 @@ gscm_seval_file (answer, toplvl, file_name) } -#ifdef __STDC__ -static GSCM_status -eval_str (char ** answer, GSCM_top_level toplvl, char * str) -#else + +static GSCM_status eval_str SCM_P ((char ** answer, GSCM_top_level toplvl, char * str)); + static GSCM_status eval_str (answer, toplvl, str) char ** answer; GSCM_top_level toplvl; char * str; -#endif { SCM sanswer; SCM scheme_str; @@ -371,16 +343,12 @@ eval_str (answer, toplvl, str) } -#ifdef __STDC__ -GSCM_status -gscm_eval_str (char ** answer, GSCM_top_level toplvl, char * str) -#else + GSCM_status gscm_eval_str (answer, toplvl, str) char ** answer; GSCM_top_level toplvl; char * str; -#endif { SCM_STACKITEM i; GSCM_status status; @@ -391,16 +359,12 @@ gscm_eval_str (answer, toplvl, str) } -#ifdef __STDC__ -GSCM_status -gscm_eval_file (char ** answer, GSCM_top_level toplvl, char * file_name) -#else + GSCM_status gscm_eval_file (answer, toplvl, file_name) char ** answer; GSCM_top_level toplvl; char * file_name; -#endif { char command[MAXPATHLEN * 3]; format_load_command (command, file_name); @@ -430,14 +394,10 @@ static char * gscm_error_msgs[] = AT(GSCM_ERROR_OPENING_INIT_FILE) "Error opening init file." }; -#ifdef __STDC__ -char * -gscm_error_msg (int n) -#else + char * gscm_error_msg (n) int n; -#endif { if ((n < 0) || (n > (sizeof (gscm_error_msgs) / sizeof (char *)))) return "Unrecognized error."; @@ -450,10 +410,7 @@ gscm_error_msg (n) /* {Defining New Procedures} */ -#ifdef __STDC__ -SCM -gscm_make_subr (SCM (*fn)(), int req, int opt, int varp, char * doc) -#else + SCM gscm_make_subr (fn, req, opt, varp, doc) SCM (*fn)(); @@ -461,19 +418,14 @@ gscm_make_subr (fn, req, opt, varp, doc) int opt; int varp; char * doc; -#endif { return scm_make_gsubr ("*anonymous*", req, opt, varp, fn); } -#ifdef __STDC__ -int -gscm_2_char (SCM c) -#else + int gscm_2_char (c) SCM c; -#endif { SCM_ASSERT (SCM_ICHRP (c), c, SCM_ARG1, "gscm_2_char"); return SCM_ICHR (c); @@ -481,16 +433,12 @@ gscm_2_char (c) -#ifdef __STDC__ -void -gscm_2_str (char ** out, int * len_out, SCM * objp) -#else + void gscm_2_str (out, len_out, objp) char ** out; int * len_out; SCM * objp; -#endif { SCM_ASSERT (SCM_NIMP (*objp) && SCM_STRINGP (*objp), *objp, SCM_ARG3, "gscm_2_str"); if (out) @@ -500,15 +448,11 @@ gscm_2_str (out, len_out, objp) } -#ifdef __STDC__ -void -gscm_error (char * message, SCM args) -#else + void gscm_error (message, args) char * message; SCM args; -#endif { SCM errsym; SCM str; @@ -519,10 +463,7 @@ gscm_error (message, args) } -#ifdef __STDC__ -GSCM_status -gscm_run_scm (int argc, char ** argv, FILE * in, FILE * out, FILE * err, GSCM_status (*initfn)(), char * initfile, char * initcmd) -#else + GSCM_status gscm_run_scm (argc, argv, in, out, err, initfn, initfile, initcmd) int argc; @@ -533,7 +474,6 @@ gscm_run_scm (argc, argv, in, out, err, initfn, initfile, initcmd) GSCM_status (*initfn)(); char * initfile; char * initcmd; -#endif { SCM_STACKITEM i; GSCM_status status; @@ -645,13 +585,9 @@ gscm_run_scm (argc, argv, in, out, err, initfn, initfile, initcmd) -#ifdef __STDC__ -void -scm_init_guile (void) -#else + void scm_init_guile () -#endif { #include "gscm.x" } diff --git a/libguile/gsubr.c b/libguile/gsubr.c index 4dd37a331..5032488c7 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -66,10 +66,7 @@ #define GSUBR_PROC(cclo) (SCM_VELTS(cclo)[2]) static SCM f_gsubr_apply; -#ifdef __STDC__ -SCM -scm_make_gsubr(char *name, int req, int opt, int rst, SCM (*fcn)()) -#else + SCM scm_make_gsubr(name, req, opt, rst, fcn) char *name; @@ -77,7 +74,6 @@ scm_make_gsubr(name, req, opt, rst, fcn) int opt; int rst; SCM (*fcn)(); -#endif { switch GSUBR_MAKTYPE(req, opt, rst) { case GSUBR_MAKTYPE(0, 0, 0): return scm_make_subr(name, scm_tc7_subr_0, fcn); @@ -112,14 +108,10 @@ scm_make_gsubr(name, req, opt, rst, fcn) SCM_PROC(s_gsubr_apply, "gsubr-apply", 0, 0, 1, scm_gsubr_apply); -#ifdef __STDC__ -SCM -scm_gsubr_apply(SCM args) -#else + SCM scm_gsubr_apply(args) SCM args; -#endif { SCM self = SCM_CAR(args); SCM (*fcn)() = SCM_SUBRF(GSUBR_PROC(self)); @@ -182,13 +174,9 @@ gsubr_21l(req1, req2, opt, rst) #endif -#ifdef __STDC__ -void -scm_init_gsubr(void) -#else + void scm_init_gsubr() -#endif { f_gsubr_apply = scm_make_subr(s_gsubr_apply, scm_tc7_lsubr, scm_gsubr_apply); #ifdef GSUBR_TEST diff --git a/libguile/gsubr.h b/libguile/gsubr.h index 9c9785227..7eb34ce02 100644 --- a/libguile/gsubr.h +++ b/libguile/gsubr.h @@ -47,19 +47,9 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern SCM scm_make_gsubr(char *name, int req, int opt, int rst, SCM (*fcn)()); -extern SCM scm_gsubr_apply(SCM args); -extern void scm_init_gsubr(void); - -#else /* STDC */ -extern SCM scm_make_gsubr(); -extern SCM scm_gsubr_apply(); -extern void scm_init_gsubr(); - -#endif /* STDC */ - - +extern SCM scm_make_gsubr SCM_P ((char *name, int req, int opt, int rst, SCM (*fcn)())); +extern SCM scm_gsubr_apply SCM_P ((SCM args)); +extern void scm_init_gsubr SCM_P ((void)); #endif /* GSUBRH */ diff --git a/libguile/hash.c b/libguile/hash.c index f1739ecbd..3ea9f866a 100644 --- a/libguile/hash.c +++ b/libguile/hash.c @@ -51,16 +51,12 @@ extern double floor(); #endif -#ifdef __STDC__ -unsigned long -scm_hasher(SCM obj, unsigned long n, scm_sizet d) -#else + unsigned long scm_hasher(obj, n, d) SCM obj; unsigned long n; scm_sizet d; -#endif { switch (7 & (int) obj) { case 2: case 6: /* SCM_INUMP(obj) */ @@ -140,30 +136,22 @@ scm_hasher(obj, n, d) -#ifdef __STDC__ -unsigned int -scm_ihashq (SCM obj, unsigned int n) -#else + unsigned int scm_ihashq (obj, n) SCM obj; unsigned int n; -#endif { return (((unsigned int) obj) >> 1) % n; } SCM_PROC(s_hashq, "hashq", 2, 0, 0, scm_hashq); -#ifdef __STDC__ -SCM -scm_hashq(SCM obj, SCM n) -#else + SCM scm_hashq(obj, n) SCM obj; SCM n; -#endif { SCM_ASSERT(SCM_INUMP(n) && 0 <= n, n, SCM_ARG2, s_hashq); return SCM_MAKINUM(scm_ihashq (obj, SCM_INUM (n))); @@ -172,15 +160,11 @@ scm_hashq(obj, n) -#ifdef __STDC__ -unsigned int -scm_ihashv (SCM obj, unsigned int n) -#else + unsigned int scm_ihashv (obj, n) SCM obj; unsigned int n; -#endif { if (SCM_ICHRP(obj)) return ((unsigned int)(scm_downcase(SCM_ICHR(obj)))) % n; /* downcase!?!! */ @@ -193,15 +177,11 @@ scm_ihashv (obj, n) SCM_PROC(s_hashv, "hashv", 2, 0, 0, scm_hashv); -#ifdef __STDC__ -SCM -scm_hashv(SCM obj, SCM n) -#else + SCM scm_hashv(obj, n) SCM obj; SCM n; -#endif { SCM_ASSERT(SCM_INUMP(n) && 0 <= n, n, SCM_ARG2, s_hashv); return SCM_MAKINUM(scm_ihashv (obj, SCM_INUM (n))); @@ -210,29 +190,21 @@ scm_hashv(obj, n) -#ifdef __STDC__ -unsigned int -scm_ihash (SCM obj, unsigned int n) -#else + unsigned int scm_ihash (obj, n) SCM obj; unsigned int n; -#endif { return (unsigned int)scm_hasher (obj, n, 10); } SCM_PROC(s_hash, "hash", 2, 0, 0, scm_hash); -#ifdef __STDC__ -SCM -scm_hash(SCM obj, SCM n) -#else + SCM scm_hash(obj, n) SCM obj; SCM n; -#endif { SCM_ASSERT(SCM_INUMP(n) && 0 <= n, n, SCM_ARG2, s_hash); return SCM_MAKINUM(scm_ihash(obj, SCM_INUM(n))); @@ -241,13 +213,9 @@ scm_hash(obj, n) -#ifdef __STDC__ -void -scm_init_hash (void) -#else + void scm_init_hash () -#endif { #include "hash.x" } diff --git a/libguile/hash.h b/libguile/hash.h index c599c95f0..b9637d0c0 100644 --- a/libguile/hash.h +++ b/libguile/hash.h @@ -47,31 +47,14 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern unsigned long scm_hasher(SCM obj, unsigned long n, scm_sizet d); -extern unsigned int scm_ihashq (SCM obj, unsigned int n); -extern SCM scm_hashq(SCM obj, SCM n); -extern unsigned int scm_ihashv (SCM obj, unsigned int n); -extern SCM scm_hashv(SCM obj, SCM n); -extern unsigned int scm_ihash (SCM obj, unsigned int n); -extern SCM scm_hash(SCM obj, SCM n); -extern void scm_init_hash (void); - -#else /* STDC */ -extern unsigned long scm_hasher(); -extern unsigned int scm_ihashq (); -extern SCM scm_hashq(); -extern unsigned int scm_ihashv (); -extern SCM scm_hashv(); -extern unsigned int scm_ihash (); -extern SCM scm_hash(); -extern void scm_init_hash (); - -#endif /* STDC */ - - - - +extern unsigned long scm_hasher SCM_P ((SCM obj, unsigned long n, scm_sizet d)); +extern unsigned int scm_ihashq SCM_P ((SCM obj, unsigned int n)); +extern SCM scm_hashq SCM_P ((SCM obj, SCM n)); +extern unsigned int scm_ihashv SCM_P ((SCM obj, unsigned int n)); +extern SCM scm_hashv SCM_P ((SCM obj, SCM n)); +extern unsigned int scm_ihash SCM_P ((SCM obj, unsigned int n)); +extern SCM scm_hash SCM_P ((SCM obj, SCM n)); +extern void scm_init_hash SCM_P ((void)); #endif /* HASHH */ diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 132edca78..a3cd76499 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -49,10 +49,7 @@ #include "hashtab.h" -#ifdef __STDC__ -SCM -scm_hash_fn_get_handle (SCM table, SCM obj, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure) -#else + SCM scm_hash_fn_get_handle (table, obj, hash_fn, assoc_fn, closure) SCM table; @@ -60,7 +57,6 @@ scm_hash_fn_get_handle (table, obj, hash_fn, assoc_fn, closure) unsigned int (*hash_fn)(); SCM (*assoc_fn)(); void * closure; -#endif { int k; SCM h; @@ -78,10 +74,7 @@ scm_hash_fn_get_handle (table, obj, hash_fn, assoc_fn, closure) } -#ifdef __STDC__ -SCM -scm_hash_fn_create_handle_x (SCM table, SCM obj, SCM init, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure) -#else + SCM scm_hash_fn_create_handle_x (table, obj, init, hash_fn, assoc_fn, closure) SCM table; @@ -90,7 +83,6 @@ scm_hash_fn_create_handle_x (table, obj, init, hash_fn, assoc_fn, closure) unsigned int (*hash_fn)(); SCM (*assoc_fn)(); void * closure; -#endif { int k; SCM it; @@ -122,10 +114,7 @@ scm_hash_fn_create_handle_x (table, obj, init, hash_fn, assoc_fn, closure) -#ifdef __STDC__ -SCM -scm_hash_fn_ref (SCM table, SCM obj, SCM dflt, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure) -#else + SCM scm_hash_fn_ref (table, obj, dflt, hash_fn, assoc_fn, closure) SCM table; @@ -134,7 +123,6 @@ scm_hash_fn_ref (table, obj, dflt, hash_fn, assoc_fn, closure) unsigned int (*hash_fn)(); SCM (*assoc_fn)(); void * closure; -#endif { SCM it; @@ -147,10 +135,7 @@ scm_hash_fn_ref (table, obj, dflt, hash_fn, assoc_fn, closure) -#ifdef __STDC__ -SCM -scm_hash_fn_set_x (SCM table, SCM obj, SCM val, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure) -#else + SCM scm_hash_fn_set_x (table, obj, val, hash_fn, assoc_fn, closure) SCM table; @@ -159,7 +144,6 @@ scm_hash_fn_set_x (table, obj, val, hash_fn, assoc_fn, closure) unsigned int (*hash_fn)(); SCM (*assoc_fn)(); void * closure; -#endif { SCM it; @@ -171,15 +155,7 @@ scm_hash_fn_set_x (table, obj, val, hash_fn, assoc_fn, closure) -#ifdef __STDC__ -SCM -scm_hash_fn_remove_x (SCM table, - SCM obj, - unsigned int (*hash_fn)(), - SCM (*assoc_fn)(), - SCM (*delete_fn)(), - void * closure) -#else + SCM scm_hash_fn_remove_x (table, obj, hash_fn, assoc_fn, delete_fn, closure) SCM table; @@ -188,7 +164,6 @@ scm_hash_fn_remove_x (table, obj, hash_fn, assoc_fn, delete_fn, closure) SCM (*assoc_fn)(); SCM (*delete_fn)(); void * closure; -#endif { int k; SCM h; @@ -210,47 +185,35 @@ scm_hash_fn_remove_x (table, obj, hash_fn, assoc_fn, delete_fn, closure) SCM_PROC (s_hashq_get_handle, "hashq-get-handle", 2, 0, 0, scm_hashq_get_handle); -#ifdef __STDC__ -SCM -scm_hashq_get_handle (SCM table, SCM obj) -#else + SCM scm_hashq_get_handle (table, obj) SCM table; SCM obj; -#endif { return scm_hash_fn_get_handle (table, obj, scm_ihashq, scm_sloppy_assq, 0); } SCM_PROC (s_hashq_create_handle_x, "hashq-create-handle!", 3, 0, 0, scm_hashq_create_handle_x); -#ifdef __STDC__ -SCM -scm_hashq_create_handle_x (SCM table, SCM obj, SCM init) -#else + SCM scm_hashq_create_handle_x (table, obj, init) SCM table; SCM obj; SCM init; -#endif { return scm_hash_fn_create_handle_x (table, obj, init, scm_ihashq, scm_sloppy_assq, 0); } SCM_PROC (s_hashq_ref, "hashq-ref", 2, 1, 0, scm_hashq_ref); -#ifdef __STDC__ -SCM -scm_hashq_ref (SCM table, SCM obj, SCM dflt) -#else + SCM scm_hashq_ref (table, obj, dflt) SCM table; SCM obj; SCM dflt; -#endif { if (dflt == SCM_UNDEFINED) dflt = SCM_BOOL_F; @@ -260,16 +223,12 @@ scm_hashq_ref (table, obj, dflt) SCM_PROC (s_hashq_set_x, "hashq-set!", 3, 0, 0, scm_hashq_set_x); -#ifdef __STDC__ -SCM -scm_hashq_set_x (SCM table, SCM obj, SCM val) -#else + SCM scm_hashq_set_x (table, obj, val) SCM table; SCM obj; SCM val; -#endif { return scm_hash_fn_set_x (table, obj, val, scm_ihashq, scm_sloppy_assq, 0); } @@ -277,15 +236,11 @@ scm_hashq_set_x (table, obj, val) SCM_PROC (s_hashq_remove_x, "hashq-remove!", 2, 0, 0, scm_hashq_remove_x); -#ifdef __STDC__ -SCM -scm_hashq_remove_x (SCM table, SCM obj) -#else + SCM scm_hashq_remove_x (table, obj) SCM table; SCM obj; -#endif { return scm_hash_fn_remove_x (table, obj, scm_ihashq, scm_sloppy_assq, scm_delq_x, 0); } @@ -294,47 +249,35 @@ scm_hashq_remove_x (table, obj) SCM_PROC (s_hashv_get_handle, "hashv-get-handle", 2, 0, 0, scm_hashv_get_handle); -#ifdef __STDC__ -SCM -scm_hashv_get_handle (SCM table, SCM obj) -#else + SCM scm_hashv_get_handle (table, obj) SCM table; SCM obj; -#endif { return scm_hash_fn_get_handle (table, obj, scm_ihashv, scm_sloppy_assv, 0); } SCM_PROC (s_hashv_create_handle_x, "hashv-create-handle!", 3, 0, 0, scm_hashv_create_handle_x); -#ifdef __STDC__ -SCM -scm_hashv_create_handle_x (SCM table, SCM obj, SCM init) -#else + SCM scm_hashv_create_handle_x (table, obj, init) SCM table; SCM obj; SCM init; -#endif { return scm_hash_fn_create_handle_x (table, obj, init, scm_ihashv, scm_sloppy_assv, 0); } SCM_PROC (s_hashv_ref, "hashv-ref", 2, 1, 0, scm_hashv_ref); -#ifdef __STDC__ -SCM -scm_hashv_ref (SCM table, SCM obj, SCM dflt) -#else + SCM scm_hashv_ref (table, obj, dflt) SCM table; SCM obj; SCM dflt; -#endif { if (dflt == SCM_UNDEFINED) dflt = SCM_BOOL_F; @@ -344,31 +287,23 @@ scm_hashv_ref (table, obj, dflt) SCM_PROC (s_hashv_set_x, "hashv-set!", 3, 0, 0, scm_hashv_set_x); -#ifdef __STDC__ -SCM -scm_hashv_set_x (SCM table, SCM obj, SCM val) -#else + SCM scm_hashv_set_x (table, obj, val) SCM table; SCM obj; SCM val; -#endif { return scm_hash_fn_set_x (table, obj, val, scm_ihashv, scm_sloppy_assv, 0); } SCM_PROC (s_hashv_remove_x, "hashv-remove!", 2, 0, 0, scm_hashv_remove_x); -#ifdef __STDC__ -SCM -scm_hashv_remove_x (SCM table, SCM obj) -#else + SCM scm_hashv_remove_x (table, obj) SCM table; SCM obj; -#endif { return scm_hash_fn_remove_x (table, obj, scm_ihashv, scm_sloppy_assv, scm_delv_x, 0); } @@ -376,47 +311,35 @@ scm_hashv_remove_x (table, obj) SCM_PROC (s_hash_get_handle, "hash-get-handle", 2, 0, 0, scm_hash_get_handle); -#ifdef __STDC__ -SCM -scm_hash_get_handle (SCM table, SCM obj) -#else + SCM scm_hash_get_handle (table, obj) SCM table; SCM obj; -#endif { return scm_hash_fn_get_handle (table, obj, scm_ihash, scm_sloppy_assoc, 0); } SCM_PROC (s_hash_create_handle_x, "hash-create-handle!", 3, 0, 0, scm_hash_create_handle_x); -#ifdef __STDC__ -SCM -scm_hash_create_handle_x (SCM table, SCM obj, SCM init) -#else + SCM scm_hash_create_handle_x (table, obj, init) SCM table; SCM obj; SCM init; -#endif { return scm_hash_fn_create_handle_x (table, obj, init, scm_ihash, scm_sloppy_assoc, 0); } SCM_PROC (s_hash_ref, "hash-ref", 2, 1, 0, scm_hash_ref); -#ifdef __STDC__ -SCM -scm_hash_ref (SCM table, SCM obj, SCM dflt) -#else + SCM scm_hash_ref (table, obj, dflt) SCM table; SCM obj; SCM dflt; -#endif { if (dflt == SCM_UNDEFINED) dflt = SCM_BOOL_F; @@ -426,16 +349,12 @@ scm_hash_ref (table, obj, dflt) SCM_PROC (s_hash_set_x, "hash-set!", 3, 0, 0, scm_hash_set_x); -#ifdef __STDC__ -SCM -scm_hash_set_x (SCM table, SCM obj, SCM val) -#else + SCM scm_hash_set_x (table, obj, val) SCM table; SCM obj; SCM val; -#endif { return scm_hash_fn_set_x (table, obj, val, scm_ihash, scm_sloppy_assoc, 0); } @@ -443,15 +362,11 @@ scm_hash_set_x (table, obj, val) SCM_PROC (s_hash_remove_x, "hash-remove!", 2, 0, 0, scm_hash_remove_x); -#ifdef __STDC__ -SCM -scm_hash_remove_x (SCM table, SCM obj) -#else + SCM scm_hash_remove_x (table, obj) SCM table; SCM obj; -#endif { return scm_hash_fn_remove_x (table, obj, scm_ihash, scm_sloppy_assoc, scm_delete_x, 0); } @@ -467,16 +382,14 @@ struct scm_ihashx_closure }; -#ifdef __STDC__ -static unsigned int -scm_ihashx (SCM obj, unsigned int n, struct scm_ihashx_closure * closure) -#else + +static unsigned int scm_ihashx SCM_P ((SCM obj, unsigned int n, struct scm_ihashx_closure * closure)); + static unsigned int scm_ihashx (obj, n, closure) SCM obj; unsigned int n; struct scm_ihashx_closure * closure; -#endif { SCM answer; SCM_ALLOW_INTS; @@ -488,16 +401,14 @@ scm_ihashx (obj, n, closure) } -#ifdef __STDC__ -static SCM -scm_sloppy_assx (SCM obj, SCM alist, struct scm_ihashx_closure * closure) -#else + +static SCM scm_sloppy_assx SCM_P ((SCM obj, SCM alist, struct scm_ihashx_closure * closure)); + static SCM scm_sloppy_assx (obj, alist, closure) SCM obj; SCM alist; struct scm_ihashx_closure * closure; -#endif { SCM answer; SCM_ALLOW_INTS; @@ -510,16 +421,14 @@ scm_sloppy_assx (obj, alist, closure) -#ifdef __STDC__ -static SCM -scm_delx_x (SCM obj, SCM alist, struct scm_ihashx_closure * closure) -#else + +static SCM scm_delx_x SCM_P ((SCM obj, SCM alist, struct scm_ihashx_closure * closure)); + static SCM scm_delx_x (obj, alist, closure) SCM obj; SCM alist; struct scm_ihashx_closure * closure; -#endif { SCM answer; SCM_ALLOW_INTS; @@ -533,17 +442,13 @@ scm_delx_x (obj, alist, closure) SCM_PROC (s_hashx_get_handle, "hashx-get-handle", 4, 0, 0, scm_hashx_get_handle); -#ifdef __STDC__ -SCM -scm_hashx_get_handle (SCM hash, SCM assoc, SCM table, SCM obj) -#else + SCM scm_hashx_get_handle (hash, assoc, table, obj) SCM hash; SCM assoc; SCM table; SCM obj; -#endif { struct scm_ihashx_closure closure; closure.hash = hash; @@ -553,10 +458,7 @@ scm_hashx_get_handle (hash, assoc, table, obj) SCM_PROC (s_hashx_create_handle_x, "hashx-create-handle!", 5, 0, 0, scm_hashx_create_handle_x); -#ifdef __STDC__ -SCM -scm_hashx_create_handle_x (SCM hash, SCM assoc, SCM table, SCM obj, SCM init) -#else + SCM scm_hashx_create_handle_x (hash, assoc, table, obj, init) SCM hash; @@ -564,7 +466,6 @@ scm_hashx_create_handle_x (hash, assoc, table, obj, init) SCM table; SCM obj; SCM init; -#endif { struct scm_ihashx_closure closure; closure.hash = hash; @@ -575,10 +476,7 @@ scm_hashx_create_handle_x (hash, assoc, table, obj, init) SCM_PROC (s_hashx_ref, "hashx-ref", 4, 1, 0, scm_hashx_ref); -#ifdef __STDC__ -SCM -scm_hashx_ref (SCM hash, SCM assoc, SCM table, SCM obj, SCM dflt) -#else + SCM scm_hashx_ref (hash, assoc, table, obj, dflt) SCM hash; @@ -586,7 +484,6 @@ scm_hashx_ref (hash, assoc, table, obj, dflt) SCM table; SCM obj; SCM dflt; -#endif { struct scm_ihashx_closure closure; if (dflt == SCM_UNDEFINED) @@ -600,10 +497,7 @@ scm_hashx_ref (hash, assoc, table, obj, dflt) SCM_PROC (s_hashx_set_x, "hashx-set!", 5, 0, 0, scm_hashx_set_x); -#ifdef __STDC__ -SCM -scm_hashx_set_x (SCM hash, SCM assoc, SCM table, SCM obj, SCM val) -#else + SCM scm_hashx_set_x (hash, assoc, table, obj, val) SCM hash; @@ -611,7 +505,6 @@ scm_hashx_set_x (hash, assoc, table, obj, val) SCM table; SCM obj; SCM val; -#endif { struct scm_ihashx_closure closure; closure.hash = hash; @@ -620,10 +513,7 @@ scm_hashx_set_x (hash, assoc, table, obj, val) } -#ifdef __STDC__ -SCM -scm_hashx_remove_x (SCM hash, SCM assoc, SCM delete, SCM table, SCM obj) -#else + SCM scm_hashx_remove_x (hash, assoc, delete, table, obj) SCM hash; @@ -631,7 +521,6 @@ scm_hashx_remove_x (hash, assoc, delete, table, obj) SCM delete; SCM table; SCM obj; -#endif { struct scm_ihashx_closure closure; closure.hash = hash; @@ -642,13 +531,9 @@ scm_hashx_remove_x (hash, assoc, delete, table, obj) -#ifdef __STDC__ -void -scm_init_hashtab (void) -#else + void scm_init_hashtab () -#endif { #include "hashtab.x" } diff --git a/libguile/hashtab.h b/libguile/hashtab.h index 2cd7577f4..ff5eceaca 100644 --- a/libguile/hashtab.h +++ b/libguile/hashtab.h @@ -46,73 +46,39 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern SCM scm_hash_fn_get_handle (SCM table, SCM obj, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure); -extern SCM scm_hash_fn_create_handle_x (SCM table, SCM obj, SCM init, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure); -extern SCM scm_hash_fn_ref (SCM table, SCM obj, SCM dflt, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure); -extern SCM scm_hash_fn_set_x (SCM table, SCM obj, SCM val, unsigned int (*hash_fn)(), SCM (*assoc_fn)(), void * closure); -extern SCM scm_hash_fn_remove_x (SCM table, - SCM obj, - unsigned int (*hash_fn)(), - SCM (*assoc_fn)(), - SCM (*delete_fn)(), - void * closure); -extern SCM scm_hashq_get_handle (SCM table, SCM obj); -extern SCM scm_hashq_create_handle_x (SCM table, SCM obj, SCM init); -extern SCM scm_hashq_ref (SCM table, SCM obj, SCM dflt); -extern SCM scm_hashq_set_x (SCM table, SCM obj, SCM val); -extern SCM scm_hashq_remove_x (SCM table, SCM obj); -extern SCM scm_hashv_get_handle (SCM table, SCM obj); -extern SCM scm_hashv_create_handle_x (SCM table, SCM obj, SCM init); -extern SCM scm_hashv_ref (SCM table, SCM obj, SCM dflt); -extern SCM scm_hashv_set_x (SCM table, SCM obj, SCM val); -extern SCM scm_hashv_remove_x (SCM table, SCM obj); -extern SCM scm_hash_get_handle (SCM table, SCM obj); -extern SCM scm_hash_create_handle_x (SCM table, SCM obj, SCM init); -extern SCM scm_hash_ref (SCM table, SCM obj, SCM dflt); -extern SCM scm_hash_set_x (SCM table, SCM obj, SCM val); -extern SCM scm_hash_remove_x (SCM table, SCM obj); -extern SCM scm_hashx_get_handle (SCM hash, SCM assoc, SCM table, SCM obj); -extern SCM scm_hashx_create_handle_x (SCM hash, SCM assoc, SCM table, SCM obj, SCM init); -extern SCM scm_hashx_ref (SCM hash, SCM assoc, SCM table, SCM obj, SCM dflt); -extern SCM scm_hashx_set_x (SCM hash, SCM assoc, SCM table, SCM obj, SCM val); -extern SCM scm_hashx_remove_x (SCM hash, SCM assoc, SCM delete, SCM table, SCM obj); -extern void scm_init_hashtab (void); - -#else /* STDC */ -extern SCM scm_hash_fn_get_handle (); -extern SCM scm_hash_fn_create_handle_x (); -extern SCM scm_hash_fn_ref (); -extern SCM scm_hash_fn_set_x (); -extern SCM scm_hash_fn_remove_x (); -extern SCM scm_hashq_get_handle (); -extern SCM scm_hashq_create_handle_x (); -extern SCM scm_hashq_ref (); -extern SCM scm_hashq_set_x (); -extern SCM scm_hashq_remove_x (); -extern SCM scm_hashv_get_handle (); -extern SCM scm_hashv_create_handle_x (); -extern SCM scm_hashv_ref (); -extern SCM scm_hashv_set_x (); -extern SCM scm_hashv_remove_x (); -extern SCM scm_hash_get_handle (); -extern SCM scm_hash_create_handle_x (); -extern SCM scm_hash_ref (); -extern SCM scm_hash_set_x (); -extern SCM scm_hash_remove_x (); -extern SCM scm_hashx_get_handle (); -extern SCM scm_hashx_create_handle_x (); -extern SCM scm_hashx_ref (); -extern SCM scm_hashx_set_x (); -extern SCM scm_hashx_remove_x (); -extern void scm_init_hashtab (); - -#endif /* STDC */ - - - +#if 0 +typedef unsigned int scm_hash_fn_t SCM_P ((SCM obj, unsigned int d, void *closure)); +typedef SCM scm_assoc_fn_t SCM_P ((SCM key, SCM alist, void *closure)); +typedef SCM scm_delete_fn_t SCM_P ((SCM elt, SCM list)); +#endif +extern SCM scm_hash_fn_get_handle SCM_P ((SCM table, SCM obj, unsigned int (*hash_fn) (), SCM (*assoc_fn) (), void * closure)); +extern SCM scm_hash_fn_create_handle_x SCM_P ((SCM table, SCM obj, SCM init, unsigned int (*hash_fn) (), SCM (*assoc_fn) (), void * closure)); +extern SCM scm_hash_fn_ref SCM_P ((SCM table, SCM obj, SCM dflt, unsigned int (*hash_fn) (), SCM (*assoc_fn) (), void * closure)); +extern SCM scm_hash_fn_set_x SCM_P ((SCM table, SCM obj, SCM val, unsigned int (*hash_fn) (), SCM (*assoc_fn) (), void * closure)); +extern SCM scm_hash_fn_remove_x SCM_P ((SCM table, SCM obj, unsigned int (*hash_fn) (), SCM (*assoc_fn) (), SCM (*delete_fn) (), void * closure)); +extern SCM scm_hashq_get_handle SCM_P ((SCM table, SCM obj)); +extern SCM scm_hashq_create_handle_x SCM_P ((SCM table, SCM obj, SCM init)); +extern SCM scm_hashq_ref SCM_P ((SCM table, SCM obj, SCM dflt)); +extern SCM scm_hashq_set_x SCM_P ((SCM table, SCM obj, SCM val)); +extern SCM scm_hashq_remove_x SCM_P ((SCM table, SCM obj)); +extern SCM scm_hashv_get_handle SCM_P ((SCM table, SCM obj)); +extern SCM scm_hashv_create_handle_x SCM_P ((SCM table, SCM obj, SCM init)); +extern SCM scm_hashv_ref SCM_P ((SCM table, SCM obj, SCM dflt)); +extern SCM scm_hashv_set_x SCM_P ((SCM table, SCM obj, SCM val)); +extern SCM scm_hashv_remove_x SCM_P ((SCM table, SCM obj)); +extern SCM scm_hash_get_handle SCM_P ((SCM table, SCM obj)); +extern SCM scm_hash_create_handle_x SCM_P ((SCM table, SCM obj, SCM init)); +extern SCM scm_hash_ref SCM_P ((SCM table, SCM obj, SCM dflt)); +extern SCM scm_hash_set_x SCM_P ((SCM table, SCM obj, SCM val)); +extern SCM scm_hash_remove_x SCM_P ((SCM table, SCM obj)); +extern SCM scm_hashx_get_handle SCM_P ((SCM hash, SCM assoc, SCM table, SCM obj)); +extern SCM scm_hashx_create_handle_x SCM_P ((SCM hash, SCM assoc, SCM table, SCM obj, SCM init)); +extern SCM scm_hashx_ref SCM_P ((SCM hash, SCM assoc, SCM table, SCM obj, SCM dflt)); +extern SCM scm_hashx_set_x SCM_P ((SCM hash, SCM assoc, SCM table, SCM obj, SCM val)); +extern SCM scm_hashx_remove_x SCM_P ((SCM hash, SCM assoc, SCM delete, SCM table, SCM obj)); +extern void scm_init_hashtab SCM_P ((void)); #endif /* HASHTABH */ diff --git a/libguile/init.c b/libguile/init.c index 05dee5ccc..3cb763186 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -231,16 +231,14 @@ scm_restart_stack (base) #if 0 static char remsg[] = "remove\n#define ", addmsg[] = "add\n#define "; -#ifdef __STDC__ -static void -fixconfig (char *s1, char *s2, int s) -#else + +static void fixconfig SCM_P ((char *s1, char *s2, int s)); + static void fixconfig (s1, s2, s) char *s1; char *s2; int s; -#endif { fputs (s1, stderr); fputs (s2, stderr); @@ -251,6 +249,7 @@ fixconfig (s1, s2, s) } +static void check_config SCM_P ((void)); static void check_config () diff --git a/libguile/ioext.c b/libguile/ioext.c index 9f1959c39..221b72fab 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -57,14 +57,10 @@ SCM_PROC (s_sys_ftell, "ftell", 1, 0, 0, scm_sys_ftell); -#ifdef __STDC__ -SCM -scm_sys_ftell (SCM port) -#else + SCM scm_sys_ftell (port) SCM port; -#endif { long pos; SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_ftell); @@ -79,16 +75,12 @@ scm_sys_ftell (port) SCM_PROC (s_sys_fseek, "fseek", 3, 0, 0, scm_sys_fseek); -#ifdef __STDC__ -SCM -scm_sys_fseek (SCM port, SCM offset, SCM whence) -#else + SCM scm_sys_fseek (port, offset, whence) SCM port; SCM offset; SCM whence; -#endif { int rv; SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_fseek); @@ -106,16 +98,12 @@ scm_sys_fseek (port, offset, whence) SCM_PROC (s_sys_freopen, "freopen", 3, 0, 0, scm_sys_freopen); -#ifdef __STDC__ -SCM -scm_sys_freopen (SCM filename, SCM modes, SCM port) -#else + SCM scm_sys_freopen (filename, modes, port) SCM filename; SCM modes; SCM port; -#endif { FILE *f; SCM_ASSERT (SCM_NIMP (filename) && SCM_STRINGP (filename), filename, SCM_ARG1, s_sys_freopen); @@ -145,15 +133,11 @@ scm_sys_freopen (filename, modes, port) SCM_PROC (s_sys_duplicate_port, "duplicate-port", 2, 0, 0, scm_sys_duplicate_port); -#ifdef __STDC__ -SCM -scm_sys_duplicate_port (SCM oldpt, SCM modes) -#else + SCM scm_sys_duplicate_port (oldpt, modes) SCM oldpt; SCM modes; -#endif { int oldfd; int newfd; @@ -191,15 +175,11 @@ scm_sys_duplicate_port (oldpt, modes) SCM_PROC (s_sys_redirect_port, "redirect-port", 2, 0, 0, scm_sys_redirect_port); -#ifdef __STDC__ -SCM -scm_sys_redirect_port (SCM into_pt, SCM from_pt) -#else + SCM scm_sys_redirect_port (into_pt, from_pt) SCM into_pt; SCM from_pt; -#endif { int ans, oldfd, newfd; SCM_DEFER_INTS; @@ -219,14 +199,10 @@ scm_sys_redirect_port (into_pt, from_pt) } SCM_PROC (s_sys_fileno, "fileno", 1, 0, 0, scm_sys_fileno); -#ifdef __STDC__ -SCM -scm_sys_fileno (SCM port) -#else + SCM scm_sys_fileno (port) SCM port; -#endif { int fd; SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_fileno); @@ -237,14 +213,10 @@ scm_sys_fileno (port) } SCM_PROC (s_sys_isatty, "isatty?", 1, 0, 0, scm_sys_isatty_p); -#ifdef __STDC__ -SCM -scm_sys_isatty_p (SCM port) -#else + SCM scm_sys_isatty_p (port) SCM port; -#endif { int rv; SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_isatty); @@ -258,15 +230,11 @@ scm_sys_isatty_p (port) SCM_PROC (s_sys_fdopen, "fdopen", 2, 0, 0, scm_sys_fdopen); -#ifdef __STDC__ -SCM -scm_sys_fdopen (SCM fdes, SCM modes) -#else + SCM scm_sys_fdopen (fdes, modes) SCM fdes; SCM modes; -#endif { FILE *f; SCM port; @@ -297,15 +265,11 @@ scm_sys_fdopen (fdes, modes) * MOVE->FDES is implemented in Scheme and calls this primitive. */ SCM_PROC (s_sys_primitive_move_to_fdes, "primitive-move->fdes", 2, 0, 0, scm_sys_primitive_move_to_fdes); -#ifdef __STDC__ -SCM -scm_sys_primitive_move_to_fdes (SCM port, SCM fd) -#else + SCM scm_sys_primitive_move_to_fdes (port, fd) SCM port; SCM fd; -#endif { FILE *stream; int old_fd; @@ -333,15 +297,11 @@ scm_sys_primitive_move_to_fdes (port, fd) return SCM_BOOL_T; } -#ifdef __STDC__ -void -scm_setfileno (FILE *fs, int fd) -#else + void scm_setfileno (fs, fd) FILE *fs; int fd; -#endif { #ifdef SET_FILE_FD_FIELD SET_FILE_FD_FIELD(fs, fd); @@ -362,14 +322,10 @@ scm_setfileno (fs, fd) * reseting the revealed count to 0. * Should be called with SCM_DEFER_INTS active. */ -#ifdef __STDC__ -void -scm_evict_ports (int fd) -#else + void scm_evict_ports (fd) int fd; -#endif { int i; @@ -386,14 +342,10 @@ scm_evict_ports (fd) /* Return a list of ports using a given file descriptor. */ SCM_PROC(s_fdes_to_ports, "fdes->ports", 1, 0, 0, scm_fdes_to_ports); -#ifdef __STDC__ -SCM -scm_fdes_to_ports (SCM fd) -#else + SCM scm_fdes_to_ports (fd) SCM fd; -#endif { SCM result = SCM_EOL; int int_fd; @@ -413,13 +365,9 @@ scm_fdes_to_ports (fd) return result; } -#ifdef __STDC__ -void -scm_init_ioext (void) -#else + void scm_init_ioext () -#endif { /* fseek() symbols. */ scm_sysintern ("SEEK_SET", SCM_MAKINUM (SEEK_SET)); diff --git a/libguile/ioext.h b/libguile/ioext.h index 9294f2223..e026a1f23 100644 --- a/libguile/ioext.h +++ b/libguile/ioext.h @@ -50,38 +50,19 @@ -#ifdef __STDC__ -extern SCM scm_sys_ftell (SCM port); -extern SCM scm_sys_fseek (SCM port, SCM offset, SCM whence); -extern SCM scm_sys_freopen (SCM filename, SCM modes, SCM port); -extern SCM scm_sys_duplicate_port (SCM oldpt, SCM modes); -extern SCM scm_sys_redirect_port (SCM into_pt, SCM from_pt); -extern SCM scm_sys_fileno (SCM port); -extern SCM scm_sys_isatty_p (SCM port); -extern SCM scm_sys_fdopen (SCM fdes, SCM modes); -extern SCM scm_sys_primitive_move_to_fdes (SCM port, SCM fd); -extern void scm_setfileno (FILE *fs, int fd); -extern void scm_evict_ports (int fd); -extern SCM scm_fdes_to_ports (SCM fd); -extern void scm_init_ioext (void); - -#else /* STDC */ -extern SCM scm_sys_ftell (); -extern SCM scm_sys_fseek (); -extern SCM scm_sys_freopen (); -extern SCM scm_sys_duplicate_port (); -extern SCM scm_sys_redirect_port (); -extern SCM scm_sys_fileno (); -extern SCM scm_sys_isatty_p (); -extern SCM scm_sys_fdopen (); -extern SCM scm_sys_primitive_move_to_fdes (); -extern void scm_setfileno (); -extern void scm_evict_ports (); -extern SCM scm_fdes_to_ports (); -extern void scm_init_ioext (); - -#endif /* STDC */ - +extern SCM scm_sys_ftell SCM_P ((SCM port)); +extern SCM scm_sys_fseek SCM_P ((SCM port, SCM offset, SCM whence)); +extern SCM scm_sys_freopen SCM_P ((SCM filename, SCM modes, SCM port)); +extern SCM scm_sys_duplicate_port SCM_P ((SCM oldpt, SCM modes)); +extern SCM scm_sys_redirect_port SCM_P ((SCM into_pt, SCM from_pt)); +extern SCM scm_sys_fileno SCM_P ((SCM port)); +extern SCM scm_sys_isatty_p SCM_P ((SCM port)); +extern SCM scm_sys_fdopen SCM_P ((SCM fdes, SCM modes)); +extern SCM scm_sys_primitive_move_to_fdes SCM_P ((SCM port, SCM fd)); +extern void scm_setfileno SCM_P ((FILE *fs, int fd)); +extern void scm_evict_ports SCM_P ((int fd)); +extern SCM scm_fdes_to_ports SCM_P ((SCM fd)); +extern void scm_init_ioext SCM_P ((void)); #endif /* IOEXTH */ diff --git a/libguile/kw.c b/libguile/kw.c index 3bf6ba63a..bb26a4a96 100644 --- a/libguile/kw.c +++ b/libguile/kw.c @@ -49,28 +49,24 @@ #include "kw.h" -#ifdef __STDC__ -static scm_sizet -free_kw (SCM obj) -#else + +static scm_sizet free_kw SCM_P ((SCM obj)); + static scm_sizet free_kw (obj) SCM obj; -#endif { return 0; } -#ifdef __STDC__ -static int -prin_kw (SCM exp, SCM port, scm_print_state *pstate) -#else + +static int prin_kw SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int prin_kw (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { scm_gen_puts (scm_regular_string, ":", port); scm_gen_puts((SCM_MB_STRINGP(SCM_CDR (exp)) @@ -88,14 +84,10 @@ static scm_smobfuns kw_smob = {scm_markcdr, free_kw, prin_kw, 0}; SCM_PROC (s_make_keyword_from_dash_symbol, "make-keyword-from-dash-symbol", 1, 0, 0, scm_make_keyword_from_dash_symbol); -#ifdef __STDC__ -SCM -scm_make_keyword_from_dash_symbol (SCM symbol) -#else + SCM scm_make_keyword_from_dash_symbol (symbol) SCM symbol; -#endif { SCM vcell; @@ -120,14 +112,10 @@ scm_make_keyword_from_dash_symbol (symbol) } SCM_PROC(s_keyword_p, "keyword?", 1, 0, 0, scm_keyword_p); -#ifdef __STDC__ -SCM -scm_keyword_p (SCM obj) -#else + SCM scm_keyword_p (obj) SCM obj; -#endif { return ( (SCM_NIMP(obj) && SCM_KEYWORDP (obj)) ? SCM_BOOL_T @@ -137,14 +125,10 @@ scm_keyword_p (obj) SCM_PROC(s_keyword_dash_symbol, "keyword-dash-symbol", 1, 0, 0, scm_keyword_dash_symbol); -#ifdef __STDC__ -SCM -scm_keyword_dash_symbol (SCM kw) -#else + SCM scm_keyword_dash_symbol (kw) SCM kw; -#endif { SCM_ASSERT (SCM_NIMP (kw) && SCM_KEYWORDP (kw), kw, SCM_ARG1, s_keyword_dash_symbol); return SCM_CDR (kw); @@ -153,13 +137,9 @@ scm_keyword_dash_symbol (kw) -#ifdef __STDC__ -void -scm_init_kw (void) -#else + void scm_init_kw () -#endif { scm_tc16_kw = scm_newsmob (&kw_smob); scm_kw_obarray = scm_make_vector (SCM_MAKINUM (256), SCM_EOL, SCM_UNDEFINED); diff --git a/libguile/kw.h b/libguile/kw.h index 6cec7f659..89387c5b3 100644 --- a/libguile/kw.h +++ b/libguile/kw.h @@ -54,17 +54,10 @@ extern int scm_tc16_kw; -#ifdef __STDC__ -extern SCM scm_make_keyword_from_dash_symbol (SCM symbol); -extern SCM scm_keyword_p (SCM obj); -extern SCM scm_keyword_dash_symbol (SCM kw); -extern void scm_init_kw (void); -#else /* STDC */ -extern SCM scm_make_keyword_from_dash_symbol (); -extern SCM scm_keyword_p (); -extern SCM scm_keyword_dash_symbol (); -extern void scm_init_kw (); +extern SCM scm_make_keyword_from_dash_symbol SCM_P ((SCM symbol)); +extern SCM scm_keyword_p SCM_P ((SCM obj)); +extern SCM scm_keyword_dash_symbol SCM_P ((SCM kw)); +extern void scm_init_kw SCM_P ((void)); -#endif /* STDC */ #endif /* KWH */ diff --git a/libguile/libguile.h b/libguile/libguile.h index 824795864..8c3b16e87 100644 --- a/libguile/libguile.h +++ b/libguile/libguile.h @@ -122,14 +122,6 @@ #include "libguile/../threads/threads.h" #endif - -#ifdef __STDC__ - -#else /* STDC */ - -#endif /* STDC */ - - #endif /* LIBGUILEH */ diff --git a/libguile/mallocs.c b/libguile/mallocs.c index fa4fd77c9..78dd76307 100644 --- a/libguile/mallocs.c +++ b/libguile/mallocs.c @@ -37,30 +37,26 @@ -#ifdef __STDC__ -static scm_sizet -fmalloc(SCM ptr) -#else + +static scm_sizet fmalloc SCM_P ((SCM ptr)); + static scm_sizet fmalloc(ptr) SCM ptr; -#endif { if (SCM_MALLOCDATA (ptr)) free (SCM_MALLOCDATA (ptr)); return 0; } -#ifdef __STDC__ -static int -prinmalloc (SCM exp, SCM port, scm_print_state *pstate) -#else + +static int prinmalloc SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int prinmalloc (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { scm_gen_puts(scm_regular_string, "#multi-byte-string", 1, 0, 0, scm_multi_byte_string); SCM_PROC(s_multi_byte_string, "multi-byte-string", 0, 0, 1, scm_multi_byte_string); -#ifdef __STDC__ -SCM -scm_multi_byte_string (SCM chrs) -#else + SCM scm_multi_byte_string (chrs) SCM chrs; -#endif { SCM res; register char *data; @@ -125,15 +113,11 @@ scm_multi_byte_string (chrs) return res; } -#ifdef __STDC__ -int -scm_mb_ilength (unsigned char * data, int size) -#else + int scm_mb_ilength (data, size) unsigned char * data; int size; -#endif { int pos; int len; @@ -160,14 +144,10 @@ scm_mb_ilength (data, size) } SCM_PROC(s_multi_byte_string_length, "multi-byte-string-length", 1, 0, 0, scm_multi_byte_string_length); -#ifdef __STDC__ -SCM -scm_multi_byte_string_length (SCM str) -#else + SCM scm_multi_byte_string_length (str) SCM str; -#endif { int size; int len; @@ -184,28 +164,20 @@ scm_multi_byte_string_length (str) SCM_PROC(s_symbol_multi_byte_p, "symbol-multi-byte?", 1, 0, 0, scm_symbol_multi_byte_p); -#ifdef __STDC__ -SCM -scm_symbol_multi_byte_p (SCM symbol) -#else + SCM scm_symbol_multi_byte_p (symbol) SCM symbol; -#endif { return SCM_SYMBOL_MULTI_BYTE_STRINGP(symbol); } SCM_PROC(s_set_symbol_multi_byte_x, "set-symbol-multi-byte!", 2, 0, 0, scm_set_symbol_multi_byte_x); -#ifdef __STDC__ -SCM -scm_set_symbol_multi_byte_x (SCM symbol, SCM val) -#else + SCM scm_set_symbol_multi_byte_x (symbol, val) SCM symbol; SCM val; -#endif { if (SCM_TYP7 (symbol) == scm_tc7_msymbol) { @@ -218,14 +190,10 @@ scm_set_symbol_multi_byte_x (symbol, val) SCM_PROC(s_regular_port_p, "regular-port?", 1, 0, 0, scm_regular_port_p); -#ifdef __STDC__ -SCM -scm_regular_port_p (SCM p) -#else + SCM scm_regular_port_p (p) SCM p; -#endif { return (SCM_PORT_REPRESENTATION(p) == scm_regular_port ? SCM_BOOL_T @@ -233,28 +201,20 @@ scm_regular_port_p (p) } SCM_PROC(s_regular_port_x, "regular-port!", 1, 0, 0, scm_regular_port_x); -#ifdef __STDC__ -SCM -scm_regular_port_x (SCM p) -#else + SCM scm_regular_port_x (p) SCM p; -#endif { SCM_PORT_REPRESENTATION(p) = scm_regular_port; return SCM_UNSPECIFIED; } SCM_PROC(s_multi_byte_port_p, "multi-byte-port?", 1, 0, 0, scm_multi_byte_port_p); -#ifdef __STDC__ -SCM -scm_multi_byte_port_p (SCM p) -#else + SCM scm_multi_byte_port_p (p) SCM p; -#endif { return (SCM_PORT_REPRESENTATION(p) == scm_mb_port ? SCM_BOOL_T @@ -262,14 +222,10 @@ scm_multi_byte_port_p (p) } SCM_PROC(s_multi_byte_port_x, "multi-byte-port!", 1, 0, 0, scm_multi_byte_port_x); -#ifdef __STDC__ -SCM -scm_multi_byte_port_x (SCM p) -#else + SCM scm_multi_byte_port_x (p) SCM p; -#endif { SCM_PORT_REPRESENTATION(p) = scm_mb_port; return SCM_UNSPECIFIED; @@ -277,14 +233,10 @@ scm_multi_byte_port_x (p) SCM_PROC(s_wide_character_port_p, "wide-character-port?", 1, 0, 0, scm_wide_character_port_p); -#ifdef __STDC__ -SCM -scm_wide_character_port_p (SCM p) -#else + SCM scm_wide_character_port_p (p) SCM p; -#endif { return (SCM_PORT_REPRESENTATION(p) == scm_wchar_port ? SCM_BOOL_T @@ -292,14 +244,10 @@ scm_wide_character_port_p (p) } SCM_PROC(s_wide_character_port_x, "wide-character-port!", 1, 0, 0, scm_wide_character_port_x); -#ifdef __STDC__ -SCM -scm_wide_character_port_x (SCM p) -#else + SCM scm_wide_character_port_x (p) SCM p; -#endif { SCM_PORT_REPRESENTATION(p) = scm_wchar_port; return SCM_UNSPECIFIED; @@ -309,16 +257,12 @@ scm_wide_character_port_x (p) -#ifdef __STDC__ -void -scm_put_wchar (int c, SCM port, int writing) -#else + void scm_put_wchar (c, port, writing) int c; SCM port; int writing; -#endif { if (writing) scm_gen_puts (scm_regular_string, "#\\", port); @@ -379,16 +323,12 @@ scm_put_wchar (c, port, writing) -#ifdef __STDC__ -void -scm_print_mb_string (SCM exp, SCM port, int writing) -#else + void scm_print_mb_string (exp, port, writing) SCM exp; SCM port; int writing; -#endif { if (writing) { @@ -431,15 +371,11 @@ scm_print_mb_string (exp, port, writing) } -#ifdef __STDC__ -void -scm_print_mb_symbol (SCM exp, SCM port) -#else + void scm_print_mb_symbol (exp, port) SCM exp; SCM port; -#endif { int pos; int end; @@ -560,13 +496,9 @@ scm_print_mb_symbol (exp, port) -#ifdef __STDC__ -void -scm_init_mbstrings (void) -#else + void scm_init_mbstrings () -#endif { #include "mbstrings.x" } diff --git a/libguile/mbstrings.h b/libguile/mbstrings.h index 9c1414b97..84482c5a8 100644 --- a/libguile/mbstrings.h +++ b/libguile/mbstrings.h @@ -56,45 +56,23 @@ -#ifdef __STDC__ -extern SCM scm_multi_byte_string_p (SCM obj); -extern SCM scm_regular_string_p (SCM obj); -extern SCM scm_multi_byte_string (SCM chrs); -extern int scm_mb_ilength (unsigned char * data, int size); -extern SCM scm_multi_byte_string_length (SCM str); -extern SCM scm_symbol_multi_byte_p (SCM symbol); -extern SCM scm_set_symbol_multi_byte_x (SCM symbol, SCM val); -extern SCM scm_regular_port_p (SCM p); -extern SCM scm_regular_port_x (SCM p); -extern SCM scm_multi_byte_port_p (SCM p); -extern SCM scm_multi_byte_port_x (SCM p); -extern SCM scm_wide_character_port_p (SCM p); -extern SCM scm_wide_character_port_x (SCM p); -extern void scm_put_wchar (int c, SCM port, int writing); -extern void scm_print_mb_string (SCM exp, SCM port, int writing); -extern void scm_print_mb_symbol (SCM exp, SCM port); -extern void scm_init_mbstrings (void); - -#else /* STDC */ -extern SCM scm_multi_byte_string_p (); -extern SCM scm_regular_string_p (); -extern SCM scm_multi_byte_string (); -extern int scm_mb_ilength (); -extern SCM scm_multi_byte_string_length (); -extern SCM scm_symbol_multi_byte_p (); -extern SCM scm_set_symbol_multi_byte_x (); -extern SCM scm_regular_port_p (); -extern SCM scm_regular_port_x (); -extern SCM scm_multi_byte_port_p (); -extern SCM scm_multi_byte_port_x (); -extern SCM scm_wide_character_port_p (); -extern SCM scm_wide_character_port_x (); -extern void scm_put_wchar (); -extern void scm_print_mb_string (); -extern void scm_print_mb_symbol (); -extern void scm_init_mbstrings (); - -#endif /* STDC */ +extern SCM scm_multi_byte_string_p SCM_P ((SCM obj)); +extern SCM scm_regular_string_p SCM_P ((SCM obj)); +extern SCM scm_multi_byte_string SCM_P ((SCM chrs)); +extern int scm_mb_ilength SCM_P ((unsigned char * data, int size)); +extern SCM scm_multi_byte_string_length SCM_P ((SCM str)); +extern SCM scm_symbol_multi_byte_p SCM_P ((SCM symbol)); +extern SCM scm_set_symbol_multi_byte_x SCM_P ((SCM symbol, SCM val)); +extern SCM scm_regular_port_p SCM_P ((SCM p)); +extern SCM scm_regular_port_x SCM_P ((SCM p)); +extern SCM scm_multi_byte_port_p SCM_P ((SCM p)); +extern SCM scm_multi_byte_port_x SCM_P ((SCM p)); +extern SCM scm_wide_character_port_p SCM_P ((SCM p)); +extern SCM scm_wide_character_port_x SCM_P ((SCM p)); +extern void scm_put_wchar SCM_P ((int c, SCM port, int writing)); +extern void scm_print_mb_string SCM_P ((SCM exp, SCM port, int writing)); +extern void scm_print_mb_symbol SCM_P ((SCM exp, SCM port)); +extern void scm_init_mbstrings SCM_P ((void)); #endif /* MBSTRINGSH */ diff --git a/libguile/numbers.c b/libguile/numbers.c index ddae40229..811eace6f 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -83,14 +83,10 @@ SCM_PROC(s_exact_p, "exact?", 1, 0, 0, scm_exact_p); -#ifdef __STDC__ -SCM -scm_exact_p(SCM x) -#else + SCM scm_exact_p(x) SCM x; -#endif { if SCM_INUMP(x) return SCM_BOOL_T; #ifdef SCM_BIGDIG @@ -100,14 +96,10 @@ scm_exact_p(x) } SCM_PROC(s_odd_p, "odd?", 1, 0, 0, scm_odd_p); -#ifdef __STDC__ -SCM -scm_odd_p(SCM n) -#else + SCM scm_odd_p(n) SCM n; -#endif { #ifdef SCM_BIGDIG if SCM_NINUMP(n) { @@ -121,14 +113,10 @@ scm_odd_p(n) } SCM_PROC(s_even_p, "even?", 1, 0, 0, scm_even_p); -#ifdef __STDC__ -SCM -scm_even_p(SCM n) -#else + SCM scm_even_p(n) SCM n; -#endif { #ifdef SCM_BIGDIG if SCM_NINUMP(n) { @@ -142,14 +130,10 @@ scm_even_p(n) } SCM_PROC(s_abs, "abs", 1, 0, 0, scm_abs); -#ifdef __STDC__ -SCM -scm_abs(SCM x) -#else + SCM scm_abs(x) SCM x; -#endif { #ifdef SCM_BIGDIG if SCM_NINUMP(x) { @@ -172,15 +156,11 @@ scm_abs(x) } SCM_PROC(s_quotient, "quotient", 2, 0, 0, scm_quotient); -#ifdef __STDC__ -SCM -scm_quotient(SCM x, SCM y) -#else + SCM scm_quotient(x, y) SCM x; SCM y; -#endif { register long z; #ifdef SCM_BIGDIG @@ -255,15 +235,11 @@ scm_quotient(x, y) } SCM_PROC(s_remainder, "remainder", 2, 0, 0, scm_remainder); -#ifdef __STDC__ -SCM -scm_remainder(SCM x, SCM y) -#else + SCM scm_remainder(x, y) SCM x; SCM y; -#endif { register long z; #ifdef SCM_BIGDIG @@ -305,15 +281,11 @@ scm_remainder(x, y) } SCM_PROC(s_modulo, "modulo", 2, 0, 0, scm_modulo); -#ifdef __STDC__ -SCM -scm_modulo(SCM x, SCM y) -#else + SCM scm_modulo(x, y) SCM x; SCM y; -#endif { register long yy, z; #ifdef SCM_BIGDIG @@ -350,15 +322,11 @@ scm_modulo(x, y) } SCM_PROC1 (s_gcd, "gcd", scm_tc7_asubr, scm_gcd); -#ifdef __STDC__ -SCM -scm_gcd(SCM x, SCM y) -#else + SCM scm_gcd(x, y) SCM x; SCM y; -#endif { register long u, v, k, t; if SCM_UNBNDP(y) return SCM_UNBNDP(x) ? SCM_INUM0 : x; @@ -416,15 +384,11 @@ scm_gcd(x, y) } SCM_PROC1 (s_lcm, "lcm", scm_tc7_asubr, scm_lcm); -#ifdef __STDC__ -SCM -scm_lcm(SCM n1, SCM n2) -#else + SCM scm_lcm(n1, n2) SCM n1; SCM n2; -#endif { SCM d; if SCM_UNBNDP(n2) { @@ -444,60 +408,44 @@ scm_lcm(n1, n2) #ifndef scm_long2num SCM_PROC1 (s_logand, "logand", scm_tc7_asubr, scm_logand); -#ifdef __STDC__ -SCM -scm_logand(SCM n1, SCM n2) -#else + SCM scm_logand(n1, n2) SCM n1; SCM n2; -#endif { return scm_long2num(scm_num2long(n1, (char *)SCM_ARG1, s_logand) & scm_num2long(n2, (char *)SCM_ARG2, s_logand)); } SCM_PROC1 (s_logior, "logior", scm_tc7_asubr, scm_logior); -#ifdef __STDC__ -SCM -scm_logior(SCM n1, SCM n2) -#else + SCM scm_logior(n1, n2) SCM n1; SCM n2; -#endif { return scm_long2num(scm_num2long(n1, (char *)SCM_ARG1, s_logior) | scm_num2long(n2, (char *)SCM_ARG2, s_logior)); } SCM_PROC1 (s_logxor, "logxor", scm_tc7_asubr, scm_logxor); -#ifdef __STDC__ -SCM -scm_logxor(SCM n1, SCM n2) -#else + SCM scm_logxor(n1, n2) SCM n1; SCM n2; -#endif { return scm_long2num(scm_num2long(n1, (char *)SCM_ARG1, s_logxor) ^ scm_num2long(n2, (char *)SCM_ARG2, s_logxor)); } SCM_PROC(s_logtest, "logtest", 2, 0, 0, scm_logtest); -#ifdef __STDC__ -SCM -scm_logtest(SCM n1, SCM n2) -#else + SCM scm_logtest(n1, n2) SCM n1; SCM n2; -#endif { return ((scm_num2long (n1, (char *)SCM_ARG1, s_logtest) & scm_num2long (n2, (char *)SCM_ARG2, s_logtest)) @@ -506,15 +454,11 @@ scm_logtest(n1, n2) SCM_PROC(s_logbit_p, "logbit?", 2, 0, 0, scm_logbit_p); -#ifdef __STDC__ -SCM -scm_logbit_p(SCM n1, SCM n2) -#else + SCM scm_logbit_p(n1, n2) SCM n1; SCM n2; -#endif { return (((1 << scm_num2long (n1, (char *)SCM_ARG1, s_logtest)) & scm_num2long (n2, (char *)SCM_ARG2, s_logtest)) @@ -524,15 +468,11 @@ scm_logbit_p(n1, n2) #else SCM_PROC1 (s_logand, "logand", scm_tc7_asubr, scm_logand); -#ifdef __STDC__ -SCM -scm_logand(SCM n1, SCM n2) -#else + SCM scm_logand(n1, n2) SCM n1; SCM n2; -#endif { SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logand); SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logand); @@ -540,15 +480,11 @@ scm_logand(n1, n2) } SCM_PROC1 (s_logior, "logior", scm_tc7_asubr, scm_logior); -#ifdef __STDC__ -SCM -scm_logior(SCM n1, SCM n2) -#else + SCM scm_logior(n1, n2) SCM n1; SCM n2; -#endif { SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logior); SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logior); @@ -556,15 +492,11 @@ scm_logior(n1, n2) } SCM_PROC1 (s_logxor, "logxor", scm_tc7_asubr, scm_logxor); -#ifdef __STDC__ -SCM -scm_logxor(SCM n1, SCM n2) -#else + SCM scm_logxor(n1, n2) SCM n1; SCM n2; -#endif { SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logxor); SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logxor); @@ -572,15 +504,11 @@ scm_logxor(n1, n2) } SCM_PROC(s_logtest, "logtest", 2, 0, 0, scm_logtest); -#ifdef __STDC__ -SCM -scm_logtest(SCM n1, SCM n2) -#else + SCM scm_logtest(n1, n2) SCM n1; SCM n2; -#endif { SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logtest); SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logtest); @@ -588,15 +516,11 @@ scm_logtest(n1, n2) } SCM_PROC(s_logbit_p, "logbit?", 2, 0, 0, scm_logbit_p); -#ifdef __STDC__ -SCM -scm_logbit_p(SCM n1, SCM n2) -#else + SCM scm_logbit_p(n1, n2) SCM n1; SCM n2; -#endif { SCM_ASSERT(SCM_INUMP(n1) && SCM_INUM(n1) >= 0, n1, SCM_ARG1, s_logbit_p); SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logbit_p); @@ -605,29 +529,21 @@ scm_logbit_p(n1, n2) #endif SCM_PROC(s_lognot, "lognot", 1, 0, 0, scm_lognot); -#ifdef __STDC__ -SCM -scm_lognot(SCM n) -#else + SCM scm_lognot(n) SCM n; -#endif { SCM_ASSERT(SCM_INUMP(n), n, SCM_ARG1, s_lognot); return scm_difference(SCM_MAKINUM(-1L), n); } SCM_PROC(s_integer_expt, "integer-expt", 2, 0, 0, scm_integer_expt); -#ifdef __STDC__ -SCM -scm_integer_expt(SCM z1, SCM z2) -#else + SCM scm_integer_expt(z1, z2) SCM z1; SCM z2; -#endif { SCM acc = SCM_MAKINUM(1L); #ifdef SCM_BIGDIG @@ -650,15 +566,11 @@ scm_integer_expt(z1, z2) } SCM_PROC(s_ash, "ash", 2, 0, 0, scm_ash); -#ifdef __STDC__ -SCM -scm_ash(SCM n, SCM cnt) -#else + SCM scm_ash(n, cnt) SCM n; SCM cnt; -#endif { SCM res = SCM_INUM(n); SCM_ASSERT(SCM_INUMP(cnt), cnt, SCM_ARG2, s_ash); @@ -682,16 +594,12 @@ scm_ash(n, cnt) } SCM_PROC(s_bit_extract, "bit-extract", 3, 0, 0, scm_bit_extract); -#ifdef __STDC__ -SCM -scm_bit_extract(SCM n, SCM start, SCM end) -#else + SCM scm_bit_extract(n, start, end) SCM n; SCM start; SCM end; -#endif { SCM_ASSERT(SCM_INUMP(start), start, SCM_ARG2, s_bit_extract); SCM_ASSERT(SCM_INUMP(end), end, SCM_ARG3, s_bit_extract); @@ -711,14 +619,10 @@ scm_bit_extract(n, start, end) char scm_logtab[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; SCM_PROC(s_logcount, "logcount", 1, 0, 0, scm_logcount); -#ifdef __STDC__ -SCM -scm_logcount (SCM n) -#else + SCM scm_logcount(n) SCM n; -#endif { register unsigned long c = 0; register long nn; @@ -742,14 +646,10 @@ scm_logcount(n) char scm_ilentab[] = {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4}; SCM_PROC(s_integer_length, "integer-length", 1, 0, 0, scm_integer_length); -#ifdef __STDC__ -SCM -scm_integer_length(SCM n) -#else + SCM scm_integer_length(n) SCM n; -#endif { register unsigned long c = 0; register long nn; @@ -775,15 +675,11 @@ scm_integer_length(n) #ifdef SCM_BIGDIG char s_bignum[] = "bignum"; -#ifdef __STDC__ -SCM -scm_mkbig(scm_sizet nlen, int sign) -#else + SCM scm_mkbig(nlen, sign) scm_sizet nlen; int sign; -#endif { SCM v = nlen; if (((v << 16) >> 16) != nlen) @@ -796,15 +692,11 @@ scm_mkbig(nlen, sign) return v; } -#ifdef __STDC__ -SCM -scm_big2inum(SCM b, scm_sizet l) -#else + SCM scm_big2inum(b, l) SCM b; scm_sizet l; -#endif { unsigned long num = 0; SCM_BIGDIG *tmp = SCM_BDIGITS(b); @@ -818,15 +710,11 @@ scm_big2inum(b, l) char s_adjbig[] = "scm_adjbig"; -#ifdef __STDC__ -SCM -scm_adjbig(SCM b, scm_sizet nlen) -#else + SCM scm_adjbig(b, nlen) SCM b; scm_sizet nlen; -#endif { long nsiz = nlen; if (((nsiz << 16) >> 16) != nlen) scm_wta(SCM_MAKINUM(nsiz), (char *)SCM_NALLOC, s_adjbig); @@ -840,14 +728,10 @@ scm_adjbig(b, nlen) } -#ifdef __STDC__ -SCM -scm_normbig(SCM b) -#else + SCM scm_normbig(b) SCM b; -#endif { #ifndef _UNICOS scm_sizet nlen = SCM_NUMDIGS(b); @@ -863,15 +747,11 @@ scm_normbig(b) } -#ifdef __STDC__ -SCM -scm_copybig(SCM b, int sign) -#else + SCM scm_copybig(b, sign) SCM b; int sign; -#endif { scm_sizet i = SCM_NUMDIGS(b); SCM ans = scm_mkbig(i, sign); @@ -881,14 +761,10 @@ scm_copybig(b, sign) } -#ifdef __STDC__ -SCM -scm_long2big(long n) -#else + SCM scm_long2big(n) long n; -#endif { scm_sizet i = 0; SCM_BIGDIG *digits; @@ -903,14 +779,10 @@ scm_long2big(n) } #ifdef LONGLONGS -#ifdef __STDC__ -SCM -scm_long_long2big(long_long n) -#else + SCM scm_long_long2big(n) long_long n; -#endif { scm_sizet i; SCM_BIGDIG *digits; @@ -946,14 +818,10 @@ scm_long_long2big(n) } #endif -#ifdef __STDC__ -SCM -scm_2ulong2big(unsigned long * np) -#else + SCM scm_2ulong2big(np) unsigned long * np; -#endif { unsigned long n; scm_sizet i; @@ -979,14 +847,10 @@ scm_2ulong2big(np) } -#ifdef __STDC__ -SCM -scm_ulong2big(unsigned long n) -#else + SCM scm_ulong2big(n) unsigned long n; -#endif { scm_sizet i = 0; SCM_BIGDIG *digits; @@ -1000,15 +864,11 @@ scm_ulong2big(n) } -#ifdef __STDC__ -int -scm_bigcomp(SCM x, SCM y) -#else + int scm_bigcomp(x, y) SCM x; SCM y; -#endif { int xsign = SCM_BIGSIGN(x); int ysign = SCM_BIGSIGN(y); @@ -1025,14 +885,10 @@ scm_bigcomp(x, y) #ifndef SCM_DIGSTOOBIG -#ifdef __STDC__ -long -scm_pseudolong(long x) -#else + long scm_pseudolong(x) long x; -#endif { union { long l; @@ -1047,15 +903,11 @@ scm_pseudolong(x) #else -#ifdef __STDC__ -void -scm_longdigs(long x, SCM_BIGDIG digs[]) -#else + void scm_longdigs(x, digs) long x; SCM_BIGDIG digs[]; -#endif { scm_sizet i = 0; if (x < 0) x = -x; @@ -1064,10 +916,7 @@ scm_longdigs(x, digs) #endif -#ifdef __STDC__ -SCM -scm_addbig(SCM_BIGDIG *x, scm_sizet nx, int xsgn, SCM bigy, int sgny) -#else + SCM scm_addbig(x, nx, xsgn, bigy, sgny) SCM_BIGDIG *x; @@ -1075,7 +924,6 @@ scm_addbig(x, nx, xsgn, bigy, sgny) int xsgn; SCM bigy; int sgny; -#endif { /* Assumes nx <= SCM_NUMDIGS(bigy) */ /* Assumes xsgn and sgny scm_equal either 0 or 0x0100 */ @@ -1121,10 +969,7 @@ scm_addbig(x, nx, xsgn, bigy, sgny) return scm_normbig(z); } -#ifdef __STDC__ -SCM -scm_mulbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn) -#else + SCM scm_mulbig(x, nx, y, ny, sgn) SCM_BIGDIG *x; @@ -1132,7 +977,6 @@ scm_mulbig(x, nx, y, ny, sgn) SCM_BIGDIG *y; scm_sizet ny; int sgn; -#endif { scm_sizet i = 0, j = nx + ny; unsigned long n = 0; @@ -1153,16 +997,12 @@ scm_mulbig(x, nx, y, ny, sgn) return scm_normbig(z); } -#ifdef __STDC__ -unsigned int -scm_divbigdig(SCM_BIGDIG *ds, scm_sizet h, SCM_BIGDIG div) -#else + unsigned int scm_divbigdig(ds, h, div) SCM_BIGDIG *ds; scm_sizet h; SCM_BIGDIG div; -#endif { register unsigned long t2 = 0; while(h--) { @@ -1174,17 +1014,13 @@ scm_divbigdig(ds, h, div) } -#ifdef __STDC__ -SCM -scm_divbigint(SCM x, long z, int sgn, int mode) -#else + SCM scm_divbigint(x, z, sgn, mode) SCM x; long z; int sgn; int mode; -#endif { if (z < 0) z = -z; if (z < SCM_BIGRAD) { @@ -1208,10 +1044,7 @@ scm_divbigint(x, z, sgn, mode) } } -#ifdef __STDC__ -SCM -scm_divbigbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn, int modes) -#else + SCM scm_divbigbig(x, nx, y, ny, sgn, modes) SCM_BIGDIG *x; @@ -1220,7 +1053,6 @@ scm_divbigbig(x, nx, y, ny, sgn, modes) scm_sizet ny; int sgn; int modes; -#endif { /* modes description 0 remainder @@ -1336,15 +1168,13 @@ static double fx[] = {0.0, 5e-1, 5e-2, 5e-3, 5e-4, 5e-5, -#ifdef __STDC__ -static scm_sizet -idbl2str(double f, char *a) -#else + +static scm_sizet idbl2str SCM_P ((double f, char *a)); + static scm_sizet idbl2str(f, a) double f; char *a; -#endif { int efmt, dpt, d, i, wp = scm_dblprec; scm_sizet ch = 0; @@ -1430,15 +1260,13 @@ idbl2str(f, a) return ch; } -#ifdef __STDC__ -static scm_sizet -iflo2str(SCM flt, char *str) -#else + +static scm_sizet iflo2str SCM_P ((SCM flt, char *str)); + static scm_sizet iflo2str(flt, str) SCM flt; char *str; -#endif { scm_sizet i; # ifdef SCM_SINGLES @@ -1456,16 +1284,12 @@ iflo2str(flt, str) } #endif /* SCM_FLOATS */ -#ifdef __STDC__ -scm_sizet -scm_iint2str(long num, int rad, char *p) -#else + scm_sizet scm_iint2str(num, rad, p) long num; int rad; char *p; -#endif { scm_sizet j; register int i = 1, d; @@ -1485,15 +1309,13 @@ scm_iint2str(num, rad, p) #ifdef SCM_BIGDIG -#ifdef __STDC__ -static SCM -big2str(SCM b, register unsigned int radix) -#else + +static SCM big2str SCM_P ((SCM b, register unsigned int radix)); + static SCM big2str(b, radix) SCM b; register unsigned int radix; -#endif { SCM t = scm_copybig(b, 0); /* sign of temp doesn't matter */ register SCM_BIGDIG *ds = SCM_BDIGITS(t); @@ -1532,15 +1354,11 @@ big2str(b, radix) SCM_PROC(s_number_to_string, "number->string", 1, 1, 0, scm_number_to_string); -#ifdef __STDC__ -SCM -scm_number_to_string(SCM x, SCM radix) -#else + SCM scm_number_to_string(x, radix) SCM x; SCM radix; -#endif { if SCM_UNBNDP(radix) radix=SCM_MAKINUM(10L); else SCM_ASSERT(SCM_INUMP(radix), radix, SCM_ARG2, s_number_to_string); @@ -1579,16 +1397,12 @@ scm_number_to_string(x, radix) /* These print routines are stubbed here so that scm_repl.c doesn't need SCM_FLOATS or SCM_BIGDIGs conditionals */ -#ifdef __STDC__ -int -scm_floprint(SCM sexp, SCM port, scm_print_state *pstate) -#else + int scm_floprint(sexp, port, pstate) SCM sexp; SCM port; scm_print_state *pstate; -#endif { #ifdef SCM_FLOATS char num_buf[SCM_FLOBUFLEN]; @@ -1600,16 +1414,12 @@ scm_floprint(sexp, port, pstate) } -#ifdef __STDC__ -int -scm_bigprint(SCM exp, SCM port, scm_print_state *pstate) -#else + int scm_bigprint(exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { #ifdef SCM_BIGDIG exp = big2str(exp, (unsigned int)10); @@ -1623,6 +1433,8 @@ scm_bigprint(exp, port, pstate) /*** STRINGS -> NUMBERS ***/ +static SCM scm_small_istr2int SCM_P ((char *str, long len, long radix)); + static SCM scm_small_istr2int(str, len, radix) char *str; @@ -1667,16 +1479,12 @@ scm_small_istr2int(str, len, radix) } -#ifdef __STDC__ -SCM -scm_istr2int(char *str, long len, long radix) -#else + SCM scm_istr2int(str, len, radix) char *str; long len; long radix; -#endif { scm_sizet j; register scm_sizet k, blen = 1; @@ -1740,16 +1548,12 @@ scm_istr2int(str, len, radix) } #ifdef SCM_FLOATS -#ifdef __STDC__ -SCM -scm_istr2flo(char *str, long len, long radix) -#else + SCM scm_istr2flo(str, len, radix) char *str; long len; long radix; -#endif { register int c, i = 0; double lead_sgn; @@ -1941,16 +1745,12 @@ scm_istr2flo(str, len, radix) #endif /* SCM_FLOATS */ -#ifdef __STDC__ -SCM -scm_istring2number(char *str, long len, long radix) -#else + SCM scm_istring2number(str, len, radix) char *str; long len; long radix; -#endif { int i = 0; char ex = 0; @@ -1986,15 +1786,11 @@ scm_istring2number(str, len, radix) SCM_PROC(s_string_to_number, "string->number", 1, 1, 0, scm_string_to_number); -#ifdef __STDC__ -SCM -scm_string_to_number(SCM str, SCM radix) -#else + SCM scm_string_to_number(str, radix) SCM str; SCM radix; -#endif { SCM answer; if SCM_UNBNDP(radix) radix=SCM_MAKINUM(10L); @@ -2006,15 +1802,11 @@ scm_string_to_number(str, radix) /*** END strs->nums ***/ #ifdef SCM_FLOATS -#ifdef __STDC__ -SCM -scm_makdbl (double x, double y) -#else + SCM scm_makdbl (x, y) double x; double y; -#endif { SCM z; if ((y==0.0) && (x==0.0)) return scm_flo0; @@ -2048,15 +1840,11 @@ scm_makdbl (x, y) #endif -#ifdef __STDC__ -SCM -scm_bigequal(SCM x, SCM y) -#else + SCM scm_bigequal(x, y) SCM x; SCM y; -#endif { #ifdef SCM_BIGDIG if (0==scm_bigcomp(x, y)) return SCM_BOOL_T; @@ -2065,15 +1853,11 @@ scm_bigequal(x, y) } -#ifdef __STDC__ -SCM -scm_floequal(SCM x, SCM y) -#else + SCM scm_floequal(x, y) SCM x; SCM y; -#endif { #ifdef SCM_FLOATS if (SCM_REALPART(x) != SCM_REALPART(y)) return SCM_BOOL_F; @@ -2087,14 +1871,10 @@ scm_floequal(x, y) SCM_PROC(s_number_p, "number?", 1, 0, 0, scm_number_p); SCM_PROC(s_complex_p, "complex?", 1, 0, 0, scm_number_p); -#ifdef __STDC__ -SCM -scm_number_p(SCM x) -#else + SCM scm_number_p(x) SCM x; -#endif { if SCM_INUMP(x) return SCM_BOOL_T; #ifdef SCM_FLOATS @@ -2112,14 +1892,10 @@ scm_number_p(x) #ifdef SCM_FLOATS SCM_PROC(s_real_p, "real?", 1, 0, 0, scm_real_p); SCM_PROC(s_rational_p, "rational?", 1, 0, 0, scm_real_p); -#ifdef __STDC__ -SCM -scm_real_p(SCM x) -#else + SCM scm_real_p(x) SCM x; -#endif { if (SCM_INUMP(x)) return SCM_BOOL_T; @@ -2137,14 +1913,10 @@ scm_real_p(x) SCM_PROC(s_int_p, "int?", 1, 0, 0, scm_int_p); -#ifdef __STDC__ -SCM -scm_int_p(SCM x) -#else + SCM scm_int_p(x) SCM x; -#endif { double r; if SCM_INUMP(x) return SCM_BOOL_T; @@ -2164,14 +1936,10 @@ scm_int_p(x) #endif /* SCM_FLOATS */ SCM_PROC(s_inexact_p, "inexact?", 1, 0, 0, scm_inexact_p); -#ifdef __STDC__ -SCM -scm_inexact_p(SCM x) -#else + SCM scm_inexact_p(x) SCM x; -#endif { #ifdef SCM_FLOATS if (SCM_NIMP(x) && SCM_INEXP(x)) return SCM_BOOL_T; @@ -2183,15 +1951,11 @@ scm_inexact_p(x) SCM_PROC1 (s_eq_p, "=?", scm_tc7_rpsubr, scm_num_eq_p); -#ifdef __STDC__ -SCM -scm_num_eq_p (SCM x, SCM y) -#else + SCM scm_num_eq_p (x, y) SCM x; SCM y; -#endif { #ifdef SCM_FLOATS SCM t; @@ -2269,15 +2033,11 @@ scm_num_eq_p (x, y) SCM_PROC1 (s_less_p, "?", scm_tc7_rpsubr, scm_gr_p); -#ifdef __STDC__ -SCM -scm_gr_p(SCM x, SCM y) -#else + SCM scm_gr_p(x, y) SCM x; SCM y; -#endif { return scm_less_p(y, x); } @@ -2365,15 +2121,11 @@ scm_gr_p(x, y) SCM_PROC1 (s_leq_p, "<=?", scm_tc7_rpsubr, scm_leq_p); -#ifdef __STDC__ -SCM -scm_leq_p(SCM x, SCM y) -#else + SCM scm_leq_p(x, y) SCM x; SCM y; -#endif { return SCM_BOOL_NOT(scm_less_p(y, x)); } @@ -2381,15 +2133,11 @@ scm_leq_p(x, y) SCM_PROC1 (s_geq_p, ">=?", scm_tc7_rpsubr, scm_geq_p); -#ifdef __STDC__ -SCM -scm_geq_p(SCM x, SCM y) -#else + SCM scm_geq_p(x, y) SCM x; SCM y; -#endif { return SCM_BOOL_NOT(scm_less_p(x, y)); } @@ -2397,14 +2145,10 @@ scm_geq_p(x, y) SCM_PROC(s_zero_p, "zero?", 1, 0, 0, scm_zero_p); -#ifdef __STDC__ -SCM -scm_zero_p(SCM z) -#else + SCM scm_zero_p(z) SCM z; -#endif { #ifdef SCM_FLOATS if SCM_NINUMP(z) { @@ -2436,14 +2180,10 @@ scm_zero_p(z) SCM_PROC(s_positive_p, "positive?", 1, 0, 0, scm_positive_p); -#ifdef __STDC__ -SCM -scm_positive_p(SCM x) -#else + SCM scm_positive_p(x) SCM x; -#endif { #ifdef SCM_FLOATS if SCM_NINUMP(x) { @@ -2475,14 +2215,10 @@ scm_positive_p(x) SCM_PROC(s_negative_p, "negative?", 1, 0, 0, scm_negative_p); -#ifdef __STDC__ -SCM -scm_negative_p(SCM x) -#else + SCM scm_negative_p(x) SCM x; -#endif { #ifdef SCM_FLOATS if SCM_NINUMP(x) { @@ -2513,15 +2249,11 @@ scm_negative_p(x) SCM_PROC1 (s_max, "max", scm_tc7_asubr, scm_max); -#ifdef __STDC__ -SCM -scm_max(SCM x, SCM y) -#else + SCM scm_max(x, y) SCM x; SCM y; -#endif { #ifdef SCM_FLOATS double z; @@ -2604,15 +2336,11 @@ scm_max(x, y) SCM_PROC1 (s_min, "min", scm_tc7_asubr, scm_min); -#ifdef __STDC__ -SCM -scm_min(SCM x, SCM y) -#else + SCM scm_min(x, y) SCM x; SCM y; -#endif { #ifdef SCM_FLOATS double z; @@ -2693,15 +2421,11 @@ scm_min(x, y) SCM_PROC1 (s_sum, "+", scm_tc7_asubr, scm_sum); -#ifdef __STDC__ -SCM -scm_sum(SCM x, SCM y) -#else + SCM scm_sum(x, y) SCM x; SCM y; -#endif { if SCM_UNBNDP(y) { if SCM_UNBNDP(x) return SCM_INUM0; @@ -2818,15 +2542,11 @@ scm_sum(x, y) SCM_PROC1 (s_difference, "-", scm_tc7_asubr, scm_difference); -#ifdef __STDC__ -SCM -scm_difference(SCM x, SCM y) -#else + SCM scm_difference(x, y) SCM x; SCM y; -#endif { #ifdef SCM_FLOATS if SCM_NINUMP(x) { @@ -2961,15 +2681,11 @@ scm_difference(x, y) SCM_PROC1 (s_product, "*", scm_tc7_asubr, scm_product); -#ifdef __STDC__ -SCM -scm_product(SCM x, SCM y) -#else + SCM scm_product(x, y) SCM x; SCM y; -#endif { if SCM_UNBNDP(y) { if SCM_UNBNDP(x) return SCM_MAKINUM(1L); @@ -3113,15 +2829,11 @@ scm_product(x, y) } -#ifdef __STDC__ -double -scm_num2dbl (SCM a, char * why) -#else + double scm_num2dbl (a, why) SCM a; char * why; -#endif { if (SCM_INUMP (a)) return (double) SCM_INUM (a); @@ -3139,28 +2851,20 @@ scm_num2dbl (a, why) SCM_PROC(s_fuck, "fuck", 1, 0, 0, scm_fuck); -#ifdef __STDC__ -SCM -scm_fuck (SCM a) -#else + SCM scm_fuck (a) SCM a; -#endif { return scm_makdbl (scm_num2dbl (a, "just because"), 0.0); } SCM_PROC1 (s_divide, "/", scm_tc7_asubr, scm_divide); -#ifdef __STDC__ -SCM -scm_divide(SCM x, SCM y) -#else + SCM scm_divide(x, y) SCM x; SCM y; -#endif { #ifdef SCM_FLOATS double d, r, i, a; @@ -3337,14 +3041,10 @@ scm_divide(x, y) #ifdef SCM_FLOATS SCM_PROC1 (s_asinh, "$asinh", scm_tc7_cxr, (SCM (*)()) scm_asinh); -#ifdef __STDC__ -double -scm_asinh(double x) -#else + double scm_asinh(x) double x; -#endif { return log(x+sqrt(x*x+1)); } @@ -3353,14 +3053,10 @@ scm_asinh(x) SCM_PROC1 (s_acosh, "$acosh", scm_tc7_cxr, (SCM (*)()) scm_acosh); -#ifdef __STDC__ -double -scm_acosh(double x) -#else + double scm_acosh(x) double x; -#endif { return log(x+sqrt(x*x-1)); } @@ -3369,14 +3065,10 @@ scm_acosh(x) SCM_PROC1 (s_atanh, "$atanh", scm_tc7_cxr, (SCM (*)()) scm_atanh); -#ifdef __STDC__ -double -scm_atanh(double x) -#else + double scm_atanh(x) double x; -#endif { return 0.5*log((1+x)/(1-x)); } @@ -3385,14 +3077,10 @@ scm_atanh(x) SCM_PROC1 (s_truncate, "truncate", scm_tc7_cxr, (SCM (*)()) scm_truncate); -#ifdef __STDC__ -double -scm_truncate(double x) -#else + double scm_truncate(x) double x; -#endif { if (x < 0.0) return -floor(-x); return floor(x); @@ -3401,14 +3089,10 @@ scm_truncate(x) SCM_PROC1 (s_round, "round", scm_tc7_cxr, (SCM (*)()) scm_round); -#ifdef __STDC__ -double -scm_round(double x) -#else + double scm_round(x) double x; -#endif { double plus_half = x + 0.5; double result = floor(plus_half); @@ -3420,14 +3104,10 @@ scm_round(x) SCM_PROC1 (s_exact_to_inexact, "exact->inexact", scm_tc7_cxr, (SCM (*)()) scm_exact_to_inexact); -#ifdef __STDC__ -double -scm_exact_to_inexact(double z) -#else + double scm_exact_to_inexact(z) double z; -#endif { return z; } @@ -3451,6 +3131,8 @@ SCM_PROC1 (s_i_tanh, "$tanh", scm_tc7_cxr, (SCM (*)())tanh); struct dpair {double x, y;}; +static void scm_two_doubles SCM_P ((SCM z1, SCM z2, char *sstring, struct dpair *xy)); + static void scm_two_doubles(z1, z2, sstring, xy) SCM z1, z2; @@ -3495,15 +3177,11 @@ scm_two_doubles(z1, z2, sstring, xy) SCM_PROC(s_sys_expt, "$expt", 2, 0, 0, scm_sys_expt); -#ifdef __STDC__ -SCM -scm_sys_expt(SCM z1, SCM z2) -#else + SCM scm_sys_expt(z1, z2) SCM z1; SCM z2; -#endif { struct dpair xy; scm_two_doubles(z1, z2, s_sys_expt, &xy); @@ -3513,15 +3191,11 @@ scm_sys_expt(z1, z2) SCM_PROC(s_sys_atan2, "$atan2", 2, 0, 0, scm_sys_atan2); -#ifdef __STDC__ -SCM -scm_sys_atan2(SCM z1, SCM z2) -#else + SCM scm_sys_atan2(z1, z2) SCM z1; SCM z2; -#endif { struct dpair xy; scm_two_doubles(z1, z2, s_sys_atan2, &xy); @@ -3531,15 +3205,11 @@ scm_sys_atan2(z1, z2) SCM_PROC(s_make_rectangular, "make-rectangular", 2, 0, 0, scm_make_rectangular); -#ifdef __STDC__ -SCM -scm_make_rectangular(SCM z1, SCM z2) -#else + SCM scm_make_rectangular(z1, z2) SCM z1; SCM z2; -#endif { struct dpair xy; scm_two_doubles(z1, z2, s_make_rectangular, &xy); @@ -3549,15 +3219,11 @@ scm_make_rectangular(z1, z2) SCM_PROC(s_make_polar, "make-polar", 2, 0, 0, scm_make_polar); -#ifdef __STDC__ -SCM -scm_make_polar(SCM z1, SCM z2) -#else + SCM scm_make_polar(z1, z2) SCM z1; SCM z2; -#endif { struct dpair xy; scm_two_doubles(z1, z2, s_make_polar, &xy); @@ -3568,14 +3234,10 @@ scm_make_polar(z1, z2) SCM_PROC(s_real_part, "real-part", 1, 0, 0, scm_real_part); -#ifdef __STDC__ -SCM -scm_real_part(SCM z) -#else + SCM scm_real_part(z) SCM z; -#endif { if SCM_NINUMP(z) { # ifdef SCM_BIGDIG @@ -3596,14 +3258,10 @@ scm_real_part(z) SCM_PROC(s_imag_part, "imag-part", 1, 0, 0, scm_imag_part); -#ifdef __STDC__ -SCM -scm_imag_part(SCM z) -#else + SCM scm_imag_part(z) SCM z; -#endif { if SCM_INUMP(z) return SCM_INUM0; # ifdef SCM_BIGDIG @@ -3623,14 +3281,10 @@ scm_imag_part(z) SCM_PROC(s_magnitude, "magnitude", 1, 0, 0, scm_magnitude); -#ifdef __STDC__ -SCM -scm_magnitude(SCM z) -#else + SCM scm_magnitude(z) SCM z; -#endif { if SCM_INUMP(z) return scm_abs(z); # ifdef SCM_BIGDIG @@ -3655,14 +3309,10 @@ scm_magnitude(z) SCM_PROC(s_angle, "angle", 1, 0, 0, scm_angle); -#ifdef __STDC__ -SCM -scm_angle(SCM z) -#else + SCM scm_angle(z) SCM z; -#endif { double x, y = 0.0; if SCM_INUMP(z) {x = (z>=SCM_INUM0) ? 1.0 : -1.0; goto do_angle;} @@ -3688,14 +3338,10 @@ scm_angle(z) SCM_PROC(s_inexact_to_exact, "inexact->exact", 1, 0, 0, scm_inexact_to_exact); -#ifdef __STDC__ -SCM -scm_inexact_to_exact(SCM z) -#else + SCM scm_inexact_to_exact(z) SCM z; -#endif { if SCM_INUMP(z) return z; # ifdef SCM_BIGDIG @@ -3728,14 +3374,10 @@ scm_inexact_to_exact(z) #else /* ~SCM_FLOATS */ SCM_PROC(s_trunc, "truncate", 1, 0, 0, scm_trunc); -#ifdef __STDC__ -SCM -scm_trunc(SCM x) -#else + SCM scm_trunc(x) SCM x; -#endif { SCM_ASSERT(SCM_INUMP(x), x, SCM_ARG1, s_truncate); return x; @@ -3748,14 +3390,10 @@ scm_trunc(x) #ifdef SCM_BIGDIG # ifdef SCM_FLOATS /* d must be integer */ -#ifdef __STDC__ -SCM -scm_dbl2big(double d) -#else + SCM scm_dbl2big(d) double d; -#endif { scm_sizet i = 0; long c; @@ -3780,14 +3418,10 @@ scm_dbl2big(d) -#ifdef __STDC__ -double -scm_big2dbl(SCM b) -#else + double scm_big2dbl(b) SCM b; -#endif { double ans = 0.0; scm_sizet i = SCM_NUMDIGS(b); @@ -3799,14 +3433,10 @@ scm_big2dbl(b) # endif #endif -#ifdef __STDC__ -SCM -scm_long2num(long sl) -#else + SCM scm_long2num(sl) long sl; -#endif { if (!SCM_FIXABLE(sl)) { #ifdef SCM_BIGDIG @@ -3824,14 +3454,10 @@ scm_long2num(sl) #ifdef LONGLONGS -#ifdef __STDC__ -SCM -scm_long_long2num(long_long sl) -#else + SCM scm_long_long2num(sl) long_long sl; -#endif { if (!SCM_FIXABLE(sl)) { #ifdef SCM_BIGDIG @@ -3849,14 +3475,10 @@ scm_long_long2num(sl) #endif -#ifdef __STDC__ -SCM -scm_ulong2num(unsigned long sl) -#else + SCM scm_ulong2num(sl) unsigned long sl; -#endif { if (!SCM_POSFIXABLE(sl)) { #ifdef SCM_BIGDIG @@ -3872,16 +3494,12 @@ scm_ulong2num(sl) return SCM_MAKINUM(sl); } -#ifdef __STDC__ -long -scm_num2long(SCM num, char *pos, char *s_caller) -#else + long scm_num2long(num, pos, s_caller) SCM num; char *pos; char *s_caller; -#endif { long res; if (SCM_INUMP(num)) @@ -3927,16 +3545,12 @@ scm_num2long(num, pos, s_caller) -#ifdef __STDC__ -long -num2long(SCM num, char *pos, char *s_caller) -#else + long num2long(num, pos, s_caller) SCM num; char *pos; char *s_caller; -#endif { long res; if SCM_INUMP(num) { @@ -3969,16 +3583,12 @@ num2long(num, pos, s_caller) #ifdef LONGLONGS -#ifdef __STDC__ -long_long -scm_num2long_long(SCM num, char *pos, char *s_caller) -#else + long_long scm_num2long_long(num, pos, s_caller) SCM num; char *pos; char *s_caller; -#endif { long_long res; if SCM_INUMP(num) { @@ -4011,16 +3621,12 @@ scm_num2long_long(num, pos, s_caller) #endif -#ifdef __STDC__ -unsigned long -scm_num2ulong(SCM num, char *pos, char *s_caller) -#else + unsigned long scm_num2ulong(num, pos, s_caller) SCM num; char *pos; char *s_caller; -#endif { unsigned long res; if (SCM_INUMP(num)) @@ -4063,6 +3669,7 @@ scm_num2ulong(num, pos, s_caller) #ifdef SCM_FLOATS # ifndef DBL_DIG +static void add1 SCM_P ((double f, double *fsum)); static void add1(f, fsum) double f, *fsum; { @@ -4072,13 +3679,9 @@ static void add1(f, fsum) #endif -#ifdef __STDC__ -void -scm_init_numbers (void) -#else + void scm_init_numbers () -#endif { #ifdef SCM_FLOATS SCM_NEWCELL(scm_flo0); diff --git a/libguile/numbers.h b/libguile/numbers.h index c16d39a94..2f0c37ccc 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -225,206 +225,100 @@ typedef struct scm_dbl -#ifdef __STDC__ -extern SCM scm_exact_p(SCM x); -extern SCM scm_odd_p(SCM n); -extern SCM scm_even_p(SCM n); -extern SCM scm_abs(SCM x); -extern SCM scm_quotient(SCM x, SCM y); -extern SCM scm_remainder(SCM x, SCM y); -extern SCM scm_modulo(SCM x, SCM y); -extern SCM scm_gcd(SCM x, SCM y); -extern SCM scm_lcm(SCM n1, SCM n2); -extern SCM scm_logand(SCM n1, SCM n2); -extern SCM scm_logior(SCM n1, SCM n2); -extern SCM scm_logxor(SCM n1, SCM n2); -extern SCM scm_logtest(SCM n1, SCM n2); -extern SCM scm_logbit_p(SCM n1, SCM n2); -extern SCM scm_lognot(SCM n); -extern SCM scm_integer_expt(SCM z1, SCM z2); -extern SCM scm_ash(SCM n, SCM cnt); -extern SCM scm_bit_extract(SCM n, SCM start, SCM end); -extern SCM scm_logcount (SCM n); -extern SCM scm_integer_length(SCM n); -extern SCM scm_mkbig(scm_sizet nlen, int sign); -extern SCM scm_big2inum(SCM b, scm_sizet l); -extern SCM scm_adjbig(SCM b, scm_sizet nlen); -extern SCM scm_normbig(SCM b); -extern SCM scm_copybig(SCM b, int sign); -extern SCM scm_long2big(long n); -extern SCM scm_long_long2big(long_long n); -extern SCM scm_2ulong2big(unsigned long * np); -extern SCM scm_ulong2big(unsigned long n); -extern int scm_bigcomp(SCM x, SCM y); -extern long scm_pseudolong(long x); -extern void scm_longdigs(long x, SCM_BIGDIG digs[]); -extern SCM scm_addbig(SCM_BIGDIG *x, scm_sizet nx, int xsgn, SCM bigy, int sgny); -extern SCM scm_mulbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn); -extern unsigned int scm_divbigdig(SCM_BIGDIG *ds, scm_sizet h, SCM_BIGDIG div); -extern SCM scm_divbigint(SCM x, long z, int sgn, int mode); -extern SCM scm_divbigbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn, int modes); -extern scm_sizet scm_iint2str(long num, int rad, char *p); -extern SCM scm_number_to_string(SCM x, SCM radix); -extern int scm_floprint(SCM sexp, SCM port, scm_print_state *pstate); -extern int scm_bigprint(SCM exp, SCM port, scm_print_state *pstate); -extern SCM scm_istr2int(char *str, long len, long radix); -extern SCM scm_istr2flo(char *str, long len, long radix); -extern SCM scm_istring2number(char *str, long len, long radix); -extern SCM scm_string_to_number(SCM str, SCM radix); -extern SCM scm_makdbl (double x, double y); -extern SCM scm_bigequal(SCM x, SCM y); -extern SCM scm_floequal(SCM x, SCM y); -extern SCM scm_number_p(SCM x); -extern SCM scm_real_p(SCM x); -extern SCM scm_int_p(SCM x); -extern SCM scm_inexact_p(SCM x); -extern SCM scm_num_eq_p (SCM x, SCM y); -extern SCM scm_less_p(SCM x, SCM y); -extern SCM scm_gr_p(SCM x, SCM y); -extern SCM scm_leq_p(SCM x, SCM y); -extern SCM scm_geq_p(SCM x, SCM y); -extern SCM scm_zero_p(SCM z); -extern SCM scm_positive_p(SCM x); -extern SCM scm_negative_p(SCM x); -extern SCM scm_max(SCM x, SCM y); -extern SCM scm_min(SCM x, SCM y); -extern SCM scm_sum(SCM x, SCM y); -extern SCM scm_difference(SCM x, SCM y); -extern SCM scm_product(SCM x, SCM y); -extern double scm_num2dbl (SCM a, char * why); -extern SCM scm_fuck (SCM a); -extern SCM scm_divide(SCM x, SCM y); -extern double scm_asinh(double x); -extern double scm_acosh(double x); -extern double scm_atanh(double x); -extern double scm_truncate(double x); -extern double scm_round(double x); -extern double scm_exact_to_inexact(double z); -extern SCM scm_sys_expt(SCM z1, SCM z2); -extern SCM scm_sys_atan2(SCM z1, SCM z2); -extern SCM scm_make_rectangular(SCM z1, SCM z2); -extern SCM scm_make_polar(SCM z1, SCM z2); -extern SCM scm_real_part(SCM z); -extern SCM scm_imag_part(SCM z); -extern SCM scm_magnitude(SCM z); -extern SCM scm_angle(SCM z); -extern SCM scm_inexact_to_exact(SCM z); -extern SCM scm_trunc(SCM x); -extern SCM scm_dbl2big(double d); -extern double scm_big2dbl(SCM b); -extern SCM scm_long2num(long sl); -extern SCM scm_long_long2num(long_long sl); -extern SCM scm_ulong2num(unsigned long sl); -extern long scm_num2long(SCM num, char *pos, char *s_caller); -extern long num2long(SCM num, char *pos, char *s_caller); -extern long_long scm_num2long_long(SCM num, char *pos, char *s_caller); -extern unsigned long scm_num2ulong(SCM num, char *pos, char *s_caller); -extern void scm_init_numbers (void); - -#else /* STDC */ -extern SCM scm_exact_p(); -extern SCM scm_odd_p(); -extern SCM scm_even_p(); -extern SCM scm_abs(); -extern SCM scm_quotient(); -extern SCM scm_remainder(); -extern SCM scm_modulo(); -extern SCM scm_gcd(); -extern SCM scm_lcm(); -extern SCM scm_logand(); -extern SCM scm_logior(); -extern SCM scm_logxor(); -extern SCM scm_logtest(); -extern SCM scm_logbit_p(); -extern SCM scm_logand(); -extern SCM scm_logior(); -extern SCM scm_logxor(); -extern SCM scm_logtest(); -extern SCM scm_logbit_p(); -extern SCM scm_lognot(); -extern SCM scm_integer_expt(); -extern SCM scm_ash(); -extern SCM scm_bit_extract(); -extern SCM scm_logcount (); -extern SCM scm_integer_length(); -extern SCM scm_mkbig(); -extern SCM scm_big2inum(); -extern SCM scm_adjbig(); -extern SCM scm_normbig(); -extern SCM scm_copybig(); -extern SCM scm_long2big(); -extern SCM scm_long_long2big(); -extern SCM scm_2ulong2big(); -extern SCM scm_ulong2big(); -extern int scm_bigcomp(); -extern long scm_pseudolong(); -extern void scm_longdigs(); -extern SCM scm_addbig(); -extern SCM scm_mulbig(); -extern unsigned int scm_divbigdig(); -extern SCM scm_divbigint(); -extern SCM scm_divbigbig(); -extern scm_sizet scm_iint2str(); -extern SCM scm_number_to_string(); -extern int scm_floprint(); -extern int scm_bigprint(); -extern SCM scm_istr2int(); -extern SCM scm_istr2int(); -extern SCM scm_istr2flo(); -extern SCM scm_istring2number(); -extern SCM scm_string_to_number(); -extern SCM scm_makdbl (); -extern SCM scm_bigequal(); -extern SCM scm_floequal(); -extern SCM scm_number_p(); -extern SCM scm_real_p(); -extern SCM scm_int_p(); -extern SCM scm_inexact_p(); -extern SCM scm_num_eq_p (); -extern SCM scm_less_p(); -extern SCM scm_gr_p(); -extern SCM scm_leq_p(); -extern SCM scm_geq_p(); -extern SCM scm_zero_p(); -extern SCM scm_positive_p(); -extern SCM scm_negative_p(); -extern SCM scm_max(); -extern SCM scm_min(); -extern SCM scm_sum(); -extern SCM scm_difference(); -extern SCM scm_product(); -extern double scm_num2dbl (); -extern SCM scm_fuck (); -extern SCM scm_divide(); -extern double scm_asinh(); -extern double scm_acosh(); -extern double scm_atanh(); -extern double scm_truncate(); -extern double scm_round(); -extern double scm_exact_to_inexact(); -extern SCM scm_sys_expt(); -extern SCM scm_sys_atan2(); -extern SCM scm_make_rectangular(); -extern SCM scm_make_polar(); -extern SCM scm_real_part(); -extern SCM scm_imag_part(); -extern SCM scm_magnitude(); -extern SCM scm_angle(); -extern SCM scm_inexact_to_exact(); -extern SCM scm_trunc(); -extern SCM scm_dbl2big(); -extern double scm_big2dbl(); -extern SCM scm_long2num(); -extern SCM scm_long_long2num(); -extern SCM scm_ulong2num(); -extern long scm_num2long(); -extern long num2long(); -extern long_long scm_num2long_long(); -extern unsigned long scm_num2ulong(); -extern void scm_init_numbers (); - -#endif /* STDC */ - +extern SCM scm_exact_p SCM_P ((SCM x)); +extern SCM scm_odd_p SCM_P ((SCM n)); +extern SCM scm_even_p SCM_P ((SCM n)); +extern SCM scm_abs SCM_P ((SCM x)); +extern SCM scm_quotient SCM_P ((SCM x, SCM y)); +extern SCM scm_remainder SCM_P ((SCM x, SCM y)); +extern SCM scm_modulo SCM_P ((SCM x, SCM y)); +extern SCM scm_gcd SCM_P ((SCM x, SCM y)); +extern SCM scm_lcm SCM_P ((SCM n1, SCM n2)); +extern SCM scm_logand SCM_P ((SCM n1, SCM n2)); +extern SCM scm_logior SCM_P ((SCM n1, SCM n2)); +extern SCM scm_logxor SCM_P ((SCM n1, SCM n2)); +extern SCM scm_logtest SCM_P ((SCM n1, SCM n2)); +extern SCM scm_logbit_p SCM_P ((SCM n1, SCM n2)); +extern SCM scm_lognot SCM_P ((SCM n)); +extern SCM scm_integer_expt SCM_P ((SCM z1, SCM z2)); +extern SCM scm_ash SCM_P ((SCM n, SCM cnt)); +extern SCM scm_bit_extract SCM_P ((SCM n, SCM start, SCM end)); +extern SCM scm_logcount SCM_P ((SCM n)); +extern SCM scm_integer_length SCM_P ((SCM n)); +extern SCM scm_mkbig SCM_P ((scm_sizet nlen, int sign)); +extern SCM scm_big2inum SCM_P ((SCM b, scm_sizet l)); +extern SCM scm_adjbig SCM_P ((SCM b, scm_sizet nlen)); +extern SCM scm_normbig SCM_P ((SCM b)); +extern SCM scm_copybig SCM_P ((SCM b, int sign)); +extern SCM scm_long2big SCM_P ((long n)); +extern SCM scm_long_long2big SCM_P ((long_long n)); +extern SCM scm_2ulong2big SCM_P ((unsigned long * np)); +extern SCM scm_ulong2big SCM_P ((unsigned long n)); +extern int scm_bigcomp SCM_P ((SCM x, SCM y)); +extern long scm_pseudolong SCM_P ((long x)); +extern void scm_longdigs SCM_P ((long x, SCM_BIGDIG digs[])); +extern SCM scm_addbig SCM_P ((SCM_BIGDIG *x, scm_sizet nx, int xsgn, SCM bigy, int sgny)); +extern SCM scm_mulbig SCM_P ((SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn)); +extern unsigned int scm_divbigdig SCM_P ((SCM_BIGDIG *ds, scm_sizet h, SCM_BIGDIG div)); +extern SCM scm_divbigint SCM_P ((SCM x, long z, int sgn, int mode)); +extern SCM scm_divbigbig SCM_P ((SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn, int modes)); +extern scm_sizet scm_iint2str SCM_P ((long num, int rad, char *p)); +extern SCM scm_number_to_string SCM_P ((SCM x, SCM radix)); +extern int scm_floprint SCM_P ((SCM sexp, SCM port, scm_print_state *pstate)); +extern int scm_bigprint SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); +extern SCM scm_istr2int SCM_P ((char *str, long len, long radix)); +extern SCM scm_istr2flo SCM_P ((char *str, long len, long radix)); +extern SCM scm_istring2number SCM_P ((char *str, long len, long radix)); +extern SCM scm_string_to_number SCM_P ((SCM str, SCM radix)); +extern SCM scm_makdbl SCM_P ((double x, double y)); +extern SCM scm_bigequal SCM_P ((SCM x, SCM y)); +extern SCM scm_floequal SCM_P ((SCM x, SCM y)); +extern SCM scm_number_p SCM_P ((SCM x)); +extern SCM scm_real_p SCM_P ((SCM x)); +extern SCM scm_int_p SCM_P ((SCM x)); +extern SCM scm_inexact_p SCM_P ((SCM x)); +extern SCM scm_num_eq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_less_p SCM_P ((SCM x, SCM y)); +extern SCM scm_gr_p SCM_P ((SCM x, SCM y)); +extern SCM scm_leq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_geq_p SCM_P ((SCM x, SCM y)); +extern SCM scm_zero_p SCM_P ((SCM z)); +extern SCM scm_positive_p SCM_P ((SCM x)); +extern SCM scm_negative_p SCM_P ((SCM x)); +extern SCM scm_max SCM_P ((SCM x, SCM y)); +extern SCM scm_min SCM_P ((SCM x, SCM y)); +extern SCM scm_sum SCM_P ((SCM x, SCM y)); +extern SCM scm_difference SCM_P ((SCM x, SCM y)); +extern SCM scm_product SCM_P ((SCM x, SCM y)); +extern double scm_num2dbl SCM_P ((SCM a, char * why)); +extern SCM scm_fuck SCM_P ((SCM a)); +extern SCM scm_divide SCM_P ((SCM x, SCM y)); +extern double scm_asinh SCM_P ((double x)); +extern double scm_acosh SCM_P ((double x)); +extern double scm_atanh SCM_P ((double x)); +extern double scm_truncate SCM_P ((double x)); +extern double scm_round SCM_P ((double x)); +extern double scm_exact_to_inexact SCM_P ((double z)); +extern SCM scm_sys_expt SCM_P ((SCM z1, SCM z2)); +extern SCM scm_sys_atan2 SCM_P ((SCM z1, SCM z2)); +extern SCM scm_make_rectangular SCM_P ((SCM z1, SCM z2)); +extern SCM scm_make_polar SCM_P ((SCM z1, SCM z2)); +extern SCM scm_real_part SCM_P ((SCM z)); +extern SCM scm_imag_part SCM_P ((SCM z)); +extern SCM scm_magnitude SCM_P ((SCM z)); +extern SCM scm_angle SCM_P ((SCM z)); +extern SCM scm_inexact_to_exact SCM_P ((SCM z)); +extern SCM scm_trunc SCM_P ((SCM x)); +extern SCM scm_dbl2big SCM_P ((double d)); +extern double scm_big2dbl SCM_P ((SCM b)); +extern SCM scm_long2num SCM_P ((long sl)); +extern SCM scm_long_long2num SCM_P ((long_long sl)); +extern SCM scm_ulong2num SCM_P ((unsigned long sl)); +extern long scm_num2long SCM_P ((SCM num, char *pos, char *s_caller)); +extern long num2long SCM_P ((SCM num, char *pos, char *s_caller)); +extern long_long scm_num2long_long SCM_P ((SCM num, char *pos, char *s_caller)); +extern unsigned long scm_num2ulong SCM_P ((SCM num, char *pos, char *s_caller)); +extern void scm_init_numbers SCM_P ((void)); #endif /* NUMBERSH */ diff --git a/libguile/objprop.c b/libguile/objprop.c index 1337c1221..f644a6694 100644 --- a/libguile/objprop.c +++ b/libguile/objprop.c @@ -53,29 +53,21 @@ */ SCM_PROC(s_object_properties, "object-properties", 1, 0, 0, scm_object_properties); -#ifdef __STDC__ -SCM -scm_object_properties (SCM obj) -#else + SCM scm_object_properties (obj) SCM obj; -#endif { return scm_hashq_ref (scm_object_whash, obj, SCM_EOL); } SCM_PROC(s_set_object_properties_x, "set-object-properties!", 2, 0, 0, scm_set_object_properties_x); -#ifdef __STDC__ -SCM -scm_set_object_properties_x (SCM obj, SCM plist) -#else + SCM scm_set_object_properties_x (obj, plist) SCM obj; SCM plist; -#endif { SCM handle = scm_hashq_create_handle_x (scm_object_whash, obj, plist); SCM_SETCDR (handle, plist); @@ -83,15 +75,11 @@ scm_set_object_properties_x (obj, plist) } SCM_PROC(s_object_property, "object-property", 2, 0, 0, scm_object_property); -#ifdef __STDC__ -SCM -scm_object_property (SCM obj, SCM key) -#else + SCM scm_object_property (obj, key) SCM obj; SCM key; -#endif { SCM assoc; assoc = scm_assq (key, SCM_CDR (scm_object_properties (obj))); @@ -99,16 +87,12 @@ scm_object_property (obj, key) } SCM_PROC(s_set_object_property_x, "set-object-property!", 3, 0, 0, scm_set_object_property_x); -#ifdef __STDC__ -SCM -scm_set_object_property_x (SCM obj, SCM key, SCM val) -#else + SCM scm_set_object_property_x (obj, key, val) SCM obj; SCM key; SCM val; -#endif { SCM h; SCM assoc; @@ -126,13 +110,9 @@ scm_set_object_property_x (obj, key, val) return val; } -#ifdef __STDC__ -void -scm_init_objprop (void) -#else + void scm_init_objprop () -#endif { scm_object_whash = scm_make_weak_key_hash_table (SCM_MAKINUM (511)); #include "objprop.x" diff --git a/libguile/objprop.h b/libguile/objprop.h index a1a19c241..89a662346 100644 --- a/libguile/objprop.h +++ b/libguile/objprop.h @@ -52,22 +52,11 @@ -#ifdef __STDC__ -extern SCM scm_object_properties (SCM obj); -extern SCM scm_set_object_properties_x (SCM obj, SCM plist); -extern SCM scm_object_property (SCM obj, SCM key); -extern SCM scm_set_object_property_x (SCM obj, SCM key, SCM val); -extern void scm_init_objprop (void); - -#else /* STDC */ -extern SCM scm_object_properties (); -extern SCM scm_set_object_properties_x (); -extern SCM scm_object_property (); -extern SCM scm_set_object_property_x (); -extern void scm_init_objprop (); - -#endif /* STDC */ - +extern SCM scm_object_properties SCM_P ((SCM obj)); +extern SCM scm_set_object_properties_x SCM_P ((SCM obj, SCM plist)); +extern SCM scm_object_property SCM_P ((SCM obj, SCM key)); +extern SCM scm_set_object_property_x SCM_P ((SCM obj, SCM key, SCM val)); +extern void scm_init_objprop SCM_P ((void)); #endif /* OBJPROPH */ diff --git a/libguile/options.c b/libguile/options.c index 0960539ba..ade12e2ee 100644 --- a/libguile/options.c +++ b/libguile/options.c @@ -114,17 +114,13 @@ SCM_SYMBOL (scm_yes_sym, "yes"); SCM_SYMBOL (scm_no_sym, "no"); -#ifdef __STDC__ -SCM -scm_options (SCM new_mode, scm_option options[], int n, char *s) -#else + SCM scm_options (new_mode, options, n, s) SCM new_mode; scm_option options[]; int n; char *s; -#endif { int i, docp = (!SCM_UNBNDP (new_mode) && (SCM_IMP (new_mode) || SCM_NCONSP (new_mode))); @@ -204,16 +200,12 @@ scm_options (new_mode, options, n, s) return ans; } -#ifdef __STDC__ -void -scm_init_opts (SCM (*func) (SCM), scm_option options[], int n) -#else + void scm_init_opts (func, options, n) SCM (*func) (SCM); scm_option options[]; int n; -#endif { int i; @@ -227,13 +219,9 @@ scm_init_opts (func, options, n) func (SCM_UNDEFINED); } -#ifdef __STDC__ -void -scm_init_options (void) -#else + void scm_init_options () -#endif { #include "options.x" } diff --git a/libguile/options.h b/libguile/options.h index d0462af61..62b0a7436 100644 --- a/libguile/options.h +++ b/libguile/options.h @@ -65,14 +65,9 @@ typedef struct scm_option extern SCM scm_yes_sym, scm_no_sym; -#ifdef __STDC__ -extern SCM scm_options (SCM new_mode, scm_option options[], int n, char *s); -extern void scm_init_opts (SCM (*func) (SCM), scm_option options[], int n); -extern void scm_init_options (void); -#else /* STDC */ -extern SCM scm_options (); -extern void scm_init_opts (); -extern void scm_init_options (); -#endif /* STDC */ + +extern SCM scm_options SCM_P ((SCM new_mode, scm_option options[], int n, char *s)); +extern void scm_init_opts SCM_P ((SCM (*func) (SCM), scm_option options[], int n)); +extern void scm_init_options SCM_P ((void)); #endif /* OPTIONSH */ diff --git a/libguile/pairs.c b/libguile/pairs.c index 26cd3da1f..02e9cc09d 100644 --- a/libguile/pairs.c +++ b/libguile/pairs.c @@ -42,30 +42,17 @@ #include #include "_scm.h" -#ifdef __STDC__ -#include -#define var_start(x, y) va_start(x, y) -#else -#include -#define var_start(x, y) va_start(x) -#endif - - /* {Pairs} */ SCM_PROC(s_cons, "cons", 2, 0, 0, scm_cons); -#ifdef __STDC__ -SCM -scm_cons (SCM x, SCM y) -#else + SCM scm_cons (x, y) SCM x; SCM y; -#endif { register SCM z; SCM_NEWCELL (z); @@ -74,16 +61,12 @@ scm_cons (x, y) return z; } -#ifdef __STDC__ -SCM -scm_cons2 (SCM w, SCM x, SCM y) -#else + SCM scm_cons2 (w, x, y) SCM w; SCM x; SCM y; -#endif { register SCM z; SCM_NEWCELL (z); @@ -98,29 +81,21 @@ scm_cons2 (w, x, y) SCM_PROC(s_pair_p, "pair?", 1, 0, 0, scm_pair_p); -#ifdef __STDC__ -SCM -scm_pair_p(SCM x) -#else + SCM scm_pair_p(x) SCM x; -#endif { if SCM_IMP(x) return SCM_BOOL_F; return SCM_CONSP(x) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC(s_set_car_x, "set-car!", 2, 0, 0, scm_set_car_x); -#ifdef __STDC__ -SCM -scm_set_car_x(SCM pair, SCM value) -#else + SCM scm_set_car_x(pair, value) SCM pair; SCM value; -#endif { SCM_ASSERT(SCM_NIMP(pair) && SCM_CONSP(pair), pair, SCM_ARG1, s_set_car_x); SCM_CAR(pair) = value; @@ -128,15 +103,11 @@ scm_set_car_x(pair, value) } SCM_PROC(s_set_cdr_x, "set-cdr!", 2, 0, 0, scm_set_cdr_x); -#ifdef __STDC__ -SCM -scm_set_cdr_x(SCM pair, SCM value) -#else + SCM scm_set_cdr_x(pair, value) SCM pair; SCM value; -#endif { SCM_ASSERT(SCM_NIMP(pair) && SCM_CONSP(pair), pair, SCM_ARG1, s_set_cdr_x); SCM_CDR(pair) = value; @@ -182,13 +153,9 @@ static scm_iproc cxrs[] = }; -#ifdef __STDC__ -void -scm_init_pairs (void) -#else + void scm_init_pairs () -#endif { scm_init_iprocs(cxrs, scm_tc7_cxr); #include "pairs.x" diff --git a/libguile/pairs.h b/libguile/pairs.h index fd0771115..9cbca3541 100644 --- a/libguile/pairs.h +++ b/libguile/pairs.h @@ -149,21 +149,12 @@ typedef SCM huge *SCMPTR; } -#ifdef __STDC__ -extern SCM scm_cons (SCM x, SCM y); -extern SCM scm_cons2 (SCM w, SCM x, SCM y); -extern SCM scm_pair_p(SCM x); -extern SCM scm_set_car_x(SCM pair, SCM value); -extern SCM scm_set_cdr_x(SCM pair, SCM value); -extern void scm_init_pairs (void); - -#else /* STDC */ -extern SCM scm_cons (); -extern SCM scm_cons2 (); -extern SCM scm_pair_p(); -extern SCM scm_set_car_x(); -extern SCM scm_set_cdr_x(); -extern void scm_init_pairs (); - -#endif /* STDC */ + +extern SCM scm_cons SCM_P ((SCM x, SCM y)); +extern SCM scm_cons2 SCM_P ((SCM w, SCM x, SCM y)); +extern SCM scm_pair_p SCM_P ((SCM x)); +extern SCM scm_set_car_x SCM_P ((SCM pair, SCM value)); +extern SCM scm_set_cdr_x SCM_P ((SCM pair, SCM value)); +extern void scm_init_pairs SCM_P ((void)); + #endif /* PAIRSH */ diff --git a/libguile/ports.c b/libguile/ports.c index 12381ddf4..96f256d11 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -73,14 +73,10 @@ scm_ptobfuns *scm_ptobs; scm_sizet scm_numptob; -#ifdef __STDC__ -SCM -scm_markstream (SCM ptr) -#else + SCM scm_markstream (ptr) SCM ptr; -#endif { int openp; if (SCM_GC8MARKP (ptr)) @@ -94,14 +90,10 @@ scm_markstream (ptr) } -#ifdef __STDC__ -long -scm_newptob (scm_ptobfuns *ptob) -#else + long scm_newptob (ptob) scm_ptobfuns *ptob; -#endif { char *tmp; if (255 <= scm_numptob) @@ -131,14 +123,10 @@ scm_newptob (ptob) /* internal SCM call */ -#ifdef __STDC__ -void -scm_fflush (SCM port) -#else + void scm_fflush (port) SCM port; -#endif { scm_sizet i = SCM_PTOBNUM (port); (scm_ptobs[i].fflush) (SCM_STREAM (port)); @@ -154,14 +142,12 @@ scm_fflush (port) # ifndef GO32 # include # include -#ifdef __STDC__ -static int -input_waiting (FILE *f) -#else + +static int input_waiting SCM_P ((FILE *f)); + static int input_waiting (f) FILE *f; -#endif { if (feof (f)) return 1; @@ -190,14 +176,12 @@ input_waiting (f) # endif -#ifdef __STDC__ -static int -input_waiting(FILE *f) -#else + +static int input_waiting SCM_P ((FILE *f)); + static int input_waiting(f) FILE *f; -#endif { # ifdef FIONREAD long remir; @@ -211,14 +195,10 @@ input_waiting(f) #endif SCM_PROC(s_char_ready_p, "char-ready?", 1, 0, 0, scm_char_ready_p); -#ifdef __STDC__ -SCM -scm_char_ready_p (SCM port) -#else + SCM scm_char_ready_p (port) SCM port; -#endif { if (SCM_UNBNDP (port)) port = scm_cur_inp; @@ -233,14 +213,10 @@ scm_char_ready_p (port) SCM_PROC (s_ungetc_char_ready_p, "ungetc-char-ready?", 1, 0, 0, scm_ungetc_char_ready_p); -#ifdef __STDC__ -SCM -scm_ungetc_char_ready_p (SCM port) -#else + SCM scm_ungetc_char_ready_p (port) SCM port; -#endif { if (SCM_UNBNDP (port)) port = scm_cur_inp; @@ -258,50 +234,34 @@ scm_ungetc_char_ready_p (port) /* {Standard Ports} */ SCM_PROC(s_current_input_port, "current-input-port", 0, 0, 0, scm_current_input_port); -#ifdef __STDC__ -SCM -scm_current_input_port (void) -#else + SCM scm_current_input_port () -#endif { return scm_cur_inp; } SCM_PROC(s_current_output_port, "current-output-port", 0, 0, 0, scm_current_output_port); -#ifdef __STDC__ -SCM -scm_current_output_port (void) -#else + SCM scm_current_output_port () -#endif { return scm_cur_outp; } SCM_PROC(s_current_error_port, "current-error-port", 0, 0, 0, scm_current_error_port); -#ifdef __STDC__ -SCM -scm_current_error_port (void) -#else + SCM scm_current_error_port () -#endif { return scm_cur_errp; } SCM_PROC(s_set_current_input_port, "set-current-input-port", 1, 0, 0, scm_set_current_input_port); -#ifdef __STDC__ -SCM -scm_set_current_input_port (SCM port) -#else + SCM scm_set_current_input_port (port) SCM port; -#endif { SCM oinp = scm_cur_inp; SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_set_current_input_port); @@ -311,14 +271,10 @@ scm_set_current_input_port (port) SCM_PROC(s_set_current_output_port, "set-current-output-port", 1, 0, 0, scm_set_current_output_port); -#ifdef __STDC__ -SCM -scm_set_current_output_port (SCM port) -#else + SCM scm_set_current_output_port (port) SCM port; -#endif { SCM ooutp = scm_cur_outp; SCM_ASSERT (SCM_NIMP (port) && SCM_OPOUTPORTP (port), port, SCM_ARG1, s_set_current_output_port); @@ -328,14 +284,10 @@ scm_set_current_output_port (port) SCM_PROC(s_set_current_error_port, "set-current-error-port", 1, 0, 0, scm_set_current_error_port); -#ifdef __STDC__ -SCM -scm_set_current_error_port (SCM port) -#else + SCM scm_set_current_error_port (port) SCM port; -#endif { SCM oerrp = scm_cur_errp; SCM_ASSERT (SCM_NIMP (port) && SCM_OPOUTPORTP (port), port, SCM_ARG1, s_set_current_error_port); @@ -356,14 +308,10 @@ int scm_port_table_size = 0; /* Number of ports in scm_port_table. */ int scm_port_table_room = 20; /* Size of the array. */ /* Add a port to the table. Call with SCM_DEFER_INTS active. */ -#ifdef __STDC__ -struct scm_port_table * -scm_add_to_port_table (SCM port) -#else + struct scm_port_table * scm_add_to_port_table (port) SCM port; -#endif { if (scm_port_table_size == scm_port_table_room) { @@ -388,14 +336,10 @@ scm_add_to_port_table (port) } /* Remove a port from the table. Call with SCM_DEFER_INTS active. */ -#ifdef __STDC__ -void -scm_remove_from_port_table (SCM port) -#else + void scm_remove_from_port_table (port) SCM port; -#endif { int i = 0; while (scm_port_table[i]->port != port) @@ -416,27 +360,19 @@ scm_remove_from_port_table (port) /* Undocumented functions for debugging. */ /* Return the number of ports in the table. */ static char s_pt_size[] = "pt-size"; -#ifdef __STDC__ -SCM -scm_pt_size (void) -#else + SCM scm_pt_size () -#endif { return SCM_MAKINUM (scm_port_table_size); } /* Return the ith member of the port table. */ static char s_pt_member[] = "pt-member"; -#ifdef __STDC__ -SCM -scm_pt_member (SCM member) -#else + SCM scm_pt_member (member) SCM member; -#endif { int i; SCM_ASSERT (SCM_INUMP (member), member, SCM_ARG1, s_pt_member); @@ -452,14 +388,10 @@ scm_pt_member (member) /* Find a port in the table and return its revealed count. Also used by the garbage collector. */ -#ifdef __STDC__ -int -scm_revealed_count (SCM port) -#else + int scm_revealed_count (port) SCM port; -#endif { return SCM_REVEALED(port); } @@ -469,14 +401,10 @@ scm_revealed_count (port) /* Return the revealed count for a port. */ SCM_PROC(s_port_revealed, "port-revealed", 1, 0, 0, scm_port_revealed); -#ifdef __STDC__ -SCM -scm_port_revealed (SCM port) -#else + SCM scm_port_revealed (port) SCM port; -#endif { SCM_ASSERT (SCM_NIMP (port) && SCM_PORTP (port), port, SCM_ARG1, s_port_revealed); return SCM_MAKINUM (scm_revealed_count (port)); @@ -484,15 +412,11 @@ scm_port_revealed (port) /* Set the revealed count for a port. */ SCM_PROC(s_set_port_revealed_x, "set-port-revealed!", 2, 0, 0, scm_set_port_revealed_x); -#ifdef __STDC__ -SCM -scm_set_port_revealed_x (SCM port, SCM rcount) -#else + SCM scm_set_port_revealed_x (port, rcount) SCM port; SCM rcount; -#endif { SCM_ASSERT (SCM_NIMP (port) && SCM_PORTP (port), port, SCM_ARG1, s_set_port_revealed_x); SCM_ASSERT (SCM_INUMP (rcount), rcount, SCM_ARG2, s_set_port_revealed_x); @@ -506,14 +430,10 @@ scm_set_port_revealed_x (port, rcount) * Call the close operation on a port object. */ SCM_PROC(s_close_port, "close-port", 1, 0, 0, scm_close_port); -#ifdef __STDC__ -SCM -scm_close_port (SCM port) -#else + SCM scm_close_port (port) SCM port; -#endif { scm_sizet i; SCM_ASSERT (SCM_NIMP (port) && SCM_PORTP (port), port, SCM_ARG1, s_close_port); @@ -530,14 +450,10 @@ scm_close_port (port) } SCM_PROC(s_close_all_ports_except, "close-all-ports-except", 0, 0, 1, scm_close_all_ports_except); -#ifdef __STDC__ -SCM -scm_close_all_ports_except (SCM ports) -#else + SCM scm_close_all_ports_except (ports) SCM ports; -#endif { int i = 0; SCM_ASSERT (SCM_NIMP (ports) && SCM_CONSP (ports), ports, SCM_ARG1, s_close_all_ports_except); @@ -568,14 +484,10 @@ scm_close_all_ports_except (ports) } SCM_PROC(s_input_port_p, "input-port?", 1, 0, 0, scm_input_port_p); -#ifdef __STDC__ -SCM -scm_input_port_p (SCM x) -#else + SCM scm_input_port_p (x) SCM x; -#endif { if (SCM_IMP (x)) return SCM_BOOL_F; @@ -583,14 +495,10 @@ scm_input_port_p (x) } SCM_PROC(s_output_port_p, "output-port?", 1, 0, 0, scm_output_port_p); -#ifdef __STDC__ -SCM -scm_output_port_p (SCM x) -#else + SCM scm_output_port_p (x) SCM x; -#endif { if (SCM_IMP (x)) return SCM_BOOL_F; @@ -599,27 +507,19 @@ scm_output_port_p (x) SCM_PROC(s_eof_object_p, "eof-object?", 1, 0, 0, scm_eof_object_p); -#ifdef __STDC__ -SCM -scm_eof_object_p (SCM x) -#else + SCM scm_eof_object_p (x) SCM x; -#endif { return (SCM_EOF_VAL == x) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC(s_force_output, "force-output", 0, 1, 0, scm_force_output); -#ifdef __STDC__ -SCM -scm_force_output (SCM port) -#else + SCM scm_force_output (port) SCM port; -#endif { if (SCM_UNBNDP (port)) port = scm_cur_outp; @@ -634,14 +534,10 @@ scm_force_output (port) SCM_PROC(s_read_char, "read-char", 0, 1, 0, scm_read_char); -#ifdef __STDC__ -SCM -scm_read_char (SCM port) -#else + SCM scm_read_char (port) SCM port; -#endif { int c; if (SCM_UNBNDP (port)) @@ -656,14 +552,10 @@ scm_read_char (port) SCM_PROC(s_peek_char, "peek-char", 0, 1, 0, scm_peek_char); -#ifdef __STDC__ -SCM -scm_peek_char (SCM port) -#else + SCM scm_peek_char (port) SCM port; -#endif { int c; if (SCM_UNBNDP (port)) @@ -678,15 +570,11 @@ scm_peek_char (port) } SCM_PROC (s_unread_char, "unread-char", 2, 0, 0, scm_unread_char); -#ifdef __STDC__ -SCM -scm_unread_char (SCM cobj, SCM port) -#else + SCM scm_unread_char (cobj, port) SCM cobj; SCM port; -#endif { int c; @@ -707,14 +595,10 @@ scm_unread_char (cobj, port) SCM_PROC (s_port_line, "port-line", 0, 1, 0, scm_port_line); -#ifdef __STDC__ -SCM -scm_port_line (SCM port) -#else + SCM scm_port_line (port) SCM port; -#endif { SCM p; p = ((port == SCM_UNDEFINED) @@ -727,14 +611,10 @@ scm_port_line (port) } SCM_PROC (s_port_column, "port-column", 0, 1, 0, scm_port_column); -#ifdef __STDC__ -SCM -scm_port_column (SCM port) -#else + SCM scm_port_column (port) SCM port; -#endif { SCM p; p = ((port == SCM_UNDEFINED) @@ -747,14 +627,10 @@ scm_port_column (port) } SCM_PROC (s_port_filename, "port-filename", 0, 1, 0, scm_port_filename); -#ifdef __STDC__ -SCM -scm_port_filename (SCM port) -#else + SCM scm_port_filename (port) SCM port; -#endif { SCM p; p = ((port == SCM_UNDEFINED) @@ -767,15 +643,11 @@ scm_port_filename (port) } SCM_PROC (s_set_port_filename_x, "set-port-filename!", 1, 1, 0, scm_set_port_filename_x); -#ifdef __STDC__ -SCM -scm_set_port_filename_x (SCM port, SCM filename) -#else + SCM scm_set_port_filename_x (port, filename) SCM port; SCM filename; -#endif { if (filename == SCM_UNDEFINED) { @@ -794,16 +666,12 @@ scm_set_port_filename_x (port, filename) extern char * ttyname(); #endif -#ifdef __STDC__ -void -scm_prinport (SCM exp, SCM port, char *type) -#else + void scm_prinport (exp, port, type) SCM exp; SCM port; char *type; -#endif { scm_gen_puts (scm_regular_string, "#<", port); if (SCM_CLOSEDP (exp)) @@ -837,13 +705,9 @@ scm_prinport (exp, port, type) scm_gen_putc ('>', port); } -#ifdef __STDC__ -void -scm_ports_prehistory (void) -#else + void scm_ports_prehistory () -#endif { scm_numptob = 0; scm_ptobs = (scm_ptobfuns *) malloc (sizeof (scm_ptobfuns)); @@ -902,51 +766,43 @@ write_void_port (ptr, size, nitems, strm) return len; } -#ifdef __STDC__ -static int -flush_void_port (SCM strm) -#else + +static int flush_void_port SCM_P ((SCM strm)); + static int flush_void_port (strm) SCM strm; -#endif { return 0; } -#ifdef __STDC__ -static int -getc_void_port (SCM strm) -#else + +static int getc_void_port SCM_P ((SCM strm)); + static int getc_void_port (strm) SCM strm; -#endif { return EOF; } -#ifdef __STDC__ -static int -close_void_port (SCM strm) -#else + +static int close_void_port SCM_P ((SCM strm)); + static int close_void_port (strm) SCM strm; -#endif { return 0; /* this is ignored by scm_close_port. */ } -#ifdef __STDC__ -static int -noop0 (FILE *stream) -#else + +static int noop0 SCM_P ((SCM stream)); + static int noop0 (stream) - FILE *stream; -#endif + SCM stream; { return 0; } @@ -968,14 +824,10 @@ static struct scm_ptobfuns void_port_ptob = -#ifdef __STDC__ -SCM -scm_void_port (char * mode_str) -#else + SCM scm_void_port (mode_str) char * mode_str; -#endif { int mode_bits; SCM answer; @@ -994,14 +846,10 @@ scm_void_port (mode_str) SCM_PROC (s_sys_make_void_port, "%make-void-port", 1, 0, 0, scm_sys_make_void_port); -#ifdef __STDC__ -SCM -scm_sys_make_void_port (SCM mode) -#else + SCM scm_sys_make_void_port (mode) SCM mode; -#endif { SCM_ASSERT (SCM_NIMP (mode) && SCM_STRINGP (mode), mode, SCM_ARG1, s_sys_make_void_port); @@ -1013,13 +861,9 @@ scm_sys_make_void_port (mode) -#ifdef __STDC__ -void -scm_init_ports (void) -#else + void scm_init_ports () -#endif { scm_tc16_void_port = scm_newptob (&void_port_ptob); #include "ports.x" diff --git a/libguile/posix.c b/libguile/posix.c index 5d70baf34..f3676fdd1 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -188,13 +188,9 @@ char *strptime (); SCM_PROC (s_sys_pipe, "pipe", 0, 0, 0, scm_sys_pipe); -#ifdef __STDC__ -SCM -scm_sys_pipe (void) -#else + SCM scm_sys_pipe () -#endif { int fd[2], rv; FILE *f_rd, *f_wt; @@ -240,13 +236,9 @@ scm_sys_pipe () SCM_PROC (s_sys_getgroups, "getgroups", 0, 0, 0, scm_sys_getgroups); -#ifdef __STDC__ -SCM -scm_sys_getgroups(void) -#else + SCM scm_sys_getgroups() -#endif { SCM grps, ans; int ngroups = getgroups (0, NULL); @@ -279,14 +271,10 @@ scm_sys_getgroups() SCM_PROC (s_sys_getpwuid, "getpw", 0, 1, 0, scm_sys_getpwuid); -#ifdef __STDC__ -SCM -scm_sys_getpwuid (SCM user) -#else + SCM scm_sys_getpwuid (user) SCM user; -#endif { SCM result; struct passwd *entry; @@ -335,14 +323,10 @@ scm_sys_getpwuid (user) SCM_PROC (s_setpwent, "setpw", 0, 1, 0, scm_setpwent); -#ifdef __STDC__ -SCM -scm_setpwent (SCM arg) -#else + SCM scm_setpwent (arg) SCM arg; -#endif { if (SCM_UNBNDP (arg) || SCM_FALSEP (arg)) endpwent (); @@ -355,14 +339,10 @@ scm_setpwent (arg) /* Combines getgrgid and getgrnam. */ SCM_PROC (s_sys_getgrgid, "getgr", 0, 1, 0, scm_sys_getgrgid); -#ifdef __STDC__ -SCM -scm_sys_getgrgid (SCM name) -#else + SCM scm_sys_getgrgid (name) SCM name; -#endif { SCM result; struct group *entry; @@ -395,14 +375,10 @@ scm_sys_getgrgid (name) SCM_PROC (s_setgrent, "setgr", 0, 1, 0, scm_setgrent); -#ifdef __STDC__ -SCM -scm_setgrent (SCM arg) -#else + SCM scm_setgrent (arg) SCM arg; -#endif { if (SCM_UNBNDP (arg) || SCM_FALSEP (arg)) endgrent (); @@ -414,15 +390,11 @@ scm_setgrent (arg) SCM_PROC (s_sys_kill, "kill", 2, 0, 0, scm_sys_kill); -#ifdef __STDC__ -SCM -scm_sys_kill (SCM pid, SCM sig) -#else + SCM scm_sys_kill (pid, sig) SCM pid; SCM sig; -#endif { SCM_ASSERT (SCM_INUMP (pid), pid, SCM_ARG1, s_sys_kill); SCM_ASSERT (SCM_INUMP (sig), sig, SCM_ARG2, s_sys_kill); @@ -435,15 +407,11 @@ scm_sys_kill (pid, sig) SCM_PROC (s_sys_waitpid, "waitpid", 1, 1, 0, scm_sys_waitpid); -#ifdef __STDC__ -SCM -scm_sys_waitpid (SCM pid, SCM options) -#else + SCM scm_sys_waitpid (pid, options) SCM pid; SCM options; -#endif { #ifdef HAVE_WAITPID int i; @@ -472,13 +440,9 @@ scm_sys_waitpid (pid, options) SCM_PROC (s_getppid, "getppid", 0, 0, 0, scm_getppid); -#ifdef __STDC__ -SCM -scm_getppid (void) -#else + SCM scm_getppid () -#endif { return SCM_MAKINUM (0L + getppid ()); } @@ -486,13 +450,9 @@ scm_getppid () SCM_PROC (s_getuid, "getuid", 0, 0, 0, scm_getuid); -#ifdef __STDC__ -SCM -scm_getuid (void) -#else + SCM scm_getuid () -#endif { return SCM_MAKINUM (0L + getuid ()); } @@ -500,13 +460,9 @@ scm_getuid () SCM_PROC (s_getgid, "getgid", 0, 0, 0, scm_getgid); -#ifdef __STDC__ -SCM -scm_getgid (void) -#else + SCM scm_getgid () -#endif { return SCM_MAKINUM (0L + getgid ()); } @@ -514,13 +470,9 @@ scm_getgid () SCM_PROC (s_geteuid, "geteuid", 0, 0, 0, scm_geteuid); -#ifdef __STDC__ -SCM -scm_geteuid (void) -#else + SCM scm_geteuid () -#endif { #ifdef HAVE_GETEUID return SCM_MAKINUM (0L + geteuid ()); @@ -532,13 +484,9 @@ scm_geteuid () SCM_PROC (s_getegid, "getegid", 0, 0, 0, scm_getegid); -#ifdef __STDC__ -SCM -scm_getegid (void) -#else + SCM scm_getegid () -#endif { #ifdef HAVE_GETEUID return SCM_MAKINUM (0L + getegid ()); @@ -549,14 +497,10 @@ scm_getegid () SCM_PROC (s_sys_setuid, "setuid", 1, 0, 0, scm_sys_setuid); -#ifdef __STDC__ -SCM -scm_sys_setuid (SCM id) -#else + SCM scm_sys_setuid (id) SCM id; -#endif { SCM_ASSERT (SCM_INUMP (id), id, SCM_ARG1, s_sys_setuid); if (setuid (SCM_INUM (id)) != 0) @@ -565,14 +509,10 @@ scm_sys_setuid (id) } SCM_PROC (s_sys_setgid, "setgid", 1, 0, 0, scm_sys_setgid); -#ifdef __STDC__ -SCM -scm_sys_setgid (SCM id) -#else + SCM scm_sys_setgid (id) SCM id; -#endif { SCM_ASSERT (SCM_INUMP (id), id, SCM_ARG1, s_sys_setgid); if (setgid (SCM_INUM (id)) != 0) @@ -581,14 +521,10 @@ scm_sys_setgid (id) } SCM_PROC (s_sys_seteuid, "seteuid", 1, 0, 0, scm_sys_seteuid); -#ifdef __STDC__ -SCM -scm_sys_seteuid (SCM id) -#else + SCM scm_sys_seteuid (id) SCM id; -#endif { int rv; @@ -604,14 +540,10 @@ scm_sys_seteuid (id) } SCM_PROC (s_sys_setegid, "setegid", 1, 0, 0, scm_sys_setegid); -#ifdef __STDC__ -SCM -scm_sys_setegid (SCM id) -#else + SCM scm_sys_setegid (id) SCM id; -#endif { int rv; @@ -672,14 +604,10 @@ scm_setsid () } SCM_PROC (s_ttyname, "ttyname", 1, 0, 0, scm_ttyname); -#ifdef __STDC__ -SCM -scm_ttyname (SCM port) -#else + SCM scm_ttyname (port) SCM port; -#endif { char *ans; int fd; @@ -754,14 +682,12 @@ scm_tcsetpgrp (port, pgid) } /* Copy exec args from an SCM vector into a new C array. */ -#ifdef __STDC__ -static char ** -scm_convert_exec_args (SCM args) -#else + +static char ** scm_convert_exec_args SCM_P ((SCM args)); + static char ** scm_convert_exec_args (args) SCM args; -#endif { char **execargv; int num_args; @@ -790,14 +716,10 @@ scm_convert_exec_args (args) } SCM_PROC (s_sys_execl, "execl", 0, 0, 1, scm_sys_execl); -#ifdef __STDC__ -SCM -scm_sys_execl (SCM args) -#else + SCM scm_sys_execl (args) SCM args; -#endif { char **execargv; SCM filename = SCM_CAR (args); @@ -813,14 +735,10 @@ scm_sys_execl (args) } SCM_PROC (s_sys_execlp, "execlp", 0, 0, 1, scm_sys_execlp); -#ifdef __STDC__ -SCM -scm_sys_execlp (SCM args) -#else + SCM scm_sys_execlp (args) SCM args; -#endif { char **execargv; SCM filename = SCM_CAR (args); @@ -837,13 +755,9 @@ scm_sys_execlp (args) /* Flushing streams etc., is not done here. */ SCM_PROC (s_sys_fork, "fork", 0, 0, 0, scm_sys_fork); -#ifdef __STDC__ -SCM -scm_sys_fork(void) -#else + SCM scm_sys_fork() -#endif { int pid; pid = fork (); @@ -854,13 +768,9 @@ scm_sys_fork() SCM_PROC (s_sys_uname, "uname", 0, 0, 0, scm_sys_uname); -#ifdef __STDC__ -SCM -scm_sys_uname (void) -#else + SCM scm_sys_uname () -#endif { #ifdef HAVE_UNAME struct utsname buf; @@ -886,14 +796,10 @@ scm_sys_uname () } SCM_PROC (s_environ, "environ", 0, 1, 0, scm_environ); -#ifdef __STDC__ -SCM -scm_environ (SCM env) -#else + SCM scm_environ (env) SCM env; -#endif { if (SCM_UNBNDP (env)) return scm_makfromstrs (-1, environ); @@ -944,15 +850,11 @@ scm_environ (env) SCM_PROC (s_open_pipe, "open-pipe", 2, 0, 0, scm_open_pipe); -#ifdef __STDC__ -SCM -scm_open_pipe (SCM pipestr, SCM modes) -#else + SCM scm_open_pipe (pipestr, modes) SCM pipestr; SCM modes; -#endif { FILE *f; register SCM z; @@ -982,43 +884,31 @@ scm_open_pipe (pipestr, modes) SCM_PROC (s_open_input_pipe, "open-input-pipe", 1, 0, 0, scm_open_input_pipe); -#ifdef __STDC__ -SCM -scm_open_input_pipe(SCM pipestr) -#else + SCM scm_open_input_pipe(pipestr) SCM pipestr; -#endif { return scm_open_pipe(pipestr, scm_makfromstr("r", (sizeof "r")-1, 0)); } SCM_PROC (s_open_output_pipe, "open-output-pipe", 1, 0, 0, scm_open_output_pipe); -#ifdef __STDC__ -SCM -scm_open_output_pipe(SCM pipestr) -#else + SCM scm_open_output_pipe(pipestr) SCM pipestr; -#endif { return scm_open_pipe(pipestr, scm_makfromstr("w", (sizeof "w")-1, 0)); } SCM_PROC (s_sys_utime, "utime", 1, 2, 0, scm_sys_utime); -#ifdef __STDC__ -SCM -scm_sys_utime (SCM pathname, SCM actime, SCM modtime) -#else + SCM scm_sys_utime (pathname, actime, modtime) SCM pathname; SCM actime; SCM modtime; -#endif { int rv; struct utimbuf utm_tmp; @@ -1042,15 +932,11 @@ scm_sys_utime (pathname, actime, modtime) } SCM_PROC (s_sys_access, "access?", 2, 0, 0, scm_sys_access); -#ifdef __STDC__ -SCM -scm_sys_access (SCM path, SCM how) -#else + SCM scm_sys_access (path, how) SCM path; SCM how; -#endif { int rv; @@ -1063,26 +949,18 @@ scm_sys_access (path, how) } SCM_PROC (s_getpid, "getpid", 0, 0, 0, scm_getpid); -#ifdef __STDC__ -SCM -scm_getpid (void) -#else + SCM scm_getpid () -#endif { return SCM_MAKINUM ((unsigned long) getpid ()); } SCM_PROC (s_sys_putenv, "putenv", 1, 0, 0, scm_sys_putenv); -#ifdef __STDC__ -SCM -scm_sys_putenv (SCM str) -#else + SCM scm_sys_putenv (str) SCM str; -#endif { #ifdef HAVE_PUTENV SCM_ASSERT (SCM_NIMP (str) && SCM_STRINGP (str), str, SCM_ARG1, s_sys_putenv); @@ -1095,15 +973,11 @@ scm_sys_putenv (str) } SCM_PROC (s_read_line, "read-line", 0, 2, 0, scm_read_line); -#ifdef __STDC__ -SCM -scm_read_line (SCM port, SCM include_terminator) -#else + SCM scm_read_line (port, include_terminator) SCM port; SCM include_terminator; -#endif { register int c; register int j = 0; @@ -1157,15 +1031,11 @@ scm_read_line (port, include_terminator) } SCM_PROC (s_read_line_x, "read-line!", 1, 1, 0, scm_read_line_x); -#ifdef __STDC__ -SCM -scm_read_line_x (SCM str, SCM port) -#else + SCM scm_read_line_x (str, port) SCM str; SCM port; -#endif { register int c; register int j = 0; @@ -1201,30 +1071,22 @@ scm_read_line_x (str, port) } SCM_PROC (s_write_line, "write-line", 1, 1, 0, scm_write_line); -#ifdef __STDC__ -SCM -scm_write_line (SCM obj, SCM port) -#else + SCM scm_write_line (obj, port) SCM obj; SCM port; -#endif { scm_display (obj, port); return scm_newline (port); } SCM_PROC (s_setlocale, "setlocale", 1, 1, 0, scm_setlocale); -#ifdef __STDC__ -SCM -scm_setlocale (SCM category, SCM locale) -#else + SCM scm_setlocale (category, locale) SCM category; SCM locale; -#endif { #ifdef HAVE_SETLOCALE char *clocale; @@ -1253,15 +1115,11 @@ scm_setlocale (category, locale) } SCM_PROC (s_strftime, "strftime", 2, 0, 0, scm_strftime); -#ifdef __STDC__ -SCM -scm_strftime (SCM format, SCM stime) -#else + SCM scm_strftime (format, stime) SCM format; SCM stime; -#endif { struct tm t; @@ -1306,15 +1164,11 @@ scm_strftime (format, stime) } SCM_PROC (s_sys_strptime, "strptime", 2, 0, 0, scm_sys_strptime); -#ifdef __STDC__ -SCM -scm_sys_strptime (SCM format, SCM string) -#else + SCM scm_sys_strptime (format, string) SCM format; SCM string; -#endif { #ifdef HAVE_STRPTIME SCM stime; @@ -1377,16 +1231,12 @@ scm_sys_strptime (format, string) } SCM_PROC (s_sys_mknod, "mknod", 3, 0, 0, scm_sys_mknod); -#ifdef __STDC__ -SCM -scm_sys_mknod(SCM path, SCM mode, SCM dev) -#else + SCM scm_sys_mknod(path, mode, dev) SCM path; SCM mode; SCM dev; -#endif { #ifdef HAVE_MKNOD int val; @@ -1406,14 +1256,10 @@ scm_sys_mknod(path, mode, dev) SCM_PROC (s_sys_nice, "nice", 1, 0, 0, scm_sys_nice); -#ifdef __STDC__ -SCM -scm_sys_nice(SCM incr) -#else + SCM scm_sys_nice(incr) SCM incr; -#endif { #ifdef HAVE_NICE SCM_ASSERT(SCM_INUMP(incr), incr, SCM_ARG1, s_sys_nice); @@ -1429,13 +1275,9 @@ scm_sys_nice(incr) SCM_PROC (s_sync, "sync", 0, 0, 0, scm_sync); -#ifdef __STDC__ -SCM -scm_sync(void) -#else + SCM scm_sync() -#endif { #ifdef HAVE_SYNC sync(); @@ -1448,13 +1290,9 @@ scm_sync() -#ifdef __STDC__ -void -scm_init_posix (void) -#else + void scm_init_posix () -#endif { scm_add_feature ("posix"); #ifdef HAVE_GETEUID diff --git a/libguile/posix.h b/libguile/posix.h dissimilarity index 60% index 904cc6236..6797bb160 100644 --- a/libguile/posix.h +++ b/libguile/posix.h @@ -1,157 +1,101 @@ -/* classes: h_files */ - -#ifndef POSIXH -#define POSIXH -/* Copyright (C) 1995 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * As a special exception, the Free Software Foundation gives permission - * for additional uses of the text contained in its release of GUILE. - * - * The exception is that, if you link the GUILE library with other files - * to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the GUILE library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the - * Free Software Foundation under the name GUILE. If you copy - * code from other Free Software Foundation releases into a copy of - * GUILE, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for GUILE, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - */ - - -#include "libguile/__scm.h" - - - - - -#ifdef __STDC__ -extern SCM scm_tcsetpgrp (SCM port, SCM pgid); -extern SCM scm_tcgetpgrp (SCM port); -extern SCM scm_ctermid (void); -extern SCM scm_setsid (void); -extern SCM scm_setpgid (SCM pid, SCM pgid); -extern SCM scm_sys_pipe (void); -extern SCM scm_sys_getgroups(void); -extern SCM scm_getpgrp (void); -extern SCM scm_sys_getpwuid (SCM user); -extern SCM scm_setpwent (SCM arg); -extern SCM scm_sys_getgrgid (SCM name); -extern SCM scm_setgrent (SCM arg); -extern SCM scm_sys_kill (SCM pid, SCM sig); -extern SCM scm_sys_waitpid (SCM pid, SCM options); -extern SCM scm_getppid (void); -extern SCM scm_getuid (void); -extern SCM scm_getgid (void); -extern SCM scm_geteuid (void); -extern SCM scm_getegid (void); -extern SCM scm_sys_setuid (SCM id); -extern SCM scm_sys_setgid (SCM id); -extern SCM scm_sys_seteuid (SCM id); -extern SCM scm_sys_setegid (SCM id); -extern SCM scm_ttyname (SCM port); -extern SCM scm_sys_execl (SCM args); -extern SCM scm_sys_execlp (SCM args); -extern SCM scm_sys_fork(void); -extern SCM scm_sys_uname (void); -extern SCM scm_environ (SCM env); -extern SCM scm_open_pipe (SCM pipestr, SCM modes); -extern SCM scm_open_input_pipe(SCM pipestr); -extern SCM scm_open_output_pipe(SCM pipestr); -extern SCM scm_sys_utime (SCM pathname, SCM actime, SCM modtime); -extern SCM scm_sys_access (SCM path, SCM how); -extern SCM scm_getpid (void); -extern SCM scm_sys_putenv (SCM str); -extern SCM scm_read_line (SCM port, SCM include_terminator); -extern SCM scm_read_line_x (SCM str, SCM port); -extern SCM scm_write_line (SCM obj, SCM port); -extern SCM scm_setlocale (SCM category, SCM locale); -extern SCM scm_strftime (SCM format, SCM stime); -extern SCM scm_sys_strptime (SCM format, SCM string); -extern SCM scm_sys_mknod(SCM path, SCM mode, SCM dev); -extern SCM scm_sys_nice(SCM incr); -extern SCM scm_sync(void); -extern void scm_init_posix (void); - -#else /* STDC */ -extern SCM scm_tcsetpgrp (); -extern SCM scm_tcgetpgrp (); -extern SCM scm_ctermid (); -extern SCM scm_setsid (); -extern SCM scm_setpgid (); -extern SCM scm_sys_pipe (); -extern SCM scm_sys_getgroups(); -extern SCM scm_getpgrp (); -extern SCM scm_sys_getpwuid (); -extern SCM scm_setpwent (); -extern SCM scm_sys_getgrgid (); -extern SCM scm_setgrent (); -extern SCM scm_sys_kill (); -extern SCM scm_sys_waitpid (); -extern SCM scm_getppid (); -extern SCM scm_getuid (); -extern SCM scm_getgid (); -extern SCM scm_geteuid (); -extern SCM scm_getegid (); -extern SCM scm_sys_setuid (); -extern SCM scm_sys_setgid (); -extern SCM scm_sys_seteuid (); -extern SCM scm_sys_setegid (); -extern SCM scm_ttyname (); -extern SCM scm_sys_execl (); -extern SCM scm_sys_execlp (); -extern SCM scm_sys_fork(); -extern SCM scm_sys_uname (); -extern SCM scm_environ (); -extern SCM scm_open_pipe (); -extern SCM scm_open_input_pipe(); -extern SCM scm_open_output_pipe(); -extern SCM scm_sys_utime (); -extern SCM scm_sys_access (); -extern SCM scm_getpid (); -extern SCM scm_sys_putenv (); -extern SCM scm_read_line (); -extern SCM scm_read_line_x (); -extern SCM scm_write_line (); -extern SCM scm_setlocale (); -extern SCM scm_strftime (); -extern SCM scm_sys_strptime (); -extern SCM scm_sys_mknod(); -extern SCM scm_sys_nice(); -extern SCM scm_sync(); -extern void scm_init_posix (); - -#endif /* STDC */ - - - - - - - -#endif /* POSIXH */ +/* classes: h_files */ + +#ifndef POSIXH +#define POSIXH +/* Copyright (C) 1995 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * As a special exception, the Free Software Foundation gives permission + * for additional uses of the text contained in its release of GUILE. + * + * The exception is that, if you link the GUILE library with other files + * to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the GUILE library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the + * Free Software Foundation under the name GUILE. If you copy + * code from other Free Software Foundation releases into a copy of + * GUILE, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for GUILE, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + */ + + +#include "libguile/__scm.h" + + + + + + +extern SCM scm_tcsetpgrp SCM_P ((SCM port, SCM pgid)); +extern SCM scm_tcgetpgrp SCM_P ((SCM port)); +extern SCM scm_ctermid SCM_P ((void)); +extern SCM scm_setsid SCM_P ((void)); +extern SCM scm_setpgid SCM_P ((SCM pid, SCM pgid)); +extern SCM scm_sys_pipe SCM_P ((void)); +extern SCM scm_sys_getgroups SCM_P ((void)); +extern SCM scm_getpgrp SCM_P ((void)); +extern SCM scm_sys_getpwuid SCM_P ((SCM user)); +extern SCM scm_setpwent SCM_P ((SCM arg)); +extern SCM scm_sys_getgrgid SCM_P ((SCM name)); +extern SCM scm_setgrent SCM_P ((SCM arg)); +extern SCM scm_sys_kill SCM_P ((SCM pid, SCM sig)); +extern SCM scm_sys_waitpid SCM_P ((SCM pid, SCM options)); +extern SCM scm_getppid SCM_P ((void)); +extern SCM scm_getuid SCM_P ((void)); +extern SCM scm_getgid SCM_P ((void)); +extern SCM scm_geteuid SCM_P ((void)); +extern SCM scm_getegid SCM_P ((void)); +extern SCM scm_sys_setuid SCM_P ((SCM id)); +extern SCM scm_sys_setgid SCM_P ((SCM id)); +extern SCM scm_sys_seteuid SCM_P ((SCM id)); +extern SCM scm_sys_setegid SCM_P ((SCM id)); +extern SCM scm_ttyname SCM_P ((SCM port)); +extern SCM scm_sys_execl SCM_P ((SCM args)); +extern SCM scm_sys_execlp SCM_P ((SCM args)); +extern SCM scm_sys_fork SCM_P ((void)); +extern SCM scm_sys_uname SCM_P ((void)); +extern SCM scm_environ SCM_P ((SCM env)); +extern SCM scm_open_pipe SCM_P ((SCM pipestr, SCM modes)); +extern SCM scm_open_input_pipe SCM_P ((SCM pipestr)); +extern SCM scm_open_output_pipe SCM_P ((SCM pipestr)); +extern SCM scm_sys_utime SCM_P ((SCM pathname, SCM actime, SCM modtime)); +extern SCM scm_sys_access SCM_P ((SCM path, SCM how)); +extern SCM scm_getpid SCM_P ((void)); +extern SCM scm_sys_putenv SCM_P ((SCM str)); +extern SCM scm_read_line SCM_P ((SCM port, SCM include_terminator)); +extern SCM scm_read_line_x SCM_P ((SCM str, SCM port)); +extern SCM scm_write_line SCM_P ((SCM obj, SCM port)); +extern SCM scm_setlocale SCM_P ((SCM category, SCM locale)); +extern SCM scm_strftime SCM_P ((SCM format, SCM stime)); +extern SCM scm_sys_strptime SCM_P ((SCM format, SCM string)); +extern SCM scm_sys_mknod SCM_P ((SCM path, SCM mode, SCM dev)); +extern SCM scm_sys_nice SCM_P ((SCM incr)); +extern SCM scm_sync SCM_P ((void)); +extern void scm_init_posix SCM_P ((void)); + +#endif /* POSIXH */ diff --git a/libguile/print.c b/libguile/print.c index 2b79c5bb4..79be57bd7 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -106,14 +106,10 @@ scm_option scm_print_opts[] = { }; SCM_PROC (s_print_options, "print-options-interface", 0, 1, 0, scm_print_options); -#ifdef __STDC__ -SCM -scm_print_options (SCM setting) -#else + SCM scm_print_options (setting) SCM setting; -#endif { SCM ans = scm_options (setting, scm_print_opts, @@ -163,13 +159,9 @@ static SCM print_state_pool; #if 1 /* Used for debugging purposes */ SCM_PROC(s_current_pstate, "current-pstate", 0, 0, 0, scm_current_pstate); -#ifdef __STDC__ -SCM -scm_current_pstate (void) -#else + SCM scm_current_pstate () -#endif { return SCM_CADR (print_state_pool); } @@ -177,27 +169,21 @@ scm_current_pstate () #define PSTATE_SIZE 50L -#ifdef __STDC__ -SCM -scm_make_print_state (void) -#else + SCM scm_make_print_state () -#endif { return scm_make_struct (SCM_CAR (print_state_pool), /* pstate type */ SCM_MAKINUM (PSTATE_SIZE), SCM_EOL); } -#ifdef __STDC__ -static void -grow_ref_stack (scm_print_state *pstate) -#else + +static void grow_ref_stack SCM_P ((scm_print_state *pstate)); + static void grow_ref_stack (pstate) scm_print_state *pstate; -#endif { int i, size = pstate->ceiling; int total_size; @@ -220,16 +206,14 @@ grow_ref_stack (pstate) SCM_ALLOW_INTS; } -#ifdef __STDC__ -static void -print_circref (SCM port, scm_print_state *pstate, SCM ref) -#else + +static void print_circref SCM_P ((SCM port, scm_print_state *pstate, SCM ref)); + static void print_circref (port, pstate, ref) SCM port; scm_print_state *pstate; SCM ref; -#endif { register int i; int self = pstate->top - 1; @@ -256,16 +240,12 @@ print_circref (port, pstate, ref) /* Print generally. Handles both write and display according to PSTATE. */ -#ifdef __STDC__ -void -scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate) -#else + void scm_iprin1 (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { register long i; taloop: @@ -562,16 +542,12 @@ taloop: * They are also expensive to allocate. Therefore print states are * kept in a pool so that they can be reused. */ -#ifdef __STDC__ -void -scm_prin1 (SCM exp, SCM port, int writingp) -#else + void scm_prin1 (exp, port, writingp) SCM exp; SCM port; int writingp; -#endif { SCM handle = 0; /* Will GC protect the handle whilst unlinked */ scm_print_state *pstate; @@ -602,16 +578,12 @@ scm_prin1 (exp, port, writingp) /* Print an integer. */ -#ifdef __STDC__ -void -scm_intprint (long n, int radix, SCM port) -#else + void scm_intprint (n, radix, port) long n; int radix; SCM port; -#endif { char num_buf[SCM_INTBUFLEN]; scm_gen_write (scm_regular_string, num_buf, scm_iint2str (n, radix, num_buf), port); @@ -619,16 +591,12 @@ scm_intprint (n, radix, port) /* Print an object of unrecognized type. */ -#ifdef __STDC__ -void -scm_ipruk (char *hdr, SCM ptr, SCM port) -#else + void scm_ipruk (hdr, ptr, port) char *hdr; SCM ptr; SCM port; -#endif { scm_gen_puts (scm_regular_string, "#scm_string; subra++) scm_make_subr(subra->scm_string, @@ -194,13 +174,9 @@ scm_init_iprocs(subra, type) -#ifdef __STDC__ -void -scm_init_procs (void) -#else + void scm_init_procs () -#endif { #include "procs.x" } diff --git a/libguile/procs.h b/libguile/procs.h index 86d64f103..bc84e5168 100644 --- a/libguile/procs.h +++ b/libguile/procs.h @@ -88,24 +88,14 @@ typedef struct scm_dsubr - -#ifdef __STDC__ -extern SCM scm_make_subr (char *name, int type, SCM (*fcn) ()); -extern SCM scm_make_subr_opt (char *name, int type, SCM (*fcn) (), int set); -extern SCM scm_makcclo (SCM proc, long len); -extern SCM scm_procedure_p (SCM obj); -extern SCM scm_thunk_p (SCM obj); -extern void scm_init_iprocs(scm_iproc *subra, int type); -extern void scm_init_procs (void); - -#else /* STDC */ -extern SCM scm_make_subr (); -extern SCM scm_make_subr_opt (); -extern SCM scm_makcclo (); -extern SCM scm_procedure_p (); -extern SCM scm_thunk_p (); -extern void scm_init_iprocs(); -extern void scm_init_procs (); +extern SCM scm_make_subr SCM_P ((char *name, int type, SCM (*fcn) ())); +extern SCM scm_make_subr_opt SCM_P ((char *name, int type, SCM (*fcn) (), + int set)); +extern SCM scm_makcclo SCM_P ((SCM proc, long len)); +extern SCM scm_procedure_p SCM_P ((SCM obj)); +extern SCM scm_thunk_p SCM_P ((SCM obj)); +extern void scm_init_iprocs SCM_P ((scm_iproc *subra, int type)); +extern void scm_init_procs SCM_P ((void)); -#endif /* STDC */ + #endif /* PROCSH */ diff --git a/libguile/ramap.c b/libguile/ramap.c index 9a968fae3..673129158 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -88,15 +88,13 @@ static ra_iproc ra_asubrs[]; /* inds must be a uvect or ivect, no check. */ -#ifdef __STDC__ -static scm_sizet -cind (SCM ra, SCM inds) -#else + +static scm_sizet cind SCM_P ((SCM ra, SCM inds)); + static scm_sizet cind (ra, inds) SCM ra; SCM inds; -#endif { scm_sizet i; int k; @@ -117,15 +115,11 @@ cind (ra, inds) 1 --> ras are at least as big as ra0; 0 --> no match. */ -#ifdef __STDC__ -int -scm_ra_matchp (SCM ra0, SCM ras) -#else + int scm_ra_matchp (ra0, ras) SCM ra0; SCM ras; -#endif { SCM ra1; scm_array_dim dims; @@ -228,10 +222,6 @@ scm_ra_matchp (ra0, ras) static char s_ra_mismatch[] = "array shape mismatch"; -#ifdef __STDC__ -int -scm_ramapc (int (*cproc) (), SCM data, SCM ra0, SCM lra, char *what) -#else int scm_ramapc (cproc, data, ra0, lra, what) int (*cproc) (); @@ -239,7 +229,6 @@ scm_ramapc (cproc, data, ra0, lra, what) SCM ra0; SCM lra; char *what; -#endif { SCM inds, z; SCM vra0, ra1, vra1; @@ -385,16 +374,12 @@ scm_ramapc (cproc, data, ra0, lra, what) static char s_array_fill_x[]; -#ifdef __STDC__ -int -scm_array_fill_int (SCM ra, SCM fill, SCM ignore) -#else + int scm_array_fill_int (ra, fill, ignore) SCM ra; SCM fill; SCM ignore; -#endif { scm_sizet i, n = SCM_ARRAY_DIMS (ra)->ubnd - SCM_ARRAY_DIMS (ra)->lbnd + 1; long inc = SCM_ARRAY_DIMS (ra)->inc; @@ -507,15 +492,11 @@ scm_array_fill_int (ra, fill, ignore) } SCM_PROC(s_array_fill_x, "array-fill!", 2, 0, 0, scm_array_fill_x); -#ifdef __STDC__ -SCM -scm_array_fill_x (SCM ra, SCM fill) -#else + SCM scm_array_fill_x (ra, fill) SCM ra; SCM fill; -#endif { scm_ramapc (scm_array_fill_int, fill, ra, SCM_EOL, s_array_fill_x); return SCM_UNSPECIFIED; @@ -523,15 +504,13 @@ scm_array_fill_x (ra, fill) -#ifdef __STDC__ -static int -racp (SCM dst, SCM src) -#else + +static int racp SCM_P ((SCM dst, SCM src)); + static int racp (src, dst) SCM dst; SCM src; -#endif { long n = (SCM_ARRAY_DIMS (src)->ubnd - SCM_ARRAY_DIMS (src)->lbnd + 1); long inc_d, inc_s = SCM_ARRAY_DIMS (src)->inc; @@ -723,15 +702,11 @@ racp (src, dst) SCM_PROC(s_serial_array_copy_x, "serial-array-copy!", 2, 0, 0, scm_array_copy_x); SCM_PROC(s_array_copy_x, "array-copy!", 2, 0, 0, scm_array_copy_x); -#ifdef __STDC__ -SCM -scm_array_copy_x (SCM src, SCM dst) -#else + SCM scm_array_copy_x (src, dst) SCM src; SCM dst; -#endif { scm_ramapc (racp, SCM_UNDEFINED, src, scm_cons (dst, SCM_EOL), s_array_copy_x); return SCM_UNSPECIFIED; @@ -739,15 +714,11 @@ scm_array_copy_x (src, dst) /* Functions callable by ARRAY-MAP! */ -#ifdef __STDC__ -int -scm_ra_eqp (SCM ra0, SCM ras) -#else + int scm_ra_eqp (ra0, ras) SCM ra0; SCM ras; -#endif { SCM ra1 = SCM_CAR (ras), ra2 = SCM_CAR (SCM_CDR (ras)); long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; @@ -810,17 +781,15 @@ scm_ra_eqp (ra0, ras) } /* opt 0 means <, nonzero means >= */ -#ifdef __STDC__ -static int -ra_compare (SCM ra0, SCM ra1, SCM ra2, int opt) -#else + +static int ra_compare SCM_P ((SCM ra0, SCM ra1, SCM ra2, int opt)); + static int ra_compare (ra0, ra1, ra2, opt) SCM ra0; SCM ra1; SCM ra2; int opt; -#endif { long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; scm_sizet i0 = SCM_ARRAY_BASE (ra0), i1 = SCM_ARRAY_BASE (ra1), i2 = SCM_ARRAY_BASE (ra2); @@ -883,68 +852,48 @@ ra_compare (ra0, ra1, ra2, opt) } -#ifdef __STDC__ -int -scm_ra_lessp (SCM ra0, SCM ras) -#else + int scm_ra_lessp (ra0, ras) SCM ra0; SCM ras; -#endif { return ra_compare (ra0, SCM_CAR (ras), SCM_CAR (SCM_CDR (ras)), 0); } -#ifdef __STDC__ -int -scm_ra_leqp (SCM ra0, SCM ras) -#else + int scm_ra_leqp (ra0, ras) SCM ra0; SCM ras; -#endif { return ra_compare (ra0, SCM_CAR (SCM_CDR (ras)), SCM_CAR (ras), 1); } -#ifdef __STDC__ -int -scm_ra_grp (SCM ra0, SCM ras) -#else + int scm_ra_grp (ra0, ras) SCM ra0; SCM ras; -#endif { return ra_compare (ra0, SCM_CAR (SCM_CDR (ras)), SCM_CAR (ras), 0); } -#ifdef __STDC__ -int -scm_ra_greqp (SCM ra0, SCM ras) -#else + int scm_ra_greqp (ra0, ras) SCM ra0; SCM ras; -#endif { return ra_compare (ra0, SCM_CAR (ras), SCM_CAR (SCM_CDR (ras)), 1); } -#ifdef __STDC__ -int -scm_ra_sum (SCM ra0, SCM ras) -#else + int scm_ra_sum (ra0, ras) SCM ra0; SCM ras; -#endif { long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; scm_sizet i0 = SCM_ARRAY_BASE (ra0); @@ -1018,15 +967,11 @@ scm_ra_sum (ra0, ras) } -#ifdef __STDC__ -int -scm_ra_difference (SCM ra0, SCM ras) -#else + int scm_ra_difference (ra0, ras) SCM ra0; SCM ras; -#endif { long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; scm_sizet i0 = SCM_ARRAY_BASE (ra0); @@ -1131,15 +1076,11 @@ scm_ra_difference (ra0, ras) } -#ifdef __STDC__ -int -scm_ra_product (SCM ra0, SCM ras) -#else + int scm_ra_product (ra0, ras) SCM ra0; SCM ras; -#endif { long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; scm_sizet i0 = SCM_ARRAY_BASE (ra0); @@ -1214,15 +1155,11 @@ scm_ra_product (ra0, ras) return 1; } -#ifdef __STDC__ -int -scm_ra_divide (SCM ra0, SCM ras) -#else + int scm_ra_divide (ra0, ras) SCM ra0; SCM ras; -#endif { long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; scm_sizet i0 = SCM_ARRAY_BASE (ra0); @@ -1331,31 +1268,24 @@ scm_ra_divide (ra0, ras) return 1; } -#ifdef __STDC__ -int -scm_array_identity (SCM src, SCM dst) -#else + int scm_array_identity (dst, src) SCM src; SCM dst; -#endif { return racp (SCM_CAR (src), scm_cons (dst, SCM_EOL)); } -#ifdef __STDC__ -static -int -ramap (SCM ra0, SCM proc, SCM ras) -#else + +static int ramap SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int ramap (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { long i = SCM_ARRAY_DIMS (ra0)->lbnd; long inc = SCM_ARRAY_DIMS (ra0)->inc; @@ -1394,16 +1324,14 @@ ramap (ra0, proc, ras) return 1; } -#ifdef __STDC__ -static int -ramap_cxr (SCM ra0, SCM proc, SCM ras) -#else + +static int ramap_cxr SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int ramap_cxr (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { SCM ra1 = SCM_CAR (ras); SCM e1 = SCM_UNDEFINED; @@ -1469,16 +1397,14 @@ ramap_cxr (ra0, proc, ras) } -#ifdef __STDC__ -static int -ramap_rp (SCM ra0, SCM proc, SCM ras) -#else + +static int ramap_rp SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int ramap_rp (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { SCM ra1 = SCM_CAR (ras), ra2 = SCM_CAR (SCM_CDR (ras)); SCM e1 = SCM_UNDEFINED, e2 = SCM_UNDEFINED; @@ -1568,16 +1494,14 @@ ramap_rp (ra0, proc, ras) } -#ifdef __STDC__ -static int -ramap_1 (SCM ra0, SCM proc, SCM ras) -#else + +static int ramap_1 SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int ramap_1 (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { SCM ra1 = SCM_CAR (ras); SCM e1 = SCM_UNDEFINED; @@ -1596,16 +1520,14 @@ ramap_1 (ra0, proc, ras) } -#ifdef __STDC__ -static int -ramap_2o (SCM ra0, SCM proc, SCM ras) -#else + +static int ramap_2o SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int ramap_2o (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { SCM ra1 = SCM_CAR (ras); SCM e1 = SCM_UNDEFINED; @@ -1649,16 +1571,14 @@ ramap_2o (ra0, proc, ras) } -#ifdef __STDC__ -static int -ramap_a (SCM ra0, SCM proc, SCM ras) -#else + +static int ramap_a SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int ramap_a (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { SCM e0 = SCM_UNDEFINED, e1 = SCM_UNDEFINED; long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; @@ -1684,16 +1604,12 @@ ramap_a (ra0, proc, ras) SCM_PROC(s_serial_array_map, "serial-array-map", 2, 0, 1, scm_array_map); SCM_PROC(s_array_map, "array-map", 2, 0, 1, scm_array_map); -#ifdef __STDC__ -SCM -scm_array_map (SCM ra0, SCM proc, SCM lra) -#else + SCM scm_array_map (ra0, proc, lra) SCM ra0; SCM proc; SCM lra; -#endif { SCM_ASSERT (SCM_BOOL_T == scm_procedure_p (proc), proc, SCM_ARG2, s_array_map); switch (SCM_TYP7 (proc)) @@ -1794,16 +1710,14 @@ scm_array_map (ra0, proc, lra) } } -#ifdef __STDC__ -static int -rafe (SCM ra0, SCM proc, SCM ras) -#else + +static int rafe SCM_P ((SCM ra0, SCM proc, SCM ras)); + static int rafe (ra0, proc, ras) SCM ra0; SCM proc; SCM ras; -#endif { long i = SCM_ARRAY_DIMS (ra0)->lbnd; scm_sizet i0 = SCM_ARRAY_BASE (ra0); @@ -1844,16 +1758,12 @@ rafe (ra0, proc, ras) SCM_PROC(s_array_for_each, "array-for-each", 2, 0, 1, scm_array_for_each); -#ifdef __STDC__ -SCM -scm_array_for_each (SCM proc, SCM ra0, SCM lra) -#else + SCM scm_array_for_each (proc, ra0, lra) SCM proc; SCM ra0; SCM lra; -#endif { SCM_ASSERT (SCM_BOOL_T == scm_procedure_p (proc), proc, SCM_ARG1, s_array_for_each); scm_ramapc (rafe, proc, ra0, lra, s_array_for_each); @@ -1861,15 +1771,11 @@ scm_array_for_each (proc, ra0, lra) } SCM_PROC(s_array_index_map_x, "array-index-map!", 2, 0, 0, scm_array_index_map_x); -#ifdef __STDC__ -SCM -scm_array_index_map_x (SCM ra, SCM proc) -#else + SCM scm_array_index_map_x (ra, proc) SCM ra; SCM proc; -#endif { scm_sizet i; SCM_ASSERT (SCM_NIMP (ra), ra, SCM_ARG1, s_array_index_map_x); @@ -1937,16 +1843,14 @@ scm_array_index_map_x (ra, proc) } } -#ifdef __STDC__ -static int -raeql_1 (SCM ra0, SCM as_equal, SCM ra1) -#else + +static int raeql_1 SCM_P ((SCM ra0, SCM as_equal, SCM ra1)); + static int raeql_1 (ra0, as_equal, ra1) SCM ra0; SCM as_equal; SCM ra1; -#endif { SCM e0 = SCM_UNDEFINED, e1 = SCM_UNDEFINED; scm_sizet i0 = 0, i1 = 0; @@ -2050,16 +1954,14 @@ raeql_1 (ra0, as_equal, ra1) } -#ifdef __STDC__ -static int -raeql (SCM ra0, SCM as_equal, SCM ra1) -#else + +static int raeql SCM_P ((SCM ra0, SCM as_equal, SCM ra1)); + static int raeql (ra0, as_equal, ra1) SCM ra0; SCM as_equal; SCM ra1; -#endif { SCM v0 = ra0, v1 = ra1; scm_array_dim dim0, dim1; @@ -2116,30 +2018,22 @@ raeql (ra0, as_equal, ra1) return scm_ramapc (raeql_1, as_equal, ra0, scm_cons (ra1, SCM_EOL), ""); } -#ifdef __STDC__ -SCM -scm_raequal (SCM ra0, SCM ra1) -#else + SCM scm_raequal (ra0, ra1) SCM ra0; SCM ra1; -#endif { return (raeql (ra0, SCM_BOOL_T, ra1) ? SCM_BOOL_T : SCM_BOOL_F); } static char s_array_equal_p[] = "array-equal?"; -#ifdef __STDC__ -SCM -scm_array_equal_p (SCM ra0, SCM ra1) -#else + SCM scm_array_equal_p (ra0, ra1) SCM ra0; SCM ra1; -#endif { if (SCM_IMP (ra0) || SCM_IMP (ra1)) callequal:return scm_equal_p (ra0, ra1); @@ -2210,20 +2104,17 @@ static ra_iproc ra_asubrs[] = {0, 0, 0} }; -static void init_raprocs (subra) +static void +init_raprocs (subra) ra_iproc *subra; { for (; subra->name; subra++) subra->sproc = SCM_CDR (scm_intern (subra->name, strlen (subra->name))); } -#ifdef __STDC__ -void -scm_init_ramap (void) -#else + void scm_init_ramap () -#endif { init_raprocs (ra_rpsubrs); init_raprocs (ra_asubrs); diff --git a/libguile/ramap.h b/libguile/ramap.h index d558a9d4e..da4ec2691 100644 --- a/libguile/ramap.h +++ b/libguile/ramap.h @@ -47,55 +47,27 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern int scm_ra_matchp (SCM ra0, SCM ras); -extern int scm_ramapc (int (*cproc) (), SCM data, SCM ra0, SCM lra, char *what); -extern int scm_array_fill_int (SCM ra, SCM fill, SCM ignore); -extern SCM scm_array_fill_x (SCM ra, SCM fill); -extern SCM scm_array_copy_x (SCM src, SCM dst); -extern int scm_ra_eqp (SCM ra0, SCM ras); -extern int scm_ra_lessp (SCM ra0, SCM ras); -extern int scm_ra_leqp (SCM ra0, SCM ras); -extern int scm_ra_grp (SCM ra0, SCM ras); -extern int scm_ra_greqp (SCM ra0, SCM ras); -extern int scm_ra_sum (SCM ra0, SCM ras); -extern int scm_ra_difference (SCM ra0, SCM ras); -extern int scm_ra_product (SCM ra0, SCM ras); -extern int scm_ra_divide (SCM ra0, SCM ras); -extern int scm_array_identity (SCM src, SCM dst); -extern SCM scm_array_map (SCM ra0, SCM proc, SCM lra); -extern SCM scm_array_for_each (SCM proc, SCM ra0, SCM lra); -extern SCM scm_array_index_map_x (SCM ra, SCM proc); -extern SCM scm_raequal (SCM ra0, SCM ra1); -extern SCM scm_array_equal_p (SCM ra0, SCM ra1); -extern void scm_init_ramap (void); - -#else /* STDC */ -extern int scm_ra_matchp (); -extern int scm_ramapc (); -extern int scm_array_fill_int (); -extern SCM scm_array_fill_x (); -extern SCM scm_array_copy_x (); -extern int scm_ra_eqp (); -extern int scm_ra_lessp (); -extern int scm_ra_leqp (); -extern int scm_ra_grp (); -extern int scm_ra_greqp (); -extern int scm_ra_sum (); -extern int scm_ra_difference (); -extern int scm_ra_product (); -extern int scm_ra_divide (); -extern int scm_array_identity (); -extern SCM scm_array_map (); -extern SCM scm_array_for_each (); -extern SCM scm_array_index_map_x (); -extern SCM scm_raequal (); -extern SCM scm_array_equal_p (); -extern void scm_init_ramap (); - -#endif /* STDC */ - - +extern int scm_ra_matchp SCM_P ((SCM ra0, SCM ras)); +extern int scm_ramapc SCM_P ((int (*cproc) (), SCM data, SCM ra0, SCM lra, char *what)); +extern int scm_array_fill_int SCM_P ((SCM ra, SCM fill, SCM ignore)); +extern SCM scm_array_fill_x SCM_P ((SCM ra, SCM fill)); +extern SCM scm_array_copy_x SCM_P ((SCM src, SCM dst)); +extern int scm_ra_eqp SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_lessp SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_leqp SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_grp SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_greqp SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_sum SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_difference SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_product SCM_P ((SCM ra0, SCM ras)); +extern int scm_ra_divide SCM_P ((SCM ra0, SCM ras)); +extern int scm_array_identity SCM_P ((SCM src, SCM dst)); +extern SCM scm_array_map SCM_P ((SCM ra0, SCM proc, SCM lra)); +extern SCM scm_array_for_each SCM_P ((SCM proc, SCM ra0, SCM lra)); +extern SCM scm_array_index_map_x SCM_P ((SCM ra, SCM proc)); +extern SCM scm_raequal SCM_P ((SCM ra0, SCM ra1)); +extern SCM scm_array_equal_p SCM_P ((SCM ra0, SCM ra1)); +extern void scm_init_ramap SCM_P ((void)); #endif /* RAMAPH */ diff --git a/libguile/read.c b/libguile/read.c index 3f29a676c..7cef82f18 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -70,14 +70,10 @@ scm_option scm_read_opts[] = { }; SCM_PROC (s_read_options, "read-options-interface", 0, 1, 0, scm_read_options); -#ifdef __STDC__ -SCM -scm_read_options (SCM setting) -#else + SCM scm_read_options (setting) SCM setting; -#endif { SCM ans = scm_options (setting, scm_read_opts, @@ -89,16 +85,12 @@ scm_read_options (setting) } SCM_PROC (s_read, "read", 0, 3, 0, scm_read); -#ifdef __STDC__ -SCM -scm_read (SCM port, SCM case_insensitive_p, SCM sharp) -#else + SCM scm_read (port, case_insensitive_p, sharp) SCM port; SCM case_insensitive_p; SCM sharp; -#endif { int c; SCM tok_buf, copy; @@ -129,29 +121,21 @@ scm_read (port, case_insensitive_p, sharp) } -#ifdef __STDC__ -char * -scm_grow_tok_buf (SCM * tok_buf) -#else + char * scm_grow_tok_buf (tok_buf) SCM * tok_buf; -#endif { scm_vector_set_length_x (*tok_buf, SCM_MAKINUM (2 * SCM_LENGTH (*tok_buf))); return SCM_CHARS (*tok_buf); } -#ifdef __STDC__ -int -scm_flush_ws (SCM port, char *eoferr) -#else + int scm_flush_ws (port, eoferr) SCM port; char *eoferr; -#endif { register int c; while (1) @@ -184,15 +168,11 @@ scm_flush_ws (port, eoferr) } -#ifdef __STDC__ -int -scm_casei_streq (char * s1, char * s2) -#else + int scm_casei_streq (s1, s2) char * s1; char * s2; -#endif { while (*s1 && *s2) if (scm_downcase((int)*s1) != scm_downcase((int)*s2)) @@ -209,17 +189,15 @@ scm_casei_streq (s1, s2) /* recsexpr is used when recording expressions * constructed by read:sharp. */ -#ifdef __STDC__ -static SCM -recsexpr (SCM obj, int line, int column, SCM filename) -#else + +static SCM recsexpr SCM_P ((SCM obj, int line, int column, SCM filename)); + static SCM recsexpr (obj, line, column, filename) SCM obj; int line; int column; SCM filename; -#endif { if (SCM_IMP (obj) || SCM_NCONSP(obj)) return obj; @@ -262,10 +240,7 @@ recsexpr (obj, line, column, filename) } static char s_list[]="list"; -#ifdef __STDC__ -SCM -scm_lreadr (SCM *tok_buf, SCM port, int case_i, SCM sharp, SCM *copy) -#else + SCM scm_lreadr (tok_buf, port, case_i, sharp, copy) SCM *tok_buf; @@ -273,7 +248,6 @@ scm_lreadr (tok_buf, port, case_i, sharp, copy) int case_i; SCM sharp; SCM *copy; -#endif { int c; scm_sizet j; @@ -519,18 +493,14 @@ tryagain: #ifdef _UNICOS _Pragma ("noopt"); /* # pragma _CRI noopt */ #endif -#ifdef __STDC__ -scm_sizet -scm_read_token (int ic, SCM * tok_buf, SCM port, int case_i, int weird) -#else + scm_sizet -scm_read_token (ic, * tok_buf, port, case_i, weird) +scm_read_token (ic, tok_buf, port, case_i, weird) int ic; SCM *tok_buf; SCM port; int case_i; int weird; -#endif { register scm_sizet j; register int c; @@ -634,22 +604,19 @@ scm_read_token (ic, * tok_buf, port, case_i, weird) } } } + #ifdef _UNICOS _Pragma ("opt"); /* # pragma _CRI opt */ #endif -#ifdef __STDC__ -SCM -scm_lreadparen (SCM * tok_buf, SCM port, char *name, int case_i, SCM sharp, SCM *copy) -#else SCM -scm_lreadparen (tok_buf, port, name, case_i, sharp, SCM *copy) +scm_lreadparen (tok_buf, port, name, case_i, sharp, copy) SCM *tok_buf; SCM port; char *name; int case_i; SCM sharp; -#endif + SCM *copy; { SCM tmp; SCM tl; @@ -682,10 +649,7 @@ scm_lreadparen (tok_buf, port, name, case_i, sharp, SCM *copy) return ans; } -#ifdef __STDC__ -SCM -scm_lreadrecparen (SCM * tok_buf, SCM port, char *name, int case_i, SCM sharp, SCM *copy) -#else + SCM scm_lreadrecparen (tok_buf, port, name, case_i, sharp, copy) SCM *tok_buf; @@ -694,7 +658,6 @@ scm_lreadrecparen (tok_buf, port, name, case_i, sharp, copy) int case_i; SCM sharp; SCM *copy; -#endif { register int c; register SCM tmp; @@ -761,13 +724,9 @@ exit: -#ifdef __STDC__ -void -scm_init_read (void) -#else + void scm_init_read () -#endif { scm_init_opts (scm_read_options, scm_read_opts, SCM_N_READ_OPTIONS); #include "read.x" diff --git a/libguile/read.h b/libguile/read.h index 97dddd005..8eef1ed24 100644 --- a/libguile/read.h +++ b/libguile/read.h @@ -75,31 +75,15 @@ extern scm_option scm_read_opts[]; -#ifdef __STDC__ -extern SCM scm_read_options (SCM setting); -extern SCM scm_read (SCM port, SCM casep, SCM sharp); -extern char * scm_grow_tok_buf (SCM * tok_buf); -extern int scm_flush_ws (SCM port, char *eoferr); -extern int scm_casei_streq (char * s1, char * s2); -extern SCM scm_lreadr (SCM * tok_buf, SCM port, int case_i, SCM sharp, SCM *copy); -extern scm_sizet scm_read_token (int ic, SCM * tok_buf, SCM port, int case_i, int weird); -extern SCM scm_lreadparen (SCM * tok_buf, SCM port, char *name, int case_i, SCM sharp, SCM *copy); -extern SCM scm_lreadrecparen (SCM * tok_buf, SCM port, char *name, int case_i, SCM sharp, SCM *copy); -extern void scm_init_read (void); - -#else /* STDC */ -extern SCM scm_read_options (); -extern SCM scm_read (); -extern char * scm_grow_tok_buf (); -extern int scm_flush_ws (); -extern int scm_casei_streq (); -extern SCM scm_lreadr (); -extern scm_sizet scm_read_token (); -extern SCM scm_lreadparen (); -extern SCM scm_lreadrecparen (); -extern void scm_init_read (); - -#endif /* STDC */ - +extern SCM scm_read_options SCM_P ((SCM setting)); +extern SCM scm_read SCM_P ((SCM port, SCM casep, SCM sharp)); +extern char * scm_grow_tok_buf SCM_P ((SCM * tok_buf)); +extern int scm_flush_ws SCM_P ((SCM port, char *eoferr)); +extern int scm_casei_streq SCM_P ((char * s1, char * s2)); +extern SCM scm_lreadr SCM_P ((SCM * tok_buf, SCM port, int case_i, SCM sharp, SCM *copy)); +extern scm_sizet scm_read_token SCM_P ((int ic, SCM * tok_buf, SCM port, int case_i, int weird)); +extern SCM scm_lreadparen SCM_P ((SCM * tok_buf, SCM port, char *name, int case_i, SCM sharp, SCM *copy)); +extern SCM scm_lreadrecparen SCM_P ((SCM * tok_buf, SCM port, char *name, int case_i, SCM sharp, SCM *copy)); +extern void scm_init_read SCM_P ((void)); #endif /* READH */ diff --git a/libguile/root.c b/libguile/root.c index 9fb6fbd8b..5e8a5e33b 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -149,12 +149,12 @@ scm_make_root (parent) return root; } -/* {call-with-new-root} +/* {call-with-dynamic-root} * * Suspending the current thread to evaluate a thunk on the * same C stack but under a new root. * - * Calls to call-with-new-root return exactly once (unless + * Calls to call-with-dynamic-root return exactly once (unless * the process is somehow exitted). */ @@ -229,15 +229,10 @@ cwdr (proc, a1, args, handler, stack_start) SCM_PROC(s_call_with_dynamic_root, "call-with-dynamic-root", 2, 0, 0, scm_call_with_dynamic_root); -#ifdef __STDC__ -SCM -scm_call_with_dynamic_root (SCM thunk, SCM handler) -#else SCM scm_call_with_dynamic_root (thunk, handler) SCM thunk; SCM handler; -#endif { SCM_STACKITEM stack_place; @@ -245,28 +240,18 @@ scm_call_with_dynamic_root (thunk, handler) } SCM_PROC(s_dynamic_root, "dynamic-root", 0, 0, 0, scm_dynamic_root); -#ifdef __STDC__ -SCM -scm_dynamic_root (void) -#else SCM scm_dynamic_root () -#endif { return scm_ulong2num (SCM_SEQ (scm_root->rootcont)); } -#ifdef __STDC__ -SCM -scm_apply_with_dynamic_root (SCM proc, SCM a1, SCM args, SCM handler) -#else SCM scm_apply_with_dynamic_root (proc, a1, args, handler) SCM proc; SCM a1; SCM args; - SCM error; -#endif + SCM handler; { SCM_STACKITEM stack_place; return cwdr (proc, a1, args, handler, &stack_place); @@ -287,16 +272,12 @@ typedef long setjmp_type; #endif -#ifdef __STDC__ -SCM -scm_call_catching_errors (SCM (*thunk)(), SCM (*err_filter)(), void *closure) -#else + SCM scm_call_catching_errors (thunk, err_filter, closure) SCM (*thunk)(); SCM (*err_filter)(); void *closure; -#endif { SCM answer; setjmp_type i; diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c index d04934435..7429a1598 100644 --- a/libguile/scmsigs.c +++ b/libguile/scmsigs.c @@ -141,14 +141,10 @@ FAKESIGFN(scm_tick_signal, SCM_TICK_SIGNAL) SCM_PROC(s_alarm, "alarm", 1, 0, 0, scm_alarm); -#ifdef __STDC__ -SCM -scm_alarm (SCM i) -#else + SCM scm_alarm (i) SCM i; -#endif { unsigned int j; SCM_ASSERT (SCM_INUMP (i) && (SCM_INUM (i) >= 0), i, SCM_ARG1, s_alarm); @@ -158,27 +154,19 @@ scm_alarm (i) SCM_PROC(s_pause, "pause", 0, 0, 0, scm_pause); -#ifdef __STDC__ -SCM -scm_pause (void) -#else + SCM scm_pause () -#endif { pause (); return SCM_UNSPECIFIED; } SCM_PROC(s_sleep, "sleep", 1, 0, 0, scm_sleep); -#ifdef __STDC__ -SCM -scm_sleep (SCM i) -#else + SCM scm_sleep (i) SCM i; -#endif { unsigned int j; SCM_ASSERT (SCM_INUMP (i) && (SCM_INUM (i) >= 0), i, SCM_ARG1, s_sleep); @@ -191,14 +179,10 @@ scm_sleep (i) } SCM_PROC(s_raise, "raise", 1, 0, 0, scm_raise); -#ifdef __STDC__ -SCM -scm_raise(SCM sig) -#else + SCM scm_raise(sig) SCM sig; -#endif { SCM_ASSERT(SCM_INUMP(sig), sig, SCM_ARG1, s_raise); # ifdef vms @@ -238,13 +222,9 @@ static SIGRETTYPE (*oldpipe) (); #endif -#ifdef __STDC__ -void -scm_init_signals (void) -#else + void scm_init_signals () -#endif { #ifdef SIGINT oldint = signal (SIGINT, scm_int_signal); @@ -279,13 +259,9 @@ scm_init_signals () /* This is used in preparation for a possible fork(). Ignore all signals before the fork so that child will catch only if it establishes a handler */ -#ifdef __STDC__ -void -scm_ignore_signals (void) -#else + void scm_ignore_signals () -#endif { #ifdef ultrix siginterrupt (SIGINT, 0); @@ -320,13 +296,9 @@ scm_ignore_signals () fflush (stderr); } -#ifdef __STDC__ -void -scm_unignore_signals (void) -#else + void scm_unignore_signals () -#endif { signal (SIGINT, scm_int_signal); #ifdef SIGHUP @@ -353,13 +325,9 @@ scm_unignore_signals () } SCM_PROC (s_restore_signals, "restore-signals", 0, 0, 0, scm_restore_signals); -#ifdef __STDC__ -SCM -scm_restore_signals (void) -#else + SCM scm_restore_signals () -#endif { #ifdef ultrix siginterrupt (SIGINT, 0); @@ -391,13 +359,9 @@ scm_restore_signals () } -#ifdef __STDC__ -void -scm_init_scmsigs (void) -#else + void scm_init_scmsigs () -#endif { #include "scmsigs.x" } diff --git a/libguile/scmsigs.h b/libguile/scmsigs.h index 261acd62c..3b8bdc48c 100644 --- a/libguile/scmsigs.h +++ b/libguile/scmsigs.h @@ -46,34 +46,15 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern SCM scm_alarm (SCM i); -extern SCM scm_pause (void); -extern SCM scm_sleep (SCM i); -extern SCM scm_raise(SCM sig); -extern void scm_init_signals (void); -extern void scm_ignore_signals (void); -extern void scm_unignore_signals (void); -extern SCM scm_restore_signals (void); -extern void scm_init_scmsigs (void); - -#else /* STDC */ -extern SCM scm_alarm (); -extern SCM scm_pause (); -extern SCM scm_sleep (); -extern SCM scm_raise(); -extern void scm_init_signals (); -extern void scm_ignore_signals (); -extern void scm_unignore_signals (); -extern SCM scm_restore_signals (); -extern void scm_init_scmsigs (); - -#endif /* STDC */ - - - - - +extern SCM scm_alarm SCM_P ((SCM i)); +extern SCM scm_pause SCM_P ((void)); +extern SCM scm_sleep SCM_P ((SCM i)); +extern SCM scm_raise SCM_P ((SCM sig)); +extern void scm_init_signals SCM_P ((void)); +extern void scm_ignore_signals SCM_P ((void)); +extern void scm_unignore_signals SCM_P ((void)); +extern SCM scm_restore_signals SCM_P ((void)); +extern void scm_init_scmsigs SCM_P ((void)); #endif /* SCMSIGSH */ diff --git a/libguile/sequences.c b/libguile/sequences.c index d58d20040..38c59e082 100644 --- a/libguile/sequences.c +++ b/libguile/sequences.c @@ -48,14 +48,10 @@ -#ifdef __STDC__ -int -scm_obj_length (SCM obj) -#else + int scm_obj_length (obj) SCM obj; -#endif { int i; i = scm_ilength(obj); @@ -76,14 +72,10 @@ scm_obj_length (obj) SCM_PROC(s_length, "length", 1, 0, 0, scm_length); -#ifdef __STDC__ -SCM -scm_length(SCM x) -#else + SCM scm_length(x) SCM x; -#endif { int i; i = scm_obj_length(x); @@ -101,14 +93,10 @@ scm_length(x) SCM_PROC (s_reverse, "reverse", 1, 0, 0, scm_reverse); -#ifdef __STDC__ -SCM -scm_reverse (SCM objs) -#else + SCM scm_reverse (objs) SCM objs; -#endif { return scm_list_reverse (objs); } @@ -116,13 +104,9 @@ scm_reverse (objs) -#ifdef __STDC__ -void -scm_init_sequences (void) -#else + void scm_init_sequences () -#endif { #include "sequences.x" } diff --git a/libguile/sequences.h b/libguile/sequences.h index eeaa6789a..6520457fc 100644 --- a/libguile/sequences.h +++ b/libguile/sequences.h @@ -50,21 +50,10 @@ -#ifdef __STDC__ -extern int scm_obj_length (SCM obj); -extern SCM scm_length(SCM x); -extern SCM scm_reverse (SCM objs); -extern void scm_init_sequences (void); - -#else /* STDC */ -extern int scm_obj_length (); -extern SCM scm_length(); -extern SCM scm_reverse (); -extern void scm_init_sequences (); - -#endif /* STDC */ - - +extern int scm_obj_length SCM_P ((SCM obj)); +extern SCM scm_length SCM_P ((SCM x)); +extern SCM scm_reverse SCM_P ((SCM objs)); +extern void scm_init_sequences SCM_P ((void)); #endif /* SEQUENCESH */ diff --git a/libguile/simpos.c b/libguile/simpos.c index 702489510..a726a73e9 100644 --- a/libguile/simpos.c +++ b/libguile/simpos.c @@ -59,14 +59,10 @@ extern int system(); #ifndef _Windows SCM_PROC(s_system, "system", 1, 0, 0, scm_system); -#ifdef __STDC__ -SCM -scm_system(SCM cmd) -#else + SCM scm_system(cmd) SCM cmd; -#endif { SCM_ASSERT(SCM_NIMP(cmd) && SCM_ROSTRINGP(cmd), cmd, SCM_ARG1, s_system); if (SCM_ROSTRINGP (cmd)) @@ -84,14 +80,10 @@ scm_system(cmd) extern char *getenv(); SCM_PROC (s_sys_getenv, "getenv", 1, 0, 0, scm_sys_getenv); -#ifdef __STDC__ -SCM -scm_sys_getenv(SCM nam) -#else + SCM scm_sys_getenv(nam) SCM nam; -#endif { char *val; SCM_ASSERT(SCM_NIMP(nam) && SCM_ROSTRINGP(nam), nam, SCM_ARG1, s_sys_getenv); @@ -142,13 +134,9 @@ scm_sys_getenv(nam) #endif SCM_PROC(s_software_type, "software-type", 0, 0, 0, scm_software_type); -#ifdef __STDC__ -SCM -scm_software_type(void) -#else + SCM scm_software_type() -#endif { #ifdef nosve return SCM_CAR(scm_intern("nosve", 5)); @@ -157,13 +145,9 @@ scm_software_type() #endif } -#ifdef __STDC__ -void -scm_init_simpos (void) -#else + void scm_init_simpos () -#endif { #include "simpos.x" } diff --git a/libguile/simpos.h b/libguile/simpos.h index 929dc6b61..73ddb006d 100644 --- a/libguile/simpos.h +++ b/libguile/simpos.h @@ -46,22 +46,10 @@ #include "libguile/__scm.h" -#ifdef __STDC__ -extern SCM scm_system(SCM cmd); -extern SCM scm_sys_getenv(SCM nam); -extern SCM scm_software_type(void); -extern void scm_init_simpos (void); - -#else /* STDC */ -extern SCM scm_system(); -extern SCM scm_sys_getenv(); -extern SCM scm_software_type(); -extern void scm_init_simpos (); - -#endif /* STDC */ - - - +extern SCM scm_system SCM_P ((SCM cmd)); +extern SCM scm_sys_getenv SCM_P ((SCM nam)); +extern SCM scm_software_type SCM_P ((void)); +extern void scm_init_simpos SCM_P ((void)); #endif /* SIMPOSH */ diff --git a/libguile/smob.c b/libguile/smob.c index 40604af2a..90c27f6fe 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -59,14 +59,10 @@ scm_sizet scm_numsmob; scm_smobfuns *scm_smobs; -#ifdef __STDC__ -long -scm_newsmob (scm_smobfuns *smob) -#else + long scm_newsmob (smob) scm_smobfuns *smob; -#endif { char *tmp; if (255 <= scm_numsmob) @@ -117,13 +113,9 @@ static scm_smobfuns bigob = -#ifdef __STDC__ -void -scm_smob_prehistory (void) -#else + void scm_smob_prehistory () -#endif { scm_numsmob = 0; scm_smobs = (scm_smobfuns *) malloc (7 * sizeof (scm_smobfuns)); diff --git a/libguile/socket.c b/libguile/socket.c index 0ed4a9b71..aae73772c 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -72,14 +72,10 @@ int close P ((int fd)); extern int inet_aton (); SCM_PROC (s_sys_inet_aton, "inet-aton", 1, 0, 0, scm_sys_inet_aton); -#ifdef __STDC__ -SCM -scm_sys_inet_aton (SCM address) -#else + SCM scm_sys_inet_aton (address) SCM address; -#endif { struct in_addr soka; @@ -93,14 +89,10 @@ scm_sys_inet_aton (address) SCM_PROC (s_inet_ntoa, "inet-ntoa", 1, 0, 0, scm_inet_ntoa); -#ifdef __STDC__ -SCM -scm_inet_ntoa (SCM inetid) -#else + SCM scm_inet_ntoa (inetid) SCM inetid; -#endif { struct in_addr addr; char *s; @@ -114,14 +106,10 @@ scm_inet_ntoa (inetid) } SCM_PROC (s_inet_netof, "inet-netof", 1, 0, 0, scm_inet_netof); -#ifdef __STDC__ -SCM -scm_inet_netof (SCM address) -#else + SCM scm_inet_netof (address) SCM address; -#endif { struct in_addr addr; addr.s_addr = htonl (scm_num2ulong (address, (char *) SCM_ARG1, s_inet_netof)); @@ -129,14 +117,10 @@ scm_inet_netof (address) } SCM_PROC (s_lnaof, "lnaof", 1, 0, 0, scm_lnaof); -#ifdef __STDC__ -SCM -scm_lnaof (SCM address) -#else + SCM scm_lnaof (address) SCM address; -#endif { struct in_addr addr; addr.s_addr = htonl (scm_num2ulong (address, (char *) SCM_ARG1, s_lnaof)); @@ -145,15 +129,11 @@ scm_lnaof (address) SCM_PROC (s_inet_makeaddr, "inet-makeaddr", 2, 0, 0, scm_inet_makeaddr); -#ifdef __STDC__ -SCM -scm_inet_makeaddr (SCM net, SCM lna) -#else + SCM scm_inet_makeaddr (net, lna) SCM net; SCM lna; -#endif { struct in_addr addr; unsigned long netnum; @@ -171,14 +151,10 @@ scm_inet_makeaddr (net, lna) */ SCM_PROC (s_sys_gethost, "gethost", 0, 1, 0, scm_sys_gethost); -#ifdef __STDC__ -SCM -scm_sys_gethost (SCM name) -#else + SCM scm_sys_gethost (name) SCM name; -#endif { SCM ans = scm_make_vector (SCM_MAKINUM (5), SCM_UNSPECIFIED, SCM_BOOL_F); SCM *ve = SCM_VELTS (ans); @@ -230,14 +206,10 @@ scm_sys_gethost (name) SCM_PROC (s_sys_getnet, "getnet", 0, 1, 0, scm_sys_getnet); -#ifdef __STDC__ -SCM -scm_sys_getnet (SCM name) -#else + SCM scm_sys_getnet (name) SCM name; -#endif { SCM ans; SCM *ve; @@ -273,14 +245,10 @@ scm_sys_getnet (name) } SCM_PROC (s_sys_getproto, "getproto", 0, 1, 0, scm_sys_getproto); -#ifdef __STDC__ -SCM -scm_sys_getproto (SCM name) -#else + SCM scm_sys_getproto (name) SCM name; -#endif { SCM ans; SCM *ve; @@ -314,14 +282,12 @@ scm_sys_getproto (name) return ans; } -#ifdef __STDC__ -static SCM -scm_return_entry (struct servent *entry) -#else + +static SCM scm_return_entry SCM_P ((struct servent *entry)); + static SCM scm_return_entry (entry) struct servent *entry; -#endif { SCM ans; SCM *ve; @@ -337,15 +303,11 @@ scm_return_entry (entry) } SCM_PROC (s_sys_getserv, "getserv", 0, 2, 0, scm_sys_getserv); -#ifdef __STDC__ -SCM -scm_sys_getserv (SCM name, SCM proto) -#else + SCM scm_sys_getserv (name, proto) SCM name; SCM proto; -#endif { struct servent *entry; if (SCM_UNBNDP (name)) @@ -374,14 +336,10 @@ scm_sys_getserv (name, proto) } SCM_PROC (s_sethost, "sethost", 0, 1, 0, scm_sethost); -#ifdef __STDC__ -SCM -scm_sethost (SCM arg) -#else + SCM scm_sethost (arg) SCM arg; -#endif { if (SCM_UNBNDP (arg)) endhostent (); @@ -391,14 +349,10 @@ scm_sethost (arg) } SCM_PROC (s_setnet, "setnet", 0, 1, 0, scm_setnet); -#ifdef __STDC__ -SCM -scm_setnet (SCM arg) -#else + SCM scm_setnet (arg) SCM arg; -#endif { if (SCM_UNBNDP (arg)) endnetent (); @@ -408,14 +362,10 @@ scm_setnet (arg) } SCM_PROC (s_setproto, "setproto", 0, 1, 0, scm_setproto); -#ifdef __STDC__ -SCM -scm_setproto (SCM arg) -#else + SCM scm_setproto (arg) SCM arg; -#endif { if (SCM_UNBNDP (arg)) endprotoent (); @@ -425,14 +375,10 @@ scm_setproto (arg) } SCM_PROC (s_setserv, "setserv", 0, 1, 0, scm_setserv); -#ifdef __STDC__ -SCM -scm_setserv (SCM arg) -#else + SCM scm_setserv (arg) SCM arg; -#endif { if (SCM_UNBNDP (arg)) endservent (); @@ -441,13 +387,9 @@ scm_setserv (arg) return SCM_UNSPECIFIED; } -#ifdef __STDC__ -void -scm_init_socket (void) -#else + void scm_init_socket () -#endif { scm_add_feature ("socket"); #include "socket.x" diff --git a/libguile/socket.h b/libguile/socket.h index 95b4ea749..b87afb18f 100644 --- a/libguile/socket.h +++ b/libguile/socket.h @@ -50,39 +50,20 @@ -#ifdef __STDC__ -extern SCM scm_sys_gethost (SCM name); -extern SCM scm_sys_inet_aton (SCM address); -extern SCM scm_inet_ntoa (SCM inetid); -extern SCM scm_inet_netof (SCM address); -extern SCM scm_lnaof (SCM address); -extern SCM scm_inet_makeaddr (SCM net, SCM lna); -extern SCM scm_sys_getnet (SCM name); -extern SCM scm_sys_getproto (SCM name); -extern SCM scm_sys_getserv (SCM name, SCM proto); -extern SCM scm_sethost (SCM arg); -extern SCM scm_setnet (SCM arg); -extern SCM scm_setproto (SCM arg); -extern SCM scm_setserv (SCM arg); -extern void scm_init_socket (void); - -#else /* STDC */ -extern SCM scm_sys_gethost (); -extern SCM scm_sys_inet_aton (); -extern SCM scm_inet_ntoa (); -extern SCM scm_inet_netof (); -extern SCM scm_lnaof (); -extern SCM scm_inet_makeaddr (); -extern SCM scm_sys_getnet (); -extern SCM scm_sys_getproto (); -extern SCM scm_sys_getserv (); -extern SCM scm_sethost (); -extern SCM scm_setnet (); -extern SCM scm_setproto (); -extern SCM scm_setserv (); -extern void scm_init_socket (); - -#endif /* STDC */ +extern SCM scm_sys_gethost SCM_P ((SCM name)); +extern SCM scm_sys_inet_aton SCM_P ((SCM address)); +extern SCM scm_inet_ntoa SCM_P ((SCM inetid)); +extern SCM scm_inet_netof SCM_P ((SCM address)); +extern SCM scm_lnaof SCM_P ((SCM address)); +extern SCM scm_inet_makeaddr SCM_P ((SCM net, SCM lna)); +extern SCM scm_sys_getnet SCM_P ((SCM name)); +extern SCM scm_sys_getproto SCM_P ((SCM name)); +extern SCM scm_sys_getserv SCM_P ((SCM name, SCM proto)); +extern SCM scm_sethost SCM_P ((SCM arg)); +extern SCM scm_setnet SCM_P ((SCM arg)); +extern SCM scm_setproto SCM_P ((SCM arg)); +extern SCM scm_setserv SCM_P ((SCM arg)); +extern void scm_init_socket SCM_P ((void)); #endif /* SOCKETH */ diff --git a/libguile/srcprop.c b/libguile/srcprop.c index 537302d5f..6e35c53f9 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -77,14 +77,12 @@ long scm_tc16_srcprops; static scm_srcprops_chunk *srcprops_chunklist = 0; static scm_srcprops *srcprops_freelist = 0; -#ifdef __STDC__ -static SCM -marksrcprops (SCM obj) -#else + +static SCM marksrcprops SCM_P ((SCM obj)); + static SCM marksrcprops (obj) SCM obj; -#endif { SCM_SETGC8MARK (obj); scm_gc_mark (SRCPROPFNAME (obj)); @@ -92,30 +90,26 @@ marksrcprops (obj) return SRCPROPPLIST (obj); } -#ifdef __STDC__ -static scm_sizet -freesrcprops (SCM obj) -#else + +static scm_sizet freesrcprops SCM_P ((SCM obj)); + static scm_sizet freesrcprops (obj) SCM obj; -#endif { *((scm_srcprops **) SCM_CDR (obj)) = srcprops_freelist; srcprops_freelist = (scm_srcprops *) SCM_CDR (obj); return 0; /* srcprops_chunks are not freed until leaving guile */ } -#ifdef __STDC__ -static int -prinsrcprops (SCM obj, SCM port, scm_print_state *pstate) -#else + +static int prinsrcprops SCM_P ((SCM obj, SCM port, scm_print_state *pstate)); + static int prinsrcprops (obj, port, pstate) SCM obj; SCM port; scm_print_state *pstate; -#endif { int writingp = SCM_WRITINGP (pstate); scm_gen_puts (scm_regular_string, "#string", 1, 0, 0, scm_string); SCM_PROC(s_string, "string", 0, 0, 1, scm_string); -#ifdef __STDC__ -SCM -scm_string (SCM chrs) -#else + SCM scm_string (chrs) SCM chrs; -#endif { SCM res; register char *data; @@ -140,15 +128,11 @@ scm_string (chrs) return res; } -#ifdef __STDC__ -SCM -scm_makstr (long len, int slots) -#else + SCM scm_makstr (len, slots) long len; int slots; -#endif { SCM s; SCM * mem; @@ -173,15 +157,11 @@ scm_makstr (len, slots) /* converts C scm_array of strings to SCM scm_list of strings. */ /* If argc < 0, a null terminated scm_array is assumed. */ -#ifdef __STDC__ -SCM -scm_makfromstrs (int argc, char **argv) -#else + SCM scm_makfromstrs (argc, argv) int argc; char **argv; -#endif { int i = argc; SCM lst = SCM_EOL; @@ -193,14 +173,10 @@ scm_makfromstrs (argc, argv) } -#ifdef __STDC__ -SCM -scm_take0str (char * it) -#else + SCM scm_take0str (it) char * it; -#endif { SCM answer; SCM_NEWCELL (answer); @@ -211,16 +187,12 @@ scm_take0str (it) return answer; } -#ifdef __STDC__ -SCM -scm_makfromstr (const char *src, scm_sizet len, int slots) -#else + SCM scm_makfromstr (src, len, slots) const char *src; scm_sizet len; int slots; -#endif { SCM s; register char *dst; @@ -232,27 +204,19 @@ scm_makfromstr (src, len, slots) } -#ifdef __STDC__ -SCM -scm_makfrom0str (const char *src) -#else + SCM scm_makfrom0str (src) const char *src; -#endif { if (!src) return SCM_BOOL_F; return scm_makfromstr (src, (scm_sizet) strlen (src), 0); } -#ifdef __STDC__ -SCM -scm_makfrom0str_opt (const char *src) -#else + SCM scm_makfrom0str_opt (src) const char *src; -#endif { return scm_makfrom0str (src); } @@ -261,15 +225,11 @@ scm_makfrom0str_opt (src) SCM_PROC(s_make_string, "make-string", 1, 1, 0, scm_make_string); -#ifdef __STDC__ -SCM -scm_make_string (SCM k, SCM chr) -#else + SCM scm_make_string (k, chr) SCM k; SCM chr; -#endif { SCM res; register char *dst; @@ -290,29 +250,21 @@ scm_make_string (k, chr) } SCM_PROC(s_string_length, "string-length", 1, 0, 0, scm_string_length); -#ifdef __STDC__ -SCM -scm_string_length (SCM str) -#else + SCM scm_string_length (str) SCM str; -#endif { SCM_ASSERT (SCM_NIMP (str) && SCM_ROSTRINGP (str), str, SCM_ARG1, s_string_length); return SCM_MAKINUM (SCM_ROLENGTH (str)); } SCM_PROC(s_string_ref, "string-ref", 1, 1, 0, scm_string_ref); -#ifdef __STDC__ -SCM -scm_string_ref (SCM str, SCM k) -#else + SCM scm_string_ref (str, k) SCM str; SCM k; -#endif { SCM_ASSERT (SCM_NIMP (str) && SCM_ROSTRINGP (str), str, SCM_ARG1, s_string_ref); if (k == SCM_UNDEFINED) @@ -323,16 +275,12 @@ scm_string_ref (str, k) } SCM_PROC(s_string_set_x, "string-set!", 3, 0, 0, scm_string_set_x); -#ifdef __STDC__ -SCM -scm_string_set_x (SCM str, SCM k, SCM chr) -#else + SCM scm_string_set_x (str, k, chr) SCM str; SCM k; SCM chr; -#endif { SCM_ASSERT (SCM_NIMP (str) && SCM_STRINGP (str), str, SCM_ARG1, s_string_set_x); SCM_ASSERT (SCM_INUMP (k), k, SCM_ARG2, s_string_set_x); @@ -345,16 +293,12 @@ scm_string_set_x (str, k, chr) SCM_PROC(s_substring, "substring", 2, 1, 0, scm_substring); -#ifdef __STDC__ -SCM -scm_substring (SCM str, SCM start, SCM end) -#else + SCM scm_substring (str, start, end) SCM str; SCM start; SCM end; -#endif { long l; SCM_ASSERT (SCM_NIMP (str) && SCM_ROSTRINGP (str), @@ -371,14 +315,10 @@ scm_substring (str, start, end) } SCM_PROC(s_string_append, "string-append", 0, 0, 1, scm_string_append); -#ifdef __STDC__ -SCM -scm_string_append (SCM args) -#else + SCM scm_string_append (args) SCM args; -#endif { SCM res; register long i = 0; @@ -403,16 +343,12 @@ scm_string_append (args) } SCM_PROC(s_make_shared_substring, "make-shared-substring", 1, 2, 0, scm_make_shared_substring); -#ifdef __STDC__ -SCM -scm_make_shared_substring (SCM str, SCM frm, SCM to) -#else + SCM scm_make_shared_substring (str, frm, to) SCM str; SCM frm; SCM to; -#endif { long f; long t; @@ -462,13 +398,9 @@ scm_make_shared_substring (str, frm, to) return answer; } -#ifdef __STDC__ -void -scm_init_strings (void) -#else + void scm_init_strings () -#endif { #include "strings.x" } diff --git a/libguile/strings.h b/libguile/strings.h index e122d1af9..93f5a6e43 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -57,57 +57,23 @@ -#ifdef __STDC__ -extern SCM scm_string_p (SCM x); -extern SCM scm_read_only_string_p (SCM x); -extern SCM scm_string (SCM chrs); -extern SCM scm_makstr (long len, int slots); -extern SCM scm_makfromstrs (int argc, char **argv); -extern SCM scm_take0str (char * it); -extern SCM scm_makfromstr (const char *src, scm_sizet len, int slots); -extern SCM scm_makfrom0str (const char *src); -extern SCM scm_makfrom0str_opt (const char *src); -extern SCM scm_make_string (SCM k, SCM chr); -extern SCM scm_string_length (SCM str); -extern SCM scm_string_ref (SCM str, SCM k); -extern SCM scm_string_set_x (SCM str, SCM k, SCM chr); -extern SCM scm_substring (SCM str, SCM start, SCM end); -extern SCM scm_string_append (SCM args); -extern SCM scm_make_shared_substring (SCM str, SCM frm, SCM to); -extern void scm_init_strings (void); - -#else /* STDC */ -extern SCM scm_string_p (); -extern SCM scm_read_only_string_p (); -extern SCM scm_string (); -extern SCM scm_makstr (); -extern SCM scm_makfromstrs (); -extern SCM scm_take0str (); -extern SCM scm_makfromstr (); -extern SCM scm_makfrom0str (); -extern SCM scm_makfrom0str_opt (); -extern SCM scm_make_string (); -extern SCM scm_string_length (); -extern SCM scm_string_ref (); -extern SCM scm_string_set_x (); -extern SCM scm_substring (); -extern SCM scm_string_append (); -extern SCM scm_make_shared_substring (); -extern void scm_init_strings (); - -#endif /* STDC */ - - - - - - - - - - - - +extern SCM scm_string_p SCM_P ((SCM x)); +extern SCM scm_read_only_string_p SCM_P ((SCM x)); +extern SCM scm_string SCM_P ((SCM chrs)); +extern SCM scm_makstr SCM_P ((long len, int slots)); +extern SCM scm_makfromstrs SCM_P ((int argc, char **argv)); +extern SCM scm_take0str SCM_P ((char * it)); +extern SCM scm_makfromstr SCM_P ((const char *src, scm_sizet len, int slots)); +extern SCM scm_makfrom0str SCM_P ((const char *src)); +extern SCM scm_makfrom0str_opt SCM_P ((const char *src)); +extern SCM scm_make_string SCM_P ((SCM k, SCM chr)); +extern SCM scm_string_length SCM_P ((SCM str)); +extern SCM scm_string_ref SCM_P ((SCM str, SCM k)); +extern SCM scm_string_set_x SCM_P ((SCM str, SCM k, SCM chr)); +extern SCM scm_substring SCM_P ((SCM str, SCM start, SCM end)); +extern SCM scm_string_append SCM_P ((SCM args)); +extern SCM scm_make_shared_substring SCM_P ((SCM str, SCM frm, SCM to)); +extern void scm_init_strings SCM_P ((void)); #endif /* STRINGSH */ diff --git a/libguile/strop.c b/libguile/strop.c index bfcf5f498..2f73f9724 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -25,10 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "strop.h" -#ifdef __STDC__ -int -scm_i_index (SCM * str, SCM chr, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why) -#else + int scm_i_index (str, chr, sub_start, sub_end, pos, pos2, pos3, pos4, why) SCM * str; @@ -40,7 +37,6 @@ scm_i_index (str, chr, sub_start, sub_end, pos, pos2, pos3, pos4, why) int pos3; int pos4; char * why; -#endif { unsigned char * p; int x; @@ -77,10 +73,7 @@ scm_i_index (str, chr, sub_start, sub_end, pos, pos2, pos3, pos4, why) return -1; } -#ifdef __STDC__ -int -scm_i_rindex (SCM * str, SCM chr, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why) -#else + int scm_i_rindex (str, chr, sub_start, sub_end, pos, pos2, pos3, pos4, why) SCM * str; @@ -92,7 +85,6 @@ scm_i_rindex (str, chr, sub_start, sub_end, pos, pos2, pos3, pos4, why) int pos3; int pos4; char * why; -#endif { unsigned char * p; int x; @@ -132,17 +124,13 @@ scm_i_rindex (str, chr, sub_start, sub_end, pos, pos2, pos3, pos4, why) SCM_PROC(s_string_index, "string-index", 2, 2, 0, scm_string_index); -#ifdef __STDC__ -SCM -scm_string_index (SCM str, SCM chr, SCM frm, SCM to) -#else + SCM scm_string_index (str, chr, frm, to) SCM str; SCM chr; SCM frm; SCM to; -#endif { int pos; @@ -157,17 +145,13 @@ scm_string_index (str, chr, frm, to) } SCM_PROC(s_string_rindex, "string-rindex", 2, 2, 0, scm_string_rindex); -#ifdef __STDC__ -SCM -scm_string_rindex (SCM str, SCM chr, SCM frm, SCM to) -#else + SCM scm_string_rindex (str, chr, frm, to) SCM str; SCM chr; SCM frm; SCM to; -#endif { int pos; @@ -187,16 +171,12 @@ scm_string_rindex (str, chr, frm, to) SCM_PROC(s_substring_move_left_x, "substring-move-left!", 2, 0, 1, scm_substring_move_left_x); -#ifdef __STDC__ -SCM -scm_substring_move_left_x (SCM str1, SCM start1, SCM args) -#else + SCM scm_substring_move_left_x (str1, start1, args) SCM str1; SCM start1; SCM args; -#endif { SCM end1, str2, start2; long i, j, e; @@ -221,16 +201,12 @@ scm_substring_move_left_x (str1, start1, args) SCM_PROC(s_substring_move_right_x, "substring-move-right!", 2, 0, 1, scm_substring_move_right_x); -#ifdef __STDC__ -SCM -scm_substring_move_right_x (SCM str1, SCM start1, SCM args) -#else + SCM scm_substring_move_right_x (str1, start1, args) SCM str1; SCM start1; SCM args; -#endif { SCM end1, str2, start2; long i, j, e; @@ -255,16 +231,12 @@ scm_substring_move_right_x (str1, start1, args) SCM_PROC(s_substring_fill_x, "substring-fill!", 2, 0, 1, scm_substring_fill_x); -#ifdef __STDC__ -SCM -scm_substring_fill_x (SCM str, SCM start, SCM args) -#else + SCM scm_substring_fill_x (str, start, args) SCM str; SCM start; SCM args; -#endif { SCM end, fill; long i, e; @@ -286,14 +258,10 @@ scm_substring_fill_x (str, start, args) SCM_PROC(s_string_null_p, "string-null?", 1, 0, 0, scm_string_null_p); -#ifdef __STDC__ -SCM -scm_string_null_p (SCM str) -#else + SCM scm_string_null_p (str) SCM str; -#endif { SCM_ASSERT (SCM_NIMP (str) && SCM_ROSTRINGP (str), str, SCM_ARG1, s_string_null_p); return (SCM_ROLENGTH (str) @@ -303,14 +271,10 @@ scm_string_null_p (str) SCM_PROC(s_string_to_list, "string->list", 1, 0, 0, scm_string_to_list); -#ifdef __STDC__ -SCM -scm_string_to_list (SCM str) -#else + SCM scm_string_to_list (str) SCM str; -#endif { long i; SCM res = SCM_EOL; @@ -324,14 +288,10 @@ scm_string_to_list (str) SCM_PROC(s_string_copy, "string-copy", 1, 0, 0, scm_string_copy); -#ifdef __STDC__ -SCM -scm_string_copy (SCM str) -#else + SCM scm_string_copy (str) SCM str; -#endif { SCM_ASSERT (SCM_NIMP (str) && SCM_STRINGP (str), str, SCM_ARG1, s_string_copy); return scm_makfromstr (SCM_CHARS (str), (scm_sizet)SCM_LENGTH (str), 0); @@ -339,15 +299,11 @@ scm_string_copy (str) SCM_PROC(s_string_fill_x, "string-fill!", 2, 0, 0, scm_string_fill_x); -#ifdef __STDC__ -SCM -scm_string_fill_x (SCM str, SCM chr) -#else + SCM scm_string_fill_x (str, chr) SCM str; SCM chr; -#endif { register char *dst, c; register long k; @@ -360,13 +316,9 @@ scm_string_fill_x (str, chr) } -#ifdef __STDC__ -void -scm_init_strop (void) -#else + void scm_init_strop () -#endif { #include "strop.x" } diff --git a/libguile/strop.h b/libguile/strop.h index 821e97b1c..fea23d79c 100644 --- a/libguile/strop.h +++ b/libguile/strop.h @@ -48,42 +48,18 @@ -#ifdef __STDC__ -extern int scm_i_index (SCM * str, SCM chr, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why); -extern int scm_i_rindex (SCM * str, SCM chr, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why); -extern SCM scm_string_index (SCM str, SCM chr, SCM frm, SCM to); -extern SCM scm_string_rindex (SCM str, SCM chr, SCM frm, SCM to); -extern SCM scm_substring_move_left_x (SCM str1, SCM start1, SCM args); -extern SCM scm_substring_move_right_x (SCM str1, SCM start1, SCM args); -extern SCM scm_substring_fill_x (SCM str, SCM start, SCM args); -extern SCM scm_string_null_p (SCM str); -extern SCM scm_string_to_list (SCM str); -extern SCM scm_string_copy (SCM str); -extern SCM scm_string_fill_x (SCM str, SCM chr); -extern void scm_init_strop (void); - -#else /* STDC */ -extern int scm_i_index (); -extern int scm_i_rindex (); -extern SCM scm_string_index (); -extern SCM scm_string_rindex (); -extern SCM scm_substring_move_left_x (); -extern SCM scm_substring_move_right_x (); -extern SCM scm_substring_fill_x (); -extern SCM scm_string_null_p (); -extern SCM scm_string_to_list (); -extern SCM scm_string_copy (); -extern SCM scm_string_fill_x (); -extern void scm_init_strop (); - -#endif /* STDC */ - - - - - - - +extern int scm_i_index SCM_P ((SCM * str, SCM chr, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why)); +extern int scm_i_rindex SCM_P ((SCM * str, SCM chr, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why)); +extern SCM scm_string_index SCM_P ((SCM str, SCM chr, SCM frm, SCM to)); +extern SCM scm_string_rindex SCM_P ((SCM str, SCM chr, SCM frm, SCM to)); +extern SCM scm_substring_move_left_x SCM_P ((SCM str1, SCM start1, SCM args)); +extern SCM scm_substring_move_right_x SCM_P ((SCM str1, SCM start1, SCM args)); +extern SCM scm_substring_fill_x SCM_P ((SCM str, SCM start, SCM args)); +extern SCM scm_string_null_p SCM_P ((SCM str)); +extern SCM scm_string_to_list SCM_P ((SCM str)); +extern SCM scm_string_copy SCM_P ((SCM str)); +extern SCM scm_string_fill_x SCM_P ((SCM str, SCM chr)); +extern void scm_init_strop SCM_P ((void)); #endif /* STROPH */ diff --git a/libguile/strorder.c b/libguile/strorder.c index 8339a893e..63d2ae7b0 100644 --- a/libguile/strorder.c +++ b/libguile/strorder.c @@ -48,15 +48,11 @@ SCM_PROC1 (s_string_equal_p, "string=?", scm_tc7_rpsubr, scm_string_equal_p); -#ifdef __STDC__ -SCM -scm_string_equal_p (SCM s1, SCM s2) -#else + SCM scm_string_equal_p (s1, s2) SCM s1; SCM s2; -#endif { register scm_sizet i; register char *c1, *c2; @@ -77,15 +73,11 @@ scm_string_equal_p (s1, s2) } SCM_PROC1 (s_string_ci_equal_p, "string-ci=?", scm_tc7_rpsubr, scm_string_ci_equal_p); -#ifdef __STDC__ -SCM -scm_string_ci_equal_p (SCM s1, SCM s2) -#else + SCM scm_string_ci_equal_p (s1, s2) SCM s1; SCM s2; -#endif { register scm_sizet i; register unsigned char *c1, *c2; @@ -105,15 +97,11 @@ scm_string_ci_equal_p (s1, s2) } SCM_PROC1 (s_string_less_p, "string?", scm_tc7_rpsubr, scm_string_gr_p); -#ifdef __STDC__ -SCM -scm_string_gr_p (SCM s1, SCM s2) -#else + SCM scm_string_gr_p (s1, s2) SCM s1; SCM s2; -#endif { return scm_string_less_p (s2, s1); } SCM_PROC1 (s_string_geq_p, "string>=?", scm_tc7_rpsubr, scm_string_geq_p); -#ifdef __STDC__ -SCM -scm_string_geq_p (SCM s1, SCM s2) -#else + SCM scm_string_geq_p (s1, s2) SCM s1; SCM s2; -#endif { return SCM_BOOL_NOT (scm_string_less_p (s1, s2)); } SCM_PROC1 (s_string_ci_less_p, "string-ci?", scm_tc7_rpsubr, scm_string_ci_gr_p); -#ifdef __STDC__ -SCM -scm_string_ci_gr_p (SCM s1, SCM s2) -#else + SCM scm_string_ci_gr_p (s1, s2) SCM s1; SCM s2; -#endif { return scm_string_ci_less_p (s2, s1); } SCM_PROC1 (s_string_ci_geq_p, "string-ci>=?", scm_tc7_rpsubr, scm_string_ci_geq_p); -#ifdef __STDC__ -SCM -scm_string_ci_geq_p (SCM s1, SCM s2) -#else + SCM scm_string_ci_geq_p (s1, s2) SCM s1; SCM s2; -#endif { return SCM_BOOL_NOT (scm_string_ci_less_p (s1, s2)); } -#ifdef __STDC__ -void -scm_init_strorder (void) -#else + void scm_init_strorder () -#endif { #include "strorder.x" } diff --git a/libguile/strorder.h b/libguile/strorder.h index 90a7f586e..2263a1c7f 100644 --- a/libguile/strorder.h +++ b/libguile/strorder.h @@ -52,34 +52,17 @@ -#ifdef __STDC__ -extern SCM scm_string_equal_p (SCM s1, SCM s2); -extern SCM scm_string_ci_equal_p (SCM s1, SCM s2); -extern SCM scm_string_less_p (SCM s1, SCM s2); -extern SCM scm_string_leq_p (SCM s1, SCM s2); -extern SCM scm_string_gr_p (SCM s1, SCM s2); -extern SCM scm_string_geq_p (SCM s1, SCM s2); -extern SCM scm_string_ci_less_p (SCM s1, SCM s2); -extern SCM scm_string_ci_leq_p (SCM s1, SCM s2); -extern SCM scm_string_ci_gr_p (SCM s1, SCM s2); -extern SCM scm_string_ci_geq_p (SCM s1, SCM s2); -extern void scm_init_strorder (void); - -#else /* STDC */ -extern SCM scm_string_equal_p (); -extern SCM scm_string_ci_equal_p (); -extern SCM scm_string_less_p (); -extern SCM scm_string_leq_p (); -extern SCM scm_string_gr_p (); -extern SCM scm_string_geq_p (); -extern SCM scm_string_ci_less_p (); -extern SCM scm_string_ci_leq_p (); -extern SCM scm_string_ci_gr_p (); -extern SCM scm_string_ci_geq_p (); -extern void scm_init_strorder (); - -#endif /* STDC */ - +extern SCM scm_string_equal_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_ci_equal_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_less_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_leq_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_gr_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_geq_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_ci_less_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_ci_leq_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_ci_gr_p SCM_P ((SCM s1, SCM s2)); +extern SCM scm_string_ci_geq_p SCM_P ((SCM s1, SCM s2)); +extern void scm_init_strorder SCM_P ((void)); #endif /* STRORDERH */ diff --git a/libguile/strports.c b/libguile/strports.c index 5f09a208e..e3f228f7a 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -57,30 +57,26 @@ * */ -#ifdef __STDC__ -static int -prinstpt (SCM exp, SCM port, int writing) -#else + +static int prinstpt SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int -prinstpt (exp, port, writing) +prinstpt (exp, port, pstate) SCM exp; SCM port; - int writing; -#endif + scm_print_state *pstate; { scm_prinport (exp, port, "string"); return !0; } -#ifdef __STDC__ -static int -stputc (int c, SCM p) -#else + +static int stputc SCM_P ((int c, SCM p)); + static int stputc (c, p) int c; SCM p; -#endif { scm_sizet ind = SCM_INUM (SCM_CAR (p)); SCM_DEFER_INTS; @@ -92,17 +88,15 @@ stputc (c, p) return c; } -#ifdef __STDC__ -static scm_sizet -stwrite (char *str, scm_sizet siz, scm_sizet num, SCM p) -#else + +static scm_sizet stwrite SCM_P ((char *str, scm_sizet siz, scm_sizet num, SCM p)); + static scm_sizet stwrite (str, siz, num, p) char *str; scm_sizet siz; scm_sizet num; SCM p; -#endif { scm_sizet ind = SCM_INUM (SCM_CAR (p)); scm_sizet len = siz * num; @@ -118,28 +112,24 @@ stwrite (str, siz, num, p) return num; } -#ifdef __STDC__ -static int -stputs (char *s, SCM p) -#else + +static int stputs SCM_P ((char *s, SCM p)); + static int stputs (s, p) char *s; SCM p; -#endif { stwrite (s, 1, strlen (s), p); return 0; } -#ifdef __STDC__ -static int -stgetc (SCM p) -#else + +static int stgetc SCM_P ((SCM p)); + static int stgetc (p) SCM p; -#endif { scm_sizet ind = SCM_INUM (SCM_CAR (p)); if (ind >= SCM_ROLENGTH (SCM_CDR (p))) @@ -148,17 +138,13 @@ stgetc (p) return SCM_ROUCHARS (SCM_CDR (p))[ind]; } -#ifdef __STDC__ -SCM -scm_mkstrport (SCM pos, SCM str, long modes, char * caller) -#else + SCM scm_mkstrport (pos, str, modes, caller) SCM pos; SCM str; long modes; char * caller; -#endif { SCM z; SCM stream; @@ -178,14 +164,10 @@ scm_mkstrport (pos, str, modes, caller) } SCM_PROC(s_call_with_output_string, "call-with-output-string", 1, 0, 0, scm_call_with_output_string); -#ifdef __STDC__ -SCM -scm_call_with_output_string (SCM proc) -#else + SCM scm_call_with_output_string (proc) SCM proc; -#endif { SCM p; p = scm_mkstrport(SCM_INUM0, scm_make_string(SCM_MAKINUM(30), SCM_UNDEFINED), @@ -208,14 +190,10 @@ scm_call_with_output_string (proc) /* Return a Scheme string obtained by printing a given object. */ -#ifdef __STDC__ -SCM -scm_strprint_obj (SCM obj) -#else + SCM scm_strprint_obj (obj) SCM obj; -#endif { SCM str; SCM port; @@ -238,28 +216,22 @@ scm_strprint_obj (obj) SCM_PROC(s_call_with_input_string, "call-with-input-string", 2, 0, 0, scm_call_with_input_string); -#ifdef __STDC__ -SCM -scm_call_with_input_string (SCM str, SCM proc) -#else + SCM scm_call_with_input_string (str, proc) SCM str; SCM proc; -#endif { SCM p = scm_mkstrport(SCM_INUM0, str, SCM_OPN | SCM_RDNG, s_call_with_input_string); return scm_apply (proc, p, scm_listofnull); } -#ifdef __STDC__ -static int -noop0 (FILE *stream) -#else + +static int noop0 SCM_P ((SCM stream)); + static int noop0 (stream) - FILE *stream; -#endif + SCM stream; { return 0; } @@ -280,13 +252,9 @@ scm_ptobfuns scm_stptob = }; -#ifdef __STDC__ -void -scm_init_strports (void) -#else + void scm_init_strports () -#endif { #include "strports.x" } diff --git a/libguile/strports.h b/libguile/strports.h index e8ba90ff4..48e15e6d6 100644 --- a/libguile/strports.h +++ b/libguile/strports.h @@ -49,27 +49,11 @@ extern scm_ptobfuns scm_stptob; -#ifdef __STDC__ -extern SCM scm_mkstrport (SCM pos, SCM str, long modes, char * caller); -extern SCM scm_call_with_output_string (SCM proc); -extern SCM scm_strprint_obj (SCM obj); -extern SCM scm_call_with_input_string (SCM str, SCM proc); -extern void scm_init_strports (void); - -#else /* STDC */ -extern SCM scm_mkstrport (); -extern SCM scm_call_with_output_string (); -extern SCM scm_strprint_obj (); -extern SCM scm_call_with_input_string (); -extern void scm_init_strports (); - -#endif /* STDC */ - - - - - - +extern SCM scm_mkstrport SCM_P ((SCM pos, SCM str, long modes, char * caller)); +extern SCM scm_call_with_output_string SCM_P ((SCM proc)); +extern SCM scm_strprint_obj SCM_P ((SCM obj)); +extern SCM scm_call_with_input_string SCM_P ((SCM str, SCM proc)); +extern void scm_init_strports SCM_P ((void)); #endif /* STRPORTSH */ diff --git a/libguile/struct.c b/libguile/struct.c index 91dee41c8..9ed0e0033 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -57,14 +57,10 @@ static int struct_num = 0; SCM_PROC (s_struct_make_layout, "make-struct-layout", 1, 0, 0, scm_make_struct_layout); -#ifdef __STDC__ -SCM -scm_make_struct_layout (SCM fields) -#else + SCM scm_make_struct_layout (fields) SCM fields; -#endif { SCM new_sym; SCM_ASSERT (SCM_NIMP (fields) && SCM_ROSTRINGP (fields), @@ -134,16 +130,14 @@ scm_make_struct_layout (fields) -#ifdef __STDC__ -static void -init_struct (SCM handle, int tail_elts, SCM inits) -#else + +static void init_struct SCM_P ((SCM handle, int tail_elts, SCM inits)); + static void init_struct (handle, tail_elts, inits) SCM handle; int tail_elts; SCM inits; -#endif { SCM layout; SCM * data; @@ -235,14 +229,10 @@ init_struct (handle, tail_elts, inits) SCM_PROC (s_struct_p, "struct?", 1, 0, 0, scm_struct_p); -#ifdef __STDC__ -SCM -scm_struct_p (SCM x) -#else + SCM scm_struct_p (x) SCM x; -#endif { return ((SCM_NIMP (x) && SCM_STRUCTP (x)) ? SCM_BOOL_T @@ -250,14 +240,10 @@ scm_struct_p (x) } SCM_PROC (s_struct_vtable_p, "struct-vtable?", 1, 0, 0, scm_struct_vtable_p); -#ifdef __STDC__ -SCM -scm_struct_vtable_p (SCM x) -#else + SCM scm_struct_vtable_p (x) SCM x; -#endif { SCM layout; SCM * mem; @@ -291,16 +277,12 @@ scm_struct_vtable_p (x) } SCM_PROC (s_make_struct, "make-struct", 2, 0, 1, scm_make_struct); -#ifdef __STDC__ -SCM -scm_make_struct (SCM vtable, SCM tail_array_size, SCM init) -#else + SCM scm_make_struct (vtable, tail_array_size, init) SCM vtable; SCM tail_array_size; SCM init; -#endif { SCM layout; int basic_size; @@ -336,16 +318,12 @@ scm_make_struct (vtable, tail_array_size, init) SCM_PROC (s_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1, scm_make_vtable_vtable); -#ifdef __STDC__ -SCM -scm_make_vtable_vtable (SCM extra_fields, SCM tail_array_size, SCM init) -#else + SCM scm_make_vtable_vtable (extra_fields, tail_array_size, init) SCM extra_fields; SCM tail_array_size; SCM init; -#endif { SCM fields; SCM layout; @@ -388,15 +366,11 @@ scm_make_vtable_vtable (extra_fields, tail_array_size, init) SCM_PROC (s_struct_ref, "struct-ref", 2, 0, 0, scm_struct_ref); -#ifdef __STDC__ -SCM -scm_struct_ref (SCM handle, SCM pos) -#else + SCM scm_struct_ref (handle, pos) SCM handle; SCM pos; -#endif { SCM answer = SCM_UNDEFINED; SCM * data; @@ -472,16 +446,12 @@ scm_struct_ref (handle, pos) SCM_PROC (s_struct_set_x, "struct-set!", 3, 0, 0, scm_struct_set_x); -#ifdef __STDC__ -SCM -scm_struct_set_x (SCM handle, SCM pos, SCM val) -#else + SCM scm_struct_set_x (handle, pos, val) SCM handle; SCM pos; SCM val; -#endif { SCM * data; SCM layout; @@ -554,14 +524,10 @@ scm_struct_set_x (handle, pos, val) SCM_PROC (s_struct_vtable, "struct-vtable", 1, 0, 0, scm_struct_vtable); -#ifdef __STDC__ -SCM -scm_struct_vtable (SCM handle) -#else + SCM scm_struct_vtable (handle) SCM handle; -#endif { SCM_ASSERT (SCM_NIMP (handle) && SCM_STRUCTP (handle), handle, SCM_ARG1, s_struct_vtable); @@ -570,14 +536,10 @@ scm_struct_vtable (handle) SCM_PROC (s_struct_vtable_tag, "struct-vtable-tag", 1, 0, 0, scm_struct_vtable_tag); -#ifdef __STDC__ -SCM -scm_struct_vtable_tag (SCM handle) -#else + SCM scm_struct_vtable_tag (handle) SCM handle; -#endif { SCM_ASSERT (SCM_NIMP (handle) && (SCM_BOOL_F != scm_struct_vtable_p (handle)), handle, SCM_ARG1, s_struct_vtable_tag); @@ -587,13 +549,9 @@ scm_struct_vtable_tag (handle) -#ifdef __STDC__ -void -scm_init_struct (void) -#else + void scm_init_struct () -#endif { required_vtable_fields = SCM_CAR (scm_intern_obarray ("pruosr", sizeof ("pruosr") - 1, SCM_BOOL_F)); scm_permanent_object (required_vtable_fields); diff --git a/libguile/struct.h b/libguile/struct.h index a8bff944c..1b2b44924 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -70,37 +70,16 @@ -#ifdef __STDC__ -extern SCM scm_make_struct_layout (SCM fields); -extern SCM scm_struct_p (SCM x); -extern SCM scm_struct_vtable_p (SCM x); -extern SCM scm_make_struct (SCM vtable, SCM tail_array_size, SCM init); -extern SCM scm_make_vtable_vtable (SCM extra_fields, SCM tail_array_size, SCM init); -extern SCM scm_struct_ref (SCM handle, SCM pos); -extern SCM scm_struct_set_x (SCM handle, SCM pos, SCM val); -extern SCM scm_struct_vtable (SCM handle); -extern SCM scm_struct_vtable_tag (SCM handle); -extern void scm_init_struct (void); - -#else /* STDC */ -extern SCM scm_make_struct_layout (); -extern SCM scm_struct_p (); -extern SCM scm_struct_vtable_p (); -extern SCM scm_make_struct (); -extern SCM scm_make_vtable_vtable (); -extern SCM scm_struct_ref (); -extern SCM scm_struct_set_x (); -extern SCM scm_struct_vtable (); -extern SCM scm_struct_vtable_tag (); -extern void scm_init_struct (); - -#endif /* STDC */ - - - - - - +extern SCM scm_make_struct_layout SCM_P ((SCM fields)); +extern SCM scm_struct_p SCM_P ((SCM x)); +extern SCM scm_struct_vtable_p SCM_P ((SCM x)); +extern SCM scm_make_struct SCM_P ((SCM vtable, SCM tail_array_size, SCM init)); +extern SCM scm_make_vtable_vtable SCM_P ((SCM extra_fields, SCM tail_array_size, SCM init)); +extern SCM scm_struct_ref SCM_P ((SCM handle, SCM pos)); +extern SCM scm_struct_set_x SCM_P ((SCM handle, SCM pos, SCM val)); +extern SCM scm_struct_vtable SCM_P ((SCM handle)); +extern SCM scm_struct_vtable_tag SCM_P ((SCM handle)); +extern void scm_init_struct SCM_P ((void)); #endif /* STRUCTH */ diff --git a/libguile/symbols.c b/libguile/symbols.c index 30f7ed4f8..4f80f9eff 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -67,16 +67,12 @@ /* {Symbols} */ -#ifdef __STDC__ -unsigned long -scm_strhash (unsigned char *str, scm_sizet len, unsigned long n) -#else + unsigned long scm_strhash (str, len, n) unsigned char *str; scm_sizet len; unsigned long n; -#endif { if (len > 5) { @@ -102,16 +98,12 @@ int scm_symhash_dim = NUM_HASH_BUCKETS; /* scm_sym2vcell * looks up the symbol in the symhash table. */ -#ifdef __STDC__ -SCM -scm_sym2vcell (SCM sym, SCM thunk, SCM definep) -#else + SCM scm_sym2vcell (sym, thunk, definep) SCM sym; SCM thunk; SCM definep; -#endif { if (SCM_NIMP(thunk)) { @@ -170,15 +162,11 @@ scm_sym2vcell (sym, thunk, definep) /* scm_sym2ovcell * looks up the symbol in an arbitrary obarray (defaulting to scm_symhash). */ -#ifdef __STDC__ -SCM -scm_sym2ovcell_soft (SCM sym, SCM obarray) -#else + SCM scm_sym2ovcell_soft (sym, obarray) SCM sym; SCM obarray; -#endif { SCM lsym, z; scm_sizet scm_hash; @@ -202,15 +190,11 @@ scm_sym2ovcell_soft (sym, obarray) return SCM_BOOL_F; } -#ifdef __STDC__ -SCM -scm_sym2ovcell (SCM sym, SCM obarray) -#else + SCM scm_sym2ovcell (sym, obarray) SCM sym; SCM obarray; -#endif { SCM answer; answer = scm_sym2ovcell_soft (sym, obarray); @@ -242,17 +226,13 @@ scm_sym2ovcell (sym, obarray) If OBARRAY is scm_symhash, and that doesn't contain the symbol, check scm_weak_symhash instead. */ -#ifdef __STDC__ -SCM -scm_intern_obarray_soft (char *name, scm_sizet len, SCM obarray, int softness) -#else + SCM scm_intern_obarray_soft (name, len, obarray, softness) char *name; scm_sizet len; SCM obarray; int softness; -#endif { SCM lsym; SCM z; @@ -347,42 +327,29 @@ scm_intern_obarray_soft (name, len, obarray, softness) } } -#ifdef __STDC__ -SCM -scm_intern_obarray (char *name, scm_sizet len, SCM obarray) -#else + SCM scm_intern_obarray (name, len, obarray) char *name; scm_sizet len; SCM obarray; -#endif { return scm_intern_obarray_soft (name, len, obarray, 0); } -#ifdef __STDC__ -SCM -scm_intern (char *name, scm_sizet len) -#else SCM scm_intern (name, len) char *name; scm_sizet len; -#endif { return scm_intern_obarray (name, len, scm_symhash); } -#ifdef __STDC__ -SCM -scm_intern0 (char * name) -#else + SCM scm_intern0 (name) char * name; -#endif { return scm_intern (name, strlen (name)); } @@ -390,15 +357,10 @@ scm_intern0 (name) /* Intern the symbol named NAME in scm_symhash, and give it the value VAL. NAME is null-terminated. */ -#ifdef __STDC__ -SCM -scm_sysintern (char *name, SCM val) -#else SCM scm_sysintern (name, val) char *name; SCM val; -#endif { SCM easy_answer; SCM_DEFER_INTS; @@ -427,28 +389,20 @@ scm_sysintern (name, val) SCM_PROC(s_symbol_p, "symbol?", 1, 0, 0, scm_symbol_p); -#ifdef __STDC__ -SCM -scm_symbol_p(SCM x) -#else + SCM scm_symbol_p(x) SCM x; -#endif { if SCM_IMP(x) return SCM_BOOL_F; return SCM_SYMBOLP(x) ? SCM_BOOL_T : SCM_BOOL_F; } SCM_PROC(s_symbol_to_string, "symbol->string", 1, 0, 0, scm_symbol_to_string); -#ifdef __STDC__ -SCM -scm_symbol_to_string(SCM s) -#else + SCM scm_symbol_to_string(s) SCM s; -#endif { SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG1, s_symbol_to_string); return scm_makfromstr(SCM_CHARS(s), (scm_sizet)SCM_LENGTH(s), 0); @@ -456,14 +410,10 @@ scm_symbol_to_string(s) SCM_PROC(s_string_to_symbol, "string->symbol", 1, 0, 0, scm_string_to_symbol); -#ifdef __STDC__ -SCM -scm_string_to_symbol(SCM s) -#else + SCM scm_string_to_symbol(s) SCM s; -#endif { SCM vcell; SCM answer; @@ -483,16 +433,12 @@ scm_string_to_symbol(s) SCM_PROC(s_string_to_obarray_symbol, "string->obarray-symbol", 2, 1, 0, scm_string_to_obarray_symbol); -#ifdef __STDC__ -SCM -scm_string_to_obarray_symbol(SCM o, SCM s, SCM softp) -#else + SCM scm_string_to_obarray_symbol(o, s, softp) SCM o; SCM s; SCM softp; -#endif { SCM vcell; SCM answer; @@ -524,15 +470,11 @@ scm_string_to_obarray_symbol(o, s, softp) } SCM_PROC(s_intern_symbol, "intern-symbol", 2, 0, 0, scm_intern_symbol); -#ifdef __STDC__ -SCM -scm_intern_symbol(SCM o, SCM s) -#else + SCM scm_intern_symbol(o, s) SCM o; SCM s; -#endif { scm_sizet hval; SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG2, s_intern_symbol); @@ -564,15 +506,11 @@ scm_intern_symbol(o, s) } SCM_PROC(s_unintern_symbol, "unintern-symbol", 2, 0, 0, scm_unintern_symbol); -#ifdef __STDC__ -SCM -scm_unintern_symbol(SCM o, SCM s) -#else + SCM scm_unintern_symbol(o, s) SCM o; SCM s; -#endif { scm_sizet hval; SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG2, s_unintern_symbol); @@ -607,15 +545,11 @@ scm_unintern_symbol(o, s) } SCM_PROC(s_symbol_binding, "symbol-binding", 2, 0, 0, scm_symbol_binding); -#ifdef __STDC__ -SCM -scm_symbol_binding (SCM o, SCM s) -#else + SCM scm_symbol_binding (o, s) SCM o; SCM s; -#endif { SCM vcell; SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG2, s_symbol_binding); @@ -628,15 +562,11 @@ scm_symbol_binding (o, s) SCM_PROC(s_symbol_interned_p, "symbol-interned?", 2, 0, 0, scm_symbol_interned_p); -#ifdef __STDC__ -SCM -scm_symbol_interned_p (SCM o, SCM s) -#else + SCM scm_symbol_interned_p (o, s) SCM o; SCM s; -#endif { SCM vcell; SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG2, s_symbol_interned_p); @@ -653,15 +583,11 @@ scm_symbol_interned_p (o, s) SCM_PROC(s_symbol_bound_p, "symbol-bound?", 2, 0, 0, scm_symbol_bound_p); -#ifdef __STDC__ -SCM -scm_symbol_bound_p (SCM o, SCM s) -#else + SCM scm_symbol_bound_p (o, s) SCM o; SCM s; -#endif { SCM vcell; SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG2, s_symbol_bound_p); @@ -677,16 +603,12 @@ scm_symbol_bound_p (o, s) SCM_PROC(s_symbol_set_x, "symbol-set!", 3, 0, 0, scm_symbol_set_x); -#ifdef __STDC__ -SCM -scm_symbol_set_x (SCM o, SCM s, SCM v) -#else + SCM scm_symbol_set_x (o, s, v) SCM o; SCM s; SCM v; -#endif { SCM vcell; SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG2, s_symbol_set_x); @@ -713,14 +635,10 @@ msymbolize (s) SCM_PROC(s_symbol_fref, "symbol-fref", 1, 0, 0, scm_symbol_fref); -#ifdef __STDC__ -SCM -scm_symbol_fref (SCM s) -#else + SCM scm_symbol_fref (s) SCM s; -#endif { SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG1, s_symbol_fref); SCM_DEFER_INTS; @@ -732,14 +650,10 @@ scm_symbol_fref (s) SCM_PROC(s_symbol_pref, "symbol-pref", 1, 0, 0, scm_symbol_pref); -#ifdef __STDC__ -SCM -scm_symbol_pref (SCM s) -#else + SCM scm_symbol_pref (s) SCM s; -#endif { SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG1, s_symbol_pref); SCM_DEFER_INTS; @@ -751,15 +665,11 @@ scm_symbol_pref (s) SCM_PROC(s_symbol_fset_x, "symbol-fset!", 2, 0, 0, scm_symbol_fset_x); -#ifdef __STDC__ -SCM -scm_symbol_fset_x (SCM s, SCM val) -#else + SCM scm_symbol_fset_x (s, val) SCM s; SCM val; -#endif { SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG1, s_symbol_fset_x); SCM_DEFER_INTS; @@ -772,15 +682,11 @@ scm_symbol_fset_x (s, val) SCM_PROC(s_symbol_pset_x, "symbol-pset!", 2, 0, 0, scm_symbol_pset_x); -#ifdef __STDC__ -SCM -scm_symbol_pset_x (SCM s, SCM val) -#else + SCM scm_symbol_pset_x (s, val) SCM s; SCM val; -#endif { SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG1, s_symbol_pset_x); SCM_DEFER_INTS; @@ -793,27 +699,19 @@ scm_symbol_pset_x (s, val) SCM_PROC(s_symbol_hash, "symbol-hash", 1, 0, 0, scm_symbol_hash); -#ifdef __STDC__ -SCM -scm_symbol_hash (SCM s) -#else + SCM scm_symbol_hash (s) SCM s; -#endif { SCM_ASSERT(SCM_NIMP(s) && SCM_SYMBOLP(s), s, SCM_ARG1, s_symbol_hash); return SCM_MAKINUM ((unsigned long)s ^ SCM_SYMBOL_HASH (s)); } -#ifdef __STDC__ -void -scm_init_symbols (void) -#else + void scm_init_symbols () -#endif { #include "symbols.x" } diff --git a/libguile/symbols.h b/libguile/symbols.h index 1936bd7c5..f8a75d5f3 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -102,65 +102,31 @@ extern int scm_symhash_dim; -#ifdef __STDC__ -extern unsigned long scm_strhash (unsigned char *str, scm_sizet len, unsigned long n); -extern SCM scm_sym2vcell (SCM sym, SCM thunk, SCM definep); -extern SCM scm_sym2ovcell_soft (SCM sym, SCM obarray); -extern SCM scm_sym2ovcell (SCM sym, SCM obarray); -extern SCM scm_intern_obarray_soft (char *name, scm_sizet len, SCM obarray, int softness); -extern SCM scm_intern_obarray (char *name, scm_sizet len, SCM obarray); -extern SCM scm_intern (char *name, scm_sizet len); -extern SCM scm_intern0 (char * name); -extern SCM scm_sysintern (char *name, SCM val); -extern SCM scm_symbol_p(SCM x); -extern SCM scm_symbol_to_string(SCM s); -extern SCM scm_string_to_symbol(SCM s); -extern SCM scm_string_to_obarray_symbol(SCM o, SCM s, SCM softp); -extern SCM scm_intern_symbol(SCM o, SCM s); -extern SCM scm_unintern_symbol(SCM o, SCM s); -extern SCM scm_symbol_binding (SCM o, SCM s); -extern SCM scm_symbol_interned_p (SCM o, SCM s); -extern SCM scm_symbol_bound_p (SCM o, SCM s); -extern SCM scm_symbol_set_x (SCM o, SCM s, SCM v); -extern SCM scm_symbol_fref (SCM s); -extern SCM scm_symbol_pref (SCM s); -extern SCM scm_symbol_fset_x (SCM s, SCM val); -extern SCM scm_symbol_pset_x (SCM s, SCM val); -extern SCM scm_symbol_hash (SCM s); -extern void scm_init_symbols (void); - -#else /* STDC */ -extern unsigned long scm_strhash (); -extern SCM scm_sym2vcell (); -extern SCM scm_sym2ovcell_soft (); -extern SCM scm_sym2ovcell (); -extern SCM scm_intern_obarray_soft (); -extern SCM scm_intern_obarray (); -extern SCM scm_intern (); -extern SCM scm_intern0 (); -extern SCM scm_sysintern (); -extern SCM scm_symbol_p(); -extern SCM scm_symbol_to_string(); -extern SCM scm_string_to_symbol(); -extern SCM scm_string_to_obarray_symbol(); -extern SCM scm_intern_symbol(); -extern SCM scm_unintern_symbol(); -extern SCM scm_symbol_binding (); -extern SCM scm_symbol_interned_p (); -extern SCM scm_symbol_bound_p (); -extern SCM scm_symbol_set_x (); -extern SCM scm_symbol_fref (); -extern SCM scm_symbol_pref (); -extern SCM scm_symbol_fset_x (); -extern SCM scm_symbol_pset_x (); -extern SCM scm_symbol_hash (); -extern void scm_init_symbols (); - -#endif /* STDC */ - - - - +extern unsigned long scm_strhash SCM_P ((unsigned char *str, scm_sizet len, unsigned long n)); +extern SCM scm_sym2vcell SCM_P ((SCM sym, SCM thunk, SCM definep)); +extern SCM scm_sym2ovcell_soft SCM_P ((SCM sym, SCM obarray)); +extern SCM scm_sym2ovcell SCM_P ((SCM sym, SCM obarray)); +extern SCM scm_intern_obarray_soft SCM_P ((char *name, scm_sizet len, SCM obarray, int softness)); +extern SCM scm_intern_obarray SCM_P ((char *name, scm_sizet len, SCM obarray)); +extern SCM scm_intern SCM_P ((char *name, scm_sizet len)); +extern SCM scm_intern0 SCM_P ((char * name)); +extern SCM scm_sysintern SCM_P ((char *name, SCM val)); +extern SCM scm_symbol_p SCM_P ((SCM x)); +extern SCM scm_symbol_to_string SCM_P ((SCM s)); +extern SCM scm_string_to_symbol SCM_P ((SCM s)); +extern SCM scm_string_to_obarray_symbol SCM_P ((SCM o, SCM s, SCM softp)); +extern SCM scm_intern_symbol SCM_P ((SCM o, SCM s)); +extern SCM scm_unintern_symbol SCM_P ((SCM o, SCM s)); +extern SCM scm_symbol_binding SCM_P ((SCM o, SCM s)); +extern SCM scm_symbol_interned_p SCM_P ((SCM o, SCM s)); +extern SCM scm_symbol_bound_p SCM_P ((SCM o, SCM s)); +extern SCM scm_symbol_set_x SCM_P ((SCM o, SCM s, SCM v)); +extern SCM scm_symbol_fref SCM_P ((SCM s)); +extern SCM scm_symbol_pref SCM_P ((SCM s)); +extern SCM scm_symbol_fset_x SCM_P ((SCM s, SCM val)); +extern SCM scm_symbol_pset_x SCM_P ((SCM s, SCM val)); +extern SCM scm_symbol_hash SCM_P ((SCM s)); +extern void scm_init_symbols SCM_P ((void)); #endif /* SYMBOLSH */ diff --git a/libguile/tag.c b/libguile/tag.c index 66023cf23..09f0effe5 100644 --- a/libguile/tag.c +++ b/libguile/tag.c @@ -84,14 +84,10 @@ SCM_CONST_LONG (scm_utag_struct_base, "utag_struct_base", 255); SCM_PROC (s_tag, "tag", 1, 0, 0, scm_tag); -#ifdef __STDC__ -SCM -scm_tag (SCM x) -#else + SCM scm_tag (x) SCM x; -#endif { switch (SCM_ITAG3 (x)) { @@ -210,13 +206,9 @@ scm_tag (x) -#ifdef __STDC__ -void -scm_init_tag (void) -#else + void scm_init_tag () -#endif { #include "tag.x" } diff --git a/libguile/tag.h b/libguile/tag.h index 7ee1ba4c0..9c4952bdf 100644 --- a/libguile/tag.h +++ b/libguile/tag.h @@ -51,13 +51,8 @@ -#ifdef __STDC__ -extern SCM scm_tag (SCM x); -extern void scm_init_tag (void); -#else /* STDC */ -extern SCM scm_tag (); -extern void scm_init_tag (); +extern SCM scm_tag SCM_P ((SCM x)); +extern void scm_init_tag SCM_P ((void)); -#endif /* STDC */ #endif /* TAGH */ diff --git a/libguile/unif.c b/libguile/unif.c index 5d604eeda..cca2ff4f9 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -79,15 +79,11 @@ long scm_tc16_array; */ static char s_vector_set_length_x[] = "vector-set-length!"; -#ifdef __STDC__ -SCM -scm_vector_set_length_x (SCM vect, SCM len) -#else + SCM scm_vector_set_length_x (vect, len) SCM vect; SCM len; -#endif { long l; scm_sizet siz; @@ -176,14 +172,10 @@ scm_vector_set_length_x (vect, len) #ifdef SCM_FLOATS #ifdef SCM_SINGLES -#ifdef __STDC__ -SCM -scm_makflo (float x) -#else + SCM scm_makflo (x) float x; -#endif { SCM z; if (x == 0.0) @@ -198,15 +190,11 @@ scm_makflo (x) #endif #endif -#ifdef __STDC__ -SCM -scm_make_uve (long k, SCM prot) -#else + SCM scm_make_uve (k, prot) long k; SCM prot; -#endif { SCM v; long i, type; @@ -295,14 +283,10 @@ scm_make_uve (k, prot) } SCM_PROC(s_uniform_vector_length, "uniform-vector-length", 1, 0, 0, scm_uniform_vector_length); -#ifdef __STDC__ -SCM -scm_uniform_vector_length (SCM v) -#else + SCM scm_uniform_vector_length (v) SCM v; -#endif { SCM_ASRTGO (SCM_NIMP (v), badarg1); switch SCM_TYP7 @@ -328,15 +312,11 @@ scm_uniform_vector_length (v) } SCM_PROC(s_array_p, "array?", 1, 1, 0, scm_array_p); -#ifdef __STDC__ -SCM -scm_array_p (SCM v, SCM prot) -#else + SCM scm_array_p (v, prot) SCM v; SCM prot; -#endif { int nprot; int enclosed; @@ -399,14 +379,10 @@ loop: SCM_PROC(s_array_rank, "array-rank", 1, 0, 0, scm_array_rank); -#ifdef __STDC__ -SCM -scm_array_rank (SCM ra) -#else + SCM scm_array_rank (ra) SCM ra; -#endif { if (SCM_IMP (ra)) return SCM_INUM0; @@ -436,14 +412,10 @@ scm_array_rank (ra) SCM_PROC(s_array_dimensions, "array-dimensions", 1, 0, 0, scm_array_dimensions); -#ifdef __STDC__ -SCM -scm_array_dimensions (SCM ra) -#else + SCM scm_array_dimensions (ra) SCM ra; -#endif { SCM res = SCM_EOL; scm_sizet k; @@ -484,16 +456,12 @@ scm_array_dimensions (ra) static char s_bad_ind[] = "Bad scm_array index"; -#ifdef __STDC__ -long -scm_aind (SCM ra, SCM args, char *what) -#else + long scm_aind (ra, args, what) - SCM ra, + SCM ra; SCM args; char *what; -#endif { SCM ind; register long j; @@ -523,14 +491,10 @@ scm_aind (ra, args, what) } -#ifdef __STDC__ -SCM -scm_make_ra (int ndim) -#else + SCM scm_make_ra (ndim) int ndim; -#endif { SCM ra; SCM_NEWCELL (ra); @@ -546,15 +510,11 @@ scm_make_ra (ndim) static char s_bad_spec[] = "Bad scm_array dimension"; /* Increments will still need to be set. */ -#ifdef __STDC__ -SCM -scm_shap2ra (SCM args, char *what) -#else + SCM scm_shap2ra (args, what) SCM args; char *what; -#endif { scm_array_dim *s; SCM ra, spec, sp; @@ -589,16 +549,12 @@ scm_shap2ra (args, what) } SCM_PROC(s_dimensions_to_uniform_array, "dimensions->uniform-array", 2, 0, 1, scm_dimensions_to_uniform_array); -#ifdef __STDC__ -SCM -scm_dimensions_to_uniform_array (SCM dims, SCM prot, SCM fill) -#else + SCM scm_dimensions_to_uniform_array (dims, prot, fill) SCM dims; SCM prot; SCM fill; -#endif { scm_sizet k, vlen = 1; long rlen = 1; @@ -684,14 +640,10 @@ scm_dimensions_to_uniform_array (dims, prot, fill) return ra; } -#ifdef __STDC__ -void -scm_ra_set_contp (SCM ra) -#else + void scm_ra_set_contp (ra) SCM ra; -#endif { scm_sizet k = SCM_ARRAY_NDIM (ra); if (k) @@ -713,16 +665,12 @@ scm_ra_set_contp (ra) SCM_PROC(s_make_shared_array, "make-shared-array", 2, 0, 1, scm_make_shared_array); -#ifdef __STDC__ -SCM -scm_make_shared_array (SCM oldra, SCM mapfunc, SCM dims) -#else + SCM scm_make_shared_array (oldra, mapfunc, dims) SCM oldra; SCM mapfunc; SCM dims; -#endif { SCM ra; SCM inds, indptr; @@ -831,14 +779,10 @@ scm_make_shared_array (oldra, mapfunc, dims) /* args are RA . DIMS */ SCM_PROC(s_transpose_array, "transpose-array", 0, 0, 1, scm_transpose_array); -#ifdef __STDC__ -SCM -scm_transpose_array (SCM args) -#else + SCM scm_transpose_array (args) SCM args; -#endif { SCM ra, res, vargs, *ve = &vargs; scm_array_dim *s, *r; @@ -927,14 +871,10 @@ scm_transpose_array (args) /* args are RA . AXES */ SCM_PROC(s_enclose_array, "enclose-array", 0, 0, 1, scm_enclose_array); -#ifdef __STDC__ -SCM -scm_enclose_array (SCM axes) -#else + SCM scm_enclose_array (axes) SCM axes; -#endif { SCM axv, ra, res, ra_inr; scm_array_dim vdim, *s = &vdim; @@ -1014,14 +954,10 @@ scm_enclose_array (axes) SCM_PROC(s_array_in_bounds_p, "array-in-bounds?", 0, 0, 1, scm_array_in_bounds_p); -#ifdef __STDC__ -SCM -scm_array_in_bounds_p (SCM args) -#else + SCM scm_array_in_bounds_p (args) SCM args; -#endif { SCM v, ind = SCM_EOL; long pos = 0; @@ -1098,15 +1034,11 @@ tail: SCM_PROC(s_array_ref, "array-ref", 1, 0, 1, scm_uniform_vector_ref); SCM_PROC(s_uniform_vector_ref, "uniform-vector-ref", 2, 0, 0, scm_uniform_vector_ref); -#ifdef __STDC__ -SCM -scm_uniform_vector_ref (SCM v, SCM args) -#else + SCM scm_uniform_vector_ref (v, args) SCM v; SCM args; -#endif { long pos; if (SCM_IMP (v)) @@ -1205,16 +1137,12 @@ scm_uniform_vector_ref (v, args) /* Internal version of scm_uniform_vector_ref for uves that does no error checking and tries to recycle conses. (Make *sure* you want them recycled.) */ -#ifdef __STDC__ -SCM -scm_cvref (SCM v, scm_sizet pos, SCM last) -#else + SCM scm_cvref (v, pos, last) SCM v; scm_sizet pos; SCM last; -#endif { switch SCM_TYP7 (v) @@ -1298,16 +1226,12 @@ scm_cvref (v, pos, last) SCM_PROC(s_uniform_array_set1_x, "uniform-array-set1!", 3, 0, 0, scm_array_set_x); SCM_PROC(s_array_set_x, "array-set!", 2, 0, 1, scm_array_set_x); -#ifdef __STDC__ -SCM -scm_array_set_x (SCM v, SCM obj, SCM args) -#else + SCM scm_array_set_x (v, obj, args) SCM v; SCM obj; SCM args; -#endif { long pos; SCM_ASRTGO (SCM_NIMP (v), badarg1); @@ -1408,15 +1332,11 @@ scm_array_set_x (v, obj, args) } SCM_PROC(s_array_contents, "array-contents", 1, 1, 0, scm_array_contents); -#ifdef __STDC__ -SCM -scm_array_contents (SCM ra, SCM strict) -#else + SCM scm_array_contents (ra, strict) SCM ra; SCM strict; -#endif { SCM sra; if (SCM_IMP (ra)) @@ -1474,15 +1394,11 @@ scm_array_contents (ra, strict) } } -#ifdef __STDC__ -SCM -scm_ra2contig (SCM ra, int copy) -#else + SCM scm_ra2contig (ra, copy) SCM ra; int copy; -#endif { SCM ret; long inc = 1; @@ -1517,15 +1433,11 @@ scm_ra2contig (ra, copy) SCM_PROC(s_uniform_array_read_x, "uniform-array-read!", 1, 1, 0, scm_uniform_array_read_x); -#ifdef __STDC__ -SCM -scm_uniform_array_read_x (SCM ra, SCM port) -#else + SCM scm_uniform_array_read_x (ra, port) SCM ra; SCM port; -#endif { SCM cra, v = ra; long sz, len, ans; @@ -1600,15 +1512,11 @@ loop: } SCM_PROC(s_uniform_array_write, "uniform-array-write", 1, 1, 0, scm_uniform_array_write); -#ifdef __STDC__ -SCM -scm_uniform_array_write (SCM v, SCM port) -#else + SCM scm_uniform_array_write (v, port) SCM v; SCM port; -#endif { long sz, len, ans; long start = 0; @@ -1675,15 +1583,11 @@ static char cnt_tab[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; SCM_PROC(s_bit_count, "bit-count", 2, 0, 0, scm_bit_count); -#ifdef __STDC__ -SCM -scm_bit_count (SCM item, SCM seq) -#else + SCM scm_bit_count (item, seq) SCM item; SCM seq; -#endif { long i; register unsigned long cnt = 0, w; @@ -1716,16 +1620,12 @@ scm_bit_count (item, seq) SCM_PROC(s_bit_position, "bit-position", 3, 0, 0, scm_bit_position); -#ifdef __STDC__ -SCM -scm_bit_position (SCM item, SCM v, SCM k) -#else + SCM scm_bit_position (item, v, k) SCM item; SCM v; SCM k; -#endif { long i, lenw, xbits, pos = SCM_INUM (k); register unsigned long w; @@ -1789,16 +1689,12 @@ scm_bit_position (item, v, k) SCM_PROC(s_bit_set_star_x, "bit-set*!", 3, 0, 0, scm_bit_set_star_x); -#ifdef __STDC__ -SCM -scm_bit_set_star_x (SCM v, SCM kv, SCM obj) -#else + SCM scm_bit_set_star_x (v, kv, obj) SCM v; SCM kv; SCM obj; -#endif { register long i, k, vlen; SCM_ASRTGO (SCM_NIMP (v), badarg1); @@ -1851,16 +1747,12 @@ scm_bit_set_star_x (v, kv, obj) SCM_PROC(s_bit_count_star, "bit-count*", 3, 0, 0, scm_bit_count_star); -#ifdef __STDC__ -SCM -scm_bit_count_star (SCM v, SCM kv, SCM obj) -#else + SCM scm_bit_count_star (v, kv, obj) SCM v; SCM kv; SCM obj; -#endif { register long i, vlen, count = 0; register unsigned long k; @@ -1922,14 +1814,10 @@ scm_bit_count_star (v, kv, obj) SCM_PROC(s_bit_invert_x, "bit-invert!", 1, 0, 0, scm_bit_invert_x); -#ifdef __STDC__ -SCM -scm_bit_invert_x (SCM v) -#else + SCM scm_bit_invert_x (v) SCM v; -#endif { register long k; SCM_ASRTGO (SCM_NIMP (v), badarg1); @@ -1949,14 +1837,10 @@ scm_bit_invert_x (v) SCM_PROC(s_string_upcase_x, "string-upcase!", 1, 0, 0, scm_string_upcase_x); -#ifdef __STDC__ -SCM -scm_string_upcase_x (SCM v) -#else + SCM scm_string_upcase_x (v) SCM v; -#endif { register long k; register unsigned char *cs; @@ -1977,14 +1861,10 @@ scm_string_upcase_x (v) } SCM_PROC(s_string_downcase_x, "string-downcase!", 1, 0, 0, scm_string_downcase_x); -#ifdef __STDC__ -SCM -scm_string_downcase_x (SCM v) -#else + SCM scm_string_downcase_x (v) SCM v; -#endif { register long k; register unsigned char *cs; @@ -2005,15 +1885,11 @@ scm_string_downcase_x (v) } -#ifdef __STDC__ -SCM -scm_istr2bve (char *str, long len) -#else + SCM scm_istr2bve (str, len) char *str; long len; -#endif { SCM v = scm_make_uve (len, SCM_BOOL_T); long *data = (long *) SCM_VELTS (v); @@ -2042,16 +1918,14 @@ scm_istr2bve (str, len) } -#ifdef __STDC__ -static SCM -ra2l (SCM ra, scm_sizet base, scm_sizet k) -#else + +static SCM ra2l SCM_P ((SCM ra, scm_sizet base, scm_sizet k)); + static SCM ra2l (ra, base, k) SCM ra; scm_sizet base; scm_sizet k; -#endif { register SCM res = SCM_EOL; register long inc = SCM_ARRAY_DIMS (ra)[k].inc; @@ -2080,14 +1954,10 @@ ra2l (ra, base, k) SCM_PROC(s_array_to_list, "array->list", 1, 0, 0, scm_array_to_list); -#ifdef __STDC__ -SCM -scm_array_to_list (SCM v) -#else + SCM scm_array_to_list (v) SCM v; -#endif { SCM res = SCM_EOL; register long k; @@ -2186,23 +2056,16 @@ scm_array_to_list (v) static char s_bad_ralst[] = "Bad scm_array contents scm_list"; -#ifdef __STDC__ -static int l2ra (SCM lst, SCM ra, scm_sizet base, scm_sizet k); -#else -static int l2ra (); -#endif + +static int l2ra SCM_P ((SCM lst, SCM ra, scm_sizet base, scm_sizet k)); SCM_PROC(s_list_to_uniform_array, "list->uniform-array", 3, 0, 0, scm_list_to_uniform_array); -#ifdef __STDC__ -SCM -scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst) -#else + SCM scm_list_to_uniform_array (ndim, prot, lst) SCM ndim; SCM prot; SCM lst; -#endif { SCM shp = SCM_EOL; SCM row = lst; @@ -2240,18 +2103,12 @@ scm_list_to_uniform_array (ndim, prot, lst) return SCM_BOOL_F; } - -#ifdef __STDC__ -static int -l2ra (SCM lst, SCM ra, scm_sizet base, scm_sizet k) -#else static int l2ra (lst, ra, base, k) SCM lst; SCM ra; scm_sizet base; scm_sizet k; -#endif { register long inc = SCM_ARRAY_DIMS (ra)[k].inc; register long n = (1 + SCM_ARRAY_DIMS (ra)[k].ubnd - SCM_ARRAY_DIMS (ra)[k].lbnd); @@ -2287,10 +2144,9 @@ l2ra (lst, ra, base, k) return ok; } -#ifdef __STDC__ -static void -rapr1 (SCM ra, scm_sizet j, scm_sizet k, SCM port, scm_print_state *pstate) -#else + +static void rapr1 SCM_P ((SCM ra, scm_sizet j, scm_sizet k, SCM port, scm_print_state *pstate)); + static void rapr1 (ra, j, k, port, pstate) SCM ra; @@ -2298,7 +2154,6 @@ rapr1 (ra, j, k, port, pstate) scm_sizet k; SCM port; scm_print_state *pstate; -#endif { long inc = 1; long n = SCM_LENGTH (ra); @@ -2455,16 +2310,12 @@ tail: } -#ifdef __STDC__ -int -scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate) -#else + int scm_raprin1 (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { SCM v = exp; scm_sizet base = 0; @@ -2562,14 +2413,10 @@ tail: } SCM_PROC(s_array_prototype, "array-prototype", 1, 0, 0, scm_array_prototype); -#ifdef __STDC__ -SCM -scm_array_prototype (SCM ra) -#else + SCM scm_array_prototype (ra) SCM ra; -#endif { int enclosed = 0; SCM_ASRTGO (SCM_NIMP (ra), badarg); @@ -2616,14 +2463,12 @@ loop: } } -#ifdef __STDC__ -static SCM -markra (SCM ptr) -#else + +static SCM markra SCM_P ((SCM ptr)); + static SCM markra (ptr) SCM ptr; -#endif { if SCM_GC8MARKP (ptr) return SCM_BOOL_F; @@ -2631,14 +2476,12 @@ markra (ptr) return SCM_ARRAY_V (ptr); } -#ifdef __STDC__ -static scm_sizet -freera (SCM ptr) -#else + +static scm_sizet freera SCM_P ((SCM ptr)); + static scm_sizet freera (ptr) SCM ptr; -#endif { scm_must_free (SCM_CHARS (ptr)); return sizeof (scm_array) + SCM_ARRAY_NDIM (ptr) * sizeof (scm_array_dim); @@ -2649,13 +2492,9 @@ static scm_smobfuns rasmob = /* This must be done after scm_init_scl() */ -#ifdef __STDC__ -void -scm_init_unif (void) -#else + void scm_init_unif () -#endif { #include "unif.x" scm_tc16_array = scm_newsmob (&rasmob); @@ -2664,29 +2503,21 @@ scm_init_unif () #else /* ARRAYS */ -#ifdef __STDC__ -int -scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate) -#else + int scm_raprin1 (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { return 0; } -#ifdef __STDC__ -SCM -scm_istr2bve (char *str, long len) -#else + SCM scm_istr2bve (str, len) char *str; long len; -#endif { return SCM_BOOL_F; } @@ -2698,7 +2529,3 @@ scm_init_unif () } #endif /* ARRAYS */ - - - - diff --git a/libguile/unif.h b/libguile/unif.h index c112b4ff6..45aef3fe2 100644 --- a/libguile/unif.h +++ b/libguile/unif.h @@ -73,86 +73,42 @@ extern long scm_tc16_array; #define SCM_HUGE_LENGTH(x) (SCM_LENGTH_MAX==SCM_LENGTH(x) ? *((long *)SCM_VELTS(x)) : SCM_LENGTH(x)) -#ifdef __STDC__ -extern SCM scm_vector_set_length_x (SCM vect, SCM len); -extern SCM scm_makflo (float x); -extern SCM scm_make_uve (long k, SCM prot); -extern SCM scm_uniform_vector_length (SCM v); -extern SCM scm_array_p (SCM v, SCM prot); -extern SCM scm_array_rank (SCM ra); -extern SCM scm_array_dimensions (SCM ra); -extern long scm_aind (SCM ra, SCM args, char *what); -extern SCM scm_make_ra (int ndim); -extern SCM scm_shap2ra (SCM args, char *what); -extern SCM scm_dimensions_to_uniform_array (SCM dims, SCM prot, SCM fill); -extern void scm_ra_set_contp (SCM ra); -extern SCM scm_make_shared_array (SCM oldra, SCM mapfunc, SCM dims); -extern SCM scm_transpose_array (SCM args); -extern SCM scm_enclose_array (SCM axes); -extern SCM scm_array_in_bounds_p (SCM args); -extern SCM scm_uniform_vector_ref (SCM v, SCM args); -extern SCM scm_cvref (SCM v, scm_sizet pos, SCM last); -extern SCM scm_array_set_x (SCM v, SCM obj, SCM args); -extern SCM scm_array_contents (SCM ra, SCM strict); -extern SCM scm_ra2contig (SCM ra, int copy); -extern SCM scm_uniform_array_read_x (SCM ra, SCM port); -extern SCM scm_uniform_array_write (SCM v, SCM port); -extern SCM scm_bit_count (SCM item, SCM seq); -extern SCM scm_bit_position (SCM item, SCM v, SCM k); -extern SCM scm_bit_set_star_x (SCM v, SCM kv, SCM obj); -extern SCM scm_bit_count_star (SCM v, SCM kv, SCM obj); -extern SCM scm_bit_invert_x (SCM v); -extern SCM scm_string_upcase_x (SCM v); -extern SCM scm_string_downcase_x (SCM v); -extern SCM scm_istr2bve (char *str, long len); -extern SCM scm_array_to_list (SCM v); -extern SCM scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst); -extern int scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate); -extern SCM scm_array_prototype (SCM ra); -extern void scm_init_unif (void); - -#else /* STDC */ -extern SCM scm_vector_set_length_x (); -extern SCM scm_makflo (); -extern SCM scm_make_uve (); -extern SCM scm_uniform_vector_length (); -extern SCM scm_array_p (); -extern SCM scm_array_rank (); -extern SCM scm_array_dimensions (); -extern long scm_aind (); -extern SCM scm_make_ra (); -extern SCM scm_shap2ra (); -extern SCM scm_dimensions_to_uniform_array (); -extern void scm_ra_set_contp (); -extern SCM scm_make_shared_array (); -extern SCM scm_transpose_array (); -extern SCM scm_enclose_array (); -extern SCM scm_array_in_bounds_p (); -extern SCM scm_uniform_vector_ref (); -extern SCM scm_cvref (); -extern SCM scm_array_set_x (); -extern SCM scm_array_contents (); -extern SCM scm_ra2contig (); -extern SCM scm_uniform_array_read_x (); -extern SCM scm_uniform_array_write (); -extern SCM scm_bit_count (); -extern SCM scm_bit_position (); -extern SCM scm_bit_set_star_x (); -extern SCM scm_bit_count_star (); -extern SCM scm_bit_invert_x (); -extern SCM scm_string_upcase_x (); -extern SCM scm_string_downcase_x (); -extern SCM scm_istr2bve (); -extern SCM scm_array_to_list (); -extern SCM scm_list_to_uniform_array (); -extern int scm_raprin1 (); -extern SCM scm_array_prototype (); -extern void scm_init_unif (); - -#endif /* STDC */ - - - +extern SCM scm_vector_set_length_x SCM_P ((SCM vect, SCM len)); +extern SCM scm_makflo SCM_P ((float x)); +extern SCM scm_make_uve SCM_P ((long k, SCM prot)); +extern SCM scm_uniform_vector_length SCM_P ((SCM v)); +extern SCM scm_array_p SCM_P ((SCM v, SCM prot)); +extern SCM scm_array_rank SCM_P ((SCM ra)); +extern SCM scm_array_dimensions SCM_P ((SCM ra)); +extern long scm_aind SCM_P ((SCM ra, SCM args, char *what)); +extern SCM scm_make_ra SCM_P ((int ndim)); +extern SCM scm_shap2ra SCM_P ((SCM args, char *what)); +extern SCM scm_dimensions_to_uniform_array SCM_P ((SCM dims, SCM prot, SCM fill)); +extern void scm_ra_set_contp SCM_P ((SCM ra)); +extern SCM scm_make_shared_array SCM_P ((SCM oldra, SCM mapfunc, SCM dims)); +extern SCM scm_transpose_array SCM_P ((SCM args)); +extern SCM scm_enclose_array SCM_P ((SCM axes)); +extern SCM scm_array_in_bounds_p SCM_P ((SCM args)); +extern SCM scm_uniform_vector_ref SCM_P ((SCM v, SCM args)); +extern SCM scm_cvref SCM_P ((SCM v, scm_sizet pos, SCM last)); +extern SCM scm_array_set_x SCM_P ((SCM v, SCM obj, SCM args)); +extern SCM scm_array_contents SCM_P ((SCM ra, SCM strict)); +extern SCM scm_ra2contig SCM_P ((SCM ra, int copy)); +extern SCM scm_uniform_array_read_x SCM_P ((SCM ra, SCM port)); +extern SCM scm_uniform_array_write SCM_P ((SCM v, SCM port)); +extern SCM scm_bit_count SCM_P ((SCM item, SCM seq)); +extern SCM scm_bit_position SCM_P ((SCM item, SCM v, SCM k)); +extern SCM scm_bit_set_star_x SCM_P ((SCM v, SCM kv, SCM obj)); +extern SCM scm_bit_count_star SCM_P ((SCM v, SCM kv, SCM obj)); +extern SCM scm_bit_invert_x SCM_P ((SCM v)); +extern SCM scm_string_upcase_x SCM_P ((SCM v)); +extern SCM scm_string_downcase_x SCM_P ((SCM v)); +extern SCM scm_istr2bve SCM_P ((char *str, long len)); +extern SCM scm_array_to_list SCM_P ((SCM v)); +extern SCM scm_list_to_uniform_array SCM_P ((SCM ndim, SCM prot, SCM lst)); +extern int scm_raprin1 SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); +extern SCM scm_array_prototype SCM_P ((SCM ra)); +extern void scm_init_unif SCM_P ((void)); #endif /* UNIFH */ diff --git a/libguile/variable.c b/libguile/variable.c index f0cb78120..93d800bb9 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -47,29 +47,25 @@ #include "variable.h" -#ifdef __STDC__ -static scm_sizet -free_var (SCM obj) -#else + +static scm_sizet free_var SCM_P ((SCM obj)); + static scm_sizet free_var (obj) SCM obj; -#endif { return 0; } -#ifdef __STDC__ -static int -prin_var (SCM exp, SCM port, scm_print_state *pstate) -#else + +static int prin_var SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int prin_var (exp, port, pstate) SCM exp; SCM port; scm_print_state *pstate; -#endif { scm_gen_puts (scm_regular_string, "#vector", 1, 0, 0, scm_vector); SCM_PROC(s_vector, "vector", 0, 0, 1, scm_vector); -#ifdef __STDC__ -SCM -scm_vector(SCM l) -#else + SCM scm_vector(l) SCM l; -#endif { SCM res; register SCM *data; @@ -99,15 +87,11 @@ scm_vector(l) } SCM_PROC(s_vector_ref, "vector-ref", 2, 0, 0, scm_vector_ref); -#ifdef __STDC__ -SCM -scm_vector_ref(SCM v, SCM k) -#else + SCM scm_vector_ref(v, k) SCM v; SCM k; -#endif { SCM_ASSERT(SCM_NIMP(v) && SCM_VECTORP(v), v, SCM_ARG1, s_vector_ref); SCM_ASSERT(SCM_INUMP(k), k, SCM_ARG2, s_vector_ref); @@ -117,16 +101,12 @@ scm_vector_ref(v, k) SCM_PROC(s_vector_set_x, "vector-set!", 3, 0, 0, scm_vector_set_x); -#ifdef __STDC__ -SCM -scm_vector_set_x(SCM v, SCM k, SCM obj) -#else + SCM scm_vector_set_x(v, k, obj) SCM v; SCM k; SCM obj; -#endif { SCM_ASSERT(SCM_NIMP(v) && SCM_VECTORP(v), v, SCM_ARG1, s_vector_set_x); SCM_ASSERT(SCM_INUMP(k), k, SCM_ARG2, s_vector_set_x); @@ -137,16 +117,12 @@ scm_vector_set_x(v, k, obj) SCM_PROC(s_make_vector, "make-vector", 1, 2, 0, scm_make_vector); -#ifdef __STDC__ -SCM -scm_make_vector(SCM k, SCM fill, SCM multip) -#else + SCM scm_make_vector(k, fill, multip) SCM k; SCM fill; SCM multip; -#endif { SCM v; int multi; @@ -180,14 +156,10 @@ scm_make_vector(k, fill, multip) SCM_PROC(s_vector_to_list, "vector->list", 1, 0, 0, scm_vector_to_list); -#ifdef __STDC__ -SCM -scm_vector_to_list(SCM v) -#else + SCM scm_vector_to_list(v) SCM v; -#endif { SCM res = SCM_EOL; long i; @@ -200,15 +172,11 @@ scm_vector_to_list(v) SCM_PROC(s_vector_fill_x, "vector-fill!", 2, 0, 0, scm_vector_fill_x); -#ifdef __STDC__ -SCM -scm_vector_fill_x(SCM v, SCM fill_x) -#else + SCM scm_vector_fill_x(v, fill_x) SCM v; SCM fill_x; -#endif { register long i; register SCM *data; @@ -219,15 +187,11 @@ scm_vector_fill_x(v, fill_x) } -#ifdef __STDC__ -SCM -scm_vector_equal_p(SCM x, SCM y) -#else + SCM scm_vector_equal_p(x, y) SCM x; SCM y; -#endif { long i; for(i = SCM_LENGTH(x)-1;i >= 0;i--) @@ -238,10 +202,7 @@ scm_vector_equal_p(x, y) SCM_PROC (s_vector_move_left_x, "vector-move-left!", 5, 0, 0, scm_vector_move_left_x); -#ifdef __STDC__ -SCM -scm_vector_move_left_x (SCM vec1, SCM start1, SCM end1, SCM vec2, SCM start2) -#else + SCM scm_vector_move_left_x (vec1, start1, end1, vec2, start2) SCM vec1; @@ -249,7 +210,6 @@ scm_vector_move_left_x (vec1, start1, end1, vec2, start2) SCM end1; SCM vec2; SCM start2; -#endif { long i; long j; @@ -272,10 +232,7 @@ scm_vector_move_left_x (vec1, start1, end1, vec2, start2) } SCM_PROC (s_vector_move_right_x, "vector-move-right!", 5, 0, 0, scm_vector_move_right_x); -#ifdef __STDC__ -SCM -scm_vector_move_right_x (SCM vec1, SCM start1, SCM end1, SCM vec2, SCM start2) -#else + SCM scm_vector_move_right_x (vec1, start1, end1, vec2, start2) SCM vec1; @@ -283,7 +240,6 @@ scm_vector_move_right_x (vec1, start1, end1, vec2, start2) SCM end1; SCM vec2; SCM start2; -#endif { long i; long j; @@ -306,13 +262,9 @@ scm_vector_move_right_x (vec1, start1, end1, vec2, start2) } -#ifdef __STDC__ -void -scm_init_vectors (void) -#else + void scm_init_vectors () -#endif { #include "vectors.x" } diff --git a/libguile/vectors.h b/libguile/vectors.h index 4315224c8..5b98afbcc 100644 --- a/libguile/vectors.h +++ b/libguile/vectors.h @@ -54,35 +54,20 @@ #define SCM_SETVELTS SCM_SETCDR -#ifdef __STDC__ -extern SCM scm_vector_p(SCM x); -extern SCM scm_vector_length(SCM v); -extern SCM scm_vector(SCM l); -extern SCM scm_vector_ref(SCM v, SCM k); -extern SCM scm_vector_set_x(SCM v, SCM k, SCM obj); -extern SCM scm_make_vector(SCM k, SCM fill, SCM multi); -extern SCM scm_vector_to_list(SCM v); -extern SCM scm_vector_fill_x(SCM v, SCM fill_x); -extern SCM scm_vector_equal_p(SCM x, SCM y); -extern SCM scm_vector_move_left_x (SCM vec1, SCM start1, SCM end1, SCM - vec2, SCM start2); -extern SCM scm_vector_move_right_x (SCM vec1, SCM start1, SCM end1, SCM - vec2, SCM start2); -extern void scm_init_vectors (void); -#else /* STDC */ -extern SCM scm_vector_p(); -extern SCM scm_vector_length(); -extern SCM scm_vector(); -extern SCM scm_vector_ref(); -extern SCM scm_vector_set_x(); -extern SCM scm_make_vector(); -extern SCM scm_vector_to_list(); -extern SCM scm_vector_fill_x(); -extern SCM scm_vector_equal_p(); -extern SCM scm_vector_move_left_x (); -extern SCM scm_vector_move_right_x (); -extern void scm_init_vectors (); +extern SCM scm_vector_p SCM_P ((SCM x)); +extern SCM scm_vector_length SCM_P ((SCM v)); +extern SCM scm_vector SCM_P ((SCM l)); +extern SCM scm_vector_ref SCM_P ((SCM v, SCM k)); +extern SCM scm_vector_set_x SCM_P ((SCM v, SCM k, SCM obj)); +extern SCM scm_make_vector SCM_P ((SCM k, SCM fill, SCM multi)); +extern SCM scm_vector_to_list SCM_P ((SCM v)); +extern SCM scm_vector_fill_x SCM_P ((SCM v, SCM fill_x)); +extern SCM scm_vector_equal_p SCM_P ((SCM x, SCM y)); +extern SCM scm_vector_move_left_x SCM_P ((SCM vec1, SCM start1, SCM end1, SCM + vec2, SCM start2)); +extern SCM scm_vector_move_right_x SCM_P ((SCM vec1, SCM start1, SCM end1, SCM + vec2, SCM start2)); +extern void scm_init_vectors SCM_P ((void)); -#endif /* STDC */ #endif /* VECTORSH */ diff --git a/libguile/version.c b/libguile/version.c index 8b699f681..889b08efc 100644 --- a/libguile/version.c +++ b/libguile/version.c @@ -48,13 +48,9 @@ /* Return a Scheme string containing Guile's major version number. */ SCM_PROC(s_major_version, "major-version", 0, 0, 0, scm_major_version); -#ifdef __STDC__ -SCM -scm_major_version (void) -#else + SCM scm_major_version () -#endif { return scm_makfrom0str (GUILE_MAJOR_VERSION); } @@ -62,13 +58,9 @@ scm_major_version () /* Return a Scheme string containing Guile's minor version number. */ SCM_PROC(s_minor_version, "minor-version", 0, 0, 0, scm_minor_version); -#ifdef __STDC__ -SCM -scm_minor_version (void) -#else + SCM scm_minor_version () -#endif { return scm_makfrom0str (GUILE_MINOR_VERSION); } @@ -76,26 +68,18 @@ scm_minor_version () /* Return a Scheme string containing Guile's complete version. */ SCM_PROC(s_version, "version", 0, 0, 0, scm_version); -#ifdef __STDC__ -SCM -scm_version (void) -#else + SCM scm_version () -#endif { return scm_makfrom0str (GUILE_VERSION); } -#ifdef __STDC__ -void -scm_init_version (void) -#else + void scm_init_version () -#endif { #include "version.x" } diff --git a/libguile/version.h b/libguile/version.h index 24f6fc031..ff48cf231 100644 --- a/libguile/version.h +++ b/libguile/version.h @@ -48,16 +48,9 @@ -#ifdef __STDC__ -extern SCM scm_major_version (void); -extern SCM scm_minor_version (void); -extern SCM scm_version (void); -extern void scm_init_version (void); -#else /* STDC */ -extern SCM scm_major_version (); -extern SCM scm_minor_version (); -extern SCM scm_version (); -extern void scm_init_version (); -#endif /* STDC */ +extern SCM scm_major_version SCM_P ((void)); +extern SCM scm_minor_version SCM_P ((void)); +extern SCM scm_version SCM_P ((void)); +extern void scm_init_version SCM_P ((void)); #endif /* VERSIONH */ diff --git a/libguile/vports.c b/libguile/vports.c index 71dec27a4..b9fae4e5d 100644 --- a/libguile/vports.c +++ b/libguile/vports.c @@ -59,16 +59,14 @@ */ -#ifdef __STDC__ -static int -prinsfpt (SCM exp, SCM port, int writing) -#else + +static int prinsfpt SCM_P ((SCM exp, SCM port, scm_print_state *pstate)); + static int -prinsfpt (exp, port, writing) +prinsfpt (exp, port, pstate) SCM exp; SCM port; - int writing; -#endif + scm_print_state *pstate; { scm_prinport (exp, port, "soft"); return !0; @@ -82,32 +80,28 @@ prinsfpt (exp, port, writing) * before returning. */ -#ifdef __STDC__ -static int -sfputc (int c, SCM p) -#else + +static int sfputc SCM_P ((int c, SCM p)); + static int sfputc (c, p) int c; SCM p; -#endif { scm_apply (SCM_VELTS (p)[0], SCM_MAKICHR (c), scm_listofnull); errno = 0; return c; } -#ifdef __STDC__ -static scm_sizet -sfwrite (char *str, scm_sizet siz, scm_sizet num, SCM p) -#else + +static scm_sizet sfwrite SCM_P ((char *str, scm_sizet siz, scm_sizet num, SCM p)); + static scm_sizet sfwrite (str, siz, num, p) char *str; scm_sizet siz; scm_sizet num; SCM p; -#endif { SCM sstr; sstr = scm_makfromstr (str, siz * num, 0); @@ -116,28 +110,24 @@ sfwrite (str, siz, num, p) return num; } -#ifdef __STDC__ -static int -sfputs (char *s, SCM p) -#else + +static int sfputs SCM_P ((char *s, SCM p)); + static int sfputs (s, p) char *s; SCM p; -#endif { sfwrite (s, 1, strlen (s), p); return 0; } -#ifdef __STDC__ -static int -sfflush (SCM stream) -#else + +static int sfflush SCM_P ((SCM stream)); + static int sfflush (stream) SCM stream; -#endif { SCM f = SCM_VELTS (stream)[2]; if (SCM_BOOL_F == f) @@ -147,14 +137,12 @@ sfflush (stream) return SCM_BOOL_F == f ? EOF : 0; } -#ifdef __STDC__ -static int -sfgetc (SCM p) -#else + +static int sfgetc SCM_P ((SCM p)); + static int sfgetc (p) SCM p; -#endif { SCM ans; ans = scm_apply (SCM_VELTS (p)[3], SCM_EOL, SCM_EOL); @@ -165,14 +153,12 @@ sfgetc (p) return SCM_ICHR (ans); } -#ifdef __STDC__ -static int -sfclose (SCM p) -#else + +static int sfclose SCM_P ((SCM p)); + static int sfclose (p) SCM p; -#endif { SCM f = SCM_VELTS (p)[4]; if (SCM_BOOL_F == f) @@ -185,15 +171,11 @@ sfclose (p) SCM_PROC(s_make_soft_port, "make-soft-port", 2, 0, 0, scm_make_soft_port); -#ifdef __STDC__ -SCM -scm_make_soft_port (SCM pv, SCM modes) -#else + SCM scm_make_soft_port (pv, modes) SCM pv; SCM modes; -#endif { struct scm_port_table * pt; SCM z; @@ -209,14 +191,12 @@ scm_make_soft_port (pv, modes) return z; } -#ifdef __STDC__ -static int -noop0 (FILE *stream) -#else + +static int noop0 SCM_P ((SCM stream)); + static int noop0 (stream) - FILE *stream; -#endif + SCM stream; { return 0; } @@ -237,13 +217,9 @@ scm_ptobfuns scm_sfptob = }; -#ifdef __STDC__ -void -scm_init_vports (void) -#else + void scm_init_vports () -#endif { #include "vports.x" } diff --git a/libguile/vports.h b/libguile/vports.h index 465ee7549..27b14a3d6 100644 --- a/libguile/vports.h +++ b/libguile/vports.h @@ -52,19 +52,8 @@ extern scm_ptobfuns scm_sfptob; -#ifdef __STDC__ -extern SCM scm_make_soft_port (SCM pv, SCM modes); -extern void scm_init_vports (void); - -#else /* STDC */ -extern SCM scm_make_soft_port (); -extern void scm_init_vports (); - -#endif /* STDC */ - - - - +extern SCM scm_make_soft_port SCM_P ((SCM pv, SCM modes)); +extern void scm_init_vports SCM_P ((void)); #endif /* VPORTSH */ diff --git a/libguile/weaks.c b/libguile/weaks.c index 8897f66cc..cb2912970 100644 --- a/libguile/weaks.c +++ b/libguile/weaks.c @@ -51,15 +51,11 @@ SCM_PROC(s_make_weak_vector, "make-weak-vector", 1, 1, 0, scm_make_weak_vector); -#ifdef __STDC__ -SCM -scm_make_weak_vector (SCM k, SCM fill) -#else + SCM scm_make_weak_vector (k, fill) SCM k; SCM fill; -#endif { SCM v; v = scm_make_vector (scm_sum (k, SCM_MAKINUM (1)), fill, SCM_UNDEFINED); @@ -74,14 +70,10 @@ scm_make_weak_vector (k, fill) SCM_PROC(s_weak_vector, "weak-vector", 0, 0, 1, scm_weak_vector); SCM_PROC(s_list_to_weak_vector, "list->weak-vector", 1, 0, 0, scm_weak_vector); -#ifdef __STDC__ -SCM -scm_weak_vector (SCM l) -#else + SCM scm_weak_vector (l) SCM l; -#endif { SCM res; register SCM *data; @@ -100,14 +92,10 @@ scm_weak_vector (l) SCM_PROC(s_weak_vector_p, "weak-vector?", 1, 0, 0, scm_weak_vector_p); -#ifdef __STDC__ -SCM -scm_weak_vector_p (SCM x) -#else + SCM scm_weak_vector_p (x) SCM x; -#endif { return ((SCM_NIMP (x) && SCM_WVECTP (x) && !SCM_IS_WHVEC (x)) ? SCM_BOOL_T @@ -121,14 +109,10 @@ scm_weak_vector_p (x) SCM_PROC(s_make_weak_key_hash_table, "make-weak-key-hash-table", 1, 0, 0, scm_make_weak_key_hash_table); -#ifdef __STDC__ -SCM -scm_make_weak_key_hash_table (SCM k) -#else + SCM scm_make_weak_key_hash_table (k) SCM k; -#endif { SCM v; SCM_ASSERT (SCM_INUMP (k), k, SCM_ARG1, s_make_weak_key_hash_table); @@ -141,14 +125,10 @@ scm_make_weak_key_hash_table (k) SCM_PROC (s_make_weak_value_hash_table, "make-weak-value-hash-table", 1, 0, 0, scm_make_weak_value_hash_table); -#ifdef __STDC__ -SCM -scm_make_weak_value_hash_table (SCM k) -#else + SCM scm_make_weak_value_hash_table (k) SCM k; -#endif { SCM v; SCM_ASSERT (SCM_INUMP (k), k, SCM_ARG1, s_make_weak_value_hash_table); @@ -162,14 +142,10 @@ scm_make_weak_value_hash_table (k) SCM_PROC (s_make_doubly_weak_hash_table, "make-doubly-weak-hash-table", 1, 0, 0, scm_make_doubly_weak_hash_table); -#ifdef __STDC__ -SCM -scm_make_doubly_weak_hash_table (SCM k) -#else + SCM scm_make_doubly_weak_hash_table (k) SCM k; -#endif { SCM v; SCM_ASSERT (SCM_INUMP (k), k, SCM_ARG1, s_make_doubly_weak_hash_table); @@ -181,14 +157,10 @@ scm_make_doubly_weak_hash_table (k) } SCM_PROC(s_weak_key_hash_table_p, "weak-key-hash-table?", 1, 0, 0, scm_weak_key_hash_table_p); -#ifdef __STDC__ -SCM -scm_weak_key_hash_table_p (SCM x) -#else + SCM scm_weak_key_hash_table_p (x) SCM x; -#endif { return ((SCM_NIMP (x) && SCM_WVECTP (x) && SCM_IS_WHVEC(x)) ? SCM_BOOL_T @@ -197,14 +169,10 @@ scm_weak_key_hash_table_p (x) SCM_PROC (s_weak_value_hash_table_p, "weak-value-hash-table?", 1, 0, 0, scm_weak_value_hash_table_p); -#ifdef __STDC__ -SCM -scm_weak_value_hash_table_p (SCM x) -#else + SCM scm_weak_value_hash_table_p (x) SCM x; -#endif { return ((SCM_NIMP (x) && SCM_WVECTP (x) && SCM_IS_WHVEC_V(x)) ? SCM_BOOL_T @@ -213,14 +181,10 @@ scm_weak_value_hash_table_p (x) SCM_PROC (s_doubly_weak_hash_table_p, "doubly-weak-hash-table?", 1, 0, 0, scm_doubly_weak_hash_table_p); -#ifdef __STDC__ -SCM -scm_doubly_weak_hash_table_p (SCM x) -#else + SCM scm_doubly_weak_hash_table_p (x) SCM x; -#endif { return ((SCM_NIMP (x) && SCM_WVECTP (x) && SCM_IS_WHVEC_B (x)) ? SCM_BOOL_T @@ -230,13 +194,9 @@ scm_doubly_weak_hash_table_p (x) -#ifdef __STDC__ -void -scm_init_weaks (void) -#else + void scm_init_weaks () -#endif { #include "weaks.x" } diff --git a/libguile/weaks.h b/libguile/weaks.h index a93aafe91..8a6eb467d 100644 --- a/libguile/weaks.h +++ b/libguile/weaks.h @@ -56,31 +56,16 @@ #define SCM_IS_WHVEC_ANY(X) (SCM_VELTS(X)[-1]) -#ifdef __STDC__ -extern SCM scm_make_weak_vector (SCM k, SCM fill); -extern SCM scm_weak_vector (SCM l); -extern SCM scm_weak_vector_p (SCM x); -extern SCM scm_make_weak_key_hash_table (SCM k); -extern SCM scm_make_weak_value_hash_table (SCM k); -extern SCM scm_make_doubly_weak_hash_table (SCM k); -extern SCM scm_weak_key_hash_table_p (SCM x); -extern SCM scm_weak_value_hash_table_p (SCM x); -extern SCM scm_doubly_weak_hash_table_p (SCM x); -extern void scm_init_weaks (void); - -#else /* STDC */ -extern SCM scm_make_weak_vector (); -extern SCM scm_weak_vector (); -extern SCM scm_weak_vector_p (); -extern SCM scm_make_weak_key_hash_table (); -extern SCM scm_make_weak_value_hash_table (); -extern SCM scm_make_doubly_weak_hash_table (); -extern SCM scm_weak_key_hash_table_p (); -extern SCM scm_weak_value_hash_table_p (); -extern SCM scm_doubly_weak_hash_table_p (); -extern void scm_init_weaks (); - -#endif /* STDC */ +extern SCM scm_make_weak_vector SCM_P ((SCM k, SCM fill)); +extern SCM scm_weak_vector SCM_P ((SCM l)); +extern SCM scm_weak_vector_p SCM_P ((SCM x)); +extern SCM scm_make_weak_key_hash_table SCM_P ((SCM k)); +extern SCM scm_make_weak_value_hash_table SCM_P ((SCM k)); +extern SCM scm_make_doubly_weak_hash_table SCM_P ((SCM k)); +extern SCM scm_weak_key_hash_table_p SCM_P ((SCM x)); +extern SCM scm_weak_value_hash_table_p SCM_P ((SCM x)); +extern SCM scm_doubly_weak_hash_table_p SCM_P ((SCM x)); +extern void scm_init_weaks SCM_P ((void)); #endif /* WEAKSH */ -- 2.20.1