[svn-commits] rmudgett: trunk r216186 - in /trunk/channels: chan_dahdi.c sig_pri.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 3 16:09:50 CDT 2009


Author: rmudgett
Date: Thu Sep  3 16:09:46 2009
New Revision: 216186

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=216186
Log:
Lets try not to use C++ keywords for variable names.

Modified:
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_pri.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=216186&r1=216185&r2=216186
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Thu Sep  3 16:09:46 2009
@@ -2565,30 +2565,31 @@
 }
 
 #if defined(HAVE_PRI)
-static void my_pri_fixup_chans(void *old_chan, void *new_chan)
-{
-	struct dahdi_pvt *old = old_chan;
-	struct dahdi_pvt *new = new_chan;
-	struct sig_pri_chan *pchan = new->sig_pvt;
+static void my_pri_fixup_chans(void *chan_old, void *chan_new)
+{
+	struct dahdi_pvt *old_chan = chan_old;
+	struct dahdi_pvt *new_chan = chan_new;
+	struct sig_pri_chan *pchan = new_chan->sig_pvt;
 	struct sig_pri_pri *pri = pchan->pri;
 
-	new->owner = old->owner;
-	old->owner = NULL;
-	if (new->owner) {
+	new_chan->owner = old_chan->owner;
+	old_chan->owner = NULL;
+	if (new_chan->owner) {
 		char newname[AST_CHANNEL_NAME];
-		snprintf(newname, sizeof(newname), "DAHDI/%d:%d-%d", pri->trunkgroup, new->channel, 1);
-		ast_change_name(new->owner, newname);
-
-		new->owner->tech_pvt = new;
-		new->owner->fds[0] = new->subs[SUB_REAL].dfd;
-		new->subs[SUB_REAL].owner = old->subs[SUB_REAL].owner;
-		old->subs[SUB_REAL].owner = NULL;
+
+		snprintf(newname, sizeof(newname), "DAHDI/%d:%d-%d", pri->trunkgroup, new_chan->channel, 1);
+		ast_change_name(new_chan->owner, newname);
+
+		new_chan->owner->tech_pvt = new_chan;
+		new_chan->owner->fds[0] = new_chan->subs[SUB_REAL].dfd;
+		new_chan->subs[SUB_REAL].owner = old_chan->subs[SUB_REAL].owner;
+		old_chan->subs[SUB_REAL].owner = NULL;
 	}
 	/* Copy any DSP that may be present */
-	new->dsp = old->dsp;
-	new->dsp_features = old->dsp_features;
-	old->dsp = NULL;
-	old->dsp_features = 0;
+	new_chan->dsp = old_chan->dsp;
+	new_chan->dsp_features = old_chan->dsp_features;
+	old_chan->dsp = NULL;
+	old_chan->dsp_features = 0;
 }
 
 static int sig_pri_tone_to_dahditone(enum sig_pri_tone tone)

Modified: trunk/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/sig_pri.c?view=diff&rev=216186&r1=216185&r2=216186
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Thu Sep  3 16:09:46 2009
@@ -524,10 +524,10 @@
 		return -1;
 }
 
-static void sig_pri_fixup_chans(struct sig_pri_chan *old, struct sig_pri_chan *new)
-{
-	if (old->calls->fixup_chans)
-		old->calls->fixup_chans(old->chan_pvt, new->chan_pvt);
+static void sig_pri_fixup_chans(struct sig_pri_chan *old_chan, struct sig_pri_chan *new_chan)
+{
+	if (old_chan->calls->fixup_chans)
+		old_chan->calls->fixup_chans(old_chan->chan_pvt, new_chan->chan_pvt);
 }
 
 static int sig_pri_play_tone(struct sig_pri_chan *p, enum sig_pri_tone tone)
@@ -664,10 +664,10 @@
 	int x;
 	int span = PRI_SPAN(channel);
 	int principle = -1;
-	int explicit = PRI_EXPLICIT(channel);
+	int explicit_ds1 = PRI_EXPLICIT(channel);
 	channel = PRI_CHANNEL(channel);
 
-	if (!explicit) {
+	if (!explicit_ds1) {
 		int index = pri_active_dchan_index(pri);
 		if (index == -1)
 			return -1;
@@ -687,6 +687,7 @@
 static int pri_fixup_principle(struct sig_pri_pri *pri, int principle, q931_call *c)
 {
 	int x;
+
 	if (!c) {
 		if (principle < 0)
 			return -1;
@@ -704,23 +705,24 @@
 		if (pri->pvts[x]->call == c) {
 			/* Found our call */
 			if (principle != x) {
-				struct sig_pri_chan *new = pri->pvts[principle], *old = pri->pvts[x];
+				struct sig_pri_chan *new_chan = pri->pvts[principle];
+				struct sig_pri_chan *old_chan = pri->pvts[x];
 
 				ast_verb(3, "Moving call from channel %d to channel %d\n",
-					old->channel, new->channel);
-				if (new->owner) {
+					old_chan->channel, new_chan->channel);
+				if (new_chan->owner) {
 					ast_log(LOG_WARNING, "Can't fix up channel from %d to %d because %d is already in use\n",
-						old->channel, new->channel, new->channel);
+						old_chan->channel, new_chan->channel, new_chan->channel);
 					return -1;
 				}
 
-				sig_pri_fixup_chans(old, new);
+				sig_pri_fixup_chans(old_chan, new_chan);
 				/* Fix it all up now */
-				new->owner = old->owner;
-				old->owner = NULL;
-
-				new->call = old->call;
-				old->call = NULL;
+				new_chan->owner = old_chan->owner;
+				old_chan->owner = NULL;
+
+				new_chan->call = old_chan->call;
+				old_chan->call = NULL;
 
 			}
 			return principle;




More information about the svn-commits mailing list