summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2016-06-28 07:22:24 -0600
committerGeorge Joseph <gjoseph@digium.com>2016-06-28 13:56:38 -0500
commitf3d236ca7fdf8b03106f1e50474ff6a79f3efb20 (patch)
treef274507a2b7b2e10580db46fe87d9b50b6ae0bb9 /main
parent73e2186195b4cd1cc764346b58b209ba1b7223bb (diff)
BuildSystem: Fix a few issues hightlighted by gcc 6.x
gcc 6.1.1 caught a few more issues. Made sure the unit tests still pass for the func_env and stdtime issues. ASTERISK-26157 #close Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e
Diffstat (limited to 'main')
-rw-r--r--main/say.c16
-rw-r--r--main/stdtime/localtime.c11
2 files changed, 15 insertions, 12 deletions
diff --git a/main/say.c b/main/say.c
index 51dc4e23a..f19ed71a1 100644
--- a/main/say.c
+++ b/main/say.c
@@ -5201,13 +5201,14 @@ int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *
case 'I':
case 'l':
/* 12-Hour */
- if (tm.tm_hour == 0)
+ if (tm.tm_hour == 0) {
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
- else if (tm.tm_hour > 12)
+ } else if (tm.tm_hour > 12) {
snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
- else
+ } else {
snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
- res = wait_file(chan, ints, nextmsg, lang);
+ }
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'H':
case 'k':
@@ -5227,11 +5228,12 @@ int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *
case 'P':
case 'p':
/* AM/PM */
- if (tm.tm_hour > 11)
+ if (tm.tm_hour > 11) {
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
- else
+ } else {
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
- res = wait_file(chan, ints, nextmsg, lang);
+ }
+ res = wait_file(chan, ints, nextmsg, lang);
break;
case 'Q':
/* Shorthand for "Today", "Yesterday", or ABdY */
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index 702edbe85..9cdf614d5 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -1849,13 +1849,14 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
*dst_enabled = 0;
/* Find where I can get gmtoff */
i = 0;
- while (sp->ttis[i].tt_isdst)
+ while (sp->ttis[i].tt_isdst) {
if (++i >= sp->typecnt) {
- i = 0;
- break;
+ i = 0;
+ break;
}
- *gmt_off = sp->ttis[i].tt_gmtoff;
- return;
+ }
+ *gmt_off = sp->ttis[i].tt_gmtoff;
+ return;
}
for (i = 1; i < sp->timecnt; ++i) {