[asterisk-dev] [Code Review] Restore ao2 API compatibility and add new ao2_callback_data function
Sean Bright
sean.bright at gmail.com
Sat Nov 22 19:36:02 CST 2008
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/64/#review153
-----------------------------------------------------------
/trunk/main/astobj2.c
<http://reviewboard.digium.com/r/64/#comment274>
This is really the meat and potatoes of the diff. Casting the void * to an appropriate function *. I think it's safe, but there may be a better way.
- Sean
On 2008-11-21 21:59:43, Sean Bright wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/64/
> -----------------------------------------------------------
>
> (Updated 2008-11-21 21:59:43)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This patch, for all intents and purposes, simply reverts the majority of the ao2 changes that added the 'void *data' argument to the ao2_callback_fn, ao2_callback, and ao2_find calls. It adds a new function, ao2_callback_data which takes the extra void *, and chan_sip is updated to use it (as this was the only place that was actually using the new argument).
>
> Not included in this patch is documentation of the new function ao2_callback_data. This will be added before commit. Secondly, Russell suggested adding an ao2_find_data, but this is problematic since this calls the cmp callback on the container being passed. I opted not to include it in this patch.
>
> The real meat-and-potatoes to keep an eye on are the changes to main/astobj2.c. The changes (casting a void * to the appropriate callback type) feels dirty, but it is necessary to avoid a good chunk of code duplication.
>
> (As a total aside, for those of you having problems using post-review, I used `post-review --branch=/trunk --username=seanbright --password=mypassword` in my WC and it worked perfectly)
>
>
> Diffs
> -----
>
> /trunk/apps/app_queue.c 158681
> /trunk/channels/chan_console.c 158681
> /trunk/channels/chan_iax2.c 158681
> /trunk/channels/chan_sip.c 158681
> /trunk/funcs/func_dialgroup.c 158681
> /trunk/include/asterisk/astobj2.h 158681
> /trunk/main/astobj2.c 158681
> /trunk/main/config.c 158681
> /trunk/main/features.c 158681
> /trunk/main/manager.c 158681
> /trunk/main/taskprocessor.c 158681
> /trunk/res/res_clialiases.c 158681
> /trunk/res/res_phoneprov.c 158681
> /trunk/res/res_timing_pthread.c 158681
> /trunk/res/res_timing_timerfd.c 158681
> /trunk/utils/hashtest2.c 158681
>
> Diff: http://reviewboard.digium.com/r/64/diff
>
>
> Testing
> -------
>
> Compilation and developer tests.
>
>
> Thanks,
>
> Sean
>
>
More information about the asterisk-dev
mailing list