Review Board 1.7.16


Use va_copy for stringfields--it's used everywhere else

Review Request #1233 - Created May 26, 2011 and submitted

Terry Wilson
trunk
Reviewers
asterisk-dev
Asterisk
The ast_string_field_build_va functions were written to take to separate va_lists to work around FreeBSD 4 not having va_copy defined. It should have been perfectly possible for that case to just define va_copy ourselves as an assignment, as if va_list was implemented in some way incompatible with that (as in an array type), passing two copies of it wouldn't have worked anyway.

In the end, we don't support anything using gcc < 3 anyway because we use va_copy all over the place anyway. This patch just simplifies things by removing the second va_list function arguments in favor of va_copy. The only place that used the function was __ast_channel_alloc_ap(). We could simplify things further by just getting rid of __ast_channel_alloc_ap() and doing everything in __ast_channel_alloc() since it is only called by __ast_channel_alloc().

Also, does the ABI compatibility stuff at the end of channel.c still need to be there in trunk?
Made a call under valgrind. Things didn't blow up and the channel had the appropriate name, so things must work.
Ship it!
Posted (May 26, 2011, 5:26 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.