[asterisk-commits] murf: trunk r75585 - in /trunk: apps/ channels/ main/ pbx/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 18 09:35:08 CDT 2007


Author: murf
Date: Wed Jul 18 09:35:07 2007
New Revision: 75585

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75585
Log:
This corrects the problem with flags and %lld formats on 64-bit machines, where uint64_t is NOT acceptable for %lld, and also works on 32-bit machines. At least, with gcc.

Modified:
    trunk/apps/app_voicemail.c
    trunk/channels/chan_sip.c
    trunk/main/channel.c
    trunk/main/rtp.c
    trunk/pbx/pbx_dundi.c
    trunk/res/res_features.c

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=75585&r1=75584&r2=75585
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Jul 18 09:35:07 2007
@@ -2190,7 +2190,7 @@
 	}
 	if (!strcmp(format, "wav49"))
 		format = "WAV";
-	ast_debug(3, "Attaching file '%s', format '%s', uservm is '%d', global is %lld\n", attach, format, attach_user_voicemail, ast_test_flag((&globalflags), VM_ATTACH));
+	ast_debug(3, "Attaching file '%s', format '%s', uservm is '%d', global is %lld\n", attach, format, attach_user_voicemail, (unsigned long long)ast_test_flag((&globalflags), VM_ATTACH));
 	/* Make a temporary file instead of piping directly to sendmail, in case the mail
 	   command hangs */
 	if ((p = vm_mkftemp(tmp)) == NULL) {

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=75585&r1=75584&r2=75585
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jul 18 09:35:07 2007
@@ -11536,7 +11536,7 @@
 				ast_cli(fd, "  Original uri:           %s\n", cur->uri);
 			if (!ast_strlen_zero(cur->cid_num))
 				ast_cli(fd, "  Caller-ID:              %s\n", cur->cid_num);
-			ast_cli(fd, "  Need Destroy:           %lld\n", ast_test_flag(&cur->flags[0], SIP_NEEDDESTROY));
+			ast_cli(fd, "  Need Destroy:           %lld\n", (unsigned long long)ast_test_flag(&cur->flags[0], SIP_NEEDDESTROY));
 			ast_cli(fd, "  Last Message:           %s\n", cur->lastmsg);
 			ast_cli(fd, "  Promiscuous Redir:      %s\n", ast_test_flag(&cur->flags[0], SIP_PROMISCREDIR) ? "Yes" : "No");
 			ast_cli(fd, "  Route:                  %s\n", cur->route ? cur->route->hop : "N/A");

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=75585&r1=75584&r2=75585
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Wed Jul 18 09:35:07 2007
@@ -2454,7 +2454,7 @@
 int ast_internal_timing_enabled(struct ast_channel *chan)
 {
 	int ret = ast_opt_internal_timing && chan->timingfd > -1;
-	ast_debug(5, "Internal timing is %s (option_internal_timing=%lld chan->timingfd=%d)\n", ret? "enabled": "disabled", ast_opt_internal_timing, chan->timingfd);
+	ast_debug(5, "Internal timing is %s (option_internal_timing=%lld chan->timingfd=%d)\n", ret? "enabled": "disabled", (unsigned long long)ast_opt_internal_timing, chan->timingfd);
 	return ret;
 }
 

Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?view=diff&rev=75585&r1=75584&r2=75585
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Wed Jul 18 09:35:07 2007
@@ -888,7 +888,7 @@
 	event = data[3] & 0x1f;
 
 	if (option_debug > 2 || rtpdebug)
-		ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02llx, power=%d, history count=%d)\n", event, len, seq, flags, power, (len - 4) / 2);
+		ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02llx, power=%d, history count=%d)\n", event, len, seq, (unsigned long long)flags, power, (len - 4) / 2);
 	if (event < 10) {
 		resp = '0' + event;
 	} else if (event < 11) {

Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?view=diff&rev=75585&r1=75584&r2=75585
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Wed Jul 18 09:35:07 2007
@@ -893,7 +893,7 @@
 		if (strchr(req->dr[x].dest, '|'))
 			continue;
 		snprintf(data + strlen(data), sizeof(data) - strlen(data), "%lld/%d/%d/%s/%s|", 
-			req->dr[x].flags, req->dr[x].weight, req->dr[x].techint, req->dr[x].dest, 
+			(unsigned  long long)req->dr[x].flags, req->dr[x].weight, req->dr[x].techint, req->dr[x].dest, 
 			dundi_eid_to_str_short(eidpeer_str, sizeof(eidpeer_str), &req->dr[x].eid));
 	}
 	ast_db_put("dundi/cache", key1, data);
@@ -1154,7 +1154,7 @@
 				if (option_debug)
 					ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", expiration);
 				ptr += length + 1;
-				while((sscanf(ptr, "%lld/%d/%d/%n", &(flags.flags), &weight, &tech, &length) == 3)) {
+				while((sscanf(ptr, "%lld/%d/%d/%n", (unsigned long long*)&(flags.flags), &weight, &tech, &length) == 3)) {
 					ptr += length;
 					term = strchr(ptr, '|');
 					if (term) {

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?view=diff&rev=75585&r1=75584&r2=75585
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Wed Jul 18 09:35:07 2007
@@ -1318,7 +1318,7 @@
 		ast_copy_flags(&features, &(config->features_caller), AST_FLAGS_ALL);
 	else
 		ast_copy_flags(&features, &(config->features_callee), AST_FLAGS_ALL);
-	ast_debug(3, "Feature interpret: chan=%s, peer=%s, sense=%d, features=%lld\n", chan->name, peer->name, sense, features.flags);
+	ast_debug(3, "Feature interpret: chan=%s, peer=%s, sense=%d, features=%lld\n", chan->name, peer->name, sense, (unsigned long long)features.flags);
 
 	ast_rwlock_rdlock(&features_lock);
 	for (x = 0; x < FEATURES_COUNT; x++) {




More information about the asterisk-commits mailing list