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

Miller Puckette mpuckett at man104-1.ucsd.edu
Wed Aug 25 20:50:45 CEST 2004


I'm not sure if any code is left now using integers that have to be
as big as pointers.  The "t_int" typedef shows up a lot though, and
having only a 32-bit machine at the moment, I'm nervous about getting
rid of them all.  I'd also be nervous just calling them "long" - there's
no guarantee that can hold a pointer either.

cheers
Miller

On Wed, Aug 25, 2004 at 02:35:07PM -0400, Mathieu Bouchard wrote:
> 
> 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