aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-11 18:09:35 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-11 18:09:35 +0000
commit8e222897e657656b5b9af006b50e51812dbed1bb (patch)
treed6654284a45ddbc17f083bedcf5d1055fd08f634 /channels/chan_dahdi.c
parent802d09a41e12f28f64a4f6be443ecf0db251b28d (diff)
Janitor patch to change uses of sizeof to ARRAY_LEN
(closes issue #13054) Reported by: pabelanger Patches: ARRAY_LEN.patch2 uploaded by pabelanger (license 224) Tested by: seanbright git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130129 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index bd68addf1..7fa99a6c0 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -1357,7 +1357,7 @@ static char *alarm2str(int alarm)
static char *event2str(int event)
{
static char buf[256];
- if ((event < (sizeof(events) / sizeof(events[0]))) && (event > -1))
+ if ((event < (ARRAY_LEN(events))) && (event > -1))
return events[event];
sprintf(buf, "Event %d", event); /* safe */
return buf;
@@ -6925,7 +6925,7 @@ static void *ss_thread(void *data)
break;
/* Increment the ringT counter so we can match it against
values in chan_dahdi.conf for distinctive ring */
- if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
+ if (++receivedRingT == ARRAY_LEN(curRingData))
break;
} else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
@@ -7084,7 +7084,7 @@ static void *ss_thread(void *data)
break;
/* Increment the ringT counter so we can match it against
values in chan_dahdi.conf for distinctive ring */
- if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
+ if (++receivedRingT == ARRAY_LEN(curRingData))
break;
} else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
@@ -7145,7 +7145,7 @@ static void *ss_thread(void *data)
break;
/* Increment the ringT counter so we can match it against
values in chan_dahdi.conf for distinctive ring */
- if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
+ if (++receivedRingT == ARRAY_LEN(curRingData))
break;
} else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
@@ -13701,7 +13701,7 @@ static void process_echocancel(struct dahdi_chan_conf *confp, const char *data,
unsigned int param_count;
unsigned int x;
- if (!(param_count = ast_app_separate_args(parse, ',', params, sizeof(params) / sizeof(params[0]))))
+ if (!(param_count = ast_app_separate_args(parse, ',', params, ARRAY_LEN(params)))
return;
memset(&confp->chan.echocancel, 0, sizeof(confp->chan.echocancel));
@@ -14809,7 +14809,7 @@ static int load_module(void)
ast_cli_register_multiple(dahdi_pri_cli, sizeof(dahdi_pri_cli) / sizeof(struct ast_cli_entry));
#endif
#ifdef HAVE_SS7
- ast_cli_register_multiple(dahdi_ss7_cli, sizeof(dahdi_ss7_cli) / sizeof(dahdi_ss7_cli[0]));
+ ast_cli_register_multiple(dahdi_ss7_cli, ARRAY_LEN(dahdi_ss7_cli));
#endif
ast_cli_register_multiple(dahdi_cli, sizeof(dahdi_cli) / sizeof(struct ast_cli_entry));