This is the mail archive of the guile@sourceware.cygnus.com 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]

Accessing smob data


In many cases, a smob's "data" is a pointer to an
application-allocated struct.  Previously (i.e. about 2 weeks ago
CVS), such data could be accessed without a cast, viz.

      mystruct_t * dat = SCM_SMOB_DATA (s);

In current CVS, this generates a compile warning (integer to pointer
conversion).  To avoid the warning, a cast is required, viz.

      mystruct_t * dat = (mystruct *) SCM_SMOB_DATA (s);

Two questions:

(1) Was this change an intentional side-effect of recent changes?

(2) Is SCM_SMOB_DATA the recommended way to extract a struct pointer
    from a smob SCM value?

Thanks!

    Neil

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