[asterisk-commits] kpfleming: branch 1.6.0 r109487 - in /branches/1.6.0: ./ channels/ channels/m...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 18 11:26:59 CDT 2008


Author: kpfleming
Date: Tue Mar 18 11:26:59 2008
New Revision: 109487

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109487
Log:
Merged revisions 109475 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r109475 | kpfleming | 2008-03-18 11:23:05 -0500 (Tue, 18 Mar 2008) | 2 lines

fix up various warnings found via the addition of format string checking... some of these were really, really bad code

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_misdn.c
    branches/1.6.0/channels/misdn/isdn_lib.c
    branches/1.6.0/channels/misdn/isdn_lib.h

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_misdn.c?view=diff&rev=109487&r1=109486&r2=109487
==============================================================================
--- branches/1.6.0/channels/chan_misdn.c (original)
+++ branches/1.6.0/channels/chan_misdn.c Tue Mar 18 11:26:59 2008
@@ -285,7 +285,8 @@
 
 static int *misdn_ports;
 
-static void chan_misdn_log(int level, int port, char *tmpl, ...);
+static void chan_misdn_log(int level, int port, char *tmpl, ...)
+	__attribute__ ((format (printf, 3, 4)));
 
 static struct ast_channel *misdn_new(struct chan_list *cl, int state,  char *exten, char *callerid, int format, int port, int c);
 static void send_digit_to_chan(struct chan_list *cl, char digit );
@@ -464,11 +465,11 @@
 			else if (fac->u.AOCDcur.freeOfCharge)
 				chan_misdn_log(1,bc->port," --> AOCD currency: free of charge\n");
 			else if (fac->u.AOCDchu.billingId >= 0)
-				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%d billingId:%d\n",
+				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%s billingId:%d\n",
 						fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
 						(fac->u.AOCDcur.typeOfChargingInfo == 0) ? "subTotal" : "total", fac->u.AOCDcur.billingId);
 			else
-				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%d\n",
+				chan_misdn_log(1,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%s\n",
 						fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
 						(fac->u.AOCDcur.typeOfChargingInfo == 0) ? "subTotal" : "total");
 			break;
@@ -4705,7 +4706,7 @@
 		int res;
 		int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples);
 
-		chan_misdn_log(9, bc->port, "TONE_GEN: len:%d\n");
+		chan_misdn_log(9, bc->port, "TONE_GEN: len:%d\n", tone_len);
 
 		if (!ast)
 			break;
@@ -4960,7 +4961,7 @@
 #endif
 		break;
 		default:
-			chan_misdn_log(0, bc->port," --> not yet handled: facility type:%p\n", bc->fac_in.Function);
+			chan_misdn_log(0, bc->port," --> not yet handled: facility type:%d\n", bc->fac_in.Function);
 		}
 		
 		break;
@@ -5603,7 +5604,7 @@
 		jb->state_buffer = wp - rp;
 	else
 		jb->state_buffer = jb->size - rp + wp;
-	chan_misdn_log(9, 0, "misdn_jb_fill: written:%d | Bufferstatus:%d p:%x\n", len, jb->state_buffer, jb);
+	chan_misdn_log(9, 0, "misdn_jb_fill: written:%d | Bufferstatus:%d p:%p\n", len, jb->state_buffer, jb);
 
 	if (jb->state_full) {
 		jb->wp = wp;
@@ -5669,11 +5670,11 @@
 			jb->state_buffer = wp - rp;
 		else
 			jb->state_buffer = jb->size - rp + wp;
-		chan_misdn_log(9, 0, "misdn_jb_empty: read:%d | Bufferstatus:%d p:%x\n", len, jb->state_buffer, jb);
+		chan_misdn_log(9, 0, "misdn_jb_empty: read:%d | Bufferstatus:%d p:%p\n", len, jb->state_buffer, jb);
 
 		jb->rp = rp;
 	} else
-		chan_misdn_log(9, 0, "misdn_jb_empty: Wait...requested:%d p:%x\n", len, jb);
+		chan_misdn_log(9, 0, "misdn_jb_empty: Wait...requested:%d p:%p\n", len, jb);
 
 	ast_mutex_unlock(&jb->mutexjb);
 

Modified: branches/1.6.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/misdn/isdn_lib.c?view=diff&rev=109487&r1=109486&r2=109487
==============================================================================
--- branches/1.6.0/channels/misdn/isdn_lib.c (original)
+++ branches/1.6.0/channels/misdn/isdn_lib.c Tue Mar 18 11:26:59 2008
@@ -3243,7 +3243,7 @@
 
 	cb_log(5, stack->port, " --> urate:%d rate:%d mode:%d user1:%d\n", bc->urate, bc->rate, bc->mode,bc->user1);
 	
-	cb_log(5, stack->port, " --> bc:%x h:%d sh:%d\n", bc, bc->holded, bc->stack_holder);
+	cb_log(5, stack->port, " --> bc:%p h:%d sh:%d\n", bc, bc->holded, bc->stack_holder);
 }
 
 void misdn_send_lock(struct misdn_bchannel *bc);
@@ -4336,7 +4336,7 @@
 {
 	struct misdn_bchannel *help;
 
-	cb_log(4,stack?stack->port:0, "*HOLDER: find %x\n",l3id);
+	cb_log(4,stack?stack->port:0, "*HOLDER: find %lx\n",l3id);
 	
 	if (!stack) return NULL;
 	

Modified: branches/1.6.0/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/misdn/isdn_lib.h?view=diff&rev=109487&r1=109486&r2=109487
==============================================================================
--- branches/1.6.0/channels/misdn/isdn_lib.h (original)
+++ branches/1.6.0/channels/misdn/isdn_lib.h Tue Mar 18 11:26:59 2008
@@ -377,12 +377,14 @@
 
 
 enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
-void (*cb_log) (int level, int port, char *tmpl, ...);
+void (*cb_log) (int level, int port, char *tmpl, ...)
+	__attribute__ ((format (printf, 3, 4)));
 int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
 
 struct misdn_lib_iface {
 	enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);
-	void (*cb_log)(int level, int port, char *tmpl, ...);
+	void (*cb_log)(int level, int port, char *tmpl, ...)
+		__attribute__ ((format (printf, 3, 4)));
 	int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
 };
 




More information about the asterisk-commits mailing list