[PD-DEV] binbuf_addv, t_int to int for "i" args?

Mathieu Bouchard matju at sympatico.ca
Wed Aug 25 20:35:07 CEST 2004


On Wed, 25 Aug 2004, Miller Puckette wrote:

> It looks like "binbuf_addv()", which gets called many places in Pd to
> save objects' state, expects integer arguments of type "t_int".  This
> is fine except on systems (athlon64 for instance) where t_int is
> bigger than int.  In lots of the calls the int args aren't cast to
> t_int but are just integers.

"long" is usually the same size as a pointer, if that's what you
want. That's what the comment says in m_pd.h.

The Ruby headers do it that way. So if that's your intent, I think t_int
should be defined as "long" pretty much everywhere, and then "%ld" used
instead of "%d".

Is there any code that really depends on
sizeof(t_int)==sizeof(void*) ? Is that comment in m_pd.h still relevant?

________________________________________________________________
Mathieu Bouchard                       http://artengine.ca/matju





More information about the Pd-dev mailing list