Browse Source

[2098] silence cppcheck warnings

they are basically false positives, but addressing them is not difficult
so I modified the code rather than suppressing them.
JINMEI Tatuya 12 years ago
parent
commit
b166b6061c

+ 1 - 0
src/lib/datasrc/memory/benchmarks/rrset_render_bench.cc

@@ -151,6 +151,7 @@ buildZone(isc::util::MemorySegmentLocal& mem_sgmt,
         if ((it + 1) != rrsets.end() &&
         if ((it + 1) != rrsets.end() &&
             (*(it + 1))->getType() == RRType::RRSIG()) {
             (*(it + 1))->getType() == RRType::RRSIG()) {
             sig_rrset = *(++it);
             sig_rrset = *(++it);
+            assert(it != rrsets.end()); // to be safe, and silence cppcheck
         }
         }
         RdataSet* rdataset =
         RdataSet* rdataset =
             RdataSet::create(mem_sgmt, encoder, rrset, sig_rrset);
             RdataSet::create(mem_sgmt, encoder, rrset, sig_rrset);

+ 4 - 1
src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc

@@ -70,7 +70,10 @@ protected:
                                    "match.example.com. 3600 IN RRSIG "
                                    "match.example.com. 3600 IN RRSIG "
                                    "A 5 2 3600 20120814220826 20120715220826 "
                                    "A 5 2 3600 20120814220826 20120715220826 "
                                    "1234 example.com. FAKE")),
                                    "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() {
     void SetUp() {
         // We create some common test data here in SetUp() so it will be
         // We create some common test data here in SetUp() so it will be