]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
clang compiler warnings: Fix a variety of "unused" warnings
authorMatthew Jordan <mjordan@digium.com>
Sat, 28 Mar 2015 12:53:50 +0000 (12:53 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sat, 28 Mar 2015 12:53:50 +0000 (12:53 +0000)
This patch fixes the -Wunused-value -Wunused-variable -Wunused-const-variable
errors caught by clang. Specifically:

* apps/app_queue.c: removed unused qpm_cmd_usage[], qum_cmd_usage[],
                    qsmp_cmd_usage[]
* cel/cel_sqlite3_custom.c: removed unused name[] = "cel_sqlite3_custom"
* codecs/gsm/src/gsm_create.c: removed unused ident[] = "$Header$"
* funcs/func_env.c:729: Fixed ast_str_append_substr.
* main/editline/np/strlcat.c: removed unused rcsid variable
* main/editline/np/strlcpy.c: removed unused rcsid variable
* utils/conf2ael.c: removed unused cfextension_states
* utils/extconf.c: removed unused cfextension_states

Review: https://reviewboard.asterisk.org/r/4526

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4526.patch submitted by dkdegroot (License 6600)

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

apps/app_queue.c
cel/cel_sqlite3_custom.c
codecs/gsm/src/gsm_create.c
funcs/func_env.c
main/editline/np/strlcat.c
main/editline/np/strlcpy.c
utils/conf2ael.c
utils/extconf.c

index d61a8fd19e28c4a12c42e5fd33017fd687a47b58..3e0bc8b9753cdfb80c10d2bcca7bfe919bd43a1c 100644 (file)
@@ -9636,15 +9636,6 @@ static char *handle_queue_reload(struct ast_cli_entry *e, int cmd, struct ast_cl
        return CLI_SUCCESS;
 }
 
-static const char qpm_cmd_usage[] =
-"Usage: queue pause member <channel> in <queue> reason <reason>\n";
-
-static const char qum_cmd_usage[] =
-"Usage: queue unpause member <channel> in <queue> reason <reason>\n";
-
-static const char qsmp_cmd_usage[] =
-"Usage: queue set member penalty <channel> from <queue> <penalty>\n";
-
 static struct ast_cli_entry cli_queue[] = {
        AST_CLI_DEFINE(queue_show, "Show status of a specified queue"),
        AST_CLI_DEFINE(handle_queue_rule_show, "Show the rules defined in queuerules.conf"),
index ce88be6f733e4acefd27c6df33e15ef3824533c3..2da6983b57bdf4535abbebba8da68f5a25c2f763 100644 (file)
@@ -61,7 +61,6 @@ AST_MUTEX_DEFINE_STATIC(lock);
 
 static const char config_file[] = "cel_sqlite3_custom.conf";
 
-static const char name[] = "cel_sqlite3_custom";
 static sqlite3 *db = NULL;
 
 static char table[80];
index a59aa2f2a38335b87ac0d943a5b1787bd3450ae2..f952a7dc2c798ca07d0b3414cb2a6bb99c296713 100644 (file)
@@ -4,8 +4,6 @@
  * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
  */
 
-static char const      ident[] = "$Header$";
-
 #include       "config.h"
 
 #ifdef HAS_STRING_H
index 26bd09c139525f958a0ecad4d54a7b6ef0b9bc4d..3c260a2fb3a168ac9d1ebc3ae88097dc6bfa693a 100644 (file)
@@ -725,7 +725,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru
                                }
                        }
                        ast_debug(3, "length_offset=%" PRId64 ", length_offset - i=%" PRId64 "\n", length_offset, length_offset - i);
-                       ast_str_append_substr(buf, len, fbuf, length_offset >= 0 ? length_offset - i : flength > i + sizeof(fbuf)) ? sizeof(fbuf) : flength - i;
+                       ast_str_append_substr(buf, len, fbuf, (length_offset >= 0) ? length_offset - i : (flength > i + sizeof(fbuf)) ? sizeof(fbuf) : flength - i);
 
                        if (length_offset >= 0) {
                                break;
index 6c9f1e92d797422608f07d8c07f33843904789a8..d9d0e72c8f3f9bbf0a93a77fa890b9b3c9881e92 100644 (file)
  */
 
 #include "config.h"
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $";
-#endif /* LIBC_SCCS and not lint */
-#ifndef lint
-static const char rcsid[] =
-  "$FreeBSD: src/lib/libc/string/strlcat.c,v 1.2.4.2 2001/07/09 23:30:06 obrien Exp $";
-#endif
-
 #include <sys/types.h>
 #include <string.h>
 
index 1f154bcf2ea75d2eb9cb7fdc7b741b6c31e8524f..ecad62b499e3a0c4a4a0888d6bd6212d18562b29 100644 (file)
  */
 
 #include "config.h"
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $";
-#endif
-#endif /* LIBC_SCCS and not lint */
-#ifndef lint
-static const char rcsid[] =
-  "$FreeBSD: src/lib/libc/string/strlcpy.c,v 1.2.4.1 2001/07/09 23:30:06 obrien Exp $";
-#endif
-
 #include <sys/types.h>
 #include <string.h>
 
index a59d7b05dddd9627688cadc65ee3319ca0723f8b..2c4438032d8c5c7db5265b1a10e7321d6a317753 100644 (file)
@@ -238,19 +238,6 @@ struct store_hint {
 
 AST_LIST_HEAD(store_hints, store_hint);
 
-static const struct cfextension_states {
-       int extension_state;
-       const char * const text;
-} extension_states[] = {
-       { AST_EXTENSION_NOT_INUSE,                     "Idle" },
-       { AST_EXTENSION_INUSE,                         "InUse" },
-       { AST_EXTENSION_BUSY,                          "Busy" },
-       { AST_EXTENSION_UNAVAILABLE,                   "Unavailable" },
-       { AST_EXTENSION_RINGING,                       "Ringing" },
-       { AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" },
-       { AST_EXTENSION_ONHOLD,                        "Hold" },
-       { AST_EXTENSION_INUSE | AST_EXTENSION_ONHOLD,  "InUse&Hold" }
-};
 #define STATUS_NO_CONTEXT      1
 #define STATUS_NO_EXTENSION    2
 #define STATUS_NO_PRIORITY     3
index b1cca16688a1d671def6f63913cd627d98ee147c..ba263cf990c1baaaabedc9424a26b5e30304061c 100644 (file)
@@ -3000,19 +3000,6 @@ struct store_hint {
 
 AST_LIST_HEAD(store_hints, store_hint);
 
-static const struct cfextension_states {
-       int extension_state;
-       const char * const text;
-} extension_states[] = {
-       { AST_EXTENSION_NOT_INUSE,                     "Idle" },
-       { AST_EXTENSION_INUSE,                         "InUse" },
-       { AST_EXTENSION_BUSY,                          "Busy" },
-       { AST_EXTENSION_UNAVAILABLE,                   "Unavailable" },
-       { AST_EXTENSION_RINGING,                       "Ringing" },
-       { AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" },
-       { AST_EXTENSION_ONHOLD,                        "Hold" },
-       { AST_EXTENSION_INUSE | AST_EXTENSION_ONHOLD,  "InUse&Hold" }
-};
 #define STATUS_NO_CONTEXT      1
 #define STATUS_NO_EXTENSION    2
 #define STATUS_NO_PRIORITY     3