mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +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:
@@ -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;
|
||||
|
@@ -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) {
|
||||
|
@@ -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:
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user