Fix more dev-mode build issues

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@419129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2014-07-22 13:17:45 +00:00
parent 3ee4ecb045
commit 912f2287e9
11 changed files with 48 additions and 48 deletions

View File

@@ -455,7 +455,7 @@ static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
if (ch) { if (ch) {
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate", manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: %s\r\n" "Channel: %s\r\nChanneltype: %s\r\n"
"CallRef: %d\r\n", ch->name, "OOH323", i->call_reference); "CallRef: %u\r\n", ch->name, "OOH323", i->call_reference);
} }
} else } else
ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
@@ -1111,7 +1111,7 @@ static int ooh323_answer(struct ast_channel *ast)
ast_channel_lock(ast); ast_channel_lock(ast);
if (!p->alertsent) { if (!p->alertsent) {
if (gH323Debug) { if (gH323Debug) {
ast_debug(1, "Sending forced ringback for %s, res = %d\n", ast_debug(1, "Sending forced ringback for %s, res = %u\n",
callToken, ooManualRingback(callToken)); callToken, ooManualRingback(callToken));
} else { } else {
ooManualRingback(callToken); ooManualRingback(callToken);
@@ -1166,7 +1166,7 @@ static int ooh323_write(struct ast_channel *ast, struct ast_frame *f)
p->lastrtptx = time(NULL); p->lastrtptx = time(NULL);
if (f->frametype == AST_FRAME_MODEM) { if (f->frametype == AST_FRAME_MODEM) {
ast_debug(1, "Send UDPTL %d/%d len %d for %s\n", ast_debug(1, "Send UDPTL %u/%d len %d for %s\n",
f->frametype, f->subclass.integer, f->datalen, ast->name); f->frametype, f->subclass.integer, f->datalen, ast->name);
if (p->udptl) if (p->udptl)
res = ast_udptl_write(p->udptl, f); res = ast_udptl_write(p->udptl, f);
@@ -1211,7 +1211,7 @@ static int ooh323_write(struct ast_channel *ast, struct ast_frame *f)
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
return 0; return 0;
} else { } else {
ast_log(LOG_WARNING, "Can't send %d type frames with OOH323 write\n", ast_log(LOG_WARNING, "Can't send %u type frames with OOH323 write\n",
f->frametype); f->frametype);
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
return 0; return 0;
@@ -1270,7 +1270,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
if (ast->_state != AST_STATE_UP) { if (ast->_state != AST_STATE_UP) {
if (!p->progsent) { if (!p->progsent) {
if (gH323Debug) if (gH323Debug)
ast_log(LOG_DEBUG,"Sending manual progress for %s, res = %d\n", callToken, ast_log(LOG_DEBUG,"Sending manual progress for %s, res = %u\n", callToken,
ooManualProgress(callToken)); ooManualProgress(callToken));
else else
ooManualProgress(callToken); ooManualProgress(callToken);
@@ -1282,7 +1282,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) { if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
if (!p->alertsent) { if (!p->alertsent) {
if (gH323Debug) { if (gH323Debug) {
ast_debug(1, "Sending manual ringback for %s, res = %d\n", ast_debug(1, "Sending manual ringback for %s, res = %u\n",
callToken, callToken,
ooManualRingback(callToken)); ooManualRingback(callToken));
} else { } else {
@@ -2087,7 +2087,7 @@ int onCallEstablished(ooCallData *call)
ast_queue_control(c, AST_CONTROL_ANSWER); ast_queue_control(c, AST_CONTROL_ANSWER);
ast_channel_unlock(p->owner); ast_channel_unlock(p->owner);
manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n" manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n"
"CallRef: %d\r\n", c->name, "OOH323", p->call_reference); "CallRef: %u\r\n", c->name, "OOH323", p->call_reference);
} }
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
@@ -2916,7 +2916,7 @@ static char *handle_cli_ooh323_show_peer(struct ast_cli_entry *e, int cmd, struc
ast_cli(a->fd, "%-15.15s%s\n", "AMA flags: ", ast_cli(a->fd, "%-15.15s%s\n", "AMA flags: ",
ast_cdr_flags2str(peer->amaflags)); ast_cdr_flags2str(peer->amaflags));
ast_cli(a->fd, "%-15.15s%s\n", "IP:Port: ", ip_port); ast_cli(a->fd, "%-15.15s%s\n", "IP:Port: ", ip_port);
ast_cli(a->fd, "%-15.15s%d\n", "OutgoingLimit: ", peer->outgoinglimit); ast_cli(a->fd, "%-15.15s%u\n", "OutgoingLimit: ", peer->outgoinglimit);
ast_cli(a->fd, "%-15.15s%d\n", "rtptimeout: ", peer->rtptimeout); ast_cli(a->fd, "%-15.15s%d\n", "rtptimeout: ", peer->rtptimeout);
if (peer->rtpmaskstr[0]) if (peer->rtpmaskstr[0])
ast_cli(a->fd, "%-15.15s%s\n", "rtpmask: ", peer->rtpmaskstr); ast_cli(a->fd, "%-15.15s%s\n", "rtpmask: ", peer->rtpmaskstr);
@@ -3062,7 +3062,7 @@ static char *handle_cli_ooh323_show_user(struct ast_cli_entry *e, int cmd, struc
ast_cdr_flags2str(user->amaflags)); ast_cdr_flags2str(user->amaflags));
ast_cli(a->fd, "%-15.15s%s\n", "Context: ", user->context); ast_cli(a->fd, "%-15.15s%s\n", "Context: ", user->context);
ast_cli(a->fd, "%-15.15s%d\n", "IncomingLimit: ", user->incominglimit); ast_cli(a->fd, "%-15.15s%d\n", "IncomingLimit: ", user->incominglimit);
ast_cli(a->fd, "%-15.15s%d\n", "InUse: ", user->inUse); ast_cli(a->fd, "%-15.15s%u\n", "InUse: ", user->inUse);
ast_cli(a->fd, "%-15.15s%d\n", "rtptimeout: ", user->rtptimeout); ast_cli(a->fd, "%-15.15s%d\n", "rtptimeout: ", user->rtptimeout);
if (user->rtpmaskstr[0]) if (user->rtpmaskstr[0])
ast_cli(a->fd, "%-15.15s%s\n", "rtpmask: ", user->rtpmaskstr); ast_cli(a->fd, "%-15.15s%s\n", "rtpmask: ", user->rtpmaskstr);
@@ -4319,7 +4319,7 @@ struct ast_frame *ooh323_rtp_read(struct ast_channel *ast, struct ooh323_pvt *p)
break; break;
case 5: case 5:
f = ast_udptl_read(p->udptl); /* UDPTL t.38 data */ f = ast_udptl_read(p->udptl); /* UDPTL t.38 data */
if (gH323Debug) ast_debug(1, "Got UDPTL %d/%d len %d for %s\n", if (gH323Debug) ast_debug(1, "Got UDPTL %u/%d len %d for %s\n",
f->frametype, f->subclass.integer, f->datalen, ast->name); f->frametype, f->subclass.integer, f->datalen, ast->name);
p->lastrtprx = time(NULL); p->lastrtprx = time(NULL);
break; break;

View File

@@ -425,7 +425,7 @@ int decodeDynBitString (OOCTXT* pctxt, ASN1DynBitStr* pBitStr)
if (pctxt->flags & ASN1FASTCOPY) { if (pctxt->flags & ASN1FASTCOPY) {
/* check is it possible to do optimized decoding */ /* check is it possible to do optimized decoding */
ASN1OCTET bit; ASN1OCTET bit = 0;
ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */ ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */
ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */ ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */
@@ -499,7 +499,7 @@ int decodeDynOctetString (OOCTXT* pctxt, ASN1DynOctStr* pOctStr)
if (pctxt->flags & ASN1FASTCOPY) { if (pctxt->flags & ASN1FASTCOPY) {
/* check if it is possible to do optimized decoding */ /* check if it is possible to do optimized decoding */
ASN1OCTET bit; ASN1OCTET bit = 0;
ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */ ASN1UINT byteIndex = pctxt->buffer.byteIndex; /* save byte index */
ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */ ASN1USINT bitOffset = pctxt->buffer.bitOffset; /* save bit offset */

View File

@@ -317,7 +317,7 @@ char* ooQ931GetMessageTypeName(int messageType, char* buf) {
strcpy(buf, "Escape"); strcpy(buf, "Escape");
break; break;
default: default:
sprintf(buf, "<%u>", messageType); sprintf(buf, "<%d>", messageType);
} }
return buf; return buf;
} }
@@ -358,7 +358,7 @@ char* ooQ931GetIEName(int number, char* buf) {
strcpy(buf, "User-User"); strcpy(buf, "User-User");
break; break;
default: default:
sprintf(buf, "0x%02x", number); sprintf(buf, "0x%02x", (unsigned)number);
} }
return buf; return buf;
} }
@@ -369,8 +369,8 @@ EXTERN void ooQ931Print (const Q931Message* q931msg) {
unsigned int i; unsigned int i;
printf("Q.931 Message:\n"); printf("Q.931 Message:\n");
printf(" protocolDiscriminator: %i\n", q931msg->protocolDiscriminator); printf(" protocolDiscriminator: %u\n", q931msg->protocolDiscriminator);
printf(" callReference: %i\n", q931msg->callReference); printf(" callReference: %u\n", q931msg->callReference);
printf(" from: %s\n", (q931msg->fromDestination ? printf(" from: %s\n", (q931msg->fromDestination ?
"destination" : "originator")); "destination" : "originator"));
printf(" messageType: %s (0x%X)\n\n", printf(" messageType: %s (0x%X)\n\n",
@@ -380,9 +380,9 @@ EXTERN void ooQ931Print (const Q931Message* q931msg) {
for(i = 0, curNode = q931msg->ies.head; i < q931msg->ies.count; i++) { for(i = 0, curNode = q931msg->ies.head; i < q931msg->ies.count; i++) {
Q931InformationElement *ie = (Q931InformationElement*) curNode->data; Q931InformationElement *ie = (Q931InformationElement*) curNode->data;
int length = (ie->length >= 0) ? ie->length : -ie->length; int length = (ie->length >= 0) ? ie->length : -ie->length;
printf(" IE[%i] (offset 0x%X):\n", i, ie->offset); printf(" IE[%u] (offset 0x%X):\n", i, (unsigned)ie->offset);
printf(" discriminator: %s (0x%X)\n", printf(" discriminator: %s (0x%X)\n",
ooQ931GetIEName(ie->discriminator, buf), ie->discriminator); ooQ931GetIEName(ie->discriminator, buf), (unsigned)ie->discriminator);
printf(" data length: %i\n", length); printf(" data length: %i\n", length);
curNode = curNode->next; curNode = curNode->next;

View File

@@ -268,7 +268,7 @@ static const char* octStrToString
if (bufsiz > 1) buffer[1] = '\0'; if (bufsiz > 1) buffer[1] = '\0';
for (i = 0; i < numocts; i++) { for (i = 0; i < numocts; i++) {
if (i < bufsiz - 1) { if (i < bufsiz - 1) {
sprintf (lbuf, "%02x", data[i]); sprintf (lbuf, "%02x", (unsigned)data[i]);
strcat (&buffer[(i*2)+1], lbuf); strcat (&buffer[(i*2)+1], lbuf);
} }
else break; else break;

View File

@@ -2825,7 +2825,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
if (ast_test_flag64(confflags, CONFFLAG_DURATION_STOP) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_STOP])) { if (ast_test_flag64(confflags, CONFFLAG_DURATION_STOP) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_STOP])) {
calldurationlimit = atoi(optargs[OPT_ARG_DURATION_STOP]); calldurationlimit = atoi(optargs[OPT_ARG_DURATION_STOP]);
ast_verb(3, "Setting call duration limit to %d seconds.\n", calldurationlimit); ast_verb(3, "Setting call duration limit to %u seconds.\n", calldurationlimit);
} }
if (ast_test_flag64(confflags, CONFFLAG_DURATION_LIMIT) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_LIMIT])) { if (ast_test_flag64(confflags, CONFFLAG_DURATION_LIMIT) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_LIMIT])) {
@@ -3863,12 +3863,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
break; break;
default: default:
ast_debug(1, ast_debug(1,
"Got ignored control frame on channel %s, f->frametype=%d,f->subclass=%d\n", "Got ignored control frame on channel %s, f->frametype=%u,f->subclass=%d\n",
chan->name, f->frametype, f->subclass.integer); chan->name, f->frametype, f->subclass.integer);
} }
} else { } else {
ast_debug(1, ast_debug(1,
"Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n", "Got unrecognized frame on channel %s, f->frametype=%u,f->subclass=%d\n",
chan->name, f->frametype, f->subclass.integer); chan->name, f->frametype, f->subclass.integer);
} }
ast_frfree(f); ast_frfree(f);
@@ -6639,7 +6639,7 @@ static int sla_station_exec(struct ast_channel *chan, const char *data)
ast_cond_destroy(&cond); ast_cond_destroy(&cond);
ast_autoservice_stop(chan); ast_autoservice_stop(chan);
if (!trunk_ref->trunk->chan) { if (!trunk_ref->trunk->chan) {
ast_debug(1, "Trunk didn't get created. chan: %lx\n", (long) trunk_ref->trunk->chan); ast_debug(1, "Trunk didn't get created. chan: %lx\n", (unsigned long) trunk_ref->trunk->chan);
pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "CONGESTION"); pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "CONGESTION");
sla_change_trunk_state(trunk_ref->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL); sla_change_trunk_state(trunk_ref->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL);
trunk_ref->chan = NULL; trunk_ref->chan = NULL;

View File

@@ -411,7 +411,7 @@ AST_TEST_DEFINE(aoc_encode_decode_test)
if (!(unit = ast_aoc_get_unit_info(decoded, i)) || if (!(unit = ast_aoc_get_unit_info(decoded, i)) ||
((unit->valid_amount) && (unit->amount != (i+1))) || ((unit->valid_amount) && (unit->amount != (i+1))) ||
((unit->valid_type) && (unit->type != (i+2)))) { ((unit->valid_type) && (unit->type != (i+2)))) {
ast_test_status_update(test, "TEST 2, invalid unit entry result, got %d,%d, expected %d,%d\n", ast_test_status_update(test, "TEST 2, invalid unit entry result, got %u,%u, expected %d,%d\n",
unit->amount, unit->amount,
unit->type, unit->type,
i+1, i+1,

View File

@@ -139,7 +139,7 @@ static int astobj2_test_helper(int use_hash, int use_cmp, unsigned int lim, stru
} }
} }
ast_test_status_update(test, "Container created: random bucket size %d: number of items: %d\n", bucket_size, lim); ast_test_status_update(test, "Container created: random bucket size %d: number of items: %u\n", bucket_size, lim);
/* Testing ao2_find with no flags */ /* Testing ao2_find with no flags */
num = 100; num = 100;

View File

@@ -82,7 +82,7 @@ static char *ht_new(int i)
if (keybuf == NULL) { if (keybuf == NULL) {
return NULL; return NULL;
} }
needed = snprintf(keybuf, buflen, "key%08x", i); needed = snprintf(keybuf, buflen, "key%08x", (unsigned)i);
ast_atomic_fetchadd_int(&alloc_count, 1); ast_atomic_fetchadd_int(&alloc_count, 1);
ast_assert(needed + 1 <= buflen); ast_assert(needed + 1 <= buflen);
return keybuf; return keybuf;

View File

@@ -66,7 +66,7 @@ static int check_event(struct ast_event *event, struct ast_test *test,
/* Check #1: Ensure event type is set properly. */ /* Check #1: Ensure event type is set properly. */
type = ast_event_get_type(event); type = ast_event_get_type(event);
if (ast_event_get_type(event) != type) { if (ast_event_get_type(event) != type) {
ast_test_status_update(test, "Expected event type: '%d', got '%d'\n", ast_test_status_update(test, "Expected event type: '%u', got '%u'\n",
expected_type, type); expected_type, type);
return -1; return -1;
} }
@@ -349,7 +349,7 @@ AST_TEST_DEFINE(event_sub_test)
sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM, sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "CUSTOM subscriptions should not exist! (%d)\n", ast_test_status_update(test, "CUSTOM subscriptions should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -382,7 +382,7 @@ AST_TEST_DEFINE(event_sub_test)
sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM, sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_EXISTS) { if (sub_res != AST_EVENT_SUB_EXISTS) {
ast_test_status_update(test, "A CUSTOM subscription should exist! (%d)\n", ast_test_status_update(test, "A CUSTOM subscription should exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -629,7 +629,7 @@ AST_TEST_DEFINE(event_sub_test)
AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, "Money", AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, "Money",
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "Str Money subscription should not exist! (%d)\n", ast_test_status_update(test, "Str Money subscription should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -647,7 +647,7 @@ AST_TEST_DEFINE(event_sub_test)
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_RAW, "FOO/bar", sizeof("FOO/bar") - 1, AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_RAW, "FOO/bar", sizeof("FOO/bar") - 1,
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "Raw FOO/bar-1 subscription should not exist! (%d)\n", ast_test_status_update(test, "Raw FOO/bar-1 subscription should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -656,7 +656,7 @@ AST_TEST_DEFINE(event_sub_test)
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_RAW, "Monkeys", sizeof("Monkeys"), AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_RAW, "Monkeys", sizeof("Monkeys"),
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "Raw Monkeys subscription should not exist! (%d)\n", ast_test_status_update(test, "Raw Monkeys subscription should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -674,7 +674,7 @@ AST_TEST_DEFINE(event_sub_test)
AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, 1, AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, 1,
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "UINT=1 subscription should not exist! (%d)\n", ast_test_status_update(test, "UINT=1 subscription should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -692,7 +692,7 @@ AST_TEST_DEFINE(event_sub_test)
AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_BITFLAGS, 8, AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_BITFLAGS, 8,
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "BITFLAGS=8 subscription should not exist! (%d)\n", ast_test_status_update(test, "BITFLAGS=8 subscription should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }
@@ -711,7 +711,7 @@ AST_TEST_DEFINE(event_sub_test)
AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, 4, AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, 4,
AST_EVENT_IE_END); AST_EVENT_IE_END);
if (sub_res != AST_EVENT_SUB_NONE) { if (sub_res != AST_EVENT_SUB_NONE) {
ast_test_status_update(test, "EXISTS subscription should not exist! (%d)\n", ast_test_status_update(test, "EXISTS subscription should not exist! (%u)\n",
sub_res); sub_res);
res = AST_TEST_FAIL; res = AST_TEST_FAIL;
} }

View File

@@ -73,7 +73,7 @@ static char *ht_new(int i)
if (keybuf == NULL) { if (keybuf == NULL) {
return NULL; return NULL;
} }
needed = snprintf(keybuf, buflen, "key%08x", i); needed = snprintf(keybuf, buflen, "key%08x", (unsigned)i);
ast_assert(needed + 1 <= buflen); ast_assert(needed + 1 <= buflen);
return keybuf; return keybuf;
} }

View File

@@ -55,12 +55,12 @@ static void output_tests(struct test *tests, size_t num_tests, int fd)
unsigned int x; unsigned int x;
for (x = 0; x < num_tests; x++) { for (x = 0; x < num_tests; x++) {
ast_cli(fd, "Test %d: %s\n", x + 1, tests[x].name); ast_cli(fd, "Test %u: %s\n", x + 1, tests[x].name);
ast_cli(fd, "\tExpected Successes: %d\n", tests[x].x_success); ast_cli(fd, "\tExpected Successes: %u\n", tests[x].x_success);
ast_cli(fd, "\tExpected Failures: %d\n", tests[x].x_failure); ast_cli(fd, "\tExpected Failures: %u\n", tests[x].x_failure);
ast_cli(fd, "\tUnexpected Successes: %d\n", tests[x].u_success); ast_cli(fd, "\tUnexpected Successes: %u\n", tests[x].u_success);
ast_cli(fd, "\tUnexpected Failures: %d\n", tests[x].u_failure); ast_cli(fd, "\tUnexpected Failures: %u\n", tests[x].u_failure);
ast_cli(fd, "Test %d Result: %s\n", x + 1, (tests[x].u_success + tests[x].u_failure) ? "FAIL" : "PASS"); ast_cli(fd, "Test %u Result: %s\n", x + 1, (tests[x].u_success + tests[x].u_failure) ? "FAIL" : "PASS");
} }
} }
@@ -88,11 +88,11 @@ static char *handle_cli_dynamic_level_test(struct ast_cli_entry *e, int cmd, str
} }
for (test = 0; test < ARRAY_LEN(tests); test++) { for (test = 0; test < ARRAY_LEN(tests); test++) {
ast_cli(a->fd, "Test %d: %s.\n", test + 1, tests[test].name); ast_cli(a->fd, "Test %u: %s.\n", test + 1, tests[test].name);
switch (test) { switch (test) {
case 0: case 0:
if ((level = ast_logger_register_level("test")) != -1) { if ((level = ast_logger_register_level("test")) != -1) {
ast_cli(a->fd, "Test: got level %d\n", level); ast_cli(a->fd, "Test: got level %u\n", level);
ast_log_dynamic_level(level, "Logger Dynamic Test: Test 1\n"); ast_log_dynamic_level(level, "Logger Dynamic Test: Test 1\n");
ast_logger_unregister_level("test"); ast_logger_unregister_level("test");
tests[test].x_success++; tests[test].x_success++;
@@ -106,7 +106,7 @@ static char *handle_cli_dynamic_level_test(struct ast_cli_entry *e, int cmd, str
char level_name[18][8]; char level_name[18][8];
for (x = 0; x < ARRAY_LEN(level_name); x++) { for (x = 0; x < ARRAY_LEN(level_name); x++) {
sprintf(level_name[x], "level%02d", x); sprintf(level_name[x], "level%02u", x);
if ((level = ast_logger_register_level(level_name[x])) == -1) { if ((level = ast_logger_register_level(level_name[x])) == -1) {
if (x < 16) { if (x < 16) {
tests[test].u_failure++; tests[test].u_failure++;
@@ -115,7 +115,7 @@ static char *handle_cli_dynamic_level_test(struct ast_cli_entry *e, int cmd, str
} }
level_name[x][0] = '\0'; level_name[x][0] = '\0';
} else { } else {
ast_cli(a->fd, "Test: registered '%s', got level %d\n", level_name[x], level); ast_cli(a->fd, "Test: registered '%s', got level %u\n", level_name[x], level);
if (x < 16) { if (x < 16) {
tests[test].x_success++; tests[test].x_success++;
} else { } else {
@@ -159,7 +159,7 @@ static char *handle_cli_performance_test(struct ast_cli_entry *e, int cmd, struc
} }
for (test = 0; test < ARRAY_LEN(tests); test++) { for (test = 0; test < ARRAY_LEN(tests); test++) {
ast_cli(a->fd, "Test %d: %s.\n", test + 1, tests[test].name); ast_cli(a->fd, "Test %u: %s.\n", test + 1, tests[test].name);
switch (test) { switch (test) {
case 0: case 0:
if ((level = ast_logger_register_level("perftest")) != -1) { if ((level = ast_logger_register_level("perftest")) != -1) {
@@ -167,7 +167,7 @@ static char *handle_cli_performance_test(struct ast_cli_entry *e, int cmd, struc
struct timeval start, end; struct timeval start, end;
int elapsed; int elapsed;
ast_cli(a->fd, "Test: got level %d\n", level); ast_cli(a->fd, "Test: got level %u\n", level);
start = ast_tvnow(); start = ast_tvnow();
for (x = 0; x < 10000; x++) { for (x = 0; x < 10000; x++) {
ast_log_dynamic_level(level, "Performance test log message\n"); ast_log_dynamic_level(level, "Performance test log message\n");