[Asterisk-Dev] Re: asterisk/include/asterisk utils.h,1.46,1.47
Thorsten Lockert
tholo at sigmasoft.com
Sat Oct 29 14:09:38 MST 2005
On Oct 29, 2005, at 13:42 , Kevin P. Fleming wrote:
> 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.
At the same time, many platforms (particularly non-Intel) are
actually more efficient handling 'int' sized variables than 'short'
sized ones... Whether you actually need/use 32+ bits or not...
Thorsten
More information about the asterisk-dev
mailing list