This is the mail archive of the mailing list for the Guile project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

typedef void * SCM

Hi guys,

today, I didn't feel like doing Real Work (tm), so I decided to take
on one of my pet peeves: making the type checking for GUILE C-code a
little more robust, by setting

       typedef void * SCM;

and doing appropriate casts everywhere.  I've changed lots of code
that did bitdiddling. You can review the patch up on my homepage, at

The result doesn't quite work yet: for reasons beyond my comprehension
the interpreter quits while evaluating the definition of
provide. Interestingly enough, it also does this when I set the macros
to the classic GUILE type. Maybe I should run make install
(unfortunately, I also need a working Guile 1.3.4)

I encountered some strange things while converting. I used guile 1.3.5
pulled from CVS.

* I replaced some slightly hairy code with macros in unif.c, ramap.c
  and arbiter.c.  I think these should go in GUILE.

* What is the correct type of scm_tc16_port_with_ps ? In print.c it is
  an SCM, in print.h it is long int

* eval.c produces lots of warnings about clobbered variables.

* As far as I can tell, the result of SCM_INUM is an integer in the C
  sense. So why does s_scm_set_port_{column,line}_x return this in
  stead of a Scheme object?

    return SCM_PTAB_ENTRY (port)->column_number = SCM_INUM (column);

* numbers.c is liberal with ints and SCM to the extreme. I sense a
  need for rewriting.

* This code confuses me (throw.c). Why doesn't this crash?

    Huh ?  wouldn't SCM_CAR(0) dump core ?
     #define JBACTIVE(O) (SCM_CARW (O) & (1L << 16L))

* the val member in scm_option is used both as SCM and as
  C-integer. Shouldn't this be a union?

* Finally, make (dist)clean doesn't remove .doc files.

Does anyone care to comment? Or can anyone tell why this thing
crashes? I left some of the pointer-integer conversions because I
wasn't sure what to do.

Han-Wen Nienhuys, ** GNU LilyPond - The Music Typesetter 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]