[asterisk-dev] [Code Review]: avoid cppcheck warnings

junky reviewboard at asterisk.org
Tue Feb 7 19:32:18 CST 2012



> On Feb. 6, 2012, 2:07 p.m., wdoekes wrote:
> > Pretty please, commit the thing already.
> 
> Terry Wilson wrote:
>     wdoekes: feel free to commit it yourself. You've done a lot of the review for it. I would commit it, but I haven't even looked at the patch. It seems better that someone who has had input into it should commit it.

yay!


> On Feb. 6, 2012, 2:07 p.m., wdoekes wrote:
> > trunk/apps/app_chanspy.c, line 777
> > <https://reviewboard.asterisk.org/r/1651/diff/12/?file=23762#file23762line777>
> >
> >     No need for initialization to 0 here. (It doesn't cost anything, but the other vars aren't initialized either.)
> >     
> >     (You could move declaration to line 961, the only block where it is used.)

move to reduce scope.
reducing scope will be my 3rd patch, since cppcheck complains about scoping too.


> On Feb. 6, 2012, 2:07 p.m., wdoekes wrote:
> > trunk/main/ast_expr2.fl, lines 465-466
> > <https://reviewboard.asterisk.org/r/1651/diff/12/?file=23779#file23779line465>
> >
> >     Spaces around =-operator.

changed


> On Feb. 6, 2012, 2:07 p.m., wdoekes wrote:
> > trunk/main/udptl.c, lines 1086-1088
> > <https://reviewboard.asterisk.org/r/1651/diff/12/?file=23782#file23782line1086>
> >
> >     Add braces.

added.


> On Feb. 6, 2012, 2:07 p.m., wdoekes wrote:
> > trunk/main/ast_expr2.fl, lines 470-474
> > <https://reviewboard.asterisk.org/r/1651/diff/12/?file=23779#file23779line470>
> >
> >     <Tilghman> [...] spaces around the ternary operator.

spaces added.


- junky


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


On Jan. 27, 2012, 7:54 p.m., junky wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1651/
> -----------------------------------------------------------
> 
> (Updated Jan. 27, 2012, 7:54 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> By running cppcheck 1.52, i realized there was many errors/warnings.
> 
> This patch fixes many of those.
> 
> 
> Diffs
> -----
> 
>   trunk/addons/chan_mobile.c 352913 
>   trunk/addons/chan_ooh323.c 352913 
>   trunk/apps/app_alarmreceiver.c 351181 
>   trunk/apps/app_chanspy.c 352913 
>   trunk/apps/app_dial.c 352913 
>   trunk/apps/app_disa.c 352913 
>   trunk/apps/app_minivm.c 352913 
>   trunk/apps/app_osplookup.c 351181 
>   trunk/apps/app_queue.c 352913 
>   trunk/apps/app_voicemail.c 352913 
>   trunk/channels/chan_dahdi.c 352913 
>   trunk/channels/chan_iax2.c 352913 
>   trunk/channels/chan_misdn.c 352913 
>   trunk/channels/chan_skinny.c 352913 
>   trunk/channels/chan_usbradio.c 352913 
>   trunk/formats/format_h263.c 351181 
>   trunk/funcs/func_env.c 351181 
>   trunk/funcs/func_odbc.c 352913 
>   trunk/funcs/func_strings.c 351181 
>   trunk/main/acl.c 352913 
>   trunk/main/ast_expr2.fl 352913 
>   trunk/main/ast_expr2f.c 352913 
>   trunk/main/pbx.c 352913 
>   trunk/main/udptl.c 352913 
>   trunk/utils/astman.c 351181 
> 
> Diff: https://reviewboard.asterisk.org/r/1651/diff
> 
> 
> Testing
> -------
> 
> still compile fine.
> Shouldn't have any impact on the code execution.
> 
> 
> Thanks,
> 
> junky
> 
>

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


More information about the asterisk-dev mailing list