From: Ondřej Surý Date: Fri, 27 Sep 2019 08:28:30 +0000 (+0200) Subject: lib/dns/rbt.c: Suppress nullPointerRedundantCheck warnings from Cppcheck X-Git-Tag: v9.15.6~72^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8be5c3fcfcbe7ed2dee3eaf508d0a674141636fa;p=thirdparty%2Fbind9.git lib/dns/rbt.c: Suppress nullPointerRedundantCheck warnings from Cppcheck --- diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c index ce8e1f3436d..34170ce9ab5 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c @@ -2676,6 +2676,7 @@ deletefromlevel(dns_rbtnode_t *item, dns_rbtnode_t **rootp) { * Fix color violations. */ if (IS_BLACK(item)) { + /* cppcheck-suppress nullPointerRedundantCheck symbolName=item */ parent = PARENT(item); while (child != *rootp && IS_BLACK(child)) { @@ -2693,6 +2694,7 @@ deletefromlevel(dns_rbtnode_t *item, dns_rbtnode_t **rootp) { INSIST(sibling != NULL); + /* cppcheck-suppress nullPointerRedundantCheck symbolName=sibling */ if (IS_BLACK(LEFT(sibling)) && IS_BLACK(RIGHT(sibling))) { MAKE_RED(sibling); @@ -2732,6 +2734,7 @@ deletefromlevel(dns_rbtnode_t *item, dns_rbtnode_t **rootp) { INSIST(sibling != NULL); + /* cppcheck-suppress nullPointerRedundantCheck symbolName=sibling */ if (IS_BLACK(LEFT(sibling)) && IS_BLACK(RIGHT(sibling))) { MAKE_RED(sibling); @@ -2863,6 +2866,7 @@ check_properties_helper(dns_rbtnode_t *node) { return (false); } + /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */ if ((DOWN(node) != NULL) && (!IS_ROOT(DOWN(node)))) return (false); @@ -2900,12 +2904,15 @@ check_black_distance_helper(dns_rbtnode_t *node, size_t *distance) { return (true); } + /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */ if (!check_black_distance_helper(LEFT(node), &dl)) return (false); + /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */ if (!check_black_distance_helper(RIGHT(node), &dr)) return (false); + /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */ if (!check_black_distance_helper(DOWN(node), &dd)) return (false);