[asterisk-commits] rmudgett: branch rmudgett/ao2_enhancements r349446 - in /team/rmudgett/ao2_en...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 3 11:11:09 CST 2012


Author: rmudgett
Date: Tue Jan  3 11:11:04 2012
New Revision: 349446

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349446
Log:
Multiple revisions 349409-349410

........
  r349409 | russell | 2011-12-31 09:45:57 -0600 (Sat, 31 Dec 2011) | 2 lines
  
  Constify tag argument in REF_DEBUG related code.
........
  r349410 | russell | 2011-12-31 09:48:09 -0600 (Sat, 31 Dec 2011) | 2 lines
  
  Fix some minor formatting issues based on coding guidelines.
........

Merged revisions 349409-349410 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/rmudgett/ao2_enhancements/   (props changed)
    team/rmudgett/ao2_enhancements/channels/chan_sip.c
    team/rmudgett/ao2_enhancements/channels/sip/include/dialog.h
    team/rmudgett/ao2_enhancements/include/asterisk/astobj2.h

Propchange: team/rmudgett/ao2_enhancements/
------------------------------------------------------------------------------
--- ao2_enhancements-integrated (original)
+++ ao2_enhancements-integrated Tue Jan  3 11:11:04 2012
@@ -1,1 +1,1 @@
-/trunk:1-349381
+/trunk:1-349445

Modified: team/rmudgett/ao2_enhancements/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ao2_enhancements/channels/chan_sip.c?view=diff&rev=349446&r1=349445&r2=349446
==============================================================================
--- team/rmudgett/ao2_enhancements/channels/chan_sip.c (original)
+++ team/rmudgett/ao2_enhancements/channels/chan_sip.c Tue Jan  3 11:11:04 2012
@@ -2222,7 +2222,7 @@
 	\return Always returns 0 */
 #define append_history(p, event, fmt , args... )	append_history_full(p, "%-15s " fmt, event, ## args)
 
-struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, char *tag, char *file, int line, const char *func)
+struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func)
 {
 	if (p)
 #ifdef REF_DEBUG
@@ -2235,7 +2235,7 @@
 	return p;
 }
 
-struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, char *tag, char *file, int line, const char *func)
+struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func)
 {
 	if (p)
 #ifdef REF_DEBUG
@@ -4116,14 +4116,16 @@
 	return 0;
 }
 
-static int send_provisional_keepalive(const void *data) {
+static int send_provisional_keepalive(const void *data)
+{
 	struct sip_pvt *pvt = (struct sip_pvt *) data;
 
 	return send_provisional_keepalive_full(pvt, 0);
 }
 
-static int send_provisional_keepalive_with_sdp(const void *data) {
-	struct sip_pvt *pvt = (void *)data;
+static int send_provisional_keepalive_with_sdp(const void *data)
+{
+	struct sip_pvt *pvt = (void *) data;
 
 	return send_provisional_keepalive_full(pvt, 1);
 }

Modified: team/rmudgett/ao2_enhancements/channels/sip/include/dialog.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ao2_enhancements/channels/sip/include/dialog.h?view=diff&rev=349446&r1=349445&r2=349446
==============================================================================
--- team/rmudgett/ao2_enhancements/channels/sip/include/dialog.h (original)
+++ team/rmudgett/ao2_enhancements/channels/sip/include/dialog.h Tue Jan  3 11:11:04 2012
@@ -31,8 +31,8 @@
  */
 #define dialog_ref(arg1,arg2) dialog_ref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 #define dialog_unref(arg1,arg2) dialog_unref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
-struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, char *tag, char *file, int line, const char *func);
-struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, char *tag, char *file, int line, const char *func);
+struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func);
+struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func);
 
 struct sip_pvt *sip_alloc(ast_string_field callid, struct ast_sockaddr *sin,
 				 int useglobal_nat, const int intended_method, struct sip_request *req);

Modified: team/rmudgett/ao2_enhancements/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ao2_enhancements/include/asterisk/astobj2.h?view=diff&rev=349446&r1=349445&r2=349446
==============================================================================
--- team/rmudgett/ao2_enhancements/include/asterisk/astobj2.h (original)
+++ team/rmudgett/ao2_enhancements/include/asterisk/astobj2.h Tue Jan  3 11:11:04 2012
@@ -207,35 +207,39 @@
 #ifdef REF_DEBUG
 #define dialog_ref(arg1,arg2) dialog_ref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 #define dialog_unref(arg1,arg2) dialog_unref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
-static struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, char *tag, const char *file, int line, const char *func)
+static struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, const char *tag, const char *file, int line, const char *func)
 {
-	if (p)
+	if (p) {
 		ao2_ref_debug(p, 1, tag, file, line, func);
-	else
+	} else {
 		ast_log(LOG_ERROR, "Attempt to Ref a null pointer\n");
+	}
 	return p;
 }
 
-static struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, char *tag, const char *file, int line, const char *func)
+static struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, const char *tag, const char *file, int line, const char *func)
 {
-	if (p)
+	if (p) {
 		ao2_ref_debug(p, -1, tag, file, line, func);
+	}
 	return NULL;
 }
 #else
-static struct sip_pvt *dialog_ref(struct sip_pvt *p, char *tag)
+static struct sip_pvt *dialog_ref(struct sip_pvt *p, const char *tag)
 {
-	if (p)
+	if (p) {
 		ao2_ref(p, 1);
-	else
+	} else {
 		ast_log(LOG_ERROR, "Attempt to Ref a null pointer\n");
+	}
 	return p;
 }
 
-static struct sip_pvt *dialog_unref(struct sip_pvt *p, char *tag)
+static struct sip_pvt *dialog_unref(struct sip_pvt *p, const char *tag)
 {
-	if (p)
+	if (p) {
 		ao2_ref(p, -1);
+	}
 	return NULL;
 }
 #endif
@@ -332,19 +336,22 @@
 
 	*//* Unlink us from the owner (channel) if we have one *//*
 	if (dialog->owner) {
-		if (lockowner)
+		if (lockowner) {
 			ast_channel_lock(dialog->owner);
+		}
 		ast_debug(1, "Detaching from channel %s\n", dialog->owner->name);
 		dialog->owner->tech_pvt = dialog_unref(dialog->owner->tech_pvt, "resetting channel dialog ptr in unlink_all");
-		if (lockowner)
+		if (lockowner) {
 			ast_channel_unlock(dialog->owner);
+		}
 	}
 	if (dialog->registry) {
-		if (dialog->registry->call == dialog)
+		if (dialog->registry->call == dialog) {
 			dialog->registry->call = dialog_unref(dialog->registry->call, "nulling out the registry's call dialog field in unlink_all");
+		}
 		dialog->registry = registry_unref(dialog->registry, "delete dialog->registry");
 	}
-    ...
+	...
  	dialog_unref(dialog, "Let's unbump the count in the unlink so the poor pvt can disappear if it is time");
 
 In the above code, the ao2_t_unlink could end up destroying the dialog




More information about the asterisk-commits mailing list