summaryrefslogtreecommitdiff
path: root/main/say.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2012-04-25 08:39:01 +0000
committerOlle Johansson <oej@edvina.net>2012-04-25 08:39:01 +0000
commit228ce5fd747a7c19dd2de34419c54a324e34404c (patch)
treed30abf4559c2150d4f7e64edf1381d32d8092925 /main/say.c
parentdb2b162e8cb9e336f6b9b3b309bcee803f4df129 (diff)
Formatting fixes
Developer guidelines are important. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/say.c')
-rw-r--r--main/say.c52
1 files changed, 34 insertions, 18 deletions
diff --git a/main/say.c b/main/say.c
index 51aa11b09..f4db3e0f0 100644
--- a/main/say.c
+++ b/main/say.c
@@ -423,10 +423,12 @@ static int ast_say_datetime_from_now_he(struct ast_channel *chan, time_t t, cons
static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang)
{
int res;
- if ((res = ast_streamfile(chan, file, lang)))
+ if ((res = ast_streamfile(chan, file, lang))) {
ast_log(LOG_WARNING, "Unable to play message %s\n", file);
- if (!res)
+ }
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
return res;
}
@@ -8047,8 +8049,9 @@ static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char
char* s = 0;
const char* remaining = fn;
- if (!num)
+ if (!num) {
return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
+ }
ast_translate_number_ka(num, fn, 512);
@@ -8064,18 +8067,20 @@ static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char
/* new_string[len + strlen("digits/")] = '\0'; */
if (!ast_streamfile(chan, new_string, language)) {
- if ((audiofd > -1) && (ctrlfd > -1))
+ if ((audiofd > -1) && (ctrlfd > -1)) {
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
- else
+ } else {
res = ast_waitstream(chan, ints);
+ }
}
ast_stopstream(chan);
ast_free(new_string);
remaining = s + 1; /* position just after the found space char. */
- while (*remaining == ' ') /* skip multiple spaces */
+ while (*remaining == ' ') { /* skip multiple spaces */
remaining++;
+ }
}
@@ -8086,10 +8091,11 @@ static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char
sprintf(new_string, "digits/%s", remaining);
if (!ast_streamfile(chan, new_string, language)) {
- if ((audiofd > -1) && (ctrlfd > -1))
+ if ((audiofd > -1) && (ctrlfd > -1)) {
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
- else
+ } else {
res = ast_waitstream(chan, ints);
+ }
}
ast_stopstream(chan);
@@ -8122,14 +8128,16 @@ static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints,
int res = 0;
ast_localtime(&when, &tm, NULL);
- if (!res)
+ if (!res) {
res = ast_say_number(chan, tm.tm_year + 1900, ints, lang, (char *) NULL);
+ }
if (!res) {
snprintf(fn, sizeof(fn), "digits/tslis %d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
if (!res) {
@@ -8142,8 +8150,9 @@ static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints,
if (!res) {
snprintf(fn, sizeof(fn), "digits/mon-%d", tm.tm_mon);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
return res;
@@ -8165,8 +8174,9 @@ static int ast_say_time_ka(struct ast_channel *chan, time_t t, const char *ints,
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char*)NULL);
if (!res) {
res = ast_streamfile(chan, "digits/saati_da", lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
if (tm.tm_min) {
@@ -8175,8 +8185,9 @@ static int ast_say_time_ka(struct ast_channel *chan, time_t t, const char *ints,
if (!res) {
res = ast_streamfile(chan, "digits/tsuti", lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
}
}
@@ -8194,8 +8205,9 @@ static int ast_say_datetime_ka(struct ast_channel *chan, time_t t, const char *i
ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
- if (!res)
+ if (!res) {
ast_say_time(chan, t, ints, lang);
+ }
return res;
}
@@ -8218,13 +8230,15 @@ static int ast_say_datetime_from_now_ka(struct ast_channel *chan, time_t t, cons
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {
/* Day of month and month */
- if (!res)
+ if (!res) {
res = ast_say_number(chan, tm.tm_mday, ints, lang, (char *) NULL);
+ }
if (!res) {
snprintf(fn, sizeof(fn), "digits/mon-%d", tm.tm_mon);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
} else if (daydiff) {
@@ -8232,12 +8246,14 @@ static int ast_say_datetime_from_now_ka(struct ast_channel *chan, time_t t, cons
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
- if (!res)
+ if (!res) {
res = ast_waitstream(chan, ints);
+ }
}
} /* Otherwise, it was today */
- if (!res)
+ if (!res) {
res = ast_say_time(chan, t, ints, lang);
+ }
return res;
}