diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-28 04:43:14 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-28 04:43:14 +0000 |
commit | 26d254366af2e05c83c9ea8f1afe78fb1417c40e (patch) | |
tree | 05155fe8ec16fe7d62770cbf00b88832cbfef1c2 /main/channel.c | |
parent | 9d47f3e5f7ad90750ad83fb9ccaebc3d06ac0444 (diff) |
Make a couple more uses of ARRAY_LEN, and convert some spaces to tabs
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100533 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/main/channel.c b/main/channel.c index cfd041819..3553a3f1b 100644 --- a/main/channel.c +++ b/main/channel.c @@ -481,7 +481,7 @@ const char *ast_cause2str(int cause) { int x; - for (x=0; x < sizeof(causes) / sizeof(causes[0]); x++) { + for (x = 0; x < ARRAY_LEN(causes); x++) { if (causes[x].cause == cause) return causes[x].desc; } @@ -494,8 +494,8 @@ int ast_str2cause(const char *name) { int x; - for (x = 0; x < sizeof(causes) / sizeof(causes[0]); x++) - if (strncasecmp(causes[x].name, name, strlen(causes[x].name)) == 0) + for (x = 0; x < ARRAY_LEN(causes); x++) + if (!strncasecmp(causes[x].name, name, strlen(causes[x].name))) return causes[x].cause; return -1; @@ -4806,44 +4806,45 @@ int ast_channel_trylock(struct ast_channel *chan) int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options) { - return ast_say_number_full(chan, num, ints, language, options, -1, -1); + return ast_say_number_full(chan, num, ints, language, options, -1, -1); } int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options) { - return ast_say_enumeration_full(chan, num, ints, language, options, -1, -1); + return ast_say_enumeration_full(chan, num, ints, language, options, -1, -1); } int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang) { - return ast_say_digits_full(chan, num, ints, lang, -1, -1); + return ast_say_digits_full(chan, num, ints, lang, -1, -1); } int ast_say_digit_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang) { - return ast_say_digit_str_full(chan, str, ints, lang, -1, -1); + return ast_say_digit_str_full(chan, str, ints, lang, -1, -1); } int ast_say_character_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang) { - return ast_say_character_str_full(chan, str, ints, lang, -1, -1); + return ast_say_character_str_full(chan, str, ints, lang, -1, -1); } int ast_say_phonetic_str(struct ast_channel *chan, const char *str, const char *ints, const char *lang) { - return ast_say_phonetic_str_full(chan, str, ints, lang, -1, -1); + return ast_say_phonetic_str_full(chan, str, ints, lang, -1, -1); } int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd) { - char buf[256]; + char buf[256]; - snprintf(buf, sizeof(buf), "%d", num); - return ast_say_digit_str_full(chan, buf, ints, lang, audiofd, ctrlfd); + snprintf(buf, sizeof(buf), "%d", num); + + return ast_say_digit_str_full(chan, buf, ints, lang, audiofd, ctrlfd); } |