diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2012-04-17 18:57:40 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2012-04-17 18:57:40 +0000 |
commit | fc63e07135d645af0df8d393aa84c0ae3b7e1924 (patch) | |
tree | f40524fe8e0facf5542c6b02041bc1fc63eae66e /main | |
parent | 70c5ac6635062efe03b51fb6c7afd30c22028be9 (diff) |
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky
Review: https://reviewboard.asterisk.org/r/1743/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/ast_expr2.fl | 1 | ||||
-rw-r--r-- | main/ast_expr2f.c | 1 | ||||
-rw-r--r-- | main/asterisk.c | 2 | ||||
-rw-r--r-- | main/data.c | 4 |
4 files changed, 3 insertions, 5 deletions
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl index 5c7e6a549..e10dde200 100644 --- a/main/ast_expr2.fl +++ b/main/ast_expr2.fl @@ -309,7 +309,6 @@ int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, ast_str_set(str, maxlen, "0"); } else { if (io.val->type == AST_EXPR_number) { - int res_length; ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i); } else if (io.val->u.s) { ast_str_set(str, maxlen, "%s", io.val->u.s); diff --git a/main/ast_expr2f.c b/main/ast_expr2f.c index c4cce6cf3..675f06b56 100644 --- a/main/ast_expr2f.c +++ b/main/ast_expr2f.c @@ -2448,7 +2448,6 @@ int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, ast_str_set(str, maxlen, "0"); } else { if (io.val->type == AST_EXPR_number) { - int res_length; ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i); } else if (io.val->u.s) { ast_str_set(str, maxlen, "%s", io.val->u.s); diff --git a/main/asterisk.c b/main/asterisk.c index 5f6449c92..902a285bf 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3598,7 +3598,7 @@ int main(int argc, char *argv[]) break; /* XXX Should we exit() here? XXX */ } - fd2 = (l.rlim_cur > sizeof(readers) * 8 ? sizeof(readers) * 8 : l.rlim_cur) - 1; + fd2 = ((l.rlim_cur > sizeof(readers) * 8) ? sizeof(readers) * 8 : l.rlim_cur) - 1; if (dup2(fd, fd2) < 0) { ast_log(LOG_WARNING, "Cannot open maximum file descriptor %d at boot? %s\n", fd2, strerror(errno)); close(fd); diff --git a/main/data.c b/main/data.c index 98f1c336c..e2194b7f0 100644 --- a/main/data.c +++ b/main/data.c @@ -696,7 +696,7 @@ static struct ast_data_search *data_search_alloc(const char *name) res->children = ao2_container_alloc(NUM_DATA_SEARCH_BUCKETS, data_search_hash, data_search_cmp); - if (!res) { + if (!res->children) { ao2_ref(res, -1); return NULL; } @@ -1653,7 +1653,7 @@ static struct data_filter *data_filter_alloc(const char *name) res->children = ao2_container_alloc(NUM_DATA_FILTER_BUCKETS, data_filter_hash, data_filter_cmp); - if (!res) { + if (!res->children) { ao2_ref(res, -1); return NULL; } |