diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-01-20 23:29:09 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-02-11 23:37:46 +0100 |
commit | feccd2d3100fd2964d4c2df58ab3da7ce4949a66 (patch) | |
tree | 1dd3e9f2002bff11ebd27babb8f5dc021ff7fc4d | |
parent | cce8b2ce93703aff953750fb40cb53176ea66504 (diff) | |
download | guile-feccd2d3100fd2964d4c2df58ab3da7ce4949a66.tar.gz |
Add `SCM_SET_SUBR_GENERIC ()' to replace `SCM_SUBR_GENERIC ()' as an lvalue.
* libguile/goops.c (scm_c_extend_primitive_generic): Use
`SCM_SET_SUBR_GENERIC ()' instead of using `SCM_SUBR_GENERIC ()' as an
lvalue.
* libguile/procs.c (scm_c_make_subr_with_generic): Use `SCM_SET_SUBR_GENERIC_LOC ()'.
* libguile/procs.h (SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC): New macros.
-rw-r--r-- | libguile/goops.c | 2 | ||||
-rw-r--r-- | libguile/procs.c | 2 | ||||
-rw-r--r-- | libguile/procs.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 827dbfb33..4e6458697 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -1902,7 +1902,7 @@ scm_c_extend_primitive_generic (SCM extended, SCM extension) gext = scm_call_2 (SCM_VARIABLE_REF (scm_var_make_extended_generic), gf, SCM_SNAME (extension)); - *SCM_SUBR_GENERIC (extension) = gext; + SCM_SET_SUBR_GENERIC (extension, gext); } else { diff --git a/libguile/procs.c b/libguile/procs.c index acd7e4663..854ddba22 100644 --- a/libguile/procs.c +++ b/libguile/procs.c @@ -99,7 +99,7 @@ scm_c_make_subr_with_generic (const char *name, long type, SCM (*fcn) (), SCM *gf) { SCM subr = scm_c_make_subr (name, type, fcn); - SCM_SUBR_GENERIC (subr) = gf; + SCM_SET_SUBR_GENERIC_LOC (subr, gf); return subr; } diff --git a/libguile/procs.h b/libguile/procs.h index 8365abec5..6f8d4c21a 100644 --- a/libguile/procs.h +++ b/libguile/procs.h @@ -50,6 +50,8 @@ typedef struct #define SCM_DSUBRF(x) ((double (*)()) SCM_CELL_WORD_1 (x)) #define SCM_SUBR_PROPS(x) (SCM_SUBR_ENTRY (x).properties) #define SCM_SUBR_GENERIC(x) (SCM_SUBR_ENTRY (x).generic) +#define SCM_SET_SUBR_GENERIC(x, g) (*SCM_SUBR_ENTRY (x).generic = (g)) +#define SCM_SET_SUBR_GENERIC_LOC(x, g) (SCM_SUBR_ENTRY (x).generic = (g)) #define SCM_CCLO_LENGTH(x) (SCM_CELL_WORD_0 (x) >> 8) #define SCM_MAKE_CCLO_TAG(v) (((v) << 8) + scm_tc7_cclo) |