summaryrefslogtreecommitdiff
path: root/res/res_fax.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 /res/res_fax.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 'res/res_fax.c')
-rw-r--r--res/res_fax.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index 4f253b758..54fc9f1ef 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -407,7 +407,7 @@ static void debug_check_frame_for_silence(struct ast_fax_session *s, unsigned in
history->consec_ms = 0;
if ((last_consec_frames != 0)) {
- ast_verb(6, "Channel '%s' fax session '%d', [ %.3ld.%.6ld ], %s sent %d frames (%d ms) of %s.\n",
+ ast_verb(6, "Channel '%s' fax session '%u', [ %.3ld.%.6ld ], %s sent %u frames (%u ms) of %s.\n",
s->channame, s->id, (long) diff.tv_sec, (long int) diff.tv_usec,
(c2s) ? "channel" : "stack", last_consec_frames, last_consec_ms,
(wassil) ? "silence" : "energy");
@@ -807,7 +807,7 @@ const char *ast_fax_state_to_str(enum ast_fax_state state)
case AST_FAX_STATE_INACTIVE:
return "Inactive";
default:
- ast_log(LOG_WARNING, "unhandled FAX state: %d\n", state);
+ ast_log(LOG_WARNING, "unhandled FAX state: %u\n", state);
return "Unknown";
}
}
@@ -1081,11 +1081,11 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
}
/* link the session to the session container */
if (!(ao2_link(faxregistry.container, s))) {
- ast_log(LOG_ERROR, "failed to add FAX session '%d' to container.\n", s->id);
+ ast_log(LOG_ERROR, "failed to add FAX session '%u' to container.\n", s->id);
ao2_ref(s, -1);
return NULL;
}
- ast_debug(4, "channel '%s' using FAX session '%d'\n", s->channame, s->id);
+ ast_debug(4, "channel '%s' using FAX session '%u'\n", s->channame, s->id);
return s;
}
@@ -1221,7 +1221,7 @@ static void set_channel_variables(struct ast_channel *chan, struct ast_fax_sessi
pbx_builtin_setvar_helper(chan, "FAXBITRATE", S_OR(details->transfer_rate, NULL));
pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", S_OR(details->resolution, NULL));
- snprintf(buf, sizeof(buf), "%d", details->pages_transferred);
+ snprintf(buf, sizeof(buf), "%u", details->pages_transferred);
pbx_builtin_setvar_helper(chan, "FAXPAGES", buf);
}
@@ -1243,7 +1243,7 @@ static void set_channel_variables(struct ast_channel *chan, struct ast_fax_sessi
#define GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason) \
do { \
- ast_log(LOG_ERROR, "channel '%s' FAX session '%d' failure, reason: '%s' (%s)\n", ast_channel_name(chan), fax->id, reason, errorstr); \
+ ast_log(LOG_ERROR, "channel '%s' FAX session '%u' failure, reason: '%s' (%s)\n", ast_channel_name(chan), fax->id, reason, errorstr); \
GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason); \
} while (0)
@@ -1416,7 +1416,7 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det
fax->smoother = NULL;
}
if (!(fax->smoother = ast_smoother_new(320))) {
- ast_log(LOG_WARNING, "Channel '%s' FAX session '%d' failed to obtain a smoother.\n", ast_channel_name(chan), fax->id);
+ ast_log(LOG_WARNING, "Channel '%s' FAX session '%u' failed to obtain a smoother.\n", ast_channel_name(chan), fax->id);
}
} else {
expected_frametype = AST_FRAME_MODEM;
@@ -1504,7 +1504,7 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det
report_fax_status(chan, details, "T.38 Negotiated");
- ast_verb(3, "Channel '%s' switched to T.38 FAX session '%d'.\n", ast_channel_name(chan), fax->id);
+ ast_verb(3, "Channel '%s' switched to T.38 FAX session '%u'.\n", ast_channel_name(chan), fax->id);
}
} else if ((frame->frametype == expected_frametype) &&
(!memcmp(&frame->subclass, &expected_framesubclass, sizeof(frame->subclass)))) {
@@ -1876,13 +1876,13 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
ast_string_field_set(details, resultstr, "maxrate is less than minrate");
set_channel_variables(chan, details);
- ast_log(LOG_ERROR, "maxrate %d is less than minrate %d\n", details->maxrate, details->minrate);
+ ast_log(LOG_ERROR, "maxrate %u is less than minrate %u\n", details->maxrate, details->minrate);
return -1;
}
if (check_modem_rate(details->modems, details->minrate)) {
ast_fax_modem_to_str(details->modems, modems, sizeof(modems));
- ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %d\n", modems, details->minrate);
+ ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, details->minrate);
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
ast_string_field_set(details, resultstr, "incompatible 'modems' and 'minrate' settings");
set_channel_variables(chan, details);
@@ -1891,7 +1891,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
if (check_modem_rate(details->modems, details->maxrate)) {
ast_fax_modem_to_str(details->modems, modems, sizeof(modems));
- ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'maxrate' setting %d\n", modems, details->maxrate);
+ ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, details->maxrate);
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
ast_string_field_set(details, resultstr, "incompatible 'modems' and 'maxrate' settings");
set_channel_variables(chan, details);
@@ -2383,13 +2383,13 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
ast_string_field_set(details, resultstr, "maxrate is less than minrate");
set_channel_variables(chan, details);
- ast_log(LOG_ERROR, "maxrate %d is less than minrate %d\n", details->maxrate, details->minrate);
+ ast_log(LOG_ERROR, "maxrate %u is less than minrate %u\n", details->maxrate, details->minrate);
return -1;
}
if (check_modem_rate(details->modems, details->minrate)) {
ast_fax_modem_to_str(details->modems, modems, sizeof(modems));
- ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %d\n", modems, details->minrate);
+ ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, details->minrate);
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
ast_string_field_set(details, resultstr, "incompatible 'modems' and 'minrate' settings");
set_channel_variables(chan, details);
@@ -2398,7 +2398,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
if (check_modem_rate(details->modems, details->maxrate)) {
ast_fax_modem_to_str(details->modems, modems, sizeof(modems));
- ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'maxrate' setting %d\n", modems, details->maxrate);
+ ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, details->maxrate);
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
ast_string_field_set(details, resultstr, "incompatible 'modems' and 'maxrate' settings");
set_channel_variables(chan, details);
@@ -3175,7 +3175,7 @@ static struct ast_frame *fax_gateway_framehook(struct ast_channel *chan, struct
active = chan;
break;
default:
- ast_log(LOG_WARNING, "unhandled framehook event %i\n", event);
+ ast_log(LOG_WARNING, "unhandled framehook event %u\n", event);
return f;
}
@@ -3560,7 +3560,7 @@ static char *fax_session_tab_complete(struct ast_cli_args *a)
tklen = strlen(a->word);
i = ao2_iterator_init(faxregistry.container, 0);
while ((s = ao2_iterator_next(&i))) {
- snprintf(tbuf, sizeof(tbuf), "%d", s->id);
+ snprintf(tbuf, sizeof(tbuf), "%u", s->id);
if (!strncasecmp(a->word, tbuf, tklen) && ++wordnum > a->n) {
name = ast_strdup(tbuf);
ao2_ref(s, -1);
@@ -3663,7 +3663,7 @@ static char *cli_fax_show_capabilities(struct ast_cli_entry *e, int cmd, struct
num_modules++;
}
AST_RWLIST_UNLOCK(&faxmodules);
- ast_cli(a->fd, "%d registered modules\n\n", num_modules);
+ ast_cli(a->fd, "%u registered modules\n\n", num_modules);
return CLI_SUCCESS;
}
@@ -3691,8 +3691,8 @@ static char *cli_fax_show_settings(struct ast_cli_entry *e, int cmd, struct ast_
ast_cli(a->fd, "FAX For Asterisk Settings:\n");
ast_cli(a->fd, "\tECM: %s\n", options.ecm ? "Enabled" : "Disabled");
ast_cli(a->fd, "\tStatus Events: %s\n", options.statusevents ? "On" : "Off");
- ast_cli(a->fd, "\tMinimum Bit Rate: %d\n", options.minrate);
- ast_cli(a->fd, "\tMaximum Bit Rate: %d\n", options.maxrate);
+ ast_cli(a->fd, "\tMinimum Bit Rate: %u\n", options.minrate);
+ ast_cli(a->fd, "\tMaximum Bit Rate: %u\n", options.maxrate);
ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
ast_cli(a->fd, "\tModem Modulations Allowed: %s\n", modems);
ast_cli(a->fd, "\n\nFAX Technology Modules:\n\n");
@@ -3726,7 +3726,7 @@ static char *cli_fax_show_session(struct ast_cli_entry *e, int cmd, struct ast_c
return CLI_SHOWUSAGE;
}
- if (sscanf(a->argv[3], "%d", &tmp.id) != 1) {
+ if (sscanf(a->argv[3], "%u", &tmp.id) != 1) {
ast_log(LOG_ERROR, "invalid session id: '%s'\n", a->argv[3]);
return RESULT_SUCCESS;
}
@@ -3833,7 +3833,7 @@ static char *cli_fax_show_sessions(struct ast_cli_entry *e, int cmd, struct ast_
filenames = generate_filenames_string(s->details, "", ", ");
- ast_cli(a->fd, "%-20.20s %-10.10s %-10d %-5.5s %-10.10s %-15.15s %-30s\n",
+ ast_cli(a->fd, "%-20.20s %-10.10s %-10u %-5.5s %-10.10s %-15.15s %-30s\n",
s->channame, s->tech->type, s->id,
cli_session_type(s),
cli_session_operation(s),
@@ -3947,21 +3947,21 @@ static int set_config(int reload)
}
if (options.maxrate < options.minrate) {
- ast_log(LOG_ERROR, "maxrate %d is less than minrate %d\n", options.maxrate, options.minrate);
+ ast_log(LOG_ERROR, "maxrate %u is less than minrate %u\n", options.maxrate, options.minrate);
res = -1;
goto end;
}
if (check_modem_rate(options.modems, options.minrate)) {
ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
- ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %d\n", modems, options.minrate);
+ ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, options.minrate);
res = -1;
goto end;
}
if (check_modem_rate(options.modems, options.maxrate)) {
ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
- ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'maxrate' setting %d\n", modems, options.maxrate);
+ ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'maxrate' setting %u\n", modems, options.maxrate);
res = -1;
goto end;
}
@@ -4016,11 +4016,11 @@ static int acf_faxopt_read(struct ast_channel *chan, const char *cmd, char *data
} else if (!strcasecmp(data, "localstationid")) {
ast_copy_string(buf, details->localstationid, len);
} else if (!strcasecmp(data, "maxrate")) {
- snprintf(buf, len, "%d", details->maxrate);
+ snprintf(buf, len, "%u", details->maxrate);
} else if (!strcasecmp(data, "minrate")) {
- snprintf(buf, len, "%d", details->minrate);
+ snprintf(buf, len, "%u", details->minrate);
} else if (!strcasecmp(data, "pages")) {
- snprintf(buf, len, "%d", details->pages_transferred);
+ snprintf(buf, len, "%u", details->pages_transferred);
} else if (!strcasecmp(data, "rate")) {
ast_copy_string(buf, details->transfer_rate, len);
} else if (!strcasecmp(data, "remotestationid")) {
@@ -4028,7 +4028,7 @@ static int acf_faxopt_read(struct ast_channel *chan, const char *cmd, char *data
} else if (!strcasecmp(data, "resolution")) {
ast_copy_string(buf, details->resolution, len);
} else if (!strcasecmp(data, "sessionid")) {
- snprintf(buf, len, "%d", details->id);
+ snprintf(buf, len, "%u", details->id);
} else if (!strcasecmp(data, "status")) {
ast_copy_string(buf, details->result, len);
} else if (!strcasecmp(data, "statusstr")) {