[asterisk-dev] Re: trunk r28934 - /trunk/apps/app_sms.c

Kevin P. Fleming kpfleming at digium.com
Sat May 20 05:43:29 MST 2006


Tony Mountifield wrote:

> Another way to fix this would be to put them into a struct:
> 
> struct {
>   unsigned char waste[AST_FRIENDLY_OFFSET];
>   unsigned char buf[MAXSAMPLES];
> } t;

Yes, we considered that when fixing chan_iax2.

> Then waste becomes t.waste and buf becomes t.buf. The rest of the code
> then stays unchanged, in particular not having to add or subtract
> AST_FRIENDLY_OFFSET in various places.

In this application (app_sms) since the code is so small, it didn't make
much of a difference :-) It would also be possible to alloca() 'buf' and
then add AST_FRIENDLY_OFFSET to it permanently, since app_sms never
needs to look into the 'offset' area at all.



More information about the asterisk-dev mailing list