[asterisk-dev] [Code Review] avoid many cppcheck (#2)
    wdoekes 
    reviewboard at asterisk.org
       
    Tue Feb 28 03:34:18 CST 2012
    
    
  
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1743/#review5663
-----------------------------------------------------------
I did a preliminary pass through it. Some items I have to check against more context.
trunk/apps/app_osplookup.c
<https://reviewboard.asterisk.org/r/1743/#comment10348>
    - acceleration has one l
    - please add a comma, we're not unable to enable the error
    
trunk/channels/chan_dahdi.c
<https://reviewboard.asterisk.org/r/1743/#comment10349>
    FIXME: double check that this doesn't change anything
trunk/channels/chan_unistim.c
<https://reviewboard.asterisk.org/r/1743/#comment10350>
    FIXME: double check that this is right
trunk/channels/chan_unistim.c
<https://reviewboard.asterisk.org/r/1743/#comment10351>
    FIXME: double check that this is right
trunk/channels/chan_unistim.c
<https://reviewboard.asterisk.org/r/1743/#comment10352>
    This doesn't seem to be needed. Since it hasn't crashed before.
trunk/codecs/codec_resample.c
<https://reviewboard.asterisk.org/r/1743/#comment10353>
    I'd rather have res used and return LOAD_FAILURE of some kind.
trunk/funcs/func_env.c
<https://reviewboard.asterisk.org/r/1743/#comment10354>
    This is nasty.
    
    I'd prefer to move the left parenthesis to just before 'end' instead.
    
    Or, simply move up the pos= to a single line and leave the for-initializer empty.
trunk/main/data.c
<https://reviewboard.asterisk.org/r/1743/#comment10355>
    FIXME: double check that this is right
trunk/main/data.c
<https://reviewboard.asterisk.org/r/1743/#comment10356>
    FIXME: double check that this is right
trunk/res/res_config_sqlite3.c
<https://reviewboard.asterisk.org/r/1743/#comment10357>
    You're changing this into something that was not intended:
    
    !(res = call()) < 0 ? -1 : 0
    
    I wouldn't even know if !0 < 0 or > 0, and when/if I did, I could drop the ternary ?: operator.
    
    Looks to me like this was intended:
    
    !(res = (call() < 0 ? -1 : 0))
trunk/res/res_jabber.c
<https://reviewboard.asterisk.org/r/1743/#comment10358>
    FIXME: double check
- wdoekes
On Feb. 14, 2012, 9:13 p.m., junky wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1743/
> -----------------------------------------------------------
> 
> (Updated Feb. 14, 2012, 9:13 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch is to prevent many more cppcheck warnings.
> 
> 
> Diffs
> -----
> 
>   trunk/cdr/cdr_pgsql.c 355447 
>   trunk/cdr/cdr_sqlite3_custom.c 355447 
>   trunk/channels/chan_agent.c 355447 
>   trunk/channels/chan_alsa.c 355447 
>   trunk/channels/chan_dahdi.c 355447 
>   trunk/channels/chan_gtalk.c 355447 
>   trunk/channels/chan_h323.c 355447 
>   trunk/channels/chan_unistim.c 355447 
>   trunk/apps/app_minivm.c 355447 
>   trunk/apps/app_osplookup.c 355447 
>   trunk/channels/vcodecs.c 355447 
>   trunk/codecs/codec_dahdi.c 355447 
>   trunk/codecs/codec_resample.c 355447 
>   trunk/formats/format_h264.c 355447 
>   trunk/funcs/func_devstate.c 355447 
>   trunk/funcs/func_env.c 355447 
>   trunk/main/ast_expr2.fl 355447 
>   trunk/main/ast_expr2f.c 355447 
>   trunk/main/asterisk.c 355447 
>   trunk/main/data.c 355447 
>   trunk/res/res_config_ldap.c 355447 
>   trunk/res/res_config_sqlite3.c 355447 
>   trunk/res/res_corosync.c 355447 
>   trunk/res/res_format_attr_celt.c 355447 
>   trunk/res/res_format_attr_silk.c 355447 
>   trunk/res/res_http_post.c 355447 
>   trunk/res/res_jabber.c 355447 
>   trunk/res/res_musiconhold.c 355447 
>   trunk/res/res_odbc.c 355447 
>   trunk/res/res_phoneprov.c 355447 
> 
> Diff: https://reviewboard.asterisk.org/r/1743/diff
> 
> 
> Testing
> -------
> 
> used cppcheck 1.52
> it compiles ;)
> 
> 
> Thanks,
> 
> junky
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120228/4a0c3a8f/attachment-0001.htm>
    
    
More information about the asterisk-dev
mailing list