Review Board 1.7.16


dsp.c ast_dsp_call_progress use local short variable in loop, plus other cleanup

Review Request #2107 - Created Sept. 12, 2012 and submitted

Alec Davis
trunk
Reviewers
asterisk-dev
Asterisk
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). Don't chain init different variables, as the type may change
compiles.
Review request changed
Updated (Sept. 20, 2012, 1:08 a.m.)
  • 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.

    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). Don't chain init different variables, as the type may change
  • changed from 1.8 to trunk to trunk
This is for trunk only.

removed white space changes.
Posted (Sept. 20, 2012, 9:46 a.m.)
reopened.

thanks richard
Ship it!
Posted (Sept. 20, 2012, 11:58 a.m.)

   

  

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.