* libguile/numbers.h (SCM_COMPLEX_MEM): Remove.
(SCM_COMPLEX_REAL): Change to just fetch the `real' field of the
pointed-to `scm_t_complex'.
(SCM_COMPLEX_IMAG): Likewise.
(scm_t_complex)[type, pad]: New fields.
* libguile/numbers.c (scm_c_make_rectangular): Allocate the whole
complex contiguously, with `scm_gc_malloc_pointerless'.
else
{
SCM z;
- SCM_NEWSMOB (z, scm_tc16_complex,
- scm_gc_malloc_pointerless (sizeof (scm_t_complex),
+
+ z = PTR2SCM (scm_gc_malloc_pointerless (sizeof (scm_t_complex),
"complex"));
+ SCM_SET_CELL_TYPE (z, scm_tc16_complex);
SCM_COMPLEX_REAL (z) = re;
SCM_COMPLEX_IMAG (z) = im;
return z;
#define SCM_COMPLEXP(x) (!SCM_IMP (x) && SCM_TYP16 (x) == scm_tc16_complex)
#define SCM_REAL_VALUE(x) (((scm_t_double *) SCM2PTR (x))->real)
-#define SCM_COMPLEX_MEM(x) ((scm_t_complex *) SCM_CELL_WORD_1 (x))
-#define SCM_COMPLEX_REAL(x) (SCM_COMPLEX_MEM (x)->real)
-#define SCM_COMPLEX_IMAG(x) (SCM_COMPLEX_MEM (x)->imag)
+#define SCM_COMPLEX_REAL(x) (((scm_t_complex *) SCM2PTR (x))->real)
+#define SCM_COMPLEX_IMAG(x) (((scm_t_complex *) SCM2PTR (x))->imag)
/* Each bignum is just an mpz_t stored in a double cell starting at word 1. */
#define SCM_I_BIG_MPZ(x) (*((mpz_t *) (SCM_CELL_OBJECT_LOC((x),1))))
typedef struct scm_t_complex
{
+ SCM type;
+ SCM pad;
double real;
double imag;
} scm_t_complex;