[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-addons-commits
Subject:    [asterisk-addons-commits] mnicholson: branch
From:       SVN commits to the Asterisk addons project
Date:       2009-01-28 22:41:46
Message-ID: E1LSJ6S-0004lA-QY () lists ! digium ! com
[Download RAW message or body]

Author: mnicholson
Date: Wed Jan 28 16:41:45 2009
New Revision: 763

URL: http://svn.digium.com/svn-view/asterisk-addons?view=rev&rev=763
Log:
change %i for scanf (and for printf for completeness) to %d

Modified:
    team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c

Modified: team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c
URL: http://svn.digium.com/svn-view/asterisk-addons/team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c?view=diff&rev=763&r1=762&r2=763
 ==============================================================================
--- team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c (original)
+++ team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c Wed Jan 28 16:41:45 \
2009 @@ -1503,7 +1503,7 @@
 	if (!value)
 		value = &v;
 
-	if (!sscanf(buf, "+CIEV: %i,%i", &i, value)) {
+	if (!sscanf(buf, "+CIEV: %d,%d", &i, value)) {
 		ast_debug(2, "[%s] error parsing CIEV event '%s'\n", pvt->owner->id, buf);
 		return HFP_CIND_NONE;
 	}
@@ -1652,7 +1652,7 @@
 static int hfp_send_cmer(struct hfp_pvt *pvt, int status)
 {
 	char cmd[32];
-	snprintf(cmd, sizeof(cmd), "AT+CMER=3,0,0,%i\r", status ? 1 : 0);
+	snprintf(cmd, sizeof(cmd), "AT+CMER=3,0,0,%d\r", status ? 1 : 0);
 	return rfcomm_write(pvt->rsock, cmd);
 }
 
@@ -1664,7 +1664,7 @@
 static int hfp_send_vgs(struct hfp_pvt *pvt, int value)
 {
 	char cmd[32];
-	snprintf(cmd, sizeof(cmd), "AT+VGS=%i\r", value);
+	snprintf(cmd, sizeof(cmd), "AT+VGS=%d\r", value);
 	return rfcomm_write(pvt->rsock, cmd);
 }
 
@@ -1677,7 +1677,7 @@
 static int hfp_send_vgm(struct hfp_pvt *pvt, int value)
 {
 	char cmd[32];
-	snprintf(cmd, sizeof(cmd), "AT+VGM=%i\r", value);
+	snprintf(cmd, sizeof(cmd), "AT+VGM=%d\r", value);
 	return rfcomm_write(pvt->rsock, cmd);
 }
 #endif
@@ -1691,7 +1691,7 @@
 static int hfp_send_clip(struct hfp_pvt *pvt, int status)
 {
 	char cmd[32];
-	snprintf(cmd, sizeof(cmd), "AT+CLIP=%i\r", status ? 1 : 0);
+	snprintf(cmd, sizeof(cmd), "AT+CLIP=%d\r", status ? 1 : 0);
 	return rfcomm_write(pvt->rsock, cmd);
 }
 
@@ -1733,7 +1733,7 @@
 static int hfp_send_cmgf(struct hfp_pvt *pvt, int mode)
 {
 	char cmd[32];
-	snprintf(cmd, sizeof(cmd), "AT+CMGF=%i\r", mode);
+	snprintf(cmd, sizeof(cmd), "AT+CMGF=%d\r", mode);
 	return rfcomm_write(pvt->rsock, cmd);
 }
 
@@ -1759,7 +1759,7 @@
 	if (hfp_read_full(pvt, buf, sizeof(buf)) != HFP_BRSF)
 		return -1;
 
-	if (!sscanf(buf, "+BRSF:%i", &brsf))
+	if (!sscanf(buf, "+BRSF:%d", &brsf))
 		return -1;
 
 	hfp_int2brsf(brsf, &pvt->brsf);
@@ -1783,12 +1783,12 @@
 
 	/* store the current indicator */
 	if (group >= sizeof(pvt->cind_state)) {
-		ast_debug(1, "ignoring CIND state '%s' for group %i, we only support up to %i \
indicators\n", indicator, group, (int) sizeof(pvt->cind_state)); +		ast_debug(1, \
"ignoring CIND state '%s' for group %d, we only support up to %d indicators\n", \
indicator, group, (int) sizeof(pvt->cind_state));  return -1;
 	}
 	
-	if (!sscanf(indicator, "%i", &value)) {
-		ast_debug(1, "error parsing CIND state '%s' for group %i\n", indicator, group);
+	if (!sscanf(indicator, "%d", &value)) {
+		ast_debug(1, "error parsing CIND state '%s' for group %d\n", indicator, group);
 		return -1;
 	}
 	
@@ -1947,7 +1947,7 @@
 					ast_debug(2, "ignoring unknown CIND indicator '%s'\n", indicator);
 				}
 			} else {
-					ast_debug(1, "can't store indicator %d (%s), we only support up to %i \
indicators", group, indicator, (int) sizeof(pvt->cind_index)); +					ast_debug(1, \
"can't store indicator %d (%s), we only support up to %d indicators", group, \
indicator, (int) sizeof(pvt->cind_index));  }
 
 			state = 0;


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-addons-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-addons-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic