summaryrefslogtreecommitdiff
path: root/funcs
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 /funcs
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 'funcs')
-rw-r--r--funcs/func_channel.c2
-rw-r--r--funcs/func_env.c6
-rw-r--r--funcs/func_frame_trace.c4
-rw-r--r--funcs/func_hangupcause.c2
-rw-r--r--funcs/func_iconv.c2
-rw-r--r--funcs/func_srv.c6
-rw-r--r--funcs/func_sysinfo.c10
7 files changed, 16 insertions, 16 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index cca15c308..82fb4c348 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -541,7 +541,7 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
ast_bridge_read_after_goto(chan, buf, len);
} else if (!strcasecmp(data, "amaflags")) {
ast_channel_lock(chan);
- snprintf(buf, len, "%d", ast_channel_amaflags(chan));
+ snprintf(buf, len, "%u", ast_channel_amaflags(chan));
ast_channel_unlock(chan);
} else if (!strncasecmp(data, "secure_bridge_", 14)) {
struct ast_datastore *ds;
diff --git a/funcs/func_env.c b/funcs/func_env.c
index a2f7c2bd2..16f9a7445 100644
--- a/funcs/func_env.c
+++ b/funcs/func_env.c
@@ -291,7 +291,7 @@ static int stat_read(struct ast_channel *chan, const char *cmd, char *data,
strcpy(buf, "1");
break;
case 's':
- snprintf(buf, len, "%d", (unsigned int) s.st_size);
+ snprintf(buf, len, "%u", (unsigned int) s.st_size);
break;
case 'f':
snprintf(buf, len, "%d", S_ISREG(s.st_mode) ? 1 : 0);
@@ -309,7 +309,7 @@ static int stat_read(struct ast_channel *chan, const char *cmd, char *data,
snprintf(buf, len, "%d", (int) s.st_ctime);
break;
case 'm':
- snprintf(buf, len, "%o", (int) s.st_mode);
+ snprintf(buf, len, "%o", s.st_mode);
break;
}
}
@@ -699,7 +699,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru
if (fread(fbuf, 1, i + sizeof(fbuf) > flength ? flength - i : sizeof(fbuf), ff) < (i + sizeof(fbuf) > flength ? flength - i : sizeof(fbuf))) {
ast_log(LOG_ERROR, "Short read?!!\n");
}
- ast_debug(3, "Appending first %" PRId64" bytes of fbuf=%s\n", i + sizeof(fbuf) > length_offset ? length_offset - i : sizeof(fbuf), fbuf);
+ ast_debug(3, "Appending first %" PRId64" bytes of fbuf=%s\n", (long)(i + sizeof(fbuf) > length_offset ? length_offset - i : sizeof(fbuf)), fbuf);
ast_str_append_substr(buf, len, fbuf, i + sizeof(fbuf) > length_offset ? length_offset - i : sizeof(fbuf));
}
} else if (length == 0) {
diff --git a/funcs/func_frame_trace.c b/funcs/func_frame_trace.c
index 6452d0bcb..ecebde4df 100644
--- a/funcs/func_frame_trace.c
+++ b/funcs/func_frame_trace.c
@@ -214,7 +214,7 @@ static void print_frame(struct ast_frame *frame)
switch (frame->frametype) {
case AST_FRAME_DTMF_END:
ast_verbose("FrameType: DTMF END\n");
- ast_verbose("Digit: 0x%02X '%c'\n", frame->subclass.integer,
+ ast_verbose("Digit: 0x%02X '%c'\n", (unsigned)frame->subclass.integer,
frame->subclass.integer < ' ' ? ' ' : frame->subclass.integer);
break;
case AST_FRAME_VOICE:
@@ -390,7 +390,7 @@ static void print_frame(struct ast_frame *frame)
break;
case AST_FRAME_DTMF_BEGIN:
ast_verbose("FrameType: DTMF BEGIN\n");
- ast_verbose("Digit: 0x%02X '%c'\n", frame->subclass.integer,
+ ast_verbose("Digit: 0x%02X '%c'\n", (unsigned)frame->subclass.integer,
frame->subclass.integer < ' ' ? ' ' : frame->subclass.integer);
break;
case AST_FRAME_BRIDGE_ACTION:
diff --git a/funcs/func_hangupcause.c b/funcs/func_hangupcause.c
index d85c54e16..0f1c41adb 100644
--- a/funcs/func_hangupcause.c
+++ b/funcs/func_hangupcause.c
@@ -128,7 +128,7 @@ static int hangupcause_read(struct ast_channel *chan, const char *cmd, char *dat
AST_STANDARD_APP_ARGS(args, parms);
if (args.argc != 2) {
/* Must have two arguments. */
- ast_log(LOG_WARNING, "The HANGUPCAUSE function must have 2 parameters, not %d\n", args.argc);
+ ast_log(LOG_WARNING, "The HANGUPCAUSE function must have 2 parameters, not %u\n", args.argc);
return -1;
}
diff --git a/funcs/func_iconv.c b/funcs/func_iconv.c
index 4c4f65f1a..c3d02865c 100644
--- a/funcs/func_iconv.c
+++ b/funcs/func_iconv.c
@@ -95,7 +95,7 @@ static int iconv_read(struct ast_channel *chan, const char *cmd, char *arguments
AST_STANDARD_APP_ARGS(args, parse);
if (args.argc < 3) {
- ast_log(LOG_WARNING, "Syntax: ICONV(<in-charset>,<out-charset>,<text>) %d\n", args.argc);
+ ast_log(LOG_WARNING, "Syntax: ICONV(<in-charset>,<out-charset>,<text>) %u\n", args.argc);
return -1;
}
diff --git a/funcs/func_srv.c b/funcs/func_srv.c
index deb94835f..3786a2fa2 100644
--- a/funcs/func_srv.c
+++ b/funcs/func_srv.c
@@ -236,11 +236,11 @@ static int srv_result_read(struct ast_channel *chan, const char *cmd, char *data
if (!strcasecmp(args.field, "host")) {
ast_copy_string(buf, host, len);
} else if (!strcasecmp(args.field, "port")) {
- snprintf(buf, len, "%u", port);
+ snprintf(buf, len, "%d", port);
} else if (!strcasecmp(args.field, "priority")) {
- snprintf(buf, len, "%u", priority);
+ snprintf(buf, len, "%d", priority);
} else if (!strcasecmp(args.field, "weight")) {
- snprintf(buf, len, "%u", weight);
+ snprintf(buf, len, "%d", weight);
} else {
ast_log(LOG_WARNING, "Unrecognized SRV field '%s'\n", args.field);
return -1;
diff --git a/funcs/func_sysinfo.c b/funcs/func_sysinfo.c
index dce392f29..8da94dd33 100644
--- a/funcs/func_sysinfo.c
+++ b/funcs/func_sysinfo.c
@@ -115,15 +115,15 @@ static int sysinfo_helper(struct ast_channel *chan, const char *cmd, char *data,
else if (!strcasecmp("uptime", data)) { /* in hours */
snprintf(buf, len, "%ld", sys_info.uptime/3600);
} else if (!strcasecmp("totalram", data)) { /* in KiB */
- snprintf(buf, len, "%ld",(sys_info.totalram * sys_info.mem_unit)/1024);
+ snprintf(buf, len, "%lu",(sys_info.totalram * sys_info.mem_unit)/1024);
} else if (!strcasecmp("freeram", data)) { /* in KiB */
- snprintf(buf, len, "%ld",(sys_info.freeram * sys_info.mem_unit)/1024);
+ snprintf(buf, len, "%lu",(sys_info.freeram * sys_info.mem_unit)/1024);
} else if (!strcasecmp("bufferram", data)) { /* in KiB */
- snprintf(buf, len, "%ld",(sys_info.bufferram * sys_info.mem_unit)/1024);
+ snprintf(buf, len, "%lu",(sys_info.bufferram * sys_info.mem_unit)/1024);
} else if (!strcasecmp("totalswap", data)) { /* in KiB */
- snprintf(buf, len, "%ld",(sys_info.totalswap * sys_info.mem_unit)/1024);
+ snprintf(buf, len, "%lu",(sys_info.totalswap * sys_info.mem_unit)/1024);
} else if (!strcasecmp("freeswap", data)) { /* in KiB */
- snprintf(buf, len, "%ld",(sys_info.freeswap * sys_info.mem_unit)/1024);
+ snprintf(buf, len, "%lu",(sys_info.freeswap * sys_info.mem_unit)/1024);
} else if (!strcasecmp("numprocs", data)) {
snprintf(buf, len, "%d", sys_info.procs);
}