[asterisk-commits] twilson: trunk r356152 - in /trunk: main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 21 14:17:56 CST 2012


Author: twilson
Date: Tue Feb 21 14:17:52 2012
New Revision: 356152

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=356152
Log:
Fix some opaquification-related compiler warnings

PseudoReview - seanbright on IRC

Modified:
    trunk/main/channel.c
    trunk/main/framehook.c
    trunk/res/res_monitor.c

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=356152&r1=356151&r2=356152
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Feb 21 14:17:52 2012
@@ -2926,7 +2926,7 @@
 int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params)
 {
 	int res = 0;
-	void *generatordata;
+	void *generatordata = NULL;
 
 	ast_channel_lock(chan);
 	if (ast_channel_generatordata(chan)) {
@@ -2937,10 +2937,12 @@
 	if (gen->alloc && !(generatordata = gen->alloc(chan, params))) {
 		res = -1;
 	}
+	if (generatordata) {
+		ast_channel_generator_set(chan, gen);
+	}
 	if (!res) {
 		ast_settimeout(chan, 50, generator_force, chan);
 		ast_channel_generatordata_set(chan, generatordata);
-		ast_channel_generator_set(chan, gen);
 	}
 	ast_channel_unlock(chan);
 

Modified: trunk/main/framehook.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/framehook.c?view=diff&rev=356152&r1=356151&r2=356152
==============================================================================
--- trunk/main/framehook.c (original)
+++ trunk/main/framehook.c Tue Feb 21 14:17:52 2012
@@ -104,12 +104,14 @@
 	framehook->chan = chan;
 
 	/* create the framehook list if it didn't already exist */
-	if (!ast_channel_framehooks(chan) && !(fh_list = ast_calloc(1, sizeof(*ast_channel_framehooks(chan))))) {
-		ast_free(framehook);
-		return -1;
+	if (!ast_channel_framehooks(chan)) {
+		if (!(fh_list = ast_calloc(1, sizeof(*ast_channel_framehooks(chan))))) {
+			ast_free(framehook);
+			return -1;
+		}
+		ast_channel_framehooks_set(chan, fh_list);
 	}
 
-	ast_channel_framehooks_set(chan, fh_list);
 	framehook->id = ++ast_channel_framehooks(chan)->id_count;
 	AST_LIST_INSERT_TAIL(&ast_channel_framehooks(chan)->list, framehook, list);
 

Modified: trunk/res/res_monitor.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_monitor.c?view=diff&rev=356152&r1=356151&r2=356152
==============================================================================
--- trunk/res/res_monitor.c (original)
+++ trunk/res/res_monitor.c Tue Feb 21 14:17:52 2012
@@ -689,11 +689,13 @@
 		snprintf(tmp, sizeof(tmp), "%s/%s.%s", urlprefix, args.fname_base,
 			((strcmp(args.format, "gsm")) ? "wav" : "gsm"));
 		ast_channel_lock(chan);
-		if (!ast_channel_cdr(chan) && !(chan_cdr = ast_cdr_alloc())) {
-			ast_channel_unlock(chan);
-			return -1;
-		}
-		ast_channel_cdr_set(chan, chan_cdr);
+		if (!ast_channel_cdr(chan)) {
+			if (!(chan_cdr = ast_cdr_alloc())) {
+				ast_channel_unlock(chan);
+				return -1;
+			}
+			ast_channel_cdr_set(chan, chan_cdr);
+		}
 		ast_cdr_setuserfield(chan, tmp);
 		ast_channel_unlock(chan);
 	}




More information about the asterisk-commits mailing list