]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix build warnings
authorKinsey Moore <kmoore@digium.com>
Fri, 6 Sep 2013 18:49:09 +0000 (18:49 +0000)
committerKinsey Moore <kmoore@digium.com>
Fri, 6 Sep 2013 18:49:09 +0000 (18:49 +0000)
When AST_DEVMODE is not defined, ast_asserts are not compiled into the
binary. In some cases, this means variables are not referenced or are
set but unused which causes warnings to show up.

(closes issue ASTERISK-22446)
Reported by: Jason Parker (qwell)

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

main/http.c
res/stasis/app.c

index 5d764b4cedd2acae0402d0cf7bf09bdbcaa83d43..e687d037cf62e75dd3a97b00a0e9716162d73e70 100644 (file)
@@ -914,7 +914,9 @@ struct ast_http_auth *ast_http_get_auth(struct ast_variable *headers)
                char decoded[256] = {};
                char *username;
                char *password;
+#ifdef AST_DEVMODE
                int cnt;
+#endif /* AST_DEVMODE */
 
                if (strcasecmp("Authorization", v->name) != 0) {
                        continue;
@@ -939,7 +941,10 @@ struct ast_http_auth *ast_http_get_auth(struct ast_variable *headers)
                /* This will truncate "userid:password" lines to
                 * sizeof(decoded). The array is long enough that this shouldn't
                 * be a problem */
-               cnt = ast_base64decode((unsigned char*)decoded, base64,
+#ifdef AST_DEVMODE
+               cnt =
+#endif /* AST_DEVMODE */
+               ast_base64decode((unsigned char*)decoded, base64,
                        sizeof(decoded) - 1);
                ast_assert(cnt < sizeof(decoded));
 
index 8abe0c19c23be80f829fd0d234084ba8de089417..ab46be508699ca7b8f87d7771833fb98d77dd078 100644 (file)
@@ -68,7 +68,9 @@ struct app_forwards {
 
 static void forwards_dtor(void *obj)
 {
+#ifdef AST_DEVMODE
        struct app_forwards *forwards = obj;
+#endif /* AST_DEVMODE */
 
        ast_assert(forwards->topic_forward == NULL);
        ast_assert(forwards->topic_cached_forward == NULL);