You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2014/08/26 16:19:11 UTC

git commit: TS-3033: Build error fixes.

Repository: trafficserver
Updated Branches:
  refs/heads/master 5772a88b9 -> e6f56c5cf


TS-3033: Build error fixes.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e6f56c5c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e6f56c5c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e6f56c5c

Branch: refs/heads/master
Commit: e6f56c5cfbb1bb90e29f30b34845ee161a32a41b
Parents: 5772a88
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Tue Aug 26 09:12:02 2014 -0500
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Tue Aug 26 09:12:02 2014 -0500

----------------------------------------------------------------------
 mgmt/utils/test_marshall.cc | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e6f56c5c/mgmt/utils/test_marshall.cc
----------------------------------------------------------------------
diff --git a/mgmt/utils/test_marshall.cc b/mgmt/utils/test_marshall.cc
index 5b2ea0a..f70e953 100644
--- a/mgmt/utils/test_marshall.cc
+++ b/mgmt/utils/test_marshall.cc
@@ -24,8 +24,8 @@
 #include "ink_inet.h"
 
 #define CHECK_EQ(expr, len) do { \
-  MgmtMarshallInt rcvd = (MgmtMarshallInt)(expr); \
-  box.check(rcvd == len, "%s returned length %d, expected %d", #expr, rcvd, (MgmtMarshallInt)(len)); \
+  MgmtMarshallInt rcvd = static_cast<MgmtMarshallInt>(expr); \
+  box.check(rcvd == static_cast<MgmtMarshallInt>(len), "%s returned length %d, expected %d", #expr, rcvd, static_cast<MgmtMarshallInt>(len)); \
 } while (0)
 
 #define CHECK_VALUE(value, expect, fmt) do { \
@@ -117,11 +117,7 @@ message_connect_channel(RegressionTest * t, int listenfd, int clientfd, int serv
 static int
 message_listen(int& port)
 {
-  union {
-    struct sockaddr sa;
-    struct sockaddr_in in;
-    struct sockaddr_storage storage;
-  } sa;
+  IpEndpoint sa;
   socklen_t slen;
   int fd;
 
@@ -130,12 +126,8 @@ message_listen(int& port)
     goto fail;
   }
 
-  ink_zero(sa);
-  sa.in.sin_family = AF_INET;
-  sa.in.sin_addr.s_addr = htonl(INADDR_ANY);
-  sa.in.sin_len = sizeof(sockaddr_in);
-
-  if (bind(fd, &sa.sa, sizeof(sa.in)) == -1) {
+  sa.setToAnyAddr(AF_INET);
+  if (bind(fd, &sa.sa, sizeof(sa)) == -1) {
     goto fail;
   }
 
@@ -239,13 +231,13 @@ REGRESSION_TEST(MessageMarshall)(RegressionTest * t, int /* atype ATS_UNUSED */,
 
   // Marshall some integral types.
   mint = -156;
-  mlong = UINT32_MAX;
+  mlong = INTU32_MAX;
   CHECK_EQ(mgmt_message_marshall(msgbuf, 1, ifields, countof(ifields), &mint, &mlong), -1);
   CHECK_EQ(mgmt_message_marshall(msgbuf, sizeof(msgbuf), ifields, countof(ifields), &mint, &mlong), 12);
   CHECK_EQ(mgmt_message_parse(msgbuf, 1, ifields, countof(ifields), &mint, &mlong), -1);
   CHECK_EQ(mgmt_message_parse(msgbuf, sizeof(msgbuf), ifields, countof(ifields), &mint, &mlong), 12);
   CHECK_VALUE(mint, -156, "%" PRId32);
-  CHECK_VALUE(mlong, (MgmtMarshallLong)UINT32_MAX, "%" PRId64);
+  CHECK_VALUE(mlong, static_cast<MgmtMarshallLong>(INTU32_MAX), "%" PRId64);
 
   // Marshall a string.
   for (unsigned i = 0; i < countof(stringvals); ++i) {