[asterisk-commits] crichter: branch 1.2 r49922 - /branches/1.2/channels/misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jan 8 01:37:09 MST 2007


Author: crichter
Date: Mon Jan  8 02:37:08 2007
New Revision: 49922

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49922
Log:
make gcc 4 happy, remove some warnings

Modified:
    branches/1.2/channels/misdn/ie.c
    branches/1.2/channels/misdn/isdn_lib.c
    branches/1.2/channels/misdn/isdn_lib.h

Modified: branches/1.2/channels/misdn/ie.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/misdn/ie.c?view=diff&rev=49922&r1=49921&r2=49922
==============================================================================
--- branches/1.2/channels/misdn/ie.c (original)
+++ branches/1.2/channels/misdn/ie.c Mon Jan  8 02:37:08 2007
@@ -260,7 +260,7 @@
 
 
 /* IE_CALL_ID */
-void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, unsigned char *callid, int callid_len, int nt, struct misdn_bchannel *bc)
+void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc)
 {
 	unsigned char *p;
 	Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -299,7 +299,7 @@
 	memcpy(p+2, callid, callid_len);
 }
 
-void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, unsigned char *callid, int *callid_len, int nt, struct misdn_bchannel *bc)
+void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc)
 {
 	char debug[25];
 	int i;
@@ -335,7 +335,7 @@
 
 
 /* IE_CALLED_PN */
-void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, unsigned char *number, int nt, struct misdn_bchannel *bc)
+void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc)
 {
 	unsigned char *p;
 	Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -371,7 +371,7 @@
 	strncpy((char *)p+3, (char *)number, strlen((char *)number));
 }
 
-void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, unsigned char *number, int number_len, int nt, struct misdn_bchannel *bc)
+void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc)
 {
 	*type = -1;
 	*plan = -1;
@@ -400,7 +400,7 @@
 
 
 /* IE_CALLING_PN */
-void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, unsigned char *number, int nt, struct misdn_bchannel *bc)
+void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
 {
 	unsigned char *p;
 	Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -455,7 +455,7 @@
 	}
 }
 
-void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len, int nt, struct misdn_bchannel *bc)
+void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
 {
 	*type = -1;
 	*plan = -1;
@@ -502,7 +502,7 @@
 
 
 /* IE_CONNECTED_PN */
-void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, unsigned char *number, int nt, struct misdn_bchannel *bc)
+void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
 {
 	unsigned char *p;
 	Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -557,7 +557,7 @@
 	}
 }
 
-void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len, int nt, struct misdn_bchannel *bc)
+void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
 {
 	*type = -1;
 	*plan = -1;

Modified: branches/1.2/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/misdn/isdn_lib.c?view=diff&rev=49922&r1=49921&r2=49922
==============================================================================
--- branches/1.2/channels/misdn/isdn_lib.c (original)
+++ branches/1.2/channels/misdn/isdn_lib.c Mon Jan  8 02:37:08 2007
@@ -279,7 +279,7 @@
 unsigned char * flip_buf_bits ( unsigned char * buf , int len)
 {
 	int i;
-	char * start = buf;
+	unsigned char * start = buf;
 	
 	for (i = 0 ; i < len; i++) {
 		buf[i] = flip_table[buf[i]];
@@ -2197,12 +2197,12 @@
 
 void misdn_tx_jitter(struct misdn_bchannel *bc, int len)
 {
-	char buf[4096 + mISDN_HEADER_LEN];
-	char *data=&buf[mISDN_HEADER_LEN];
+	unsigned char buf[4096 + mISDN_HEADER_LEN];
+	unsigned char *data=&buf[mISDN_HEADER_LEN];
 	iframe_t *txfrm= (iframe_t*)buf;
 	int jlen, r;
 	
-	jlen=cb_jb_empty(bc,data,len);
+	jlen=cb_jb_empty(bc,(char*)data,len);
 	
 	if (jlen) {
 #ifdef MISDN_SAVE_DATA
@@ -3988,7 +3988,7 @@
 			return -1;
 	}
 	
-	char buf[4096 + mISDN_HEADER_LEN];
+	unsigned char buf[4096 + mISDN_HEADER_LEN];
 	iframe_t *frm= (iframe_t*)buf;
 	int  r;
 	
@@ -4294,43 +4294,36 @@
 	int conf_id=bc1->pid +1;
 
 	cb_log(4, bc1->port, "I Send: BRIDGE from:%d to:%d\n",bc1->port,bc2->port);
-	
-	struct misdn_bchannel *bc_list[]={
-		bc1,bc2,NULL
-	};
-	struct misdn_bchannel **bc;
-		
-	for (bc=bc_list; *bc;  *bc++) { 
-		(*bc)->conf_id=conf_id;
-		cb_log(4, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr);
-	
-		switch((*bc)->bc_state) {
-			case BCHAN_ACTIVATED:
-				misdn_join_conf(*bc,conf_id);
-				break;
-			default:
-				bc_next_state_change(*bc,BCHAN_BRIDGED);
-				break;
-		}
-	}
+
+	bc1->conf_id=conf_id;
+	cb_log(4, bc1->port, " --> bc_addr:%x\n",bc1->addr);
+	if (bc1->bc_state==BCHAN_ACTIVATED) 
+		misdn_join_conf(bc1,conf_id);
+	else
+		bc_next_state_change(bc1,BCHAN_BRIDGED);
+	/*and again*/
+	bc2->conf_id=conf_id;
+	cb_log(4, bc2->port, " --> bc_addr:%x\n",bc2->addr);
+	if (bc2->bc_state==BCHAN_ACTIVATED) 
+		misdn_join_conf(bc2,conf_id);
+	else
+		bc_next_state_change(bc2,BCHAN_BRIDGED);
+
 }
 
 void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2)
 {
-
-	struct misdn_bchannel *bc_list[]={
-		bc1,bc2,NULL
-	};
-	struct misdn_bchannel **bc;
-		
-	for (bc=bc_list; *bc;  *bc++) { 
-		if ( (*bc)->bc_state == BCHAN_BRIDGED){
-			misdn_split_conf( *bc, (*bc)->conf_id);
-		} else {
-			cb_log( 2, (*bc)->port, "BC not bridged (state:%s) so not splitting it\n",bc_state2str((*bc)->bc_state));
-		}
-	}
-	
+	if ( bc1->bc_state == BCHAN_BRIDGED)
+		misdn_split_conf( bc1, bc1->conf_id);
+	else 
+		cb_log( 2, bc1->port, "BC not bridged (state:%s) so not splitting it\n",bc_state2str(bc1->bc_state));
+
+	/*again*/
+
+	if ( bc2->bc_state == BCHAN_BRIDGED)
+		misdn_split_conf( bc2, bc2->conf_id);
+	else 
+		cb_log( 2, bc1->port, "BC not bridged (state:%s) so not splitting it\n",bc_state2str(bc2->bc_state));
 }
 
 

Modified: branches/1.2/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/misdn/isdn_lib.h?view=diff&rev=49922&r1=49921&r2=49922
==============================================================================
--- branches/1.2/channels/misdn/isdn_lib.h (original)
+++ branches/1.2/channels/misdn/isdn_lib.h Mon Jan  8 02:37:08 2007
@@ -329,17 +329,17 @@
 	int hdlc;
 	/* V110 */
   
-	unsigned char display[84];
-	unsigned char msn[32];
-	unsigned char oad[32];
-	unsigned char rad[32];
-	unsigned char dad[32];
-	unsigned char cad[32];
-	unsigned char orig_dad[32];
-	unsigned char keypad[32];
-
-	unsigned char info_dad[64];
-	unsigned char infos_pending[64];
+	char display[84];
+	char msn[32];
+	char oad[32];
+	char rad[32];
+	char dad[32];
+	char cad[32];
+	char orig_dad[32];
+	char keypad[32];
+
+	char info_dad[64];
+	char infos_pending[64];
 
 /* 	unsigned char info_keypad[32]; */
 /* 	unsigned char clisub[24]; */



More information about the asterisk-commits mailing list