summaryrefslogtreecommitdiff
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-05-09 22:49:26 +0000
committerKinsey Moore <kmoore@digium.com>2014-05-09 22:49:26 +0000
commitabd3e4040bd76058d0148884879858894258fb9f (patch)
treec5695a0880c4928731b1aa864f862c6cffa57428 /channels/chan_mgcp.c
parentf3b55da1b855b12a59f84fd9bf6768eb101cd910 (diff)
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
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index ad2b8bc5b..1955edaea 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -1245,7 +1245,7 @@ static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame)
if (frame->frametype == AST_FRAME_IMAGE)
return 0;
else {
- ast_log(LOG_WARNING, "Can't send %d type frames with MGCP write\n", frame->frametype);
+ ast_log(LOG_WARNING, "Can't send %u type frames with MGCP write\n", frame->frametype);
return 0;
}
} else {
@@ -2023,7 +2023,7 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
sdpLineNum_iterator_init(&iterator);
while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */
- if (sscanf(a, "rtpmap: %30u %127[^/]/", &codec, mimeSubtype) != 2)
+ if (sscanf(a, "rtpmap: %30d %127[^/]/", &codec, mimeSubtype) != 2)
continue;
/* Note: should really look at the 'freq' and '#chans' params too */
ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(sub->rtp), sub->rtp, codec, "audio", mimeSubtype, 0);
@@ -2123,9 +2123,9 @@ static int init_req(struct mgcp_endpoint *p, struct mgcp_request *req, char *ver
req->header[req->headers] = req->data + req->len;
/* check if we need brackets around the gw name */
if (p->parent->isnamedottedip) {
- snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %d %s@[%s] MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : "");
+ snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %u %s@[%s] MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : "");
} else {
-+ snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %d %s@%s MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : "");
++ snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %u %s@%s MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : "");
}
req->len += strlen(req->header[req->headers]);
if (req->headers < MGCP_MAX_HEADERS) {
@@ -2794,7 +2794,7 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
req = find_command(p, sub, &p->cmd_queue, &p->cmd_queue_lock, ident);
if (!req) {
- ast_verb(3, "No command found on [%s] for transaction %d. Ignoring...\n",
+ ast_verb(3, "No command found on [%s] for transaction %u. Ignoring...\n",
gw->name, ident);
return;
}
@@ -2808,10 +2808,10 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
p->hookstate = MGCP_ONHOOK;
break;
case 406:
- ast_log(LOG_NOTICE, "Transaction %d timed out\n", ident);
+ ast_log(LOG_NOTICE, "Transaction %u timed out\n", ident);
break;
case 407:
- ast_log(LOG_NOTICE, "Transaction %d aborted\n", ident);
+ ast_log(LOG_NOTICE, "Transaction %u aborted\n", ident);
break;
}
if (sub) {
@@ -2964,7 +2964,7 @@ static void start_rtp(struct mgcp_subchannel *sub)
ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_NAT, sub->nat);
}
/* Make a call*ID */
- snprintf(sub->callid, sizeof(sub->callid), "%08lx%s", ast_random(), sub->txident);
+ snprintf(sub->callid, sizeof(sub->callid), "%08lx%s", (unsigned long)ast_random(), sub->txident);
/* Transmit the connection create */
if(!sub->parent->pktcgatealloc) {
transmit_connect_with_sdp(sub, NULL);
@@ -4207,7 +4207,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
e->mwi_event_sub = stasis_subscribe(mailbox_specific_topic, mwi_event_cb, NULL);
}
}
- snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", ast_random());
+ snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", (unsigned long)ast_random());
e->msgstate = -1;
e->amaflags = amaflags;
ast_format_cap_copy(e->cap, global_capability);
@@ -4236,7 +4236,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
e->hookstate = MGCP_ONHOOK;
e->chanvars = copy_vars(chanvars);
if (!ep_reload) {
- /*snprintf(txident, sizeof(txident), "%08lx", ast_random());*/
+ /*snprintf(txident, sizeof(txident), "%08lx", (unsigned long)ast_random());*/
for (i = 0; i < MAX_SUBS; i++) {
sub = ast_calloc(1, sizeof(*sub));
if (sub) {
@@ -4245,7 +4245,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
ast_mutex_init(&sub->cx_queue_lock);
sub->parent = e;
sub->id = i;
- snprintf(sub->txident, sizeof(sub->txident), "%08lx", ast_random());
+ snprintf(sub->txident, sizeof(sub->txident), "%08lx", (unsigned long)ast_random());
/*stnrcpy(sub->txident, txident, sizeof(sub->txident) - 1);*/
sub->cxmode = MGCP_CX_INACTIVE;
sub->nat = nat;
@@ -4347,7 +4347,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
e->onhooktime = time(NULL);
/* ASSUME we're onhook */
e->hookstate = MGCP_ONHOOK;
- snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", ast_random());
+ snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", (unsigned long)ast_random());
}
for (i = 0, sub = NULL; i < MAX_SUBS; i++) {
@@ -4369,7 +4369,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
ast_copy_string(sub->magic, MGCP_SUBCHANNEL_MAGIC, sizeof(sub->magic));
sub->parent = e;
sub->id = i;
- snprintf(sub->txident, sizeof(sub->txident), "%08lx", ast_random());
+ snprintf(sub->txident, sizeof(sub->txident), "%08lx", (unsigned long)ast_random());
sub->cxmode = MGCP_CX_INACTIVE;
sub->next = e->sub;
e->sub = sub;