]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
BuildSystem: Fix a few issues hightlighted by gcc 6.x 60/3260/2
authorGeorge Joseph <gjoseph@digium.com>
Tue, 28 Jun 2016 13:22:24 +0000 (07:22 -0600)
committerJoshua Colp <jcolp@digium.com>
Thu, 21 Jul 2016 12:33:37 +0000 (07:33 -0500)
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
(cherry picked from commit 95d8b057602e35f2469f7c1d568677b29178ccdf)

channels/chan_agent.c
channels/chan_motif.c
funcs/func_env.c
main/say.c
main/stdtime/localtime.c

index b9047fe63e0dc3493041fc06c5285172f11de0e1..a8e84e72102255f67b3169724ce6d1d339f2f907 100644 (file)
@@ -212,7 +212,6 @@ static char moh[80] = "default";
 #define AST_MAX_BUF    256
 #define AST_MAX_FILENAME_LEN   256
 
-static const char pa_family[] = "Agents";          /*!< Persistent Agents astdb family */
 #define PA_MAX_LEN 2048                             /*!< The maximum length of each persistent member agent database entry */
 
 #define DEFAULT_ACCEPTDTMF '#'
@@ -1858,11 +1857,6 @@ static char *agents_show_online(struct ast_cli_entry *e, int cmd, struct ast_cli
        return CLI_SUCCESS;
 }
 
-static const char agent_logoff_usage[] =
-"Usage: agent logoff <channel> [soft]\n"
-"       Sets an agent as no longer logged in.\n"
-"       If 'soft' is specified, do not hangup existing calls.\n";
-
 static struct ast_cli_entry cli_agents[] = {
        AST_CLI_DEFINE(agents_show, "Show status of agents"),
        AST_CLI_DEFINE(agents_show_online, "Show all online agents"),
index 751e33a23d05051882f2f95fedc92727d5798faa..e51c82a40e076d31886dca64a83da937854a04c8 100644 (file)
@@ -173,7 +173,6 @@ struct jingle_session {
        struct ast_callid *callid;            /*!< Bound session call-id */
 };
 
-static const char desc[] = "Motif Jingle Channel";
 static const char channel_type[] = "Motif";
 
 struct jingle_config {
index a2f7c2bd25341e17a46a05ffda04abbfb923b013..81b81d1a55a42ac88d755aa8b800c161649e10f6 100644 (file)
@@ -624,7 +624,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru
                                ast_log(LOG_ERROR, "Cannot seek to offset %" PRId64 ": %s\n", i, strerror(errno));
                        }
                        end = fread(fbuf, 1, sizeof(fbuf), ff);
-                       for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos > fbuf - 1; pos--) {
+                       for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos >= fbuf; pos--) {
                                LINE_COUNTER(pos, format, count);
 
                                if (length < 0 && count * -1 == length) {
@@ -1024,7 +1024,7 @@ static int file_write(struct ast_channel *chan, const char *cmd, char *data, con
                                                fclose(ff);
                                                return -1;
                                        }
-                                       for (pos = fbuf + sizeof(fbuf) - 1; pos > fbuf - 1; pos--) {
+                                       for (pos = fbuf + sizeof(fbuf) - 1; pos >= fbuf; pos--) {
                                                LINE_COUNTER(pos, newline_format, count);
 
                                                if (length < 0 && count * -1 == length) {
index 295d4110f4639997620f536edc9069d3e49ed348..819ad3103eedeb17ae2f17d2e5152c88bc5da395 100644 (file)
@@ -5159,13 +5159,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':
@@ -5185,11 +5186,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 */
index f7b4bd0050186d3c3784fa38d5846bc909603291..66dcb60f106c5e41e372f80f6aa0b124556fd7ab 100644 (file)
@@ -1663,13 +1663,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) {