[svn-commits] pabelanger: branch 10 r356428 - in /branches/10: ./ apps/app_rpt.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Feb 22 21:23:33 CST 2012


Author: pabelanger
Date: Wed Feb 22 21:23:28 2012
New Revision: 356428

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=356428
Log:
Multiple revisions 356290,356335,356337

........
  r356290 | pabelanger | 2012-02-22 15:20:29 -0500 (Wed, 22 Feb 2012) | 4 lines
  
  Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
  
  Review: https://reviewboard.asterisk.org/r/1763/
........
  r356335 | pabelanger | 2012-02-22 16:29:25 -0500 (Wed, 22 Feb 2012) | 2 lines
  
  Add back strsep() function for previous commit
........
  r356337 | pabelanger | 2012-02-22 16:36:37 -0500 (Wed, 22 Feb 2012) | 2 lines
  
  Missed one strsep() function
........

Merged revisions 356290,356335,356337 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/apps/app_rpt.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/apps/app_rpt.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_rpt.c?view=diff&rev=356428&r1=356427&r2=356428
==============================================================================
--- branches/10/apps/app_rpt.c (original)
+++ branches/10/apps/app_rpt.c Wed Feb 22 21:23:28 2012
@@ -1392,10 +1392,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)){
@@ -1404,13 +1402,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);
@@ -2940,7 +2933,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;
@@ -2960,7 +2953,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 */
@@ -3965,7 +3957,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;
@@ -4563,7 +4555,6 @@
 		res = ast_streamfile(mychannel, "rpt/invalid-freq", mychannel->language);
 		break;
 	    case REMMODE:
-		cp = 0;
 		wait_interval(myrpt, DLY_TELEM, mychannel);
 		switch(myrpt->remmode)
 		{
@@ -5702,7 +5693,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;
@@ -5738,7 +5729,7 @@
 		sprintf(sx,"%s:4569/%s",s1,sy + 1);
 		s1 = sx;
 	}
-	s2 = strsep(&s,",");
+	strsep(&s,",");
 	rpt_mutex_lock(&myrpt->lock);
 	l = myrpt->links.next;
 	/* try to find this one in queue */
@@ -5900,7 +5891,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;
@@ -5941,7 +5932,7 @@
 				sprintf(sx,"%s:4569/%s",s1,sy + 1);
 				s1 = sx;
 			}
-			s2 = strsep(&s,",");
+			strsep(&s,",");
 			rpt_mutex_lock(&myrpt->lock);
 			l = myrpt->links.next;
 			/* try to find this one in queue */
@@ -6397,7 +6388,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;
 
@@ -6406,8 +6396,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;
@@ -7831,7 +7820,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;
 
@@ -7894,31 +7883,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;
@@ -8390,11 +8354,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);
 
@@ -8922,9 +8885,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); 			
 
@@ -10362,7 +10324,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;
 	struct ast_format_cap *cap = NULL;
@@ -10389,7 +10351,7 @@
 		sprintf(sx,"%s:4569/%s",s1,sy + 1);
 		s1 = sx;
 	}
-	s2 = strsep(&s,",");
+	strsep(&s,",");
 	snprintf(deststr, sizeof(deststr), "IAX2/%s", s1);
 	tele = strchr(deststr, '/');
 	if (!tele) {
@@ -12039,12 +12001,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 svn-commits mailing list