[asterisk-dev] [Code Review] Restore ao2 API compatibility and add new ao2_callback_data function
Sean Bright
sean.bright at gmail.com
Sun Nov 23 09:47:39 CST 2008
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/64/
-----------------------------------------------------------
(Updated 2008-11-23 09:47:39.599128)
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