Review Board 1.7.16


Restore ao2 API compatibility and add new ao2_callback_data function

Review Request #64 - Created Nov. 21, 2008 and submitted

Sean Bright
/trunk
Reviewers
asterisk-dev
Asterisk
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)
Compilation and developer tests.
Review request changed
Updated (Nov. 23, 2008, 3:51 a.m.)
  • Try again.

    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)
    
Review request changed
Updated (Nov. 23, 2008, 3:51 a.m.)

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.