[asterisk-commits] tzafrir: branch 1.8 r333507 - /branches/1.8/channels/chan_vpb.cc

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 28 04:49:58 CDT 2011


Author: tzafrir
Date: Sun Aug 28 04:49:55 2011
New Revision: 333507

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333507
Log:
chan_vpb: remove unused variables (gcc4.6)

GCC 4.6 detects variables that get assined to, but never used later.
Also removes some remmed-out lines that become invalid.

(closes issue ASTERISK-18336)
Signed-off-by: Tzafrir Cohen (License #5035) <tzafrir.cohen at xorcom.com>,

Modified:
    branches/1.8/channels/chan_vpb.cc

Modified: branches/1.8/channels/chan_vpb.cc
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_vpb.cc?view=diff&rev=333507&r1=333506&r2=333507
==============================================================================
--- branches/1.8/channels/chan_vpb.cc (original)
+++ branches/1.8/channels/chan_vpb.cc Sun Aug 28 04:49:55 2011
@@ -829,7 +829,6 @@
 {
 	struct ast_frame f = {AST_FRAME_CONTROL}; /* default is control, Clear rest. */
 	int endbridge = 0;
-	int res = 0;
 
 	ast_verb(4, "%s: handle_owned: got event: [%d=>%d]\n", p->dev, e->type, e->data);
 
@@ -1055,7 +1054,7 @@
 	}
 
 	if (endbridge) {
-		res = ast_mutex_unlock(&p->lock);
+		ast_mutex_unlock(&p->lock);
 /*
 		ast_verb(4, "%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
 */
@@ -1079,7 +1078,7 @@
 				p->dev, f.frametype, f.subclass.integer);
 		}
 	}
-	res = ast_mutex_unlock(&p->lock);
+	ast_mutex_unlock(&p->lock);
 /*
 	ast_verb(4, "%s: unLOCKING in handle_owned [%d]\n", p->dev,res);
 */
@@ -1656,7 +1655,6 @@
 {
 	struct vpb_pvt *p = (struct vpb_pvt *)ast->tech_pvt;
 	int res = 0;
-	int tmp = 0;
 
 	if (use_ast_ind == 1) {
 		ast_verb(4, "%s: vpb_indicate called when using Ast Indications !?!\n", p->dev);
@@ -1720,17 +1718,13 @@
 		res = 0;
 		break;
 	}
-	tmp = ast_mutex_unlock(&p->lock);
-/*
-	ast_verb(4, "%s: unLOCKING in indicate [%d]\n", p->dev,tmp);
-*/
+	ast_mutex_unlock(&p->lock);
 	return res;
 }
 
 static int vpb_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct vpb_pvt *p = (struct vpb_pvt *)newchan->tech_pvt;
-	int res = 0;
 
 /*
 	ast_verb(4, "%s: LOCKING in fixup \n", p->dev);
@@ -1753,10 +1747,7 @@
 		}
 	}
 
-	res = ast_mutex_unlock(&p->lock);
-/*
-	ast_verb(4, "%s: unLOCKING in fixup [%d]\n", p->dev,res);
-*/
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 
@@ -1769,7 +1760,6 @@
 {
 	struct vpb_pvt *p = (struct vpb_pvt *)ast->tech_pvt;
 	char s[2];
-	int res = 0;
 
 	if (use_ast_dtmf) {
 		ast_verb(4, "%s: vpb_digit: asked to play digit[%c] but we are using asterisk dtmf play back?!\n", p->dev, digit);
@@ -1792,10 +1782,7 @@
 	strncat(p->play_dtmf, s, sizeof(*p->play_dtmf) - strlen(p->play_dtmf) - 1);
 	ast_mutex_unlock(&p->play_dtmf_lock);
 
-	res = ast_mutex_unlock(&p->lock);
-/*
-	ast_verb(4, "%s: unLOCKING in digit [%d]\n", p->dev,res);
-*/
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 
@@ -1806,7 +1793,6 @@
 	int res = 0, i;
 	char *s = strrchr(dest, '/');
 	char dialstring[254] = "";
-	int tmp = 0;
 
 /*
 	ast_verb(4, "%s: LOCKING in call \n", p->dev);
@@ -1829,10 +1815,7 @@
 
 	if (ast->_state != AST_STATE_DOWN && ast->_state != AST_STATE_RESERVED) {
 		ast_log(LOG_WARNING, "vpb_call on %s neither down nor reserved!\n", ast->name);
-		tmp = ast_mutex_unlock(&p->lock);
-/*
-		ast_verb(4, "%s: unLOCKING in call [%d]\n", p->dev,tmp);
-*/
+		ast_mutex_unlock(&p->lock);
 		return -1;
 	}
 	if (p->mode != MODE_FXO)  /* Station port, ring it. */
@@ -1901,10 +1884,7 @@
 		ast_pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
 	}
 
-	tmp = ast_mutex_unlock(&p->lock);
-/*
-	ast_verb(4, "%s: unLOCKING in call [%d]\n", p->dev,tmp);
-*/
+	ast_mutex_unlock(&p->lock);
 	return res;
 }
 
@@ -1913,7 +1893,6 @@
 	struct vpb_pvt *p = (struct vpb_pvt *)ast->tech_pvt;
 	VPB_EVENT je;
 	char str[VPB_MAX_STR];
-	int res = 0;
 
 /*
 	ast_verb(4, "%s: LOCKING in hangup \n", p->dev);
@@ -1925,10 +1904,7 @@
 
 	if (!ast->tech || !ast->tech_pvt) {
 		ast_log(LOG_WARNING, "%s: channel not connected?\n", ast->name);
-		res = ast_mutex_unlock(&p->lock);
-/*
-		ast_verb(4, "%s: unLOCKING in hangup [%d]\n", p->dev,res);
-*/
+		ast_mutex_unlock(&p->lock);
 		/* Free up ast dsp if we have one */
 		if (use_ast_dtmfdet && p->vad) {
 			ast_dsp_free(p->vad);
@@ -2013,21 +1989,13 @@
 	ast_verb(2, "%s: Hangup complete\n", ast->name);
 
 	restart_monitor();
-/*
-	ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
-*/
-	res = ast_mutex_unlock(&p->lock);
-/*
-	ast_verb(4, "%s: unLOCKING in hangup [%d]\n", p->dev,res);
-	ast_verb(4, "%s: LOCKING in hangup count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
-*/
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 
 static int vpb_answer(struct ast_channel *ast)
 {
 	struct vpb_pvt *p = (struct vpb_pvt *)ast->tech_pvt;
-	int res = 0;
 /*
 	VPB_EVENT je;
 	int ret;
@@ -2078,10 +2046,7 @@
 		ast_verb(4, "%s: Re-enabling Loop Drop detection\n", p->dev);
 		vpb_enable_event(p->handle, VPB_MDROP);
 	}
-	res = ast_mutex_unlock(&p->lock);
-/*
-	ast_verb(4, "%s: unLOCKING in answer [%d]\n", p->dev,res);
-*/
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 




More information about the asterisk-commits mailing list