BIND 10 trac2009, updated. afc0fe7345aa86ba3eaebf1bba8f62db64760c1f [2009] Add comment about why a static_cast is necessary

BIND 10 source code commits bind10-changes at lists.isc.org
Thu May 31 05:12:36 UTC 2012


The branch, trac2009 has been updated
       via  afc0fe7345aa86ba3eaebf1bba8f62db64760c1f (commit)
      from  20a21a87777944fea10cf615b0b54d6e96df00ae (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 afc0fe7345aa86ba3eaebf1bba8f62db64760c1f
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu May 31 10:41:39 2012 +0530

    [2009] Add comment about why a static_cast is necessary

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

Summary of changes:
 src/lib/xfr/xfrout_client.cc |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-----------------------------------------------------------------------
diff --git a/src/lib/xfr/xfrout_client.cc b/src/lib/xfr/xfrout_client.cc
index 1d7ce3b..af0c1b5 100644
--- a/src/lib/xfr/xfrout_client.cc
+++ b/src/lib/xfr/xfrout_client.cc
@@ -82,7 +82,12 @@ XfroutClient::sendXfroutRequestInfo(const int tcp_sock,
 
     // TODO: this shouldn't be blocking send, even though it's unlikely to
     // block.
-    // converting the 16-bit word to network byte order.
+    // Converting the 16-bit word to network byte order.
+
+    // Splitting msg_len below performs something called a 'narrowing
+    // conversion' (conversion of uint16_t to uint8_t). C++0x (and GCC
+    // 4.7) requires explicit casting when a narrowing conversion is
+    // performed. For reference, see 8.5.4/6 of n3225.
     const uint8_t lenbuf[2] = { static_cast<uint8_t>(msg_len >> 8),
                                 static_cast<uint8_t>(msg_len & 0xff) };
     if (send(impl_->socket_.native(), lenbuf, sizeof(lenbuf), 0) !=



More information about the bind10-changes mailing list