diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1997-01-30 20:25:09 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1997-01-30 20:25:09 +0000 |
commit | ad310508112bad654b73784c8e451691fcf96188 (patch) | |
tree | b4504c31fe20aeee26239ddbd970b157632e9762 /libguile/ramap.c | |
parent | 87f2fb72232d84b296542a702241f3126260639b (diff) | |
download | guile-ad310508112bad654b73784c8e451691fcf96188.tar.gz |
The following two changes (ramap.c, throw.c) are motivated by the
apparent unportability of forward declarations of static arrays of
the form `static foo bar[];'.
* ramap.c (scm_array_fill_x): Moved above scm_array_fill_int.
(ra_rpsubrs, ra_asubrs): Moved to the top of array code.
* throw.c (scm_throw): Moved above scm_ithrow.
* options.h: Removed the extern declarations of scm_yes_sym and
scm_no_sym since these are static.
Diffstat (limited to 'libguile/ramap.c')
-rw-r--r-- | libguile/ramap.c | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/libguile/ramap.c b/libguile/ramap.c index a139566fc..370dfd97a 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -64,8 +64,32 @@ typedef struct int (*vproc) (); } ra_iproc; -static ra_iproc ra_rpsubrs[]; -static ra_iproc ra_asubrs[]; + +/* These tables are a kluge that will not scale well when more + * vectorized subrs are added. It is tempting to steal some bits from + * the SCM_CAR of all subrs (like those selected by SCM_SMOBNUM) to hold an + * offset into a table of vectorized subrs. + */ + +static ra_iproc ra_rpsubrs[] = +{ + {"=", SCM_UNDEFINED, scm_ra_eqp}, + {"<", SCM_UNDEFINED, scm_ra_lessp}, + {"<=", SCM_UNDEFINED, scm_ra_leqp}, + {">", SCM_UNDEFINED, scm_ra_grp}, + {">=", SCM_UNDEFINED, scm_ra_greqp}, + {0, 0, 0} +}; + +static ra_iproc ra_asubrs[] = +{ + {"+", SCM_UNDEFINED, scm_ra_sum}, + {"-", SCM_UNDEFINED, scm_ra_difference}, + {"*", SCM_UNDEFINED, scm_ra_product}, + {"/", SCM_UNDEFINED, scm_ra_divide}, + {0, 0, 0} +}; + #define BVE_REF(a, i) ((SCM_VELTS(a)[(i)/SCM_LONG_BIT] & (1L<<((i)%SCM_LONG_BIT))) ? 1 : 0) #define BVE_SET(a, i) (SCM_VELTS(a)[(i)/SCM_LONG_BIT] |= (1L<<((i)%SCM_LONG_BIT))) @@ -373,7 +397,17 @@ scm_ramapc (cproc, data, ra0, lra, what) } -static char s_array_fill_x[]; +SCM_PROC(s_array_fill_x, "array-fill!", 2, 0, 0, scm_array_fill_x); + +SCM +scm_array_fill_x (ra, fill) + SCM ra; + SCM fill; +{ + scm_ramapc (scm_array_fill_int, fill, ra, SCM_EOL, s_array_fill_x); + return SCM_UNSPECIFIED; +} + int scm_array_fill_int (ra, fill, ignore) @@ -491,17 +525,6 @@ scm_array_fill_int (ra, fill, ignore) return 1; } -SCM_PROC(s_array_fill_x, "array-fill!", 2, 0, 0, scm_array_fill_x); - -SCM -scm_array_fill_x (ra, fill) - SCM ra; - SCM fill; -{ - scm_ramapc (scm_array_fill_int, fill, ra, SCM_EOL, s_array_fill_x); - return SCM_UNSPECIFIED; -} - @@ -2078,32 +2101,6 @@ scm_array_equal_p (ra0, ra1) - -/* These tables are a kluge that will not scale well when more - * vectorized subrs are added. It is tempting to steal some bits from - * the SCM_CAR of all subrs (like those selected by SCM_SMOBNUM) to hold an - * offset into a table of vectorized subrs. - */ - -static ra_iproc ra_rpsubrs[] = -{ - {"=", SCM_UNDEFINED, scm_ra_eqp}, - {"<", SCM_UNDEFINED, scm_ra_lessp}, - {"<=", SCM_UNDEFINED, scm_ra_leqp}, - {">", SCM_UNDEFINED, scm_ra_grp}, - {">=", SCM_UNDEFINED, scm_ra_greqp}, - {0, 0, 0} -}; - -static ra_iproc ra_asubrs[] = -{ - {"+", SCM_UNDEFINED, scm_ra_sum}, - {"-", SCM_UNDEFINED, scm_ra_difference}, - {"*", SCM_UNDEFINED, scm_ra_product}, - {"/", SCM_UNDEFINED, scm_ra_divide}, - {0, 0, 0} -}; - static void init_raprocs (subra) ra_iproc *subra; |