Browse Source

Merge branch 'trac3312'

Mukund Sivaraman 11 years ago
parent
commit
aafa7f6542

+ 1 - 1
src/bin/d2/tests/nc_trans_unittests.cc

@@ -326,8 +326,8 @@ public:
         ASSERT_EQ(NameChangeTransaction::NOP_EVT,
                   name_change->getNextEvent());
 
-        int cnt = 0;
         while (name_change->getNextEvent() == NameChangeTransaction::NOP_EVT) {
+            int cnt = 0;
             ASSERT_NO_THROW(cnt = runTimedIO(run_time));
             if (cnt == 0) {
                 FAIL() << "IO Service stopped unexpectedly";

+ 1 - 1
src/lib/acl/ip_check.cc

@@ -115,7 +115,7 @@ namespace {
 const uint8_t*
 getSockAddrData(const struct sockaddr& sa) {
     const void* sa_ptr = &sa;
-    const void* data_ptr;
+    const void* data_ptr = NULL;
     if (sa.sa_family == AF_INET) {
         const struct sockaddr_in* sin =
             static_cast<const struct sockaddr_in*>(sa_ptr);

+ 1 - 1
src/lib/datasrc/memory/zone_data_loader.cc

@@ -69,7 +69,7 @@ typedef boost::function<void(isc::dns::ConstRRsetPtr)> LoadCallback;
 class ZoneDataLoader : boost::noncopyable {
 public:
     ZoneDataLoader(util::MemorySegment& mem_sgmt,
-                   const isc::dns::RRClass rrclass,
+                   const isc::dns::RRClass& rrclass,
                    const isc::dns::Name& zone_name, ZoneData& zone_data) :
         updater_(mem_sgmt, rrclass, zone_name, zone_data)
     {}

+ 1 - 1
src/lib/datasrc/memory/zone_data_updater.h

@@ -67,7 +67,7 @@ public:
     ///    on the given memory segment. Currently, at most one zone data
     ///    updater may exist on the same memory segment.
     ZoneDataUpdater(util::MemorySegment& mem_sgmt,
-                    isc::dns::RRClass rrclass,
+                    const isc::dns::RRClass& rrclass,
                     const isc::dns::Name& zone_name,
                     ZoneData& zone_data) :
        mem_sgmt_(mem_sgmt),

+ 4 - 4
src/lib/datasrc/tests/database_unittest.cc

@@ -1683,7 +1683,7 @@ findTestCommon(ZoneFinder& finder, const isc::dns::Name& name,
                const isc::dns::RRType& type,
                ConstZoneFinderContextPtr actual_result,
                const isc::dns::RRType& expected_type,
-               const isc::dns::RRTTL expected_ttl,
+               const isc::dns::RRTTL& expected_ttl,
                ZoneFinder::Result expected_result,
                const std::vector<string>& expected_rdatas,
                const std::vector<string>& expected_sig_rdatas,
@@ -1737,7 +1737,7 @@ doFindTest(ZoneFinder& finder,
            const isc::dns::Name& name,
            const isc::dns::RRType& type,
            const isc::dns::RRType& expected_type,
-           const isc::dns::RRTTL expected_ttl,
+           const isc::dns::RRTTL& expected_ttl,
            ZoneFinder::Result expected_result,
            const std::vector<std::string>& expected_rdatas,
            const std::vector<std::string>& expected_sig_rdatas,
@@ -1758,7 +1758,7 @@ doFindAtOriginTest(ZoneFinder& finder,
                    const isc::dns::Name& origin,
                    const isc::dns::RRType& type,
                    const isc::dns::RRType& expected_type,
-                   const isc::dns::RRTTL expected_ttl,
+                   const isc::dns::RRTTL& expected_ttl,
                    ZoneFinder::Result expected_result,
                    const std::vector<std::string>& expected_rdatas,
                    const std::vector<std::string>& expected_sig_rdatas,
@@ -1781,7 +1781,7 @@ doFindAtOriginTest(ZoneFinder& finder,
 void
 doFindAllTestResult(ZoneFinder& finder, const isc::dns::Name& name,
                     ZoneFinder::Result expected_result,
-                    const isc::dns::RRType expected_type,
+                    const isc::dns::RRType& expected_type,
                     std::vector<std::string> expected_rdata,
                     const isc::dns::Name& expected_name =
                     isc::dns::Name::ROOT_NAME(),

+ 2 - 2
src/lib/dns/python/rdata_python.cc

@@ -104,9 +104,9 @@ Rdata_init(PyObject* self_p, PyObject* args, PyObject*) {
     const char* s;
     const char* data;
     Py_ssize_t len;
-    s_Rdata* self(static_cast<s_Rdata*>(self_p));
-
     try {
+        s_Rdata* self = static_cast<s_Rdata*>(self_p);
+
         // Create from string
         if (PyArg_ParseTuple(args, "O!O!s", &rrtype_type, &rrtype,
                              &rrclass_type, &rrclass,

+ 1 - 1
src/lib/dns/python/rrset_python.cc

@@ -251,9 +251,9 @@ PyObject*
 RRset_toWire(PyObject* self_p, PyObject* args) {
     PyObject* bytes;
     PyObject* mr;
-    const s_RRset* self(static_cast<const s_RRset*>(self_p));
 
     try {
+        const s_RRset* self = static_cast<const s_RRset*>(self_p);
         if (PyArg_ParseTuple(args, "O", &bytes) && PySequence_Check(bytes)) {
             PyObject* bytes_o = bytes;
 

+ 5 - 5
src/lib/log/message_dictionary.cc

@@ -63,13 +63,13 @@ MessageDictionary::load(const char* messages[]) {
     vector<std::string> duplicates;
     int i = 0;
     while (messages[i]) {
-
-        // ID present, so note it and point to text.
-        const MessageID ident(messages[i++]);
+        // ID present, so point to text.
+        ++i;
         if (messages[i]) {
-
+            const MessageID ident(messages[i - 1]);
             // Text not null, note it and point to next ident.
-            string text(messages[i++]);
+            const std::string text(messages[i]);
+            ++i;
 
             // Add ID and text to message dictionary, noting if the ID was
             // already present.

+ 0 - 2
src/lib/resolve/tests/recursive_query_unittest.cc

@@ -377,7 +377,6 @@ protected:
                             DNSLookup* lookup = NULL,
                             DNSAnswer* answer = NULL) :
             io_(io_service),
-            done_(false),
             message_(new Message(Message::PARSE)),
             answer_message_(new Message(Message::RENDER)),
             respbuf_(new OutputBuffer(0)),
@@ -406,7 +405,6 @@ protected:
 
     protected:
         IOService& io_;
-        bool done_;
 
     private:
         // Currently unused; these will be used for testing