aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-08 16:40:28 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-08 16:40:28 +0000
commit0110f8c87a0481038e3673640c387417fb339b4c (patch)
treedf03af827ea95734e2906e4737660d983e3e0b01 /channels/chan_sip.c
parentcdea52a3def39e3b06cb2ef6f0ca88a4c5f710a8 (diff)
Janitor project to convert sizeof to ARRAY_LEN macro.
(closes issue #13002) Reported by: caio1982 Patches: janitor_arraylen5.diff uploaded by caio1982 (license 22) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@129045 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4f71133d2..bdaefc0f2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2630,7 +2630,7 @@ static unsigned int parse_sip_options(struct sip_pvt *pvt, const char *supported
next = ast_skip_blanks(next);
if (sipdebug)
ast_debug(3, "Found SIP option: -%s-\n", next);
- for (i=0; i < (sizeof(sip_options) / sizeof(sip_options[0])); i++) {
+ for (i = 0; i < ARRAY_LEN(sip_options); i++) {
if (!strcasecmp(next, sip_options[i].text)) {
profile |= sip_options[i].id;
found = TRUE;
@@ -5705,9 +5705,10 @@ static const char *find_alias(const char *name, const char *_default)
};
int x;
- for (x=0; x<sizeof(aliases) / sizeof(aliases[0]); x++)
+ for (x = 0; x < ARRAY_LEN(aliases); x++) {
if (!strcasecmp(aliases[x].fullname, name))
return aliases[x].shortname;
+ }
return _default;
}
@@ -13104,7 +13105,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct
ast_cli(fd, " SIP Options : ");
if (peer->sipoptions) {
int lastoption = -1;
- for (x=0 ; (x < (sizeof(sip_options) / sizeof(sip_options[0]))); x++) {
+ for (x = 0 ; x < ARRAY_LEN(sip_options); x++) {
if (sip_options[x].id != lastoption) {
if (peer->sipoptions & sip_options[x].id)
ast_cli(fd, "%s ", sip_options[x].text);
@@ -13965,7 +13966,7 @@ static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_a
ast_cli(a->fd, " SIP Options: ");
if (cur->sipoptions) {
int x;
- for (x=0 ; (x < (sizeof(sip_options) / sizeof(sip_options[0]))); x++) {
+ for (x = 0 ; x < ARRAY_LEN(sip_options); x++) {
if (cur->sipoptions & sip_options[x].id)
ast_cli(a->fd, "%s ", sip_options[x].text);
}