BIND 10 master, updated. 10d9ff6b5b241f41939bee5bc5304d24b3147e15 [master] Fix const_reverse_iterator comparison with operator!= on Solaris GCC

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Aug 8 11:03:15 UTC 2013


The branch, master has been updated
       via  10d9ff6b5b241f41939bee5bc5304d24b3147e15 (commit)
      from  73372e3a10aef030bb33f2834357fe2f4a3bb481 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 10d9ff6b5b241f41939bee5bc5304d24b3147e15
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Aug 8 03:15:40 2013 +0530

    [master] Fix const_reverse_iterator comparison with operator!= on Solaris GCC

-----------------------------------------------------------------------

Summary of changes:
 src/bin/d2/d2_cfg_mgr.cc |   37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/d2/d2_cfg_mgr.cc b/src/bin/d2/d2_cfg_mgr.cc
index 0e037d3..ef63a0a 100644
--- a/src/bin/d2/d2_cfg_mgr.cc
+++ b/src/bin/d2/d2_cfg_mgr.cc
@@ -21,6 +21,12 @@
 namespace isc {
 namespace d2 {
 
+namespace {
+
+typedef std::vector<uint8_t> ByteAddress;
+
+} // end of unnamed namespace
+
 // *********************** D2CfgContext  *************************
 
 D2CfgContext::D2CfgContext()
@@ -117,13 +123,20 @@ D2CfgMgr::reverseV4Address(const isc::asiolink::IOAddress& ioaddr) {
     }
 
     // Get the address in byte vector form.
-    std::vector<uint8_t> bytes = ioaddr.toBytes();
+    const ByteAddress bytes = ioaddr.toBytes();
 
     // Walk backwards through vector outputting each octet and a dot.
     std::ostringstream stream;
-    std::vector<uint8_t>::const_reverse_iterator rit;
 
-    for (rit = bytes.rbegin(); rit != bytes.rend(); ++rit) {
+    // We have to set the following variable to get
+    // const_reverse_iterator type of rend(), otherwise Solaris GCC
+    // complains on operator!= by trying to use the non-const variant.
+    const ByteAddress::const_reverse_iterator end = bytes.rend();
+
+    for (ByteAddress::const_reverse_iterator rit = bytes.rbegin();
+         rit != end;
+         ++rit)
+    {
         stream << static_cast<unsigned int>(*rit) << ".";
     }
 
@@ -140,14 +153,21 @@ D2CfgMgr::reverseV6Address(const isc::asiolink::IOAddress& ioaddr) {
     }
 
     // Turn the address into a string of digits.
-    std::vector<uint8_t> bytes = ioaddr.toBytes();
-    std::string digits;
-    digits = isc::util::encode::encodeHex(bytes);
+    const ByteAddress bytes = ioaddr.toBytes();
+    const std::string digits = isc::util::encode::encodeHex(bytes);
 
     // Walk backwards through string outputting each digits and a dot.
     std::ostringstream stream;
-    std::string::const_reverse_iterator rit;
-    for (rit = digits.rbegin(); rit != digits.rend(); ++rit) {
+
+    // We have to set the following variable to get
+    // const_reverse_iterator type of rend(), otherwise Solaris GCC
+    // complains on operator!= by trying to use the non-const variant.
+    const std::string::const_reverse_iterator end = digits.rend();
+
+    for (std::string::const_reverse_iterator rit = digits.rbegin();
+         rit != end;
+         ++rit)
+    {
         stream << static_cast<char>(*rit) << ".";
     }
 
@@ -192,4 +212,3 @@ D2CfgMgr::createConfigParser(const std::string& config_id) {
 
 }; // end of isc::dhcp namespace
 }; // end of isc namespace
-



More information about the bind10-changes mailing list