summaryrefslogtreecommitdiff
path: root/main
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 /main
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 'main')
-rw-r--r--main/abstract_jb.c2
-rw-r--r--main/acl.c2
-rw-r--r--main/adsi.c2
-rw-r--r--main/aoc.c6
-rw-r--r--main/app.c8
-rw-r--r--main/asterisk.c6
-rw-r--r--main/audiohook.c6
-rw-r--r--main/bridge.c12
-rw-r--r--main/bridge_channel.c2
-rw-r--r--main/bucket.c2
-rw-r--r--main/callerid.c8
-rw-r--r--main/ccss.c22
-rw-r--r--main/cdr.c10
-rw-r--r--main/channel.c20
-rw-r--r--main/cli.c8
-rw-r--r--main/config.c2
-rw-r--r--main/config_options.c6
-rw-r--r--main/core_unreal.c4
-rw-r--r--main/data.c13
-rw-r--r--main/devicestate.c2
-rw-r--r--main/dsp.c2
-rw-r--r--main/enum.c4
-rw-r--r--main/event.c2
-rw-r--r--main/file.c2
-rw-r--r--main/format.c8
-rw-r--r--main/frame.c8
-rw-r--r--main/io.c4
-rw-r--r--main/loader.c6
-rw-r--r--main/logger.c12
-rw-r--r--main/manager.c2
-rw-r--r--main/manager_bridges.c2
-rw-r--r--main/manager_channels.c2
-rw-r--r--main/netsock.c6
-rw-r--r--main/parking.c2
-rw-r--r--main/pbx.c2
-rw-r--r--main/rtp_engine.c4
-rw-r--r--main/sched.c6
-rw-r--r--main/security_events.c10
-rw-r--r--main/slinfactory.c2
-rw-r--r--main/stdtime/localtime.c2
-rw-r--r--main/stun.c10
-rw-r--r--main/taskprocessor.c2
-rw-r--r--main/translate.c6
-rw-r--r--main/udptl.c12
-rw-r--r--main/utils.c6
-rw-r--r--main/xmldoc.c2
46 files changed, 135 insertions, 134 deletions
diff --git a/main/abstract_jb.c b/main/abstract_jb.c
index 3baa344e0..7841b6a4e 100644
--- a/main/abstract_jb.c
+++ b/main/abstract_jb.c
@@ -284,7 +284,7 @@ int ast_jb_put(struct ast_channel *chan, struct ast_frame *f)
/* We consider an enabled jitterbuffer should receive frames with valid timing info. */
if (!ast_test_flag(f, AST_FRFLAG_HAS_TIMING_INFO) || f->len < 2 || f->ts < 0) {
ast_log(LOG_WARNING, "%s received frame with invalid timing info: "
- "has_timing_info=%d, len=%ld, ts=%ld, src=%s\n",
+ "has_timing_info=%u, len=%ld, ts=%ld, src=%s\n",
ast_channel_name(chan), ast_test_flag(f, AST_FRFLAG_HAS_TIMING_INFO), f->len, f->ts, f->src);
return -1;
}
diff --git a/main/acl.c b/main/acl.c
index c341125fd..213d6d8aa 100644
--- a/main/acl.c
+++ b/main/acl.c
@@ -658,7 +658,7 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha
parsed_addr = ast_strdupa(ast_sockaddr_stringify(&ha->addr));
parsed_mask = ast_strdupa(ast_sockaddr_stringify(&ha->netmask));
- ast_debug(3, "%s/%s sense %d appended to ACL\n", parsed_addr, parsed_mask, ha->sense);
+ ast_debug(3, "%s/%s sense %u appended to ACL\n", parsed_addr, parsed_mask, ha->sense);
}
return ret;
diff --git a/main/adsi.c b/main/adsi.c
index bb8570af3..fcbbd11c5 100644
--- a/main/adsi.c
+++ b/main/adsi.c
@@ -341,7 +341,7 @@ void ast_adsi_install_funcs(const struct adsi_funcs *funcs)
{
if (funcs && funcs->version < current_adsi_version) {
ast_log(LOG_WARNING, "Cannot install ADSI function pointers due to version mismatch."
- "Ours: %u, Theirs: %u\n", current_adsi_version, funcs->version);
+ "Ours: %d, Theirs: %u\n", current_adsi_version, funcs->version);
return;
}
diff --git a/main/aoc.c b/main/aoc.c
index e8b23f595..7dd888ec2 100644
--- a/main/aoc.c
+++ b/main/aoc.c
@@ -1534,7 +1534,7 @@ static void aoc_d_event(const struct ast_aoc_decoded *decoded, struct ast_str **
decoded->unit_list[idx].amount);
}
if (decoded->unit_list[idx].valid_type) {
- ast_str_append(msg, 0, "%s/TypeOf: %d\r\n", prefix,
+ ast_str_append(msg, 0, "%s/TypeOf: %u\r\n", prefix,
decoded->unit_list[idx].type);
}
}
@@ -1597,7 +1597,7 @@ static void aoc_e_event(const struct ast_aoc_decoded *decoded, struct ast_str **
decoded->unit_list[idx].amount);
}
if (decoded->unit_list[idx].valid_type) {
- ast_str_append(msg, 0, "%s/TypeOf: %d\r\n", prefix,
+ ast_str_append(msg, 0, "%s/TypeOf: %u\r\n", prefix,
decoded->unit_list[idx].type);
}
}
@@ -1628,7 +1628,7 @@ static struct ast_json *units_to_json(const struct ast_aoc_decoded *decoded)
if (decoded->unit_list[i].valid_type) {
ast_json_object_set(
unit, "TypeOf", ast_json_stringf(
- "%d", decoded->unit_list[i].type));
+ "%u", decoded->unit_list[i].type));
}
if (ast_json_array_append(units, unit)) {
diff --git a/main/app.c b/main/app.c
index a02c6d671..a5c4c7af5 100644
--- a/main/app.c
+++ b/main/app.c
@@ -773,7 +773,7 @@ static void linear_release(struct ast_channel *chan, void *params)
struct linear_state *ls = params;
if (ls->origwfmt.id && ast_set_write_format(chan, &ls->origwfmt)) {
- ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", ast_channel_name(chan), ls->origwfmt.id);
+ ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%u'\n", ast_channel_name(chan), ls->origwfmt.id);
}
if (ls->autoclose) {
@@ -1254,7 +1254,7 @@ static struct ast_frame *make_silence(const struct ast_frame *orig)
samples += orig->samples;
}
- ast_verb(4, "Silencing %zd samples\n", samples);
+ ast_verb(4, "Silencing %zu samples\n", samples);
datalen = sizeof(short) * samples;
@@ -2004,7 +2004,7 @@ static enum AST_LOCK_RESULT ast_lock_path_lockfile(const char *path)
s = ast_alloca(lp + 10);
fs = ast_alloca(lp + 20);
- snprintf(fs, strlen(path) + 19, "%s/.lock-%08lx", path, ast_random());
+ snprintf(fs, strlen(path) + 19, "%s/.lock-%08lx", path, (unsigned long)ast_random());
fd = open(fs, O_WRONLY | O_CREAT | O_EXCL, AST_FILE_MODE);
if (fd < 0) {
ast_log(LOG_ERROR, "Unable to create lock file '%s': %s\n", path, strerror(errno));
@@ -2382,7 +2382,7 @@ static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option,
ast_stopstream(chan);
return res;
default:
- ast_log(LOG_NOTICE, "Unknown dispatch function %d, ignoring!\n", option->action);
+ ast_log(LOG_NOTICE, "Unknown dispatch function %u, ignoring!\n", option->action);
return 0;
}
return -1;
diff --git a/main/asterisk.c b/main/asterisk.c
index 8a619b1eb..a3bb88198 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -823,14 +823,14 @@ static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cl
ast_cli(a->fd, "\nSystem Statistics\n");
ast_cli(a->fd, "-----------------\n");
- ast_cli(a->fd, " System Uptime: %lu hours\n", uptime);
+ ast_cli(a->fd, " System Uptime: %ld hours\n", uptime);
ast_cli(a->fd, " Total RAM: %" PRIu64 " KiB\n", physmem / 1024);
ast_cli(a->fd, " Free RAM: %" PRIu64 " KiB\n", freeram);
#if defined(HAVE_SYSINFO)
ast_cli(a->fd, " Buffer RAM: %" PRIu64 " KiB\n", ((uint64_t) sys_info.bufferram * sys_info.mem_unit) / 1024);
#endif
#if defined (HAVE_SYSCTL) || defined(HAVE_SWAPCTL)
- ast_cli(a->fd, " Total Swap Space: %u KiB\n", totalswap);
+ ast_cli(a->fd, " Total Swap Space: %d KiB\n", totalswap);
ast_cli(a->fd, " Free Swap Space: %" PRIu64 " KiB\n\n", freeswap);
#endif
ast_cli(a->fd, " Number of Processes: %d \n\n", nprocs);
@@ -1706,7 +1706,7 @@ static int ast_makesocket(void)
ast_log(LOG_WARNING, "Unable to change ownership of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
if (!ast_strlen_zero(ast_config_AST_CTL_PERMISSIONS)) {
- int p1;
+ unsigned int p1;
mode_t p;
sscanf(ast_config_AST_CTL_PERMISSIONS, "%30o", &p1);
p = p1;
diff --git a/main/audiohook.c b/main/audiohook.c
index 32bd3621f..90802b6cd 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -262,7 +262,7 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
if (!usable_read && !usable_write) {
/* If both factories are unusable bail out */
- ast_debug(1, "Read factory %p and write factory %p both fail to provide %zd samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);
+ ast_debug(1, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);
return NULL;
}
@@ -987,7 +987,7 @@ int ast_channel_audiohook_count_by_source(struct ast_channel *chan, const char *
}
break;
default:
- ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type);
+ ast_debug(1, "Invalid audiohook type supplied, (%u)\n", type);
return -1;
}
@@ -1022,7 +1022,7 @@ int ast_channel_audiohook_count_by_source_running(struct ast_channel *chan, cons
}
break;
default:
- ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type);
+ ast_debug(1, "Invalid audiohook type supplied, (%u)\n", type);
return -1;
}
return count;
diff --git a/main/bridge.c b/main/bridge.c
index d06b7b555..6fdf0d554 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -268,7 +268,7 @@ int ast_bridge_technology_unregister(struct ast_bridge_technology *technology)
*/
static void bridge_queue_action_nodup(struct ast_bridge *bridge, struct ast_frame *action)
{
- ast_debug(1, "Bridge %s: queueing action type:%d sub:%d\n",
+ ast_debug(1, "Bridge %s: queueing action type:%u sub:%d\n",
bridge->uniqueid, action->frametype, action->subclass.integer);
ast_bridge_lock(bridge);
@@ -487,7 +487,7 @@ static struct ast_bridge_technology *find_best_technology(uint32_t capabilities,
continue;
}
if (best && current->preference <= best->preference) {
- ast_debug(1, "Bridge technology %s has less preference than %s (%d <= %d). Skipping.\n",
+ ast_debug(1, "Bridge technology %s has less preference than %s (%u <= %u). Skipping.\n",
current->name, best->name, current->preference, best->preference);
continue;
}
@@ -3144,7 +3144,7 @@ int ast_bridge_features_enable(struct ast_bridge_features *features,
dtmf = builtin_features_dtmf[feature];
/* If no DTMF is still available (ie: it has been disabled) then error out now */
if (ast_strlen_zero(dtmf)) {
- ast_debug(1, "Failed to enable built in feature %d on %p, no DTMF string is available for it.\n",
+ ast_debug(1, "Failed to enable built in feature %u on %p, no DTMF string is available for it.\n",
feature, features);
return -1;
}
@@ -4930,7 +4930,7 @@ static const char *tech_capability2str(uint32_t capabilities)
static char *handle_bridge_technology_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define FORMAT_HDR "%-20s %-20s %8s %s\n"
-#define FORMAT_ROW "%-20s %-20s %8d %s\n"
+#define FORMAT_ROW "%-20s %-20s %8u %s\n"
struct ast_bridge_technology *cur;
@@ -5117,7 +5117,7 @@ static int manager_bridge_tech_list(struct mansession *s, const struct message *
"Event: BridgeTechnologyListItem\r\n"
"BridgeTechnology: %s\r\n"
"BridgeType: %s\r\n"
- "BridgePriority: %d\r\n"
+ "BridgePriority: %u\r\n"
"BridgeSuspended: %s\r\n"
"%s"
"\r\n",
@@ -5153,7 +5153,7 @@ static void bridge_prnt_obj(void *v_obj, void *where, ao2_prnt_fn *prnt)
if (!bridge) {
return;
}
- prnt(where, "%s %s chans:%d",
+ prnt(where, "%s %s chans:%u",
bridge->uniqueid, bridge->v_table->name, bridge->num_channels);
}
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 75008fe18..2b37f25b5 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -283,7 +283,7 @@ void ast_bridge_channel_leave_bridge_nolock(struct ast_bridge_channel *bridge_ch
return;
}
- ast_debug(1, "Setting %p(%s) state from:%d to:%d\n",
+ ast_debug(1, "Setting %p(%s) state from:%u to:%u\n",
bridge_channel, ast_channel_name(bridge_channel->chan), bridge_channel->state,
new_state);
diff --git a/main/bucket.c b/main/bucket.c
index f021dffcf..78a2289fd 100644
--- a/main/bucket.c
+++ b/main/bucket.c
@@ -903,7 +903,7 @@ static int timeval_str2struct(const struct aco_option *opt, struct ast_variable
static int timeval_struct2str(const void *obj, const intptr_t *args, char **buf)
{
struct timeval *field = (struct timeval *)(obj + args[0]);
- return (ast_asprintf(buf, "%lu.%06lu", field->tv_sec, (unsigned long)field->tv_usec) < 0) ? -1 : 0;
+ return (ast_asprintf(buf, "%lu.%06lu", (unsigned long)field->tv_sec, (unsigned long)field->tv_usec) < 0) ? -1 : 0;
}
/*! \brief Initialize bucket support */
diff --git a/main/callerid.c b/main/callerid.c
index 849579ec8..5f53cb2ae 100644
--- a/main/callerid.c
+++ b/main/callerid.c
@@ -447,7 +447,7 @@ int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, s
case 0x06: /* short dial number */
case 0x07: /* reserved */
default: /* reserved */
- ast_debug(2, "cid info:#1=%X\n", cid->rawdata[x]);
+ ast_debug(2, "cid info:#1=%X\n", (unsigned)cid->rawdata[x]);
break ;
}
x++;
@@ -463,7 +463,7 @@ int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, s
case 0x09: /* private dial plan */
case 0x05: /* reserved */
default: /* reserved */
- ast_debug(2, "cid info:#2=%X\n", cid->rawdata[x]);
+ ast_debug(2, "cid info:#2=%X\n", (unsigned)cid->rawdata[x]);
break ;
}
x++;
@@ -503,7 +503,7 @@ int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, s
case 0x07: /* reserved */
default: /* reserved */
if (option_debug > 1)
- ast_log(LOG_NOTICE, "did info:#1=%X\n", cid->rawdata[x]);
+ ast_log(LOG_NOTICE, "did info:#1=%X\n", (unsigned)cid->rawdata[x]);
break ;
}
x++;
@@ -519,7 +519,7 @@ int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, s
case 0x09: /* private dial plan */
case 0x05: /* reserved */
default: /* reserved */
- ast_debug(2, "did info:#2=%X\n", cid->rawdata[x]);
+ ast_debug(2, "did info:#2=%X\n", (unsigned)cid->rawdata[x]);
break ;
}
x++;
diff --git a/main/ccss.c b/main/ccss.c
index 625147382..09fa2d114 100644
--- a/main/ccss.c
+++ b/main/ccss.c
@@ -2105,7 +2105,7 @@ static struct ast_cc_monitor *cc_extension_monitor_init(const char * const exten
cc_interface->monitor_class = AST_CC_EXTENSION_MONITOR;
strcpy(cc_interface->device_name, ast_str_buffer(str));
monitor->interface = cc_interface;
- ast_log_dynamic_level(cc_logger_level, "Created an extension cc interface for '%s' with id %d and parent %d\n", cc_interface->device_name, monitor->id, monitor->parent_id);
+ ast_log_dynamic_level(cc_logger_level, "Created an extension cc interface for '%s' with id %u and parent %u\n", cc_interface->device_name, monitor->id, monitor->parent_id);
return monitor;
}
@@ -2284,7 +2284,7 @@ static struct ast_cc_monitor *cc_device_monitor_init(const char * const device_n
monitor->interface = cc_interface;
monitor->available_timer_id = -1;
ast_cc_copy_config_params(cc_interface->config_params, &cc_data->config_params);
- ast_log_dynamic_level(cc_logger_level, "Core %d: Created a device cc interface for '%s' with id %d and parent %d\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %d: Created a device cc interface for '%s' with id %u and parent %u\n",
monitor->core_id, cc_interface->device_name, monitor->id, monitor->parent_id);
return monitor;
}
@@ -2579,7 +2579,7 @@ static struct ast_cc_agent *cc_agent_init(struct ast_channel *caller_chan,
cc_unref(agent, "Agent init callback failed.");
return NULL;
}
- ast_log_dynamic_level(cc_logger_level, "Core %d: Created an agent for caller %s\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: Created an agent for caller %s\n",
agent->core_id, agent->device_name);
return agent;
}
@@ -2684,7 +2684,7 @@ static int offer_timer_expire(const void *data)
{
struct ast_cc_agent *agent = (struct ast_cc_agent *) data;
struct cc_generic_agent_pvt *agent_pvt = agent->private_data;
- ast_log_dynamic_level(cc_logger_level, "Core %d: Queuing change request because offer timer has expired.\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: Queuing change request because offer timer has expired.\n",
agent->core_id);
agent_pvt->offer_timer_id = -1;
ast_cc_failed(agent->core_id, "Generic agent %s offer timer expired", agent->device_name);
@@ -2702,7 +2702,7 @@ static int cc_generic_agent_start_offer_timer(struct ast_cc_agent *agent)
ast_assert(agent->cc_params != NULL);
when = ast_get_cc_offer_timer(agent->cc_params) * 1000;
- ast_log_dynamic_level(cc_logger_level, "Core %d: About to schedule offer timer expiration for %d ms\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: About to schedule offer timer expiration for %d ms\n",
agent->core_id, when);
if ((sched_id = ast_sched_add(cc_sched_context, when, offer_timer_expire, cc_ref(agent, "Give scheduler an agent ref"))) == -1) {
return -1;
@@ -2830,7 +2830,7 @@ static void *generic_recall(void *data)
if (!(chan = ast_request_and_dial(tech, tmp_cap, NULL, NULL, target, recall_timer, &reason, generic_pvt->cid_num, generic_pvt->cid_name))) {
/* Hmm, no channel. Sucks for you, bud.
*/
- ast_log_dynamic_level(cc_logger_level, "Core %d: Failed to call back %s for reason %d\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: Failed to call back %s for reason %d\n",
agent->core_id, agent->device_name, reason);
ast_cc_failed(agent->core_id, "Failed to call back device %s/%s", tech, target);
ast_format_cap_destroy(tmp_cap);
@@ -2854,7 +2854,7 @@ static void *generic_recall(void *data)
pbx_builtin_setvar_helper(chan, "CC_CONTEXT", generic_pvt->context);
if (!ast_strlen_zero(callback_macro)) {
- ast_log_dynamic_level(cc_logger_level, "Core %d: There's a callback macro configured for agent %s\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: There's a callback macro configured for agent %s\n",
agent->core_id, agent->device_name);
if (ast_app_exec_macro(NULL, chan, callback_macro)) {
ast_cc_failed(agent->core_id, "Callback macro to %s failed. Maybe a hangup?", agent->device_name);
@@ -2864,7 +2864,7 @@ static void *generic_recall(void *data)
}
if (!ast_strlen_zero(callback_sub)) {
- ast_log_dynamic_level(cc_logger_level, "Core %d: There's a callback subroutine configured for agent %s\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: There's a callback subroutine configured for agent %s\n",
agent->core_id, agent->device_name);
if (ast_app_exec_sub(NULL, chan, callback_sub, 0)) {
ast_cc_failed(agent->core_id, "Callback subroutine to %s failed. Maybe a hangup?", agent->device_name);
@@ -2993,7 +2993,7 @@ static int is_state_change_valid(enum cc_state current_state, const enum cc_stat
int is_valid = 0;
switch (new_state) {
case CC_AVAILABLE:
- ast_log_dynamic_level(cc_logger_level, "Core %d: Asked to change to state %d? That should never happen.\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: Asked to change to state %u? That should never happen.\n",
agent->core_id, new_state);
break;
case CC_CALLER_OFFERED:
@@ -3036,7 +3036,7 @@ static int is_state_change_valid(enum cc_state current_state, const enum cc_stat
is_valid = 1;
break;
default:
- ast_log_dynamic_level(cc_logger_level, "Core %d: Asked to change to unknown state %d\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %u: Asked to change to unknown state %u\n",
agent->core_id, new_state);
break;
}
@@ -3279,7 +3279,7 @@ static int cc_do_state_change(void *datap)
enum cc_state previous_state;
int res;
- ast_log_dynamic_level(cc_logger_level, "Core %d: State change to %d requested. Reason: %s\n",
+ ast_log_dynamic_level(cc_logger_level, "Core %d: State change to %u requested. Reason: %s\n",
args->core_id, args->state, args->debug);
core_instance = args->core_instance;
diff --git a/main/cdr.c b/main/cdr.c
index 1828b0a4c..17fa8a25f 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -3007,7 +3007,7 @@ static int cdr_object_format_property(struct cdr_object *cdr_obj, const char *na
} else if (!strcasecmp(name, "billsec")) {
snprintf(value, length, "%ld", cdr_object_get_billsec(cdr_obj));
} else if (!strcasecmp(name, "disposition")) {
- snprintf(value, length, "%d", cdr_obj->disposition);
+ snprintf(value, length, "%u", cdr_obj->disposition);
} else if (!strcasecmp(name, "amaflags")) {
snprintf(value, length, "%d", party_a->amaflags);
} else if (!strcasecmp(name, "accountcode")) {
@@ -3025,7 +3025,7 @@ static int cdr_object_format_property(struct cdr_object *cdr_obj, const char *na
} else if (!strcasecmp(name, "userfield")) {
ast_copy_string(value, cdr_obj->party_a.userfield, length);
} else if (!strcasecmp(name, "sequence")) {
- snprintf(value, length, "%d", cdr_obj->sequence);
+ snprintf(value, length, "%u", cdr_obj->sequence);
} else {
return 1;
}
@@ -3860,8 +3860,8 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_
ast_cli(a->fd, " Safe shutdown: %s\n", ast_test_flag(&mod_cfg->general->batch_settings.settings, BATCH_MODE_SAFE_SHUTDOWN) ? "Enabled" : "Disabled");
ast_cli(a->fd, " Threading model: %s\n", ast_test_flag(&mod_cfg->general->batch_settings.settings, BATCH_MODE_SCHEDULER_ONLY) ? "Scheduler only" : "Scheduler plus separate threads");
ast_cli(a->fd, " Current batch size: %d record%s\n", cnt, ESS(cnt));
- ast_cli(a->fd, " Maximum batch size: %d record%s\n", mod_cfg->general->batch_settings.size, ESS(mod_cfg->general->batch_settings.size));
- ast_cli(a->fd, " Maximum batch time: %d second%s\n", mod_cfg->general->batch_settings.time, ESS(mod_cfg->general->batch_settings.time));
+ ast_cli(a->fd, " Maximum batch size: %u record%s\n", mod_cfg->general->batch_settings.size, ESS(mod_cfg->general->batch_settings.size));
+ ast_cli(a->fd, " Maximum batch time: %u second%s\n", mod_cfg->general->batch_settings.time, ESS(mod_cfg->general->batch_settings.time));
ast_cli(a->fd, " Next batch processing time: %ld second%s\n\n", nextbatchtime, ESS(nextbatchtime));
}
ast_cli(a->fd, "* Registered Backends\n");
@@ -4093,7 +4093,7 @@ static void cdr_enable_batch_mode(struct ast_cdr_config *config)
/* Kill the currently scheduled item */
AST_SCHED_DEL(sched, cdr_sched);
cdr_sched = ast_sched_add(sched, config->batch_settings.time * 1000, submit_scheduled_batch, NULL);
- ast_log(LOG_NOTICE, "CDR batch mode logging enabled, first of either size %d or time %d seconds.\n",
+ ast_log(LOG_NOTICE, "CDR batch mode logging enabled, first of either size %u or time %u seconds.\n",
config->batch_settings.size, config->batch_settings.time);
}
diff --git a/main/channel.c b/main/channel.c
index 94b0e8b1c..1161fb676 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -738,7 +738,7 @@ const char *ast_state2str(enum ast_channel_state state)
default:
if (!(buf = ast_threadstorage_get(&state2str_threadbuf, STATE2STR_BUFSIZE)))
return "Unknown";
- snprintf(buf, STATE2STR_BUFSIZE, "Unknown (%d)", state);
+ snprintf(buf, STATE2STR_BUFSIZE, "Unknown (%u)", state);
return buf;
}
}
@@ -1198,7 +1198,7 @@ static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, in
if (ast_channel_alert_writable(chan)) {
if (ast_channel_alert_write(chan)) {
- ast_log(LOG_WARNING, "Unable to write to alert pipe on %s (qlen = %d): %s!\n",
+ ast_log(LOG_WARNING, "Unable to write to alert pipe on %s (qlen = %u): %s!\n",
ast_channel_name(chan), queued_frames, strerror(errno));
}
} else if (ast_channel_timingfd(chan) > -1) {
@@ -2838,7 +2838,7 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay)
break;
}
if (ms == 0) {
- ast_debug(2, "Didn't receive a media frame from %s within %d ms of answering. Continuing anyway\n", ast_channel_name(chan), MAX(delay, 500));
+ ast_debug(2, "Didn't receive a media frame from %s within %u ms of answering. Continuing anyway\n", ast_channel_name(chan), MAX(delay, 500));
break;
}
cur = ast_read(chan);
@@ -4075,7 +4075,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
f->len = option_dtmfminduration;
}
if (f->len < option_dtmfminduration && !ast_test_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY)) {
- ast_log(LOG_DTMF, "DTMF end '%c' has duration %ld but want minimum %d, emulating on %s\n", f->subclass.integer, f->len, option_dtmfminduration, ast_channel_name(chan));
+ ast_log(LOG_DTMF, "DTMF end '%c' has duration %ld but want minimum %u, emulating on %s\n", f->subclass.integer, f->len, option_dtmfminduration, ast_channel_name(chan));
ast_set_flag(ast_channel_flags(chan), AST_FLAG_EMULATE_DTMF);
ast_channel_dtmf_digit_to_emulate_set(chan, f->subclass.integer);
ast_channel_emulate_dtmf_duration_set(chan, option_dtmfminduration - f->len);
@@ -4663,14 +4663,14 @@ int ast_indicate_data(struct ast_channel *chan, int _condition,
if (ts) {
/* We have a tone to play, yay. */
- ast_debug(1, "Driver for channel '%s' does not support indication %d, emulating it\n", ast_channel_name(chan), condition);
+ ast_debug(1, "Driver for channel '%s' does not support indication %u, emulating it\n", ast_channel_name(chan), condition);
res = ast_playtones_start(chan, 0, ts->data, 1);
ts = ast_tone_zone_sound_unref(ts);
}
if (res) {
/* not handled */
- ast_log(LOG_WARNING, "Unable to handle indication %d for '%s'\n", condition, ast_channel_name(chan));
+ ast_log(LOG_WARNING, "Unable to handle indication %u for '%s'\n", condition, ast_channel_name(chan));
}
indicate_cleanup:
@@ -6443,7 +6443,7 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
/* Start the masquerade channel contents rearangement. */
ast_channel_lock_both(original, clonechan);
- ast_debug(4, "Actually Masquerading %s(%d) into the structure of %s(%d)\n",
+ ast_debug(4, "Actually Masquerading %s(%u) into the structure of %s(%u)\n",
ast_channel_name(clonechan), ast_channel_state(clonechan), ast_channel_name(original), ast_channel_state(original));
/*
@@ -6746,7 +6746,7 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
pthread_kill(ast_channel_blocker(original), SIGURG);
}
- ast_debug(1, "Done Masquerading %s (%d)\n", ast_channel_name(original), ast_channel_state(original));
+ ast_debug(1, "Done Masquerading %s (%u)\n", ast_channel_name(original), ast_channel_state(original));
ast_channel_unlock(original);
if ((bridged = ast_channel_bridge_peer(original))) {
@@ -10334,7 +10334,7 @@ int ast_channel_suppress(struct ast_channel *chan, unsigned int direction, enum
int framehook_id;
if (!(datastore_info = suppress_get_datastore_information(frametype))) {
- ast_log(LOG_WARNING, "Attempted to suppress an unsupported frame type (%d).\n", frametype);
+ ast_log(LOG_WARNING, "Attempted to suppress an unsupported frame type (%u).\n", frametype);
return -1;
}
@@ -10392,7 +10392,7 @@ int ast_channel_unsuppress(struct ast_channel *chan, unsigned int direction, enu
struct suppress_data *suppress;
if (!(datastore_info = suppress_get_datastore_information(frametype))) {
- ast_log(LOG_WARNING, "Attempted to unsuppress an unsupported frame type (%d).\n", frametype);
+ ast_log(LOG_WARNING, "Attempted to unsuppress an unsupported frame type (%u).\n", frametype);
return -1;
}
diff --git a/main/cli.c b/main/cli.c
index fa5cc987a..0fbdb69f6 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -541,7 +541,7 @@ static char *handle_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args
ast_clear_flag(&ast_options, AST_OPT_FLAG_DEBUG_MODULE);
}
AST_RWLIST_UNLOCK(&debug_modules);
- ast_cli(a->fd, "Core debug was %d and has been set to 0 for '%s'.\n",
+ ast_cli(a->fd, "Core debug was %u and has been set to 0 for '%s'.\n",
ml->level, mod);
ast_free(ml);
return CLI_SUCCESS;
@@ -549,7 +549,7 @@ static char *handle_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args
if (ml) {
if ((atleast && newlevel < ml->level) || ml->level == newlevel) {
- ast_cli(a->fd, "Core debug is still %d for '%s'.\n", ml->level, mod);
+ ast_cli(a->fd, "Core debug is still %u for '%s'.\n", ml->level, mod);
AST_RWLIST_UNLOCK(&debug_modules);
return CLI_SUCCESS;
}
@@ -568,7 +568,7 @@ static char *handle_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args
}
ast_set_flag(&ast_options, AST_OPT_FLAG_DEBUG_MODULE);
- ast_cli(a->fd, "Core debug was %d and has been set to %d for '%s'.\n",
+ ast_cli(a->fd, "Core debug was %d and has been set to %u for '%s'.\n",
oldval, ml->level, ml->module);
AST_RWLIST_UNLOCK(&debug_modules);
@@ -1579,7 +1579,7 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
"Eff. Connected Line ID Name: %s\n"
" DNID Digits: %s\n"
" Language: %s\n"
- " State: %s (%d)\n"
+ " State: %s (%u)\n"
" NativeFormats: %s\n"
" WriteFormat: %s\n"
" ReadFormat: %s\n"
diff --git a/main/config.c b/main/config.c
index 041f1bca2..30817be41 100644
--- a/main/config.c
+++ b/main/config.c
@@ -3086,7 +3086,7 @@ char *ast_realtime_decode_chunk(char *chunk)
char *orig = chunk;
for (; *chunk; chunk++) {
if (*chunk == '^' && strchr("0123456789ABCDEFabcdef", chunk[1]) && strchr("0123456789ABCDEFabcdef", chunk[2])) {
- sscanf(chunk + 1, "%02hhX", chunk);
+ sscanf(chunk + 1, "%02hhX", (unsigned char *)chunk);
memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
}
}
diff --git a/main/config_options.c b/main/config_options.c
index ec45abb4f..a52a9da25 100644
--- a/main/config_options.c
+++ b/main/config_options.c
@@ -326,7 +326,7 @@ int __aco_option_register(struct aco_info *info, const char *name, enum aco_matc
if (!opt->handler && !(opt->handler = ast_config_option_default_handler(opt->type))) {
/* This should never happen */
- ast_log(LOG_ERROR, "No handler provided, and no default handler exists for type %d\n", opt->type);
+ ast_log(LOG_ERROR, "No handler provided, and no default handler exists for type %u\n", opt->type);
ao2_ref(opt, -1);
return -1;
};
@@ -1336,10 +1336,10 @@ static int uint_handler_fn(const struct aco_option *opt, struct ast_variable *va
ast_parse_arg(var->value, flags, field, (unsigned int) opt->args[1], (unsigned int) opt->args[2]);
if (res) {
if (opt->flags & PARSE_RANGE_DEFAULTS) {
- ast_log(LOG_WARNING, "Failed to set %s=%s. Set to %d instead due to range limit (%d, %d)\n", var->name, var->value, *field, (int) opt->args[1], (int) opt->args[2]);
+ ast_log(LOG_WARNING, "Failed to set %s=%s. Set to %u instead due to range limit (%d, %d)\n", var->name, var->value, *field, (int) opt->args[1], (int) opt->args[2]);
res = 0;
} else if (opt->flags & PARSE_DEFAULT) {
- ast_log(LOG_WARNING, "Failed to set %s=%s, Set to default value %d instead.\n", var->name, var->value, *field);
+ ast_log(LOG_WARNING, "Failed to set %s=%s, Set to default value %u instead.\n", var->name, var->value, *field);
res = 0;
}
}
diff --git a/main/core_unreal.c b/main/core_unreal.c
index 51f03eab3..bf6b52732 100644
--- a/main/core_unreal.c
+++ b/main/core_unreal.c
@@ -923,7 +923,7 @@ struct ast_channel *ast_unreal_new_channels(struct ast_unreal_pvt *p,
*/
if (!(owner = ast_channel_alloc(1, semi1_state, NULL, NULL, NULL,
exten, context, &id1, requestor, 0,
- "%s/%s-%08x;1", tech->type, p->name, generated_seqno))) {
+ "%s/%s-%08x;1", tech->type, p->name, (unsigned)generated_seqno))) {
ast_log(LOG_WARNING, "Unable to allocate owner channel structure\n");
return NULL;
}
@@ -962,7 +962,7 @@ struct ast_channel *ast_unreal_new_channels(struct ast_unreal_pvt *p,
if (!(chan = ast_channel_alloc(1, semi2_state, NULL, NULL, NULL,
exten, context, &id2, owner, 0,
- "%s/%s-%08x;2", tech->type, p->name, generated_seqno))) {
+ "%s/%s-%08x;2", tech->type, p->name, (unsigned)generated_seqno))) {
ast_log(LOG_WARNING, "Unable to allocate chan channel structure\n");
ao2_ref(p, -1);
ast_channel_release(owner);
diff --git a/main/data.c b/main/data.c
index af4abd902..092d7aad5 100644
--- a/main/data.c
+++ b/main/data.c
@@ -2115,17 +2115,17 @@ static void data_get_xml_add_child(struct ast_data *parent_data,
ast_xml_set_text(child_xml, node->payload.str);
break;
case AST_DATA_TIMESTAMP:
- snprintf(node_content, sizeof(node_content), "%d",
+ snprintf(node_content, sizeof(node_content), "%u",
node->payload.uint);
ast_xml_set_text(child_xml, node_content);
break;
case AST_DATA_SECONDS:
- snprintf(node_content, sizeof(node_content), "%d",
+ snprintf(node_content, sizeof(node_content), "%u",
node->payload.uint);
ast_xml_set_text(child_xml, node_content);
break;
case AST_DATA_MILLISECONDS:
- snprintf(node_content, sizeof(node_content), "%d",
+ snprintf(node_content, sizeof(node_content), "%u",
node->payload.uint);
ast_xml_set_text(child_xml, node_content);
break;
@@ -2754,17 +2754,17 @@ static void data_result_print_cli_node(int fd, const struct ast_data *node, uint
node->name);
break;
case AST_DATA_TIMESTAMP:
- ast_str_append(&output, 0, "%s%s: %d\n", ast_str_buffer(tabs),
+ ast_str_append(&output, 0, "%s%s: %u\n", ast_str_buffer(tabs),
node->name,
node->payload.uint);
break;
case AST_DATA_SECONDS:
- ast_str_append(&output, 0, "%s%s: %d\n", ast_str_buffer(tabs),
+ ast_str_append(&output, 0, "%s%s: %u\n", ast_str_buffer(tabs),
node->name,
node->payload.uint);
break;
case AST_DATA_MILLISECONDS:
- ast_str_append(&output, 0, "%s%s: %d\n", ast_str_buffer(tabs),
+ ast_str_append(&output, 0, "%s%s: %u\n", ast_str_buffer(tabs),
node->name,
node->payload.uint);
break;
@@ -2815,6 +2815,7 @@ static void data_result_print_cli_node(int fd, const struct ast_data *node, uint
* \param[in] root The root node of the tree.
* \param[in] depth Actual depth.
*/
+
static void __data_result_print_cli(int fd, const struct ast_data *root, uint32_t depth)
{
struct ao2_iterator iter;
diff --git a/main/devicestate.c b/main/devicestate.c
index 839557485..1199e68ab 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -456,7 +456,7 @@ static void do_state_change(const char *device, enum ast_devstate_cache cachable
state = _ast_device_state(device, 0);
- ast_debug(3, "Changing state for %s - state %d (%s)\n", device, state, ast_devstate2str(state));
+ ast_debug(3, "Changing state for %s - state %u (%s)\n", device, state, ast_devstate2str(state));
ast_publish_device_state(device, state, cachable);
}
diff --git a/main/dsp.c b/main/dsp.c
index 6027cd748..747ff28e5 100644
--- a/main/dsp.c
+++ b/main/dsp.c
@@ -1109,7 +1109,7 @@ static int __ast_dsp_call_progress(struct ast_dsp *dsp, short *s, int len)
}
break;
default:
- ast_log(LOG_WARNING, "Can't process in unknown prog mode '%d'\n", dsp->progmode);
+ ast_log(LOG_WARNING, "Can't process in unknown prog mode '%u'\n", dsp->progmode);
}
if (newstate == dsp->tstate) {
dsp->tcount++;
diff --git a/main/enum.c b/main/enum.c
index 7528092e9..e36a9c745 100644
--- a/main/enum.c
+++ b/main/enum.c
@@ -383,7 +383,7 @@ static unsigned int parse_ie(char *data, unsigned int maxdatalen, unsigned char
srclen--;
if (len > srclen) {
- ast_log(LOG_WARNING, "ENUM parsing failed: Wanted %d characters, got %d\n", len, srclen);
+ ast_log(LOG_WARNING, "ENUM parsing failed: Wanted %u characters, got %u\n", len, srclen);
return -1;
}
@@ -661,7 +661,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds
return -1;
}
- ast_debug(2, "num='%s', tech='%s', suffix='%s', options='%s', record=%d\n", number, tech, suffix, options, record);
+ ast_debug(2, "num='%s', tech='%s', suffix='%s', options='%s', record=%u\n", number, tech, suffix, options, record);
/*
We don't need that any more, that "n" preceding the number has been replaced by a flag
diff --git a/main/event.c b/main/event.c
index d183e585e..990f62161 100644
--- a/main/event.c
+++ b/main/event.c
@@ -346,7 +346,7 @@ struct ast_event *ast_event_new(enum ast_event_type type, ...)
/* Invalid type */
if (type >= AST_EVENT_TOTAL) {
ast_log(LOG_WARNING, "Someone tried to create an event of invalid "
- "type '%d'!\n", type);
+ "type '%u'!\n", type);
return NULL;
}
diff --git a/main/file.c b/main/file.c
index 458f25446..df67fbf43 100644
--- a/main/file.c
+++ b/main/file.c
@@ -606,7 +606,7 @@ static int filehelper(const char *filename, const void *arg2, const char *fmt, c
break;
default:
- ast_log(LOG_WARNING, "Unknown helper %d\n", action);
+ ast_log(LOG_WARNING, "Unknown helper %u\n", action);
}
ast_free(fn);
}
diff --git a/main/format.c b/main/format.c
index 9c7b5919a..a41f26b4c 100644
--- a/main/format.c
+++ b/main/format.c
@@ -912,7 +912,7 @@ static char *show_codec_n(struct ast_cli_entry *e, int cmd, struct ast_cli_args
}
if (!found) {
- ast_cli(a->fd, "Codec %d not found\n", format_id);
+ ast_cli(a->fd, "Codec %u not found\n", format_id);
}
f_list = ast_format_list_destroy(f_list);
@@ -1163,7 +1163,7 @@ static int custom_celt_format(struct ast_format_list *entry, unsigned int maxbit
return -1;
}
- snprintf(entry->desc, sizeof(entry->desc), "CELT Custom Format %dkhz", entry->samplespersecond/1000);
+ snprintf(entry->desc, sizeof(entry->desc), "CELT Custom Format %ukhz", entry->samplespersecond/1000);
ast_format_append(&entry->format,
CELT_ATTR_KEY_SAMP_RATE, entry->samplespersecond,
@@ -1216,7 +1216,7 @@ static int custom_silk_format(struct ast_format_list *entry, unsigned int maxbit
AST_FORMAT_ATTR_END);
break;
default:
- ast_log(LOG_WARNING, "Custom SILK format definition '%s' can not support sample rate %d\n", entry->name, entry->samplespersecond);
+ ast_log(LOG_WARNING, "Custom SILK format definition '%s' can not support sample rate %u\n", entry->name, entry->samplespersecond);
return -1;
}
ast_format_append(&entry->format,
@@ -1385,7 +1385,7 @@ int ast_format_attr_reg_interface(const struct ast_format_attr_interface *interf
/* check for duplicates first*/
if ((wrapper = ao2_find(interfaces, &tmp_wrapper, (OBJ_POINTER | OBJ_NOLOCK)))) {
ao2_unlock(interfaces);
- ast_log(LOG_WARNING, "Can not register attribute interface for format id %d, interface already exists.\n", interface->id);
+ ast_log(LOG_WARNING, "Can not register attribute interface for format id %u, interface already exists.\n", interface->id);
ao2_ref(wrapper, -1);
return -1;
}
diff --git a/main/frame.c b/main/frame.c
index 1b13abc69..76ea3f66c 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -757,7 +757,7 @@ void ast_frame_type2str(enum ast_frame_type frame_type, char *ftype, size_t len)
ast_copy_string(ftype, "Video", len);
break;
default:
- snprintf(ftype, len, "Unknown Frametype '%d'", frame_type);
+ snprintf(ftype, len, "Unknown Frametype '%u'", frame_type);
break;
}
}
@@ -798,7 +798,7 @@ void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
ast_frame_subclass2str(f, subclass, sizeof(subclass), moreinfo, sizeof(moreinfo));
if (!ast_strlen_zero(moreinfo))
- ast_verb(-1, "%s [ TYPE: %s (%d) SUBCLASS: %s (%d) '%s' ] [%s]\n",
+ ast_verb(-1, "%s [ TYPE: %s (%u) SUBCLASS: %s (%d) '%s' ] [%s]\n",
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
f->frametype,
@@ -807,7 +807,7 @@ void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
term_color(cmn, moreinfo, COLOR_BRGREEN, COLOR_BLACK, sizeof(cmn)),
term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
else
- ast_verb(-1, "%s [ TYPE: %s (%d) SUBCLASS: %s (%d) ] [%s]\n",
+ ast_verb(-1, "%s [ TYPE: %s (%u) SUBCLASS: %s (%d) ] [%s]\n",
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
f->frametype,
@@ -900,7 +900,7 @@ static int g723_len(unsigned char buf)
return 20;
break;
default:
- ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", type);
+ ast_log(LOG_WARNING, "Badly encoded frame (%u)\n", type);
}
return -1;
}
diff --git a/main/io.c b/main/io.c
index cd15b5b07..cd35995ad 100644
--- a/main/io.c
+++ b/main/io.c
@@ -312,7 +312,7 @@ void ast_io_dump(struct io_context *ioc)
*/
int x;
- ast_debug(1, "Asterisk IO Dump: %d entries, %d max entries\n", ioc->fdcnt, ioc->maxfdcnt);
+ ast_debug(1, "Asterisk IO Dump: %u entries, %u max entries\n", ioc->fdcnt, ioc->maxfdcnt);
ast_debug(1, "================================================\n");
ast_debug(1, "| ID FD Callback Data Events |\n");
ast_debug(1, "+------+------+-----------+-----------+--------+\n");
@@ -322,7 +322,7 @@ void ast_io_dump(struct io_context *ioc)
ioc->fds[x].fd,
ioc->ior[x].callback,
ioc->ior[x].data,
- ioc->fds[x].events);
+ (unsigned)ioc->fds[x].events);
}
ast_debug(1, "================================================\n");
}
diff --git a/main/loader.c b/main/loader.c
index 8c581838f..e40cbf369 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -333,7 +333,7 @@ static int printdigest(const unsigned char *d)
char buf[256]; /* large enough so we don't have to worry */
for (pos = 0, x = 0; x < 16; x++)
- pos += sprintf(buf + pos, " %02x", *d++);
+ pos += sprintf(buf + pos, " %02x", (unsigned)*d++);
ast_debug(1, "Unexpected signature:%s\n", buf);
@@ -802,7 +802,7 @@ static void publish_reload_message(const char *name, enum ast_module_reload_resu
RAII_VAR(struct ast_json *, event_object, NULL, ast_json_unref);
char res_buffer[8];
- snprintf(res_buffer, sizeof(res_buffer), "%d", result);
+ snprintf(res_buffer, sizeof(res_buffer), "%u", result);
event_object = ast_json_pack("{s: s, s: s}",
"Module", S_OR(name, "All"),
"Status", res_buffer);
@@ -1320,7 +1320,7 @@ int load_modules(unsigned int preload_only)
load_count++;
if (load_count)
- ast_log(LOG_NOTICE, "%d modules will be loaded.\n", load_count);
+ ast_log(LOG_NOTICE, "%u modules will be loaded.\n", load_count);
/* first, load only modules that provide global symbols */
if ((res = load_resource_list(&load_order, 1, &modulecount)) < 0) {
diff --git a/main/logger.c b/main/logger.c
index 2f81760f0..2c0f3f4a3 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -248,7 +248,7 @@ static void make_components(struct logchannel *chan)
unsigned int logmask = 0;
char *stringp = ast_strdupa(chan->components);
unsigned int x;
- int verb_level;
+ unsigned int verb_level;
/* Default to using option_verbose as the verbosity level of the logging channel. */
verb_level = -1;
@@ -1153,7 +1153,7 @@ static void ast_log_vsyslog(struct logmsg *msg)
char call_identifier_str[13];
if (msg->callid) {
- snprintf(call_identifier_str, sizeof(call_identifier_str), "[C-%08x]", msg->callid->call_identifier);
+ snprintf(call_identifier_str, sizeof(call_identifier_str), "[C-%08x]", (unsigned)msg->callid->call_identifier);
} else {
call_identifier_str[0] = '\0';
}
@@ -1199,7 +1199,7 @@ static void logger_print_normal(struct logmsg *logmsg)
char call_identifier_str[13];
if (logmsg->callid) {
- snprintf(call_identifier_str, sizeof(call_identifier_str), "[C-%08x]", logmsg->callid->call_identifier);
+ snprintf(call_identifier_str, sizeof(call_identifier_str), "[C-%08x]", (unsigned)logmsg->callid->call_identifier);
} else {
call_identifier_str[0] = '\0';
}
@@ -1438,7 +1438,7 @@ void close_logger(void)
void ast_callid_strnprint(char *buffer, size_t buffer_size, struct ast_callid *callid)
{
- snprintf(buffer, buffer_size, "[C-%08x]", callid->call_identifier);
+ snprintf(buffer, buffer_size, "[C-%08x]", (unsigned)callid->call_identifier);
}
struct ast_callid *ast_create_callid(void)
@@ -2076,7 +2076,7 @@ int ast_logger_register_level(const char *name)
AST_RWLIST_UNLOCK(&logchannels);
- ast_debug(1, "Registered dynamic logger level '%s' with index %d.\n", name, available);
+ ast_debug(1, "Registered dynamic logger level '%s' with index %u.\n", name, available);
update_logchannels();
@@ -2114,7 +2114,7 @@ void ast_logger_unregister_level(const char *name)
levels[x] = NULL;
AST_RWLIST_UNLOCK(&logchannels);
- ast_debug(1, "Unregistered dynamic logger level '%s' with index %d.\n", name, x);
+ ast_debug(1, "Unregistered dynamic logger level '%s' with index %u.\n", name, x);
update_logchannels();
} else {
diff --git a/main/manager.c b/main/manager.c
index 5bcd20f95..cb2b0bbe2 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -2930,7 +2930,7 @@ static int authenticate(struct mansession *s, const struct message *m)
MD5Update(&md5, (unsigned char *) user->secret, strlen(user->secret));
MD5Final(digest, &md5);
for (x = 0; x < 16; x++)
- len += sprintf(md5key + len, "%2.2x", digest[x]);
+ len += sprintf(md5key + len, "%2.2x", (unsigned)digest[x]);
if (!strcmp(md5key, key)) {
error = 0;
} else {
diff --git a/main/manager_bridges.c b/main/manager_bridges.c
index 90281283d..63a927246 100644
--- a/main/manager_bridges.c
+++ b/main/manager_bridges.c
@@ -158,7 +158,7 @@ struct ast_str *ast_manager_build_bridge_state_string_prefix(
"%sBridgeTechnology: %s\r\n"
"%sBridgeCreator: %s\r\n"
"%sBridgeName: %s\r\n"
- "%sBridgeNumChannels: %d\r\n",
+ "%sBridgeNumChannels: %u\r\n",
prefix, snapshot->uniqueid,
prefix, snapshot->subclass,
prefix, snapshot->technology,
diff --git a/main/manager_channels.c b/main/manager_channels.c
index e61f790a6..507e2c9b4 100644
--- a/main/manager_channels.c
+++ b/main/manager_channels.c
@@ -416,7 +416,7 @@ struct ast_str *ast_manager_build_channel_state_string_prefix(
res = ast_str_set(&out, 0,
"%sChannel: %s\r\n"
- "%sChannelState: %d\r\n"
+ "%sChannelState: %u\r\n"
"%sChannelStateDesc: %s\r\n"
"%sCallerIDNum: %s\r\n"
"%sCallerIDName: %s\r\n"
diff --git a/main/netsock.c b/main/netsock.c
index 18bf561f1..cf4c792af 100644
--- a/main/netsock.c
+++ b/main/netsock.c
@@ -211,10 +211,10 @@ char *ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid)
*s = '\0';
} else {
for (x = 0; x < 5; x++) {
- sprintf(s, "%02x:", eid->eid[x]);
+ sprintf(s, "%02x:", (unsigned)eid->eid[x]);
s += 3;
}
- sprintf(s, "%02x", eid->eid[5]);
+ sprintf(s, "%02x", (unsigned)eid->eid[5]);
}
return os;
}
@@ -246,7 +246,7 @@ void ast_set_default_eid(struct ast_eid *eid)
/* Try pciX#[1..N] */
for (i = 0; i < MAXIF; i++) {
memset(&ifr, 0, sizeof(ifr));
- snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "pci%u#%u", x, i);
+ snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "pci%d#%u", x, i);
if (!ioctl(s, SIOCGIFHWADDR, &ifr)) {
break;
}
diff --git a/main/parking.c b/main/parking.c
index f4ed27d61..db274a3ff 100644
--- a/main/parking.c
+++ b/main/parking.c
@@ -200,7 +200,7 @@ int ast_parking_register_bridge_features(struct ast_parking_bridge_feature_fn_ta
if (fn_table->module_version != PARKING_MODULE_VERSION) {
ast_log(AST_LOG_WARNING, "Parking module provided incorrect parking module "
- "version: %d (expected: %d)\n", fn_table->module_version, PARKING_MODULE_VERSION);
+ "version: %u (expected: %d)\n", fn_table->module_version, PARKING_MODULE_VERSION);
return -1;
}
diff --git a/main/pbx.c b/main/pbx.c
index c8421bd83..faddc4774 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -3632,7 +3632,7 @@ const char *ast_str_retrieve_variable(struct ast_str **str, ssize_t maxlen, stru
}
if (s == &not_found) { /* look for more */
if (!strcmp(var, "EPOCH")) {
- ast_str_set(str, maxlen, "%u", (int) time(NULL));
+ ast_str_set(str, maxlen, "%d", (int) time(NULL));
s = ast_str_buffer(*str);
} else if (!strcmp(var, "SYSTEMNAME")) {
s = ast_config_AST_SYSTEM_NAME;
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index e47ab833f..a49a8425e 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -1288,7 +1288,7 @@ char *ast_rtp_instance_get_quality(struct ast_rtp_instance *instance, enum ast_r
/* Now actually fill the buffer with the good information */
if (field == AST_RTP_INSTANCE_STAT_FIELD_QUALITY) {
- snprintf(buf, size, "ssrc=%i;themssrc=%u;lp=%u;rxjitter=%f;rxcount=%u;txjitter=%f;txcount=%u;rlp=%u;rtt=%f",
+ snprintf(buf, size, "ssrc=%u;themssrc=%u;lp=%u;rxjitter=%f;rxcount=%u;txjitter=%f;txcount=%u;rlp=%u;rtt=%f",
stats.local_ssrc, stats.remote_ssrc, stats.rxploss, stats.rxjitter, stats.rxcount, stats.txjitter, stats.txcount, stats.txploss, stats.rtt);
} else if (field == AST_RTP_INSTANCE_STAT_FIELD_QUALITY_JITTER) {
snprintf(buf, size, "minrxjitter=%f;maxrxjitter=%f;avgrxjitter=%f;stdevrxjitter=%f;reported_minjitter=%f;reported_maxjitter=%f;reported_avgjitter=%f;reported_stdevjitter=%f;",
@@ -1796,7 +1796,7 @@ static struct ast_manager_event_blob *rtcp_report_to_ami(struct stasis_message *
ast_str_append(&report_string, 0, "Report%dSourceSSRC: 0x%.8x\r\n",
i, payload->report->report_block[i]->source_ssrc);
- ast_str_append(&report_string, 0, "Report%dFractionLost: %u\r\n",
+ ast_str_append(&report_string, 0, "Report%dFractionLost: %d\r\n",
i, payload->report->report_block[i]->lost_count.fraction);
ast_str_append(&report_string, 0, "Report%dCumulativeLost: %u\r\n",
i, payload->report->report_block[i]->lost_count.packets);
diff --git a/main/sched.c b/main/sched.c
index 4de021432..1debf714b 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -493,7 +493,7 @@ void ast_sched_report(struct ast_sched_context *con, struct ast_str **buf, struc
size_t heap_size;
memset(countlist, 0, sizeof(countlist));
- ast_str_set(buf, 0, " Highwater = %d\n schedcnt = %zd\n", con->highwater, ast_heap_size(con->sched_heap));
+ ast_str_set(buf, 0, " Highwater = %u\n schedcnt = %zu\n", con->highwater, ast_heap_size(con->sched_heap));
ast_mutex_lock(&con->lock);
@@ -530,9 +530,9 @@ void ast_sched_dump(struct ast_sched_context *con)
int x;
size_t heap_size;
#ifdef SCHED_MAX_CACHE
- ast_debug(1, "Asterisk Schedule Dump (%zd in Q, %d Total, %d Cache, %d high-water)\n", ast_heap_size(con->sched_heap), con->eventcnt - 1, con->schedccnt, con->highwater);
+ ast_debug(1, "Asterisk Schedule Dump (%zu in Q, %u Total, %u Cache, %u high-water)\n", ast_heap_size(con->sched_heap), con->eventcnt - 1, con->schedccnt, con->highwater);
#else
- ast_debug(1, "Asterisk Schedule Dump (%zd in Q, %d Total, %d high-water)\n", ast_heap_size(con->sched_heap), con->eventcnt - 1, con->highwater);
+ ast_debug(1, "Asterisk Schedule Dump (%zu in Q, %u Total, %u high-water)\n", ast_heap_size(con->sched_heap), con->eventcnt - 1, con->highwater);
#endif
ast_debug(1, "=============================================================\n");
diff --git a/main/security_events.c b/main/security_events.c
index bd8ed5dba..f4dc6fc6d 100644
--- a/main/security_events.c
+++ b/main/security_events.c
@@ -970,7 +970,7 @@ static int add_json_object(struct ast_json *json, const struct ast_security_even
if (req && !str) {
ast_log(LOG_WARNING, "Required IE '%d' (%s) for security event "
- "type '%d' (%s) not present\n", ie_type->ie_type,
+ "type '%u' (%s) not present\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type),
sec->event_type, ast_security_event_get_name(sec->event_type));
res = -1;
@@ -997,7 +997,7 @@ static int add_json_object(struct ast_json *json, const struct ast_security_even
uint32_t val;
val = *((const uint32_t *)(((const char *) sec) + ie_type->offset));
- json_string = ast_json_stringf("%d", val);
+ json_string = ast_json_stringf("%u", val);
if (!json_string) {
res = -1;
break;
@@ -1016,7 +1016,7 @@ static int add_json_object(struct ast_json *json, const struct ast_security_even
if (req && !addr->addr) {
ast_log(LOG_WARNING, "Required IE '%d' (%s) for security event "
- "type '%d' (%s) not present\n", ie_type->ie_type,
+ "type '%u' (%s) not present\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type),
sec->event_type, ast_security_event_get_name(sec->event_type));
res = -1;
@@ -1036,7 +1036,7 @@ static int add_json_object(struct ast_json *json, const struct ast_security_even
if (req && !tval) {
ast_log(LOG_WARNING, "Required IE '%d' (%s) for security event "
- "type '%d' (%s) not present\n", ie_type->ie_type,
+ "type '%u' (%s) not present\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type),
sec->event_type, ast_security_event_get_name(sec->event_type));
res = -1;
@@ -1087,7 +1087,7 @@ static struct ast_json *alloc_security_event_json_object(const struct ast_securi
return NULL;
}
- json_temp = ast_json_stringf("%d", sec->version);
+ json_temp = ast_json_stringf("%u", sec->version);
if (!json_temp || ast_json_object_set(json_object, ast_event_get_ie_type_name(AST_EVENT_IE_EVENT_VERSION), json_temp)) {
return NULL;
}
diff --git a/main/slinfactory.c b/main/slinfactory.c
index 687a6c02d..44efc420f 100644
--- a/main/slinfactory.c
+++ b/main/slinfactory.c
@@ -91,7 +91,7 @@ int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f)
if (!sf->trans) {
if (!(sf->trans = ast_translator_build_path(&sf->output_format, &f->subclass.format))) {
- ast_log(LOG_WARNING, "Cannot build a path from %s (%d)to %s (%d)\n",
+ ast_log(LOG_WARNING, "Cannot build a path from %s (%u)to %s (%u)\n",
ast_getformatname(&f->subclass.format),
f->subclass.format.id,
ast_getformatname(&sf->output_format),
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index 5ca43b818..b2745d919 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -309,7 +309,7 @@ static void *inotify_daemon(void *data)
/* This read should block, most of the time. */
if ((res = read(inotify_fd, &buf, sizeof(buf))) < sizeof(buf.iev) && res > 0) {
/* This should never happen */
- ast_log(LOG_ERROR, "Inotify read less than a full event (%zd < %zd)?!!\n", res, sizeof(buf.iev));
+ ast_log(LOG_ERROR, "Inotify read less than a full event (%zd < %zu)?!!\n", res, sizeof(buf.iev));
break;
} else if (res < 0) {
if (errno == EINTR || errno == EAGAIN) {
diff --git a/main/stun.c b/main/stun.c
index 3b4d2ad6b..268bbe4de 100644
--- a/main/stun.c
+++ b/main/stun.c
@@ -182,7 +182,7 @@ static int stun_process_attr(struct stun_state *state, struct stun_attr *attr)
{
if (stundebug)
ast_verbose("Found STUN Attribute %s (%04x), length %d\n",
- stun_attr2str(ntohs(attr->attr)), ntohs(attr->attr), ntohs(attr->len));
+ stun_attr2str(ntohs(attr->attr)), (unsigned)ntohs(attr->attr), ntohs(attr->len));
switch (ntohs(attr->attr)) {
case STUN_USERNAME:
state->username = (const char *) (attr->value);
@@ -193,7 +193,7 @@ static int stun_process_attr(struct stun_state *state, struct stun_attr *attr)
default:
if (stundebug)
ast_verbose("Ignoring STUN attribute %s (%04x), length %d\n",
- stun_attr2str(ntohs(attr->attr)), ntohs(attr->attr), ntohs(attr->len));
+ stun_attr2str(ntohs(attr->attr)), (unsigned)ntohs(attr->attr), ntohs(attr->len));
}
return 0;
}
@@ -281,7 +281,7 @@ int ast_stun_handle_packet(int s, struct sockaddr_in *src, unsigned char *data,
data += sizeof(struct stun_header);
x = ntohs(hdr->msglen); /* len as advertised in the message */
if (stundebug)
- ast_verbose("STUN Packet, msg %s (%04x), length: %d\n", stun_msg2str(ntohs(hdr->msgtype)), ntohs(hdr->msgtype), x);
+ ast_verbose("STUN Packet, msg %s (%04x), length: %d\n", stun_msg2str(ntohs(hdr->msgtype)), (unsigned)ntohs(hdr->msgtype), x);
if (x > len) {
ast_debug(1, "Scrambled STUN packet length (got %d, expecting %d)\n", x, (int)len);
} else
@@ -302,7 +302,7 @@ int ast_stun_handle_packet(int s, struct sockaddr_in *src, unsigned char *data,
if (stun_cb)
stun_cb(attr, arg);
if (stun_process_attr(&st, attr)) {
- ast_debug(1, "Failed to handle attribute %s (%04x)\n", stun_attr2str(ntohs(attr->attr)), ntohs(attr->attr));
+ ast_debug(1, "Failed to handle attribute %s (%04x)\n", stun_attr2str(ntohs(attr->attr)), (unsigned)ntohs(attr->attr));
break;
}
/* Clear attribute id: in case previous entry was a string,
@@ -353,7 +353,7 @@ int ast_stun_handle_packet(int s, struct sockaddr_in *src, unsigned char *data,
break;
default:
if (stundebug)
- ast_verbose("Dunno what to do with STUN message %04x (%s)\n", ntohs(hdr->msgtype), stun_msg2str(ntohs(hdr->msgtype)));
+ ast_verbose("Dunno what to do with STUN message %04x (%s)\n", (unsigned)ntohs(hdr->msgtype), stun_msg2str(ntohs(hdr->msgtype)));
}
}
return ret;
diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index ac8df9772..0582f76fa 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -444,7 +444,7 @@ static char *cli_tps_report(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
qsize = p->tps_queue_size;
maxqsize = p->stats->max_qsize;
processed = p->stats->_tasks_processed_count;
- ast_cli(a->fd, "\n%24s %17ld %12ld %12ld", name, processed, qsize, maxqsize);
+ ast_cli(a->fd, "\n%24s %17lu %12lu %12lu", name, processed, qsize, maxqsize);
ao2_ref(p, -1);
}
ao2_iterator_destroy(&i);
diff --git a/main/translate.c b/main/translate.c
index df2754d11..c24700b45 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -533,7 +533,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
frame. */
path->nextout = ast_tvadd(path->nextout, ast_samp2tv(out->samples, ast_format_rate(&out->subclass.format)));
if (f->samples != out->samples && ast_test_flag(out, AST_FRFLAG_HAS_TIMING_INFO)) {
- ast_debug(4, "Sample size different %u vs %u\n", f->samples, out->samples);
+ ast_debug(4, "Sample size different %d vs %d\n", f->samples, out->samples);
ast_clear_flag(out, AST_FRFLAG_HAS_TIMING_INFO);
}
} else {
@@ -770,7 +770,7 @@ static void matrix_rebuild(int samples)
matrix_get(x, z)->table_cost = newtablecost;
matrix_get(x, z)->multistep = 1;
changed++;
- ast_debug(10, "Discovered %d cost path from %s to %s, via %s\n",
+ ast_debug(10, "Discovered %u cost path from %s to %s, via %s\n",
matrix_get(x, z)->table_cost,
ast_getformatname(ast_format_set(&tmpx, index2format(x), 0)),
ast_getformatname(ast_format_set(&tmpy, index2format(z), 0)),
@@ -910,7 +910,7 @@ static char *handle_show_translation_table(struct ast_cli_args *a)
if (x >= 0 && y >= 0 && matrix_get(x, y)->step) {
/* Actual codec output */
- ast_str_append(&out, 0, "%*d", curlen + 1, (matrix_get(x, y)->table_cost/100));
+ ast_str_append(&out, 0, "%*u", curlen + 1, (matrix_get(x, y)->table_cost/100));
} else if (i == -1 && k >= 0) {
/* Top row - use a dynamic size */
ast_str_append(&out, 0, "%*s", curlen + 1, ast_getformatname(&f_list[k].format));
diff --git a/main/udptl.c b/main/udptl.c
index acbb4d78e..c8fee019b 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -365,7 +365,7 @@ static int encode_open_type(const struct ast_udptl *udptl, uint8_t *buf, unsigne
if ((enclen = encode_length(buf, len, num_octets)) < 0)
return -1;
if (enclen + *len > buflen) {
- ast_log(LOG_ERROR, "UDPTL (%s): Buffer overflow detected (%d + %d > %d)\n",
+ ast_log(LOG_ERROR, "UDPTL (%s): Buffer overflow detected (%u + %u > %u)\n",
LOG_TAG(udptl), enclen, *len, buflen);
return -1;
}
@@ -443,7 +443,7 @@ static int udptl_rx_packet(struct ast_udptl *s, uint8_t *buf, unsigned int len)
if (seq_no - i >= s->rx_seq_no) {
/* This one wasn't seen before */
/* Decode the secondary IFP packet */
- ast_debug(3, "Recovering lost packet via secondary %d, len %d\n", seq_no - i, lengths[i - 1]);
+ ast_debug(3, "Recovering lost packet via secondary %d, len %u\n", seq_no - i, lengths[i - 1]);
s->f[ifp_no].frametype = AST_FRAME_MODEM;
s->f[ifp_no].subclass.integer = AST_MODEM_T38;
@@ -1158,7 +1158,7 @@ int ast_udptl_write(struct ast_udptl *s, struct ast_frame *f)
if (len > s->far_max_ifp) {
ast_log(LOG_WARNING,
- "UDPTL (%s): UDPTL asked to send %d bytes of IFP when far end only prepared to accept %d bytes; data loss will occur."
+ "UDPTL (%s): UDPTL asked to send %u bytes of IFP when far end only prepared to accept %d bytes; data loss will occur."
"You may need to override the T38FaxMaxDatagram value for this endpoint in the channel driver configuration.\n",
LOG_TAG(s), len, s->far_max_ifp);
len = s->far_max_ifp;
@@ -1176,7 +1176,7 @@ int ast_udptl_write(struct ast_udptl *s, struct ast_frame *f)
LOG_TAG(s), ast_sockaddr_stringify(&s->them), strerror(errno));
}
if (udptl_debug_test_addr(&s->them)) {
- ast_verb(1, "UDPTL (%s): packet to %s (seq %d, len %d)\n",
+ ast_verb(1, "UDPTL (%s): packet to %s (seq %u, len %u)\n",
LOG_TAG(s), ast_sockaddr_stringify(&s->them), seq, len);
}
}
@@ -1330,7 +1330,7 @@ static int udptl_pre_apply_config(void) {
/* Fix up any global config values that we can handle before replacing the config */
if (cfg->general->use_even_ports && (cfg->general->start & 1)) {
++cfg->general->start;
- ast_log(LOG_NOTICE, "Odd numbered udptlstart specified but use_even_ports enabled. udptlstart is now %d\n", cfg->general->start);
+ ast_log(LOG_NOTICE, "Odd numbered udptlstart specified but use_even_ports enabled. udptlstart is now %u\n", cfg->general->start);
}
if (cfg->general->start > cfg->general->end) {
ast_log(LOG_WARNING, "Unreasonable values for UDPTL start/end ports; defaulting to %s-%s.\n", __stringify(DEFAULT_UDPTLSTART), __stringify(DEFAULT_UDPTLEND));
@@ -1339,7 +1339,7 @@ static int udptl_pre_apply_config(void) {
}
if (cfg->general->use_even_ports && (cfg->general->end & 1)) {
--cfg->general->end;
- ast_log(LOG_NOTICE, "Odd numbered udptlend specified but use_even_ports enabled. udptlend is now %d\n", cfg->general->end);
+ ast_log(LOG_NOTICE, "Odd numbered udptlend specified but use_even_ports enabled. udptlend is now %u\n", cfg->general->end);
}
return 0;
diff --git a/main/utils.c b/main/utils.c
index c3bf5d032..2826a41d5 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -251,7 +251,7 @@ void ast_md5_hash(char *output, const char *input)
MD5Final(digest, &md5);
ptr = output;
for (x = 0; x < 16; x++)
- ptr += sprintf(ptr, "%2.2x", digest[x]);
+ ptr += sprintf(ptr, "%2.2x", (unsigned)digest[x]);
}
/*! \brief Produce 40 char SHA1 hash of value. */
@@ -269,7 +269,7 @@ void ast_sha1_hash(char *output, const char *input)
SHA1Result(&sha, Message_Digest);
ptr = output;
for (x = 0; x < 20; x++)
- ptr += sprintf(ptr, "%2.2x", Message_Digest[x]);
+ ptr += sprintf(ptr, "%2.2x", (unsigned)Message_Digest[x]);
}
/*! \brief Produce a 20 byte SHA1 hash of value. */
@@ -420,7 +420,7 @@ char *ast_uri_encode(const char *string, char *outbuf, int buflen, struct ast_fl
if (out - outbuf >= buflen - 3) {
break;
}
- out += sprintf(out, "%%%02X", (unsigned char) *ptr);
+ out += sprintf(out, "%%%02X", (unsigned) *ptr);
} else {
*out = *ptr; /* Continue copying the string */
out++;
diff --git a/main/xmldoc.c b/main/xmldoc.c
index 7a48c8701..431eb1dd7 100644
--- a/main/xmldoc.c
+++ b/main/xmldoc.c
@@ -2765,7 +2765,7 @@ int ast_xmldoc_load_documentation(void)
globret = glob(xmlpattern, MY_GLOB_FLAGS, NULL, &globbuf);
#endif
- ast_debug(3, "gl_pathc %zd\n", globbuf.gl_pathc);
+ ast_debug(3, "gl_pathc %zu\n", globbuf.gl_pathc);
if (globret == GLOB_NOSPACE) {
ast_log(LOG_WARNING, "XML load failure, glob expansion of pattern '%s' failed: Not enough memory\n", xmlpattern);
ast_free(xmlpattern);