diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 24662c643..f423a6f44 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2000-03-22 Dirk Herrmann + + * numbers.h, ramap.c, struct.h, vectors.h: Don't use SCM2PTR for + non scheme values. If raw data is stored in SCM variables, it has + to be accessed using SCM_UNPACK until a better solution is found. + 2000-03-22 Mikael Djurfeldt * tags.h (SCM_ECONSP, SCM_NECONSP): More corrections of diff --git a/libguile/numbers.h b/libguile/numbers.h index 244c013e9..12fc10845 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -185,8 +185,8 @@ #define SCM_CPLXP(x) SCM_COMPLEXP(x) /* Deprecated */ #define SCM_REAL_VALUE(x) (((scm_double_t *) SCM2PTR (x))->real) -#define SCM_COMPLEX_REAL(x) (((scm_complex_t *) SCM2PTR (SCM_CDR (x)))->real) -#define SCM_COMPLEX_IMAG(x) (((scm_complex_t *) SCM2PTR (SCM_CDR (x)))->imag) +#define SCM_COMPLEX_REAL(x) (((scm_complex_t *) SCM_UNPACK (SCM_CDR (x)))->real) +#define SCM_COMPLEX_IMAG(x) (((scm_complex_t *) SCM_UNPACK (SCM_CDR (x)))->imag) #define SCM_REAL(x) \ (SCM_SLOPPY_REALP (x) \ ? SCM_REAL_VALUE (x) \ @@ -257,7 +257,7 @@ #define SCM_BIGSIGNFLAG 0x10000L #define SCM_BIGSIZEFIELD 17 #define SCM_BIGSIGN(x) (SCM_UNPACK_CAR (x) & SCM_BIGSIGNFLAG) -#define SCM_BDIGITS(x) ((SCM_BIGDIG *) SCM2PTR (SCM_CDR (x))) +#define SCM_BDIGITS(x) ((SCM_BIGDIG *) SCM_UNPACK (SCM_CDR (x))) #define SCM_NUMDIGS(x) ((scm_sizet) (SCM_UNPACK_CAR (x) >> SCM_BIGSIZEFIELD)) #define SCM_SETNUMDIGS(x, v, sign) \ SCM_SETCAR (x, \ diff --git a/libguile/ramap.c b/libguile/ramap.c index 8ab2bde4c..c186de153 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -1325,8 +1325,8 @@ ramap_rp (SCM ra0,SCM proc,SCM ras) of a cell as raw data. Further: How can we be sure that the values fit into an inum? */ - SCM n1 = SCM_MAKINUM (((long *) SCM2PTR (SCM_CDR (ra1)))[i1]); - SCM n2 = SCM_MAKINUM (((long *) SCM2PTR (SCM_CDR (ra2)))[i2]); + SCM n1 = SCM_MAKINUM (((long *) SCM_UNPACK (SCM_CDR (ra1)))[i1]); + SCM n2 = SCM_MAKINUM (((long *) SCM_UNPACK (SCM_CDR (ra2)))[i2]); if (SCM_FALSEP (SCM_SUBRF (proc) (n1, n2))); SCM_BITVEC_CLR (ra0, i0); } diff --git a/libguile/struct.h b/libguile/struct.h index 80c2e4d79..56de61c8f 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -78,7 +78,7 @@ typedef scm_sizet (*scm_struct_free_t) (SCM *vtable, SCM *data); (no hidden words) */ #define SCM_STRUCTP(X) (SCM_NIMP(X) && (SCM_TYP3(X) == scm_tc3_cons_gloc)) -#define SCM_STRUCT_DATA(X) ((SCM *) SCM2PTR (SCM_CDR (X))) +#define SCM_STRUCT_DATA(X) ((SCM *) SCM_UNPACK (SCM_CDR (X))) #define SCM_STRUCT_VTABLE_DATA(X) ((SCM *) (SCM_UNPACK (SCM_CAR (X)) - 1)) #define SCM_STRUCT_LAYOUT(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_layout]) #define SCM_STRUCT_VTABLE(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_vtable]) diff --git a/libguile/vectors.h b/libguile/vectors.h index da5bf303c..c0692a0d0 100644 --- a/libguile/vectors.h +++ b/libguile/vectors.h @@ -53,8 +53,8 @@ #define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector)) #define SCM_NVECTORP(x) (!SCM_VECTORP (x)) -#define SCM_VELTS(x) ((SCM *) SCM2PTR (SCM_CDR (x))) -#define SCM_VELTS_AS_STACKITEMS(x) ((SCM_STACKITEM *) SCM2PTR (SCM_CDR (x))) +#define SCM_VELTS(x) ((SCM *) SCM_UNPACK (SCM_CDR (x))) +#define SCM_VELTS_AS_STACKITEMS(x) ((SCM_STACKITEM *) SCM_UNPACK (SCM_CDR (x))) #define SCM_SETVELTS SCM_SETCDR