From: Russell Bryant Date: Wed, 29 Apr 2009 08:51:21 +0000 (+0000) Subject: Resolve Solaris build issues and add some API documentation. X-Git-Tag: 11.0.0-beta1~4981 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c1ffef923635f0ae81b628e409c56d172a72656;p=thirdparty%2Fasterisk.git Resolve Solaris build issues and add some API documentation. (issue #14981) Reported by: snuffy git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190989 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index eb28c1111c..ad0e2ec4aa 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -2073,8 +2073,27 @@ struct ast_group_info { } \ } while (0) +/*! + * \brief Increase channel reference count + * + * \param c the channel + * + * \retval c always + * + * \since 1.6.3 + */ #define ast_channel_ref(c) ({ ao2_ref(c, +1); (c); }) -#define ast_channel_unref(c) ({ ao2_ref(c, -1); (NULL); }) + +/*! + * \brief Decrease channel reference count + * + * \param c the channel + * + * \retval NULL always + * + * \since 1.6.3 + */ +#define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); }) /*! Channel Iterating @{ */ diff --git a/main/rtp_engine.c b/main/rtp_engine.c index 89f9a595c7..ac0885a10e 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -1540,7 +1540,8 @@ int ast_rtp_instance_make_compatible(struct ast_channel *chan, struct ast_rtp_in if (!peer_instance || peer_instance->engine != instance->engine) { ast_channel_unlock(peer); - peer_instance = (ao2_ref(peer_instance, -1), NULL); + ao2_ref(peer_instance, -1); + peer_instance = NULL; return -1; } @@ -1548,7 +1549,8 @@ int ast_rtp_instance_make_compatible(struct ast_channel *chan, struct ast_rtp_in ast_channel_unlock(peer); - peer_instance = (ao2_ref(peer_instance, -1), NULL); + ao2_ref(peer_instance, -1); + peer_instance = NULL; return res; }