[asterisk-dev] [Code Review]: Opaquify ast_channel lists and structs
Terry Wilson
reviewboard at asterisk.org
Mon Feb 27 17:47:16 CST 2012
> On Feb. 27, 2012, 3:13 p.m., rmudgett wrote:
> > /trunk/channels/chan_local.c, lines 473-477
> > <https://reviewboard.asterisk.org/r/1773/diff/1/?file=24833#file24833line473>
> >
> > 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.
do-while'd and added to utils.h
> On Feb. 27, 2012, 3:13 p.m., rmudgett wrote:
> > /trunk/main/channel_internal_api.c, lines 755-790
> > <https://reviewboard.asterisk.org/r/1773/diff/1/?file=24860#file24860line755>
> >
> > 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
Changed to struct assignments and removed un-used functions.
- Terry
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1773/#review5659
-----------------------------------------------------------
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/3310e757/attachment-0001.htm>
More information about the asterisk-dev
mailing list