[asterisk-commits] twilson: branch 1.8 r358011 - in /branches/1.8/channels: ./ misdn/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 2 17:21:23 CST 2012


Author: twilson
Date: Fri Mar  2 17:21:18 2012
New Revision: 358011

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=358011
Log:
Correct some set-but-unused variable warnings in the mISDN library.

(from kpfleming's commit to trunk r356292)

Modified:
    branches/1.8/channels/chan_misdn.c
    branches/1.8/channels/misdn/isdn_lib.c
    branches/1.8/channels/misdn/isdn_msg_parser.c

Modified: branches/1.8/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_misdn.c?view=diff&rev=358011&r1=358010&r2=358011
==============================================================================
--- branches/1.8/channels/chan_misdn.c (original)
+++ branches/1.8/channels/chan_misdn.c Fri Mar  2 17:21:18 2012
@@ -7404,7 +7404,6 @@
 static int misdn_write(struct ast_channel *ast, struct ast_frame *frame)
 {
 	struct chan_list *ch;
-	int i  = 0;
 
 	if (!ast || !(ch = MISDN_ASTERISK_TECH_PVT(ast))) {
 		return -1;
@@ -7503,7 +7502,7 @@
 
 	} else {
 		/* transmit without jitterbuffer */
-		i = misdn_lib_tx2misdn_frm(ch->bc, frame->data.ptr, frame->samples);
+		misdn_lib_tx2misdn_frm(ch->bc, frame->data.ptr, frame->samples);
 	}
 
 	return 0;

Modified: branches/1.8/channels/misdn/isdn_lib.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/misdn/isdn_lib.c?view=diff&rev=358011&r1=358010&r2=358011
==============================================================================
--- branches/1.8/channels/misdn/isdn_lib.c (original)
+++ branches/1.8/channels/misdn/isdn_lib.c Fri Mar  2 17:21:18 2012
@@ -2316,12 +2316,11 @@
 					break;
 			}
 			if (it) {
-				int ret;
-				ret = mISDN_write_frame(stack->midev, msg->data, frm->addr,
-							MGR_TIMER | RESPONSE, 0, 0, NULL, TIMEOUT_1SEC);
+				mISDN_write_frame(stack->midev, msg->data, frm->addr,
+						  MGR_TIMER | RESPONSE, 0, 0, NULL, TIMEOUT_1SEC);
 				test_and_clear_bit(FLG_TIMER_RUNING, (long unsigned int *)&it->Flags);
 				pthread_mutex_lock(&stack->nstlock);
-				ret = it->function(it->data);
+				it->function(it->data);
 				pthread_mutex_unlock(&stack->nstlock);
 				free_msg(msg);
 				return 1;
@@ -4516,7 +4515,6 @@
 void manager_bchannel_deactivate(struct misdn_bchannel * bc)
 {
 	struct misdn_stack *stack=get_stack_by_bc(bc);
-	iframe_t dact;
 	char buf[128];
 
 	switch (bc->bc_state) {
@@ -4535,10 +4533,6 @@
 
 	bc->generate_tone=0;
 
-	dact.prim = DL_RELEASE | REQUEST;
-	dact.addr = bc->addr | FLG_MSG_DOWN;
-	dact.dinfo = 0;
-	dact.len = 0;
 	mISDN_write_frame(stack->midev, buf, bc->addr | FLG_MSG_DOWN, DL_RELEASE|REQUEST,0,0,NULL, TIMEOUT_1SEC);
 
 	clear_ibuffer(bc->astbuf);
@@ -4554,7 +4548,6 @@
 	struct misdn_stack *stack=get_stack_by_bc(bc);
 	char buf[4096 + mISDN_HEADER_LEN];
 	iframe_t *frm = (iframe_t*)buf;
-	int r;
 
 	switch (bc->bc_state) {
 		case BCHAN_ACTIVATED:
@@ -4578,7 +4571,7 @@
 		cb_log(6, stack->port, "Writing %d data bytes\n",len);
 
 	cb_log(9, stack->port, "Writing %d bytes 2 mISDN\n",len);
-	r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_INFINIT);
+	mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_INFINIT);
 	return 0;
 }
 

Modified: branches/1.8/channels/misdn/isdn_msg_parser.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/misdn/isdn_msg_parser.c?view=diff&rev=358011&r1=358010&r2=358011
==============================================================================
--- branches/1.8/channels/misdn/isdn_msg_parser.c (original)
+++ branches/1.8/channels/misdn/isdn_msg_parser.c Fri Mar  2 17:21:18 2012
@@ -805,12 +805,8 @@
 
 static msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	USER_INFORMATION_t *user_information;
 	msg_t *msg =(msg_t*)create_l3msg(CC_USER_INFORMATION | REQUEST, MT_USER_INFORMATION,  bc?bc->l3_id:-1, sizeof(USER_INFORMATION_t) ,nt);
 
-	user_information=(USER_INFORMATION_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building USER_INFORMATION Msg\n");
 #endif
@@ -828,12 +824,8 @@
 
 static msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	SUSPEND_REJECT_t *suspend_reject;
 	msg_t *msg =(msg_t*)create_l3msg(CC_SUSPEND_REJECT | REQUEST, MT_SUSPEND_REJECT,  bc?bc->l3_id:-1, sizeof(SUSPEND_REJECT_t) ,nt);
 
-	suspend_reject=(SUSPEND_REJECT_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building SUSPEND_REJECT Msg\n");
 #endif
@@ -851,12 +843,8 @@
 
 static msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	RESUME_REJECT_t *resume_reject;
 	msg_t *msg =(msg_t*)create_l3msg(CC_RESUME_REJECT | REQUEST, MT_RESUME_REJECT,  bc?bc->l3_id:-1, sizeof(RESUME_REJECT_t) ,nt);
 
-	resume_reject=(RESUME_REJECT_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building RESUME_REJECT Msg\n");
 #endif
@@ -874,12 +862,8 @@
 
 static msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	HOLD_t *hold;
 	msg_t *msg =(msg_t*)create_l3msg(CC_HOLD | REQUEST, MT_HOLD,  bc?bc->l3_id:-1, sizeof(HOLD_t) ,nt);
 
-	hold=(HOLD_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building HOLD Msg\n");
 #endif
@@ -897,12 +881,8 @@
 
 static msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	SUSPEND_t *suspend;
 	msg_t *msg =(msg_t*)create_l3msg(CC_SUSPEND | REQUEST, MT_SUSPEND,  bc?bc->l3_id:-1, sizeof(SUSPEND_t) ,nt);
 
-	suspend=(SUSPEND_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building SUSPEND Msg\n");
 #endif
@@ -920,12 +900,8 @@
 
 static msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	RESUME_t *resume;
 	msg_t *msg =(msg_t*)create_l3msg(CC_RESUME | REQUEST, MT_RESUME,  bc?bc->l3_id:-1, sizeof(RESUME_t) ,nt);
 
-	resume=(RESUME_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building RESUME Msg\n");
 #endif
@@ -943,12 +919,8 @@
 
 static msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	HOLD_ACKNOWLEDGE_t *hold_acknowledge;
 	msg_t *msg =(msg_t*)create_l3msg(CC_HOLD_ACKNOWLEDGE | REQUEST, MT_HOLD_ACKNOWLEDGE,  bc?bc->l3_id:-1, sizeof(HOLD_ACKNOWLEDGE_t) ,nt);
 
-	hold_acknowledge=(HOLD_ACKNOWLEDGE_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building HOLD_ACKNOWLEDGE Msg\n");
 #endif
@@ -966,12 +938,8 @@
 
 static msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	SUSPEND_ACKNOWLEDGE_t *suspend_acknowledge;
 	msg_t *msg =(msg_t*)create_l3msg(CC_SUSPEND_ACKNOWLEDGE | REQUEST, MT_SUSPEND_ACKNOWLEDGE,  bc?bc->l3_id:-1, sizeof(SUSPEND_ACKNOWLEDGE_t) ,nt);
 
-	suspend_acknowledge=(SUSPEND_ACKNOWLEDGE_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building SUSPEND_ACKNOWLEDGE Msg\n");
 #endif
@@ -989,12 +957,8 @@
 
 static msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	RESUME_ACKNOWLEDGE_t *resume_acknowledge;
 	msg_t *msg =(msg_t*)create_l3msg(CC_RESUME_ACKNOWLEDGE | REQUEST, MT_RESUME_ACKNOWLEDGE,  bc?bc->l3_id:-1, sizeof(RESUME_ACKNOWLEDGE_t) ,nt);
 
-	resume_acknowledge=(RESUME_ACKNOWLEDGE_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building RESUME_ACKNOWLEDGE Msg\n");
 #endif
@@ -1012,12 +976,8 @@
 
 static msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	HOLD_REJECT_t *hold_reject;
 	msg_t *msg =(msg_t*)create_l3msg(CC_HOLD_REJECT | REQUEST, MT_HOLD_REJECT,  bc?bc->l3_id:-1, sizeof(HOLD_REJECT_t) ,nt);
 
-	hold_reject=(HOLD_REJECT_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building HOLD_REJECT Msg\n");
 #endif
@@ -1035,11 +995,7 @@
 
 static msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	RETRIEVE_t *retrieve;
 	msg_t *msg =(msg_t*)create_l3msg(CC_RETRIEVE | REQUEST, MT_RETRIEVE,  bc?bc->l3_id:-1, sizeof(RETRIEVE_t) ,nt);
-
-	retrieve=(RETRIEVE_t*)((msg->data+HEADER_LEN));
 
 #ifdef DEBUG
 	printf("Building RETRIEVE Msg\n");
@@ -1082,11 +1038,7 @@
 
 static msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	RETRIEVE_REJECT_t *retrieve_reject;
 	msg_t *msg =(msg_t*)create_l3msg(CC_RETRIEVE_REJECT | REQUEST, MT_RETRIEVE_REJECT,  bc?bc->l3_id:-1, sizeof(RETRIEVE_REJECT_t) ,nt);
-
-	retrieve_reject=(RETRIEVE_REJECT_t*)((msg->data+HEADER_LEN));
 
 #ifdef DEBUG
 	printf("Building RETRIEVE_REJECT Msg\n");
@@ -1577,11 +1529,7 @@
 
 static msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	STATUS_ENQUIRY_t *status_enquiry;
 	msg_t *msg =(msg_t*)create_l3msg(CC_STATUS_ENQUIRY | REQUEST, MT_STATUS_ENQUIRY,  bc?bc->l3_id:-1, sizeof(STATUS_ENQUIRY_t) ,nt);
-
-	status_enquiry=(STATUS_ENQUIRY_t*)((msg->data+HEADER_LEN));
 
 #ifdef DEBUG
 	printf("Building STATUS_ENQUIRY Msg\n");
@@ -1645,12 +1593,8 @@
 
 static msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	STATUS_t *status;
 	msg_t *msg =(msg_t*)create_l3msg(CC_STATUS | REQUEST, MT_STATUS,  bc?bc->l3_id:-1, sizeof(STATUS_t) ,nt);
 
-	status=(STATUS_t*)((msg->data+HEADER_LEN));
-
 #ifdef DEBUG
 	printf("Building STATUS Msg\n");
 #endif
@@ -1666,11 +1610,7 @@
 
 static msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
 {
-	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
-	STATUS_t *status;
 	msg_t *msg =(msg_t*)create_l3msg(CC_STATUS | REQUEST, MT_STATUS,  bc?bc->l3_id:-1, sizeof(STATUS_t) ,nt);
-
-	status=(STATUS_t*)((msg->data+HEADER_LEN));
 
 #ifdef DEBUG
 	printf("Building STATUS Msg\n");




More information about the asterisk-commits mailing list