mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
Allow Asterisk to compile under GCC 4.10
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -766,7 +766,7 @@ static char *generate_random_string(char *buf, size_t size)
|
||||
for (x=0; x<4; x++) {
|
||||
val[x] = ast_random();
|
||||
}
|
||||
snprintf(buf, size, "%08lx%08lx%08lx%08lx", val[0], val[1], val[2], val[3]);
|
||||
snprintf(buf, size, "%08lx%08lx%08lx%08lx", (long unsigned)val[0], (long unsigned)val[1], (long unsigned)val[2], (long unsigned)val[3]);
|
||||
|
||||
return buf;
|
||||
}
|
||||
@@ -862,7 +862,7 @@ static int ast_rtp_dtls_set_configuration(struct ast_rtp_instance *instance, con
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
sprintf(local_fingerprint, "%.2X:", fingerprint[i]);
|
||||
sprintf(local_fingerprint, "%.2X:", (unsigned)fingerprint[i]);
|
||||
local_fingerprint += 3;
|
||||
}
|
||||
|
||||
@@ -1483,7 +1483,7 @@ static int dtls_srtp_setup(struct ast_rtp *rtp, struct ast_srtp *srtp, struct as
|
||||
}
|
||||
|
||||
if (res_srtp_policy->set_suite(local_policy, rtp->suite)) {
|
||||
ast_log(LOG_WARNING, "Could not set suite to '%d' on local policy of '%p' when setting up DTLS-SRTP\n", rtp->suite, rtp);
|
||||
ast_log(LOG_WARNING, "Could not set suite to '%u' on local policy of '%p' when setting up DTLS-SRTP\n", rtp->suite, rtp);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -1503,7 +1503,7 @@ static int dtls_srtp_setup(struct ast_rtp *rtp, struct ast_srtp *srtp, struct as
|
||||
}
|
||||
|
||||
if (res_srtp_policy->set_suite(remote_policy, rtp->suite)) {
|
||||
ast_log(LOG_WARNING, "Could not set suite to '%d' on remote policy of '%p' when setting up DTLS-SRTP\n", rtp->suite, rtp);
|
||||
ast_log(LOG_WARNING, "Could not set suite to '%u' on remote policy of '%p' when setting up DTLS-SRTP\n", rtp->suite, rtp);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -2185,7 +2185,7 @@ static int ast_rtp_dtmf_begin(struct ast_rtp_instance *instance, char digit)
|
||||
}
|
||||
update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address);
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Sent RTP DTMF packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
|
||||
ast_verbose("Sent RTP DTMF packet to %s%s (type %-2.2d, seq %-6.6d, ts %-6.6u, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
ice ? " (via ICE)" : "",
|
||||
payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
|
||||
@@ -2236,7 +2236,7 @@ static int ast_rtp_dtmf_continuation(struct ast_rtp_instance *instance)
|
||||
update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address);
|
||||
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Sent RTP DTMF packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
|
||||
ast_verbose("Sent RTP DTMF packet to %s%s (type %-2.2d, seq %-6.6d, ts %-6.6u, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
ice ? " (via ICE)" : "",
|
||||
rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
|
||||
@@ -2285,7 +2285,7 @@ static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance *instance, cha
|
||||
rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
|
||||
|
||||
if (duration > 0 && (measured_samples = duration * rtp_get_rate(&rtp->f.subclass.format) / 1000) > rtp->send_duration) {
|
||||
ast_debug(2, "Adjusting final end duration from %u to %u\n", rtp->send_duration, measured_samples);
|
||||
ast_debug(2, "Adjusting final end duration from %d to %u\n", rtp->send_duration, measured_samples);
|
||||
rtp->send_duration = measured_samples;
|
||||
}
|
||||
|
||||
@@ -2312,7 +2312,7 @@ static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance *instance, cha
|
||||
update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address);
|
||||
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Sent RTP DTMF packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
|
||||
ast_verbose("Sent RTP DTMF packet to %s%s (type %-2.2d, seq %-6.6d, ts %-6.6u, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
ice ? " (via ICE)" : "",
|
||||
rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
|
||||
@@ -2576,7 +2576,7 @@ static int ast_rtcp_write_report(struct ast_rtp_instance *instance, int sr)
|
||||
}
|
||||
ast_verbose(" Report block:\n");
|
||||
ast_verbose(" Their SSRC: %u\n", report_block->source_ssrc);
|
||||
ast_verbose(" Fraction lost: %u\n", report_block->lost_count.fraction);
|
||||
ast_verbose(" Fraction lost: %d\n", report_block->lost_count.fraction);
|
||||
ast_verbose(" Cumulative loss: %u\n", report_block->lost_count.packets);
|
||||
ast_verbose(" Highest seq no: %u\n", report_block->highest_seq_no);
|
||||
ast_verbose(" IA jitter: %.4f\n", (double)report_block->ia_jitter / rate);
|
||||
@@ -2652,7 +2652,7 @@ static int ast_rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame
|
||||
if (abs(rtp->lastts - pred) < MAX_TIMESTAMP_SKEW) {
|
||||
rtp->lastts = pred;
|
||||
} else {
|
||||
ast_debug(3, "Difference is %d, ms is %d\n", abs(rtp->lastts - pred), ms);
|
||||
ast_debug(3, "Difference is %d, ms is %u\n", abs(rtp->lastts - pred), ms);
|
||||
mark = 1;
|
||||
}
|
||||
}
|
||||
@@ -2667,7 +2667,7 @@ static int ast_rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame
|
||||
rtp->lastts = pred;
|
||||
rtp->lastovidtimestamp += frame->samples;
|
||||
} else {
|
||||
ast_debug(3, "Difference is %d, ms is %d (%d), pred/ts/samples %d/%d/%d\n", abs(rtp->lastts - pred), ms, ms * 90, rtp->lastts, pred, frame->samples);
|
||||
ast_debug(3, "Difference is %d, ms is %u (%u), pred/ts/samples %u/%d/%d\n", abs(rtp->lastts - pred), ms, ms * 90, rtp->lastts, pred, frame->samples);
|
||||
rtp->lastovidtimestamp = rtp->lastts;
|
||||
}
|
||||
}
|
||||
@@ -2681,7 +2681,7 @@ static int ast_rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame
|
||||
rtp->lastts = pred;
|
||||
rtp->lastotexttimestamp += frame->samples;
|
||||
} else {
|
||||
ast_debug(3, "Difference is %d, ms is %d, pred/ts/samples %d/%d/%d\n", abs(rtp->lastts - pred), ms, rtp->lastts, pred, frame->samples);
|
||||
ast_debug(3, "Difference is %d, ms is %u, pred/ts/samples %u/%d/%d\n", abs(rtp->lastts - pred), ms, rtp->lastts, pred, frame->samples);
|
||||
rtp->lastotexttimestamp = rtp->lastts;
|
||||
}
|
||||
}
|
||||
@@ -2744,7 +2744,7 @@ static int ast_rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame
|
||||
update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address);
|
||||
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Sent RTP packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
|
||||
ast_verbose("Sent RTP packet to %s%s (type %-2.2d, seq %-6.6d, ts %-6.6u, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
ice ? " (via ICE)" : "",
|
||||
codec, rtp->seqno, rtp->lastts, res - hdrlen);
|
||||
@@ -3061,7 +3061,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
|
||||
samples &= 0xFFFF;
|
||||
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Got RTP RFC2833 from %s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d) \n",
|
||||
ast_verbose("Got RTP RFC2833 from %s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6d, mark %d, event %08x, end %d, duration %-5.5u) \n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
payloadtype, seqno, timestamp, len, (mark?1:0), event, ((event_end & 0x80)?1:0), samples);
|
||||
}
|
||||
@@ -3122,7 +3122,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
|
||||
rtp->dtmf_duration = rtp->dtmf_timeout = 0;
|
||||
AST_LIST_INSERT_TAIL(frames, f, frame_list);
|
||||
} else if (rtpdebug) {
|
||||
ast_debug(1, "Dropping duplicate or out of order DTMF END frame (seqno: %d, ts %d, digit %c)\n",
|
||||
ast_debug(1, "Dropping duplicate or out of order DTMF END frame (seqno: %u, ts %u, digit %c)\n",
|
||||
seqno, timestamp, resp);
|
||||
}
|
||||
} else {
|
||||
@@ -3139,7 +3139,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
|
||||
* this.
|
||||
*/
|
||||
if (rtpdebug) {
|
||||
ast_debug(1, "Dropping out of order DTMF frame (seqno %d, ts %d, digit %c)\n",
|
||||
ast_debug(1, "Dropping out of order DTMF frame (seqno %u, ts %u, digit %c)\n",
|
||||
seqno, timestamp, resp);
|
||||
}
|
||||
return;
|
||||
@@ -3224,7 +3224,7 @@ static struct ast_frame *process_dtmf_cisco(struct ast_rtp_instance *instance, u
|
||||
event = data[3] & 0x1f;
|
||||
|
||||
if (rtpdebug)
|
||||
ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02x, 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=%02x, power=%u, history count=%d)\n", event, len, seq, flags, power, (len - 4) / 2);
|
||||
if (event < 10) {
|
||||
resp = '0' + event;
|
||||
} else if (event < 11) {
|
||||
@@ -3560,8 +3560,8 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
|
||||
timeval2ntp(now, &msw, &lsw);
|
||||
lsr_now = (((msw & 0xffff) << 16) | ((lsw & 0xffff0000) >> 16));
|
||||
ast_verbose("Internal RTCP NTP clock skew detected: "
|
||||
"lsr=%u, now=%u, dlsr=%u (%d:%03dms), "
|
||||
"diff=%d\n",
|
||||
"lsr=%u, now=%u, dlsr=%u (%u:%03ums), "
|
||||
"diff=%u\n",
|
||||
report_block->lsr, lsr_now, report_block->dlsr, report_block->dlsr / 65536,
|
||||
(report_block->dlsr % 65536) * 1000 / 65536,
|
||||
report_block->dlsr - (lsr_now - report_block->lsr));
|
||||
@@ -3571,7 +3571,7 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
|
||||
rtp->rtcp->reported_jitter_count++;
|
||||
|
||||
if (rtcp_debug_test_addr(&addr)) {
|
||||
ast_verbose(" Fraction lost: %u\n", report_block->lost_count.fraction);
|
||||
ast_verbose(" Fraction lost: %d\n", report_block->lost_count.fraction);
|
||||
ast_verbose(" Packets lost so far: %u\n", report_block->lost_count.packets);
|
||||
ast_verbose(" Highest sequence number: %u\n", report_block->highest_seq_no & 0x0000ffff);
|
||||
ast_verbose(" Sequence number cycles: %u\n", report_block->highest_seq_no >> 16);
|
||||
@@ -3705,7 +3705,7 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, unsigned int
|
||||
update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address);
|
||||
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Sent RTP P2P packet to %s%s (type %-2.2d, len %-6.6u)\n",
|
||||
ast_verbose("Sent RTP P2P packet to %s%s (type %-2.2d, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
ice ? " (via ICE)" : "",
|
||||
bridged_payload, len - hdrlen);
|
||||
@@ -3914,7 +3914,7 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
|
||||
hdrlen += (ntohl(rtpheader[hdrlen/4]) & 0xffff) << 2;
|
||||
hdrlen += 4;
|
||||
if (option_debug) {
|
||||
int profile;
|
||||
unsigned int profile;
|
||||
profile = (ntohl(rtpheader[3]) & 0xffff0000) >> 16;
|
||||
if (profile == 0x505a)
|
||||
ast_debug(1, "Found Zfone extension in RTP stream - zrtp - not supported.\n");
|
||||
@@ -3955,7 +3955,7 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
|
||||
}
|
||||
|
||||
if (rtp_debug_test_addr(&addr)) {
|
||||
ast_verbose("Got RTP packet from %s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
|
||||
ast_verbose("Got RTP packet from %s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&addr),
|
||||
payloadtype, seqno, timestamp,res - hdrlen);
|
||||
}
|
||||
@@ -4448,7 +4448,7 @@ static int ast_rtp_sendcng(struct ast_rtp_instance *instance, int level)
|
||||
update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address);
|
||||
|
||||
if (rtp_debug_test_addr(&remote_address)) {
|
||||
ast_verbose("Sent Comfort Noise RTP packet to %s%s (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
|
||||
ast_verbose("Sent Comfort Noise RTP packet to %s%s (type %-2.2d, seq %-6.6d, ts %-6.6u, len %-6.6d)\n",
|
||||
ast_sockaddr_stringify(&remote_address),
|
||||
ice ? " (via ICE)" : "",
|
||||
AST_RTP_CN, rtp->seqno, rtp->lastdigitts, res - hdrlen);
|
||||
|
Reference in New Issue
Block a user