[Asterisk-Dev] Re: asterisk/include/asterisk utils.h,1.46,1.47

Kevin P. Fleming kpfleming at digium.com
Sat Oct 29 13:42:59 MST 2005


Luigi Rizzo wrote:

> while you are at it, it is probably a good idea
> to change by-value arguments to [unsigned] int rather than
> short (or often even char's). The compiler will generally pass
> them as int anyways, ops on non-native types are often
> slower (assuming one cares), and using int enables one to use
> more strict compiler checks which is _extremely_ useful.

In this particular case we are dealing with SLINEAR audio data, which 
intentionally is stored in 'short' variable to match its native range. 
Granted, a platform could define a 'short' as being longer than 16 bits 
(or fewer), but no current common platforms do so and it's unlikely 
future ones will do so. If that becomes an issue, we'll switch to 
int16_t or something similar.



More information about the asterisk-dev mailing list