You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/01/13 02:45:20 UTC

[2/2] mesos git commit: Consistently used fixed width integral types.

Consistently used fixed width integral types.

The type `long` has different widths under e.g., 32- and 64-bit
architectures. Since we already use fixed width types internally in most
places, these remaining uses have been updated.

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


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

Branch: refs/heads/master
Commit: e24d24d8749470c99dc9ed63c05c8a3192f8c1d6
Parents: d7daf70
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Tue Jan 12 16:59:00 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Jan 12 17:38:51 2016 -0800

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/duration.hpp        | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e24d24d8/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp
index 40b2260..ec65b8f 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp
@@ -14,7 +14,6 @@
 #define __STOUT_DURATION_HPP__
 
 #include <ctype.h> // For 'isdigit'.
-#include <limits.h> // For 'LLONG_(MAX|MIN)'.
 
 // For 'timeval'.
 #ifndef __WINDOWS__
@@ -399,7 +398,8 @@ inline std::ostream& operator<<(std::ostream& stream, const Duration& duration_)
 
 inline Try<Duration> Duration::create(double seconds)
 {
-  if (seconds * SECONDS > LLONG_MAX || seconds * SECONDS < LLONG_MIN) {
+  if (seconds * SECONDS > std::numeric_limits<int64_t>::max() ||
+      seconds * SECONDS < std::numeric_limits<int64_t>::min()) {
     return Error("Argument out of the range that a Duration can represent due "
                  "to int64_t's size limit");
   }
@@ -407,10 +407,15 @@ inline Try<Duration> Duration::create(double seconds)
   return Nanoseconds(static_cast<int64_t>(seconds * SECONDS));
 }
 
-
-inline constexpr Duration Duration::max() { return Nanoseconds(LLONG_MAX); }
+inline constexpr Duration Duration::max()
+{
+  return Nanoseconds(std::numeric_limits<int64_t>::max());
+}
 
 
-inline constexpr Duration Duration::min() { return Nanoseconds(LLONG_MIN); }
+inline constexpr Duration Duration::min()
+{
+  return Nanoseconds(std::numeric_limits<int64_t>::min());
+}
 
 #endif // __STOUT_DURATION_HPP__