1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

* Remove function scm_init_iprocs, remove struct scm_iproc and simplify

initialization of c[ad]+r functions.
* Remove structs scm_subr and scm_dsubr and access the function cell words
  directly instead of casting a cell to a C struct.
This commit is contained in:
Dirk Herrmann 2000-04-25 09:45:16 +00:00
parent 820920e6a3
commit e59bb51662
4 changed files with 50 additions and 64 deletions

View file

@ -1,3 +1,14 @@
2000-04-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
* pairs.c (cxrs, scm_init_pairs): Simplify initialization of
c[ad]+r functions.
* procs.c (scm_init_iprocs), procs.h (scm_subr, scm_iproc,
scm_dsubr, scm_init_iprocs): Removed.
* procs.h (SCM_SUBRF, SCM_DSUBRF): Access the cell words
directly instead of casting a cell to a C struct.
2000-04-22 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
Better modularization of GC extensions through new C level GC

View file

@ -123,39 +123,39 @@ SCM_DEFINE (scm_set_cdr_x, "set-cdr!", 2, 0, 0,
static const scm_iproc cxrs[] =
static const char * cxrs[] =
{
{"car", 0},
{"cdr", 0},
{"caar", 0},
{"cadr", 0},
{"cdar", 0},
{"cddr", 0},
{"caaar", 0},
{"caadr", 0},
{"cadar", 0},
{"caddr", 0},
{"cdaar", 0},
{"cdadr", 0},
{"cddar", 0},
{"cdddr", 0},
{"caaaar", 0},
{"caaadr", 0},
{"caadar", 0},
{"caaddr", 0},
{"cadaar", 0},
{"cadadr", 0},
{"caddar", 0},
{"cadddr", 0},
{"cdaaar", 0},
{"cdaadr", 0},
{"cdadar", 0},
{"cdaddr", 0},
{"cddaar", 0},
{"cddadr", 0},
{"cdddar", 0},
{"cddddr", 0},
{0, 0}
"car",
"cdr",
"caar",
"cadr",
"cdar",
"cddr",
"caaar",
"caadr",
"cadar",
"caddr",
"cdaar",
"cdadr",
"cddar",
"cdddr",
"caaaar",
"caaadr",
"caadar",
"caaddr",
"cadaar",
"cadadr",
"caddar",
"cadddr",
"cdaaar",
"cdaadr",
"cdadar",
"cdaddr",
"cddaar",
"cddadr",
"cdddar",
"cddddr",
0
};
@ -163,7 +163,11 @@ static const scm_iproc cxrs[] =
void
scm_init_pairs ()
{
scm_init_iprocs (cxrs, scm_tc7_cxr);
unsigned int subnr = 0;
for (subnr = 0; cxrs [subnr]; subnr++)
scm_make_subr(cxrs [subnr], scm_tc7_cxr, NULL);
#include "libguile/pairs.x"
}

View file

@ -370,16 +370,6 @@ scm_setter (SCM proc)
}
void
scm_init_iprocs(const scm_iproc *subra, int type)
{
for(;subra->scm_string; subra++)
scm_make_subr(subra->scm_string,
type,
subra->cproc);
}
void
scm_init_subr_table ()
{

View file

@ -55,24 +55,6 @@
/* Subrs
*/
typedef struct scm_subr
{
long sname;
SCM (*cproc) ();
} scm_subr;
typedef struct scm_iproc
{
char *scm_string;
SCM (*cproc) ();
} scm_iproc;
typedef struct scm_dsubr
{
long sname;
double (*dproc) ();
} scm_dsubr;
typedef struct
{
SCM handle; /* link back to procedure object */
@ -89,8 +71,8 @@ typedef struct
SCM_SET_CELL_WORD_0 (subr, (num << 8) + SCM_TYP7 (subr))
#define SCM_SUBR_ENTRY(x) (scm_subr_table[SCM_SUBRNUM (x)])
#define SCM_SNAME(x) (SCM_SUBR_ENTRY (x).name)
#define SCM_SUBRF(x) (((scm_subr *)(SCM2PTR(x)))->cproc)
#define SCM_DSUBRF(x) (((scm_dsubr *)(SCM2PTR(x)))->dproc)
#define SCM_SUBRF(x) ((SCM (*)()) SCM_CELL_WORD_1 (x))
#define SCM_DSUBRF(x) ((double (*)()) SCM_CELL_WORD_1 (x))
#define SCM_CCLO_SUBR(x) (SCM_VELTS(x)[0])
#define SCM_SUBR_GENERIC(x) (SCM_SUBR_ENTRY (x).generic)
@ -189,7 +171,6 @@ extern SCM scm_procedure_with_setter_p (SCM obj);
extern SCM scm_make_procedure_with_setter (SCM procedure, SCM setter);
extern SCM scm_procedure (SCM proc);
extern SCM scm_setter (SCM proc);
extern void scm_init_iprocs (const scm_iproc *subra, int type);
extern void scm_init_subr_table (void);
extern void scm_init_procs (void);