[asterisk-dev] [Code Review] Opaquify ast_channel lists and structs

rmudgett reviewboard at asterisk.org
Mon Feb 27 15:13:22 CST 2012


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


My eyes!


/trunk/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1773/#comment10330>

    Could this be pushed into something like utils.h?  It is quite handy like S_OR/S_COR.  I know ast_do_masquerade() could use it if the other structs were not collected into a union.
    
    This should use the do {} while (0) trick since it is a macro.



/trunk/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/1773/#comment10335>

    Use of memcpy is more error prone than the struct copy line:
    chan->__do_not_use_xxx = *value;
    
    Also the following are not used:
    ast_channel_dtmff_set
    ast_channel_jb_set
    ast_channel_varshead_set


- rmudgett


On Feb. 24, 2012, 8:16 p.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1773/
> -----------------------------------------------------------
> 
> (Updated Feb. 24, 2012, 8:16 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Opaquify lists and remaining structs. I had do a lot of manual fixing in this one. I also added a SWAP macro in chan_local because I was tired of typing and saw some copy/paste code that could use it. I can type things out if people really want me to. :-p Setters for the structs are just wrappers around memcpy. For the most part I could have done things like *ast_channel_caller(chan1) = *ast_channel_caller(chan2), but ick.
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/sig_pri.c 356603 
>   /trunk/channels/sig_analog.c 356603 
>   /trunk/channels/chan_skinny.c 356603 
>   /trunk/channels/chan_unistim.c 356603 
>   /trunk/channels/chan_usbradio.c 356603 
>   /trunk/channels/chan_vpb.cc 356603 
>   /trunk/channels/console_video.c 356603 
>   /trunk/channels/chan_sip.c 356603 
>   /trunk/channels/chan_oss.c 356603 
>   /trunk/channels/chan_phone.c 356603 
>   /trunk/channels/chan_mgcp.c 356603 
>   /trunk/channels/chan_misdn.c 356603 
>   /trunk/channels/chan_local.c 356603 
>   /trunk/channels/chan_jingle.c 356603 
>   /trunk/channels/chan_gtalk.c 356603 
>   /trunk/channels/chan_h323.c 356603 
>   /trunk/channels/chan_iax2.c 356603 
>   /trunk/apps/app_while.c 356603 
>   /trunk/apps/app_zapateller.c 356603 
>   /trunk/bridges/bridge_builtin_features.c 356603 
>   /trunk/channels/chan_agent.c 356603 
>   /trunk/channels/chan_console.c 356603 
>   /trunk/channels/chan_dahdi.c 356603 
>   /trunk/apps/app_talkdetect.c 356603 
>   /trunk/apps/app_voicemail.c 356603 
>   /trunk/apps/app_setcallerid.c 356603 
>   /trunk/apps/app_sms.c 356603 
>   /trunk/apps/app_stack.c 356603 
>   /trunk/apps/app_readexten.c 356603 
>   /trunk/apps/app_rpt.c 356603 
>   /trunk/apps/app_minivm.c 356603 
>   /trunk/apps/app_mixmonitor.c 356603 
>   /trunk/apps/app_osplookup.c 356603 
>   /trunk/apps/app_parkandannounce.c 356603 
>   /trunk/apps/app_privacy.c 356603 
>   /trunk/apps/app_queue.c 356603 
>   /trunk/apps/app_disa.c 356603 
>   /trunk/apps/app_dumpchan.c 356603 
>   /trunk/apps/app_fax.c 356603 
>   /trunk/apps/app_followme.c 356603 
>   /trunk/apps/app_macro.c 356603 
>   /trunk/apps/app_meetme.c 356603 
>   /trunk/apps/app_alarmreceiver.c 356603 
>   /trunk/apps/app_amd.c 356603 
>   /trunk/apps/app_confbridge.c 356603 
>   /trunk/apps/app_dial.c 356603 
>   /trunk/addons/chan_ooh323.c 356603 
>   /trunk/channels/sig_ss7.c 356603 
>   /trunk/funcs/func_blacklist.c 356603 
>   /trunk/funcs/func_callerid.c 356603 
>   /trunk/funcs/func_dialplan.c 356603 
>   /trunk/funcs/func_strings.c 356603 
>   /trunk/funcs/func_timeout.c 356603 
>   /trunk/include/asterisk/channel.h 356603 
>   /trunk/main/abstract_jb.c 356603 
>   /trunk/main/app.c 356603 
>   /trunk/main/autochan.c 356603 
>   /trunk/main/ccss.c 356603 
>   /trunk/main/cdr.c 356603 
>   /trunk/main/cel.c 356603 
>   /trunk/main/channel.c 356603 
>   /trunk/main/channel_internal_api.c 356603 
>   /trunk/main/cli.c 356603 
>   /trunk/main/dial.c 356603 
>   /trunk/main/features.c 356603 
>   /trunk/main/file.c 356603 
>   /trunk/main/manager.c 356603 
>   /trunk/main/message.c 356603 
>   /trunk/main/pbx.c 356603 
>   /trunk/pbx/pbx_lua.c 356603 
>   /trunk/res/res_agi.c 356603 
>   /trunk/res/res_fax.c 356603 
>   /trunk/res/snmp/agent.c 356603 
>   /trunk/tests/test_substitution.c 356603 
> 
> Diff: https://reviewboard.asterisk.org/r/1773/diff
> 
> 
> Testing
> -------
> 
> Unit tests pass.
> 
> 
> Thanks,
> 
> Terry
> 
>

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


More information about the asterisk-dev mailing list