]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2098] silence cppcheck warnings
authorJINMEI Tatuya <jinmei@isc.org>
Thu, 30 Aug 2012 23:43:57 +0000 (16:43 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 30 Aug 2012 23:43:57 +0000 (16:43 -0700)
they are basically false positives, but addressing them is not difficult
so I modified the code rather than suppressing them.

src/lib/datasrc/memory/benchmarks/rrset_render_bench.cc
src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc

index c5cdef66755eaae1eaa579c8e61c0318bdfb87cc..bc418e85c9c3d4ae90af131915841eb7326b1f48 100644 (file)
@@ -151,6 +151,7 @@ buildZone(isc::util::MemorySegmentLocal& mem_sgmt,
         if ((it + 1) != rrsets.end() &&
             (*(it + 1))->getType() == RRType::RRSIG()) {
             sig_rrset = *(++it);
+            assert(it != rrsets.end()); // to be safe, and silence cppcheck
         }
         RdataSet* rdataset =
             RdataSet::create(mem_sgmt, encoder, rrset, sig_rrset);
index cf486bf9da718434c9ec6546dc4e57be550c042c..33df2ebe36968b09897cecf6dee41d217a4dfaec 100644 (file)
@@ -70,7 +70,10 @@ protected:
                                    "match.example.com. 3600 IN RRSIG "
                                    "A 5 2 3600 20120814220826 20120715220826 "
                                    "1234 example.com. FAKE")),
-        zone_data_(NULL)
+        zone_data_(NULL), origin_node_(NULL), www_node_(NULL),
+        wildcard_node_(NULL), ns_rdataset_(NULL), dname_rdataset_(NULL),
+        a_rdataset_(NULL), aaaa_rdataset_(NULL), rrsig_only_rdataset_(NULL),
+        wildcard_rdataset_(NULL)
     {}
     void SetUp() {
         // We create some common test data here in SetUp() so it will be