[asterisk-dev] [Code Review] dsp.c ast_dsp_call_progress use local short variable in loop, plus other cleanup

rmudgett reviewboard at asterisk.org
Fri Sep 14 11:32:27 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2107/#review7066
-----------------------------------------------------------


This type of patch should only be done for trunk.

The whitespace changes should be done in their own commit so they don't bury actual code changes.  You might as well delete all trailing whitespace in this file while you are doing this.


branches/1.8/main/dsp.c
<https://reviewboard.asterisk.org/r/2107/#comment13663>

    Chaining inits this way just makes for long lines.
    
    Also if the types are different, you may set yourself up for subtle bugs because of conversions.



branches/1.8/main/dsp.c
<https://reviewboard.asterisk.org/r/2107/#comment13664>

    Chaining inits this way just makes for long lines.


- rmudgett


On Sept. 12, 2012, 6:12 a.m., Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2107/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2012, 6:12 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> janitor cleanup. No functional change.
> 
> 1). ast_dsp_call_progress: use 'short samp' instead of s[x] inside loop.
>     apply same casting as other _init, dsp->energy = (int32_t) samp * (int32_t) samp
> 
> 2). ast_dtmf_detect_init: move repeated setting of s->energy to outside of loop.
>     do goertzel_init loop first before setting s->lasthit and s->current_hit, consistant with ast_dsp_digitreset()
> 
> 3). ast_mf_detect_init:
>     do goertzel_init loop first before setting s->hits[] and s->current_hit, consistant with ast_dsp_digitreset()
> 
> 4). white space, in areas I've been recently, plus others.
> 
> 
> Diffs
> -----
> 
>   branches/1.8/main/dsp.c 372929 
> 
> Diff: https://reviewboard.asterisk.org/r/2107/diff
> 
> 
> Testing
> -------
> 
> compiles.
> 
> 
> Thanks,
> 
> Alec
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120914/4fa11c82/attachment-0001.htm>


More information about the asterisk-dev mailing list