[asterisk-commits] pabelanger: branch 1.8 r356290 - /branches/1.8/apps/app_rpt.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 22 14:20:34 CST 2012


Author: pabelanger
Date: Wed Feb 22 14:20:29 2012
New Revision: 356290

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=356290
Log:
Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)

Review: https://reviewboard.asterisk.org/r/1763/

Modified:
    branches/1.8/apps/app_rpt.c

Modified: branches/1.8/apps/app_rpt.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_rpt.c?view=diff&rev=356290&r1=356289&r2=356290
==============================================================================
--- branches/1.8/apps/app_rpt.c (original)
+++ branches/1.8/apps/app_rpt.c Wed Feb 22 14:20:29 2012
@@ -1380,10 +1380,8 @@
 static int linkcount(struct rpt *myrpt)
 {
 	struct	rpt_link *l;
-	char *reverse_patch_state;
- 	int numoflinks;
-
-	reverse_patch_state = "DOWN";
+	int numoflinks;
+
 	numoflinks = 0;
 	l = myrpt->links.next;
 	while(l && (l != &myrpt->links)){
@@ -1392,13 +1390,8 @@
 			"maximum number of links exceeds %d in rpt_do_stats()!",MAX_STAT_LINKS);
 			break;
 		}
-		//if (l->name[0] == '0'){ /* Skip '0' nodes */
-		//	reverse_patch_state = "UP";
-		//	l = l->next;
-		//	continue;
-		//}
 		numoflinks++;
-	 
+
 		l = l->next;
 	}
 	ast_log(LOG_NOTICE, "numoflinks=%i\n",numoflinks);
@@ -2928,7 +2921,7 @@
 
 static int rpt_do_lstats(int fd, int argc, const char * const *argv)
 {
-	int i,j;
+	int i;
 	char *connstate;
 	struct rpt *myrpt;
 	struct rpt_link *l;
@@ -2948,7 +2941,6 @@
 			myrpt = &rpt_vars[i];
 			rpt_mutex_lock(&myrpt->lock); /* LOCK */
 			/* Traverse the list of connected nodes */
-			j = 0;
 			l = myrpt->links.next;
 			while(l && (l != &myrpt->links)){
 				if (l->name[0] == '0'){ /* Skip '0' nodes */
@@ -3953,7 +3945,7 @@
 struct	rpt_link *l,*l1,linkbase;
 struct	ast_channel *mychannel;
 int vmajor, vminor, m;
-char *p,*ct,*ct_copy,*ident, *nodename,*cp;
+char *p,*ct,*ct_copy,*ident, *nodename;
 time_t t;
 #ifdef	NEW_ASTERISK
 struct ast_tm localtm;
@@ -4550,7 +4542,6 @@
 		res = ast_streamfile(mychannel, "rpt/invalid-freq", mychannel->language);
 		break;
 	    case REMMODE:
-		cp = 0;
 		wait_interval(myrpt, DLY_TELEM, mychannel);
 		switch(myrpt->remmode)
 		{
@@ -5686,7 +5677,7 @@
 
 static int connect_link(struct rpt *myrpt, char* node, int mode, int perma)
 {
-	char *val, *s, *s1, *s2, *tele;
+	char *val, *s, *s1, *tele;
 	char lstr[MAXLINKLIST],*strs[MAXLINKLIST];
 	char tmp[300], deststr[300] = "",modechange = 0;
 	char sx[320],*sy;
@@ -5721,7 +5712,6 @@
 		sprintf(sx,"%s:4569/%s",s1,sy + 1);
 		s1 = sx;
 	}
-	s2 = strsep(&s,",");
 	rpt_mutex_lock(&myrpt->lock);
 	l = myrpt->links.next;
 	/* try to find this one in queue */
@@ -5881,7 +5871,7 @@
 static int function_ilink(struct rpt *myrpt, char *param, char *digits, int command_source, struct rpt_link *mylink)
 {
 
-	char *val, *s, *s1, *s2;
+	char *val, *s, *s1;
 	char tmp[300];
 	char digitbuf[MAXNODESTR],*strs[MAXLINKLIST];
 	char mode,perma;
@@ -5922,7 +5912,6 @@
 				sprintf(sx,"%s:4569/%s",s1,sy + 1);
 				s1 = sx;
 			}
-			s2 = strsep(&s,",");
 			rpt_mutex_lock(&myrpt->lock);
 			l = myrpt->links.next;
 			/* try to find this one in queue */
@@ -6378,7 +6367,6 @@
 static int function_cop(struct rpt *myrpt, char *param, char *digitbuf, int command_source, struct rpt_link *mylink)
 {
 	char string[16];
-	int res;
 
 	int i, r;
 
@@ -6387,8 +6375,7 @@
 	
 	switch(myatoi(param)){
 		case 1: /* System reset */
-			res = system("killall -9 asterisk");
-			return DC_COMPLETE;
+			return system("killall -9 asterisk");
 
 		case 2:
 			myrpt->p.s[myrpt->p.sysstate_cur].txdisable = 0;
@@ -7812,7 +7799,7 @@
 static int setrtx(struct rpt *myrpt)
 {
 char tmp[MAXREMSTR] = "",*s,rigstr[200],pwr,res = 0;
-int	band,txoffset = 0,txpower = 0,rxpl,txpl;
+int	band,rxpl,txpl;
 float ofac;
 double txfreq;
 
@@ -7875,31 +7862,6 @@
 			printf("@@@@ Bad TX PL: %s\n", myrpt->txpl);
 	 	return -1;
 	}
-	
-	switch(myrpt->offset)
-	{
-	    case REM_MINUS:
-		txoffset = 0;
-		break;
-	    case REM_PLUS:
-		txoffset = 0x10;
-		break;
-	    case REM_SIMPLEX:
-		txoffset = 0x20;
-		break;
-	}
-	switch(myrpt->powerlevel)
-	{
-	    case REM_LOWPWR:
-		txpower = 0;
-		break;
-	    case REM_MEDPWR:
-		txpower = 0x20;
-		break;
-	    case REM_HIPWR:
-		txpower = 0x10;
-		break;
-	}
 
 	res = setrtx_check(myrpt);
 	if (res < 0) return res;
@@ -8371,11 +8333,10 @@
 static int set_freq_ft897(struct rpt *myrpt, char *newfreq)
 {
 	unsigned char cmdstr[5];
-	int fd,m,d;
+	int m,d;
 	char mhz[MAXREMSTR];
 	char decimals[MAXREMSTR];
 
-	fd = 0;
 	if(debug) 
 		printf("New frequency: %s\n",newfreq);
 
@@ -8903,9 +8864,8 @@
 {
 	unsigned char cmdstr[20];
 	char mhz[MAXREMSTR], decimals[MAXREMSTR];
-	int fd,m,d;
-
-	fd = 0;
+	int m,d;
+
 	if(debug) 
 		ast_log(LOG_NOTICE,"newfreq:%s\n",newfreq); 			
 
@@ -10343,7 +10303,7 @@
 
 static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l)
 {
-	char *val, *s, *s1, *s2, *tele;
+	char *val, *s, *s1, *tele;
 	char tmp[300], deststr[300] = "";
 	char sx[320],*sy;
 
@@ -10369,7 +10329,6 @@
 		sprintf(sx,"%s:4569/%s",s1,sy + 1);
 		s1 = sx;
 	}
-	s2 = strsep(&s,",");
 	snprintf(deststr, sizeof(deststr), "IAX2/%s", s1);
 	tele = strchr(deststr, '/');
 	if (!tele) {
@@ -12009,12 +11968,11 @@
 		}			
 		if (myrpt->cmdAction.state == CMD_STATE_READY)
 		{ /* there is a command waiting to be processed */
-			int status;
 			myrpt->cmdAction.state = CMD_STATE_EXECUTING;
 			// lose the lock
 			rpt_mutex_unlock(&myrpt->lock);
 			// do the function
-			status = (*function_table[myrpt->cmdAction.functionNumber].function)(myrpt,myrpt->cmdAction.param, myrpt->cmdAction.digits, myrpt->cmdAction.command_source, NULL);
+			(*function_table[myrpt->cmdAction.functionNumber].function)(myrpt,myrpt->cmdAction.param, myrpt->cmdAction.digits, myrpt->cmdAction.command_source, NULL);
 			// get the lock again
 			rpt_mutex_lock(&myrpt->lock);
 			myrpt->cmdAction.state = CMD_STATE_IDLE;




More information about the asterisk-commits mailing list