[PD-dev] t_sample vs t_float in PDa vs vanilla

IOhannes m zmölnig zmoelnig at iem.at
Fri Jan 1 22:22:56 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hans-Christoph Steiner wrote:
> 
> This would obviously work better that my code, but I still don't see the
> point of using a t_float there.  All three lines are casting t_ints from
> w into values that then get added together to be a t_sample so why use
> anything the middle?  On PDa that means casting a t_int to a t_float
> then to an int (i.e. t_sample) for no reason.

w[2] is t_int* to be something pointable.
you cast it to t_float because the value really is a t_float.
then you convert it to a t_sample, because this is what you need.
on PDa it is the same;


you can never get around these three casts, if you want it to work
correctly.
you can do "magic" if you believe that this will make the compiled code
faster (in most cases it won't) and you don't care for readability and
maintainability.


mfgasdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAks+Z7AACgkQkX2Xpv6ydvQ5TACcCBzIIl9iSF6vDx2sUF9hsDTG
/QAAoNWZhRxVk1nBYVS3tUx6hvYwEATH
=r6sz
-----END PGP SIGNATURE-----




More information about the Pd-dev mailing list