You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2014/05/03 04:36:20 UTC

[3/7] git commit: Updated stout to satisfy whitespace/line_length.

Updated stout to satisfy whitespace/line_length.

Review: https://reviews.apache.org/r/20976


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

Branch: refs/heads/master
Commit: dd0cb83728e4349a51c1452ede0f2ae6f68c5fac
Parents: c140273
Author: Benjamin Hindman <be...@gmail.com>
Authored: Thu May 1 13:23:46 2014 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Fri May 2 19:25:04 2014 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/abort.hpp      | 33 +++++++++++++-------
 .../3rdparty/stout/include/stout/base64.hpp     |  2 --
 .../3rdparty/stout/include/stout/foreach.hpp    | 32 +++++++++----------
 .../3rdparty/stout/include/stout/os/sysctl.hpp  |  7 ++++-
 .../3rdparty/stout/tests/base64_tests.cpp       |  3 +-
 .../3rdparty/stout/tests/strings_tests.cpp      | 10 +++---
 6 files changed, 52 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/dd0cb837/3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp
index d43f1b5..f20feea 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp
@@ -48,27 +48,38 @@ struct _Abort
     // In fact, it is highly unlikely that strlen would be
     // implemented in an unsafe manner:
     // http://austingroupbugs.net/view.php?id=692
-    while (write(STDERR_FILENO, prefix, strlen(prefix)) == -1 && errno == EINTR);
+    while (write(STDERR_FILENO, prefix, strlen(prefix)) == -1 &&
+           errno == EINTR);
     while (arg0 != NULL &&
-           write(STDERR_FILENO, arg0, strlen(arg0)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg0, strlen(arg0)) == -1 &&
+           errno == EINTR);
     while (arg1 != NULL &&
-           write(STDERR_FILENO, arg1, strlen(arg1)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg1, strlen(arg1)) == -1 &&
+           errno == EINTR);
     while (arg2 != NULL &&
-           write(STDERR_FILENO, arg2, strlen(arg2)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg2, strlen(arg2)) == -1 &&
+           errno == EINTR);
     while (arg3 != NULL &&
-           write(STDERR_FILENO, arg3, strlen(arg3)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg3, strlen(arg3)) == -1 &&
+           errno == EINTR);
     while (arg4 != NULL &&
-           write(STDERR_FILENO, arg4, strlen(arg4)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg4, strlen(arg4)) == -1 &&
+           errno == EINTR);
     while (arg5 != NULL &&
-           write(STDERR_FILENO, arg5, strlen(arg5)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg5, strlen(arg5)) == -1 &&
+           errno == EINTR);
     while (arg6 != NULL &&
-           write(STDERR_FILENO, arg6, strlen(arg6)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg6, strlen(arg6)) == -1 &&
+           errno == EINTR);
     while (arg7 != NULL &&
-           write(STDERR_FILENO, arg7, strlen(arg7)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg7, strlen(arg7)) == -1 &&
+           errno == EINTR);
     while (arg8 != NULL &&
-           write(STDERR_FILENO, arg8, strlen(arg8)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg8, strlen(arg8)) == -1 &&
+           errno == EINTR);
     while (arg9 != NULL &&
-           write(STDERR_FILENO, arg9, strlen(arg9)) == -1 && errno == EINTR);
+           write(STDERR_FILENO, arg9, strlen(arg9)) == -1 &&
+           errno == EINTR);
     abort();
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/dd0cb837/3rdparty/libprocess/3rdparty/stout/include/stout/base64.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/base64.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/base64.hpp
index 3aeafcd..1f0944a 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/base64.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/base64.hpp
@@ -17,7 +17,6 @@
 #include <cctype>
 #include <string>
 
-namespace stout {
 namespace base64 {
 
 // This slightly modified base64 implementation from
@@ -126,6 +125,5 @@ std::string decode(const std::string& s)
 }
 
 } // namespace base64 {
-} // namespace stout {
 
 #endif // __STOUT_BASE64_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/dd0cb837/3rdparty/libprocess/3rdparty/stout/include/stout/foreach.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/foreach.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/foreach.hpp
index 428e4ba..0739d63 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/foreach.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/foreach.hpp
@@ -33,22 +33,22 @@ swallow_assign const ignore = swallow_assign();
 
 } // namespace __foreach__ {
 
-#define BOOST_FOREACH_PAIR(VARFIRST, VARSECOND, COL)                                                            \
-    BOOST_FOREACH_PREAMBLE()                                                                                    \
-    if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \
-    if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_BEGIN(COL)) {} else   \
-    if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_END(COL)) {} else     \
-    for (bool BOOST_FOREACH_ID(_foreach_continue) = true, BOOST_FOREACH_ID(_foreach_onetime) = true;            \
-              BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_DONE(COL);                                  \
-              BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_NEXT(COL) : (void)0)                          \
-        if  (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_onetime))) {} else                     \
-        for (VARFIRST = BOOST_FOREACH_DEREF(COL).first;                                                         \
-       !BOOST_FOREACH_ID(_foreach_onetime);                                                                     \
-       BOOST_FOREACH_ID(_foreach_onetime) = true)                                                               \
-            if  (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else                \
-            for (VARSECOND = BOOST_FOREACH_DEREF(COL).second;                                                   \
-     !BOOST_FOREACH_ID(_foreach_continue);                                                                      \
-     BOOST_FOREACH_ID(_foreach_continue) = true)
+#define BOOST_FOREACH_PAIR(VARFIRST, VARSECOND, COL)                    \
+  BOOST_FOREACH_PREAMBLE()                                              \
+  if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else /* NOLINT(whitespace/line_length) */ \
+    if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_BEGIN(COL)) {} else /* NOLINT(whitespace/line_length) */ \
+      if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_END(COL)) {} else /* NOLINT(whitespace/line_length) */ \
+        for (bool BOOST_FOREACH_ID(_foreach_continue) = true, BOOST_FOREACH_ID(_foreach_onetime) = true; /* NOLINT(whitespace/line_length) */ \
+             BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_DONE(COL); /* NOLINT(whitespace/line_length) */ \
+             BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_NEXT(COL) : (void)0) /* NOLINT(whitespace/line_length) */ \
+          if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_onetime))) {} else /* NOLINT(whitespace/line_length) */ \
+            for (VARFIRST = BOOST_FOREACH_DEREF(COL).first;             \
+                 !BOOST_FOREACH_ID(_foreach_onetime);                   \
+                 BOOST_FOREACH_ID(_foreach_onetime) = true)             \
+              if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else /* NOLINT(whitespace/line_length) */ \
+                for (VARSECOND = BOOST_FOREACH_DEREF(COL).second;       \
+                     !BOOST_FOREACH_ID(_foreach_continue);              \
+                     BOOST_FOREACH_ID(_foreach_continue) = true)
 
 #define foreach BOOST_FOREACH
 #define foreachpair BOOST_FOREACH_PAIR

http://git-wip-us.apache.org/repos/asf/mesos/blob/dd0cb837/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp
index 6b04590..a1e6e4d 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp
@@ -158,7 +158,12 @@ inline sysctl::sysctl(int level1, int level2, int level3, int level4)
 }
 
 
-inline sysctl::sysctl(int level1, int level2, int level3, int level4, int level5)
+inline sysctl::sysctl(
+    int level1,
+    int level2,
+    int level3,
+    int level4,
+    int level5)
   : levels(5), name(new int[levels])
 {
   name[0] = level1;

http://git-wip-us.apache.org/repos/asf/mesos/blob/dd0cb837/3rdparty/libprocess/3rdparty/stout/tests/base64_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/base64_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/base64_tests.cpp
index 050cc1c..28a94f9 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/base64_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/base64_tests.cpp
@@ -18,9 +18,10 @@
 
 TEST(Base64, Encode)
 {
-  EXPECT_EQ("dGVzdHVzZXI6dGVzdHBhc3M=", base64::encode((const unsigned char *)("testuser:testpass"), 17));
+  EXPECT_EQ("dGVzdHVzZXI6dGVzdHBhc3M=", base64::encode("testuser:testpass"));
 }
 
+
 TEST(Base64, Decode)
 {
   EXPECT_EQ("testuser:testpass", base64::decode("dGVzdHVzZXI6dGVzdHBhc3M="));

http://git-wip-us.apache.org/repos/asf/mesos/blob/dd0cb837/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
index b5a233f..c83156e 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp
@@ -98,7 +98,8 @@ TEST(StringsTest, TokenizeStringWithDelimsAtStart)
 
 TEST(StringsTest, TokenizeStringWithDelimsAtEnd)
 {
-  vector<string> tokens = strings::tokenize("hello world,  what's up?  ", " ");
+  vector<string> tokens =
+    strings::tokenize("hello world,  what's up?  ", " ");
   ASSERT_EQ(4u, tokens.size());
   EXPECT_EQ("hello",  tokens[0]);
   EXPECT_EQ("world,", tokens[1]);
@@ -109,7 +110,8 @@ TEST(StringsTest, TokenizeStringWithDelimsAtEnd)
 
 TEST(StringsTest, TokenizeStringWithDelimsAtStartAndEnd)
 {
-  vector<string> tokens = strings::tokenize("  hello world,  what's up?  ", " ");
+  vector<string> tokens =
+    strings::tokenize("  hello world,  what's up?  ", " ");
   ASSERT_EQ(4u, tokens.size());
   EXPECT_EQ("hello",  tokens[0]);
   EXPECT_EQ("world,", tokens[1]);
@@ -120,8 +122,8 @@ TEST(StringsTest, TokenizeStringWithDelimsAtStartAndEnd)
 
 TEST(StringsTest, TokenizeWithMultipleDelims)
 {
-  vector<string> tokens = strings::tokenize("hello\tworld,  \twhat's up?",
-                                            " \t");
+  vector<string> tokens =
+    strings::tokenize("hello\tworld,  \twhat's up?", " \t");
   ASSERT_EQ(4u, tokens.size());
   EXPECT_EQ("hello",  tokens[0]);
   EXPECT_EQ("world,", tokens[1]);