Formatting fixes
authorOlle Johansson <oej@edvina.net>
Wed, 25 Apr 2012 08:39:01 +0000 (08:39 +0000)
committerOlle Johansson <oej@edvina.net>
Wed, 25 Apr 2012 08:39:01 +0000 (08:39 +0000)
Developer guidelines are important.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363517 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/say.c

index 51aa11b..f4db3e0 100644 (file)
@@ -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;
 }