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.
This commit is contained in:
Mikael Djurfeldt 1997-01-30 20:25:09 +00:00
commit ad31050811
4 changed files with 62 additions and 53 deletions

View file

@ -1,3 +1,17 @@
Thu Jan 30 20:14:09 1997 Mikael Djurfeldt <mdj@syk-0606.pdc.kth.se>
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.
Fri Jan 24 06:16:32 1997 Gary Houston <ghouston@actrix.gen.nz>
* ports.c: add SCM_PROC declarations for pt-size and pt-member.

View file

@ -63,8 +63,6 @@ typedef struct scm_option
#define SCM_OPTION_INTEGER 1
#define SCM_OPTION_SCM 2
extern SCM scm_yes_sym, scm_no_sym;
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));

View file

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

View file

@ -367,6 +367,17 @@ scm_handle_by_message (handler_data, tag, args)
}
SCM_PROC(s_throw, "throw", 1, 0, 1, scm_throw);
SCM
scm_throw (key, args)
SCM key;
SCM args;
{
/* May return if handled by lazy catch. */
return scm_ithrow (key, args, 1);
}
static char s_throw[];
SCM
scm_ithrow (key, args, noreturn)
@ -481,17 +492,6 @@ scm_ithrow (key, args, noreturn)
}
SCM_PROC(s_throw, "throw", 1, 0, 1, scm_throw);
SCM
scm_throw (key, args)
SCM key;
SCM args;
{
/* May return if handled by lazy catch. */
return scm_ithrow (key, args, 1);
}
void
scm_init_throw ()
{