Repository: mesos Updated Branches: refs/heads/master c9a218921 -> 04301c29b
stout: Removed whitespace padding in overloaded operators. Review: https://reviews.apache.org/r/37018 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/bce0a371 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bce0a371 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bce0a371 Branch: refs/heads/master Commit: bce0a37156276dfe98e8b5c3b1739177ae6ba365 Parents: c9a2189 Author: Artem Harutyunyan <[email protected]> Authored: Sun Aug 9 18:26:39 2015 -0400 Committer: Michael Park <[email protected]> Committed: Sun Aug 9 19:11:21 2015 -0400 ---------------------------------------------------------------------- 3rdparty/libprocess/3rdparty/stout/README.md | 10 ++-- .../3rdparty/stout/include/stout/bytes.hpp | 32 +++++------ .../3rdparty/stout/include/stout/cache.hpp | 12 ++--- .../3rdparty/stout/include/stout/duration.hpp | 36 ++++++------- .../stout/include/stout/flags/flags.hpp | 4 +- .../3rdparty/stout/include/stout/hashset.hpp | 2 +- .../3rdparty/stout/include/stout/interval.hpp | 46 ++++++++-------- .../3rdparty/stout/include/stout/ip.hpp | 22 ++++---- .../3rdparty/stout/include/stout/json.hpp | 56 +++++++++----------- .../3rdparty/stout/include/stout/mac.hpp | 12 ++--- .../3rdparty/stout/include/stout/option.hpp | 16 +++--- .../stout/include/stout/os/posix/fork.hpp | 4 +- .../stout/include/stout/os/posix/process.hpp | 20 ++++--- .../stout/include/stout/os/posix/signals.hpp | 3 +- .../3rdparty/stout/include/stout/os/sysctl.hpp | 8 +-- .../stout/include/stout/os/windows/process.hpp | 4 +- .../stout/include/stout/os/windows/signals.hpp | 2 +- .../3rdparty/stout/include/stout/path.hpp | 4 +- .../3rdparty/stout/include/stout/proc.hpp | 6 +-- .../3rdparty/stout/include/stout/protobuf.hpp | 18 +++---- .../3rdparty/stout/include/stout/result.hpp | 2 +- .../3rdparty/stout/include/stout/set.hpp | 6 +-- .../3rdparty/stout/include/stout/try.hpp | 2 +- .../3rdparty/stout/include/stout/version.hpp | 20 +++---- .../3rdparty/stout/tests/hashmap_tests.cpp | 4 +- .../3rdparty/stout/tests/hashset_tests.cpp | 4 +- .../3rdparty/stout/tests/recordio_tests.cpp | 6 +-- 27 files changed, 172 insertions(+), 189 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/README.md ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/README.md b/3rdparty/libprocess/3rdparty/stout/README.md index 39a6a3f..d7596e5 100644 --- a/3rdparty/libprocess/3rdparty/stout/README.md +++ b/3rdparty/libprocess/3rdparty/stout/README.md @@ -215,7 +215,7 @@ Of course, nesting of a `JSON::Value` is also permitted as per the JSON specific array.values.push_back(object2); ~~~ -You can "render" a JSON value using `std::ostream operator <<` (or by using `stringify` (see [here](#stringify)). +You can "render" a JSON value using `std::ostream operator<<` (or by using `stringify` (see [here](#stringify)). <a href="lambda"></a> @@ -307,7 +307,7 @@ There is also a protobuf to JSON converter via `JSON::Protobuf` that enables ser Utilities for inspecting and manipulating strings are available in the `strings` namespace. This includes varying tokenization techniques via `strings::tokenize`, `strings::split`, and `strings::pairs`. -String formatting is provided via `strings::format`. The `strings::format` functions produces strings based on the `printf` family of functions. Except, unlike the `printf` family of functions, the `strings::format` routines attempt to "stringify" (see [here](#stringify)) any arguments that are not POD types (i.e., "plain old data": primitives, pointers, certain structs/classes and unions, etc). This enables passing structs/classes to `strings::format` provided there is a definition/specialization of `std::ostream operator <<` available for that type. Note that the `%s` format specifier is expected for each argument that gets passed. A specialization for `std::string` is also provided so that `std::string::c_str` is not necessary (but again, `%s` is expected as the format specifier). +String formatting is provided via `strings::format`. The `strings::format` functions produces strings based on the `printf` family of functions. Except, unlike the `printf` family of functions, the `strings::format` routines attempt to "stringify" (see [here](#stringify)) any arguments that are not POD types (i.e., "plain old data": primitives, pointers, certain structs/classes and unions, etc). This enables passing structs/classes to `strings::format` provided there is a definition/specialization of `std::ostream operator<<` available for that type. Note that the `%s` format specifier is expected for each argument that gets passed. A specialization for `std::string` is also provided so that `std::string::c_str` is not necessary (but again, `%s` is expected as the format specifier). @@ -398,7 +398,7 @@ Used to represent some magnitude of bytes, i.e., kilobytes, megabytes, gigabytes Bytes bytes = Megabytes(10); ~~~ -There are operators for comparing (equal to, greater than or less than, etc) and manipulating (addition, subtraction, etc) `Bytes` objects, as well as a `std::ostream operator <<` overload (thus making them stringifiable, see [here](#stringify)). For example: +There are operators for comparing (equal to, greater than or less than, etc) and manipulating (addition, subtraction, etc) `Bytes` objects, as well as a `std::ostream operator<<` overload (thus making them stringifiable, see [here](#stringify)). For example: ~~~{.cpp} Try<Bytes> bytes = Bytes::parse("32MB"); @@ -417,7 +417,7 @@ Used to represent some duration of time. The main way to construct a `Duration` Duration d = Seconds(5); ~~~ -There are operators for comparing (equal to, greater than or less than, etc) and manipulating (addition, subtraction, etc) `Duration` objects, as well as a `std::ostream operator <<` overload (thus making them stringifiable, see [here](#stringify)). Note that the `std::ostream operator <<` overload formats the output (including the unit) based on the magnitude, for example: +There are operators for comparing (equal to, greater than or less than, etc) and manipulating (addition, subtraction, etc) `Duration` objects, as well as a `std::ostream operator<<` overload (thus making them stringifiable, see [here](#stringify)). Note that the `std::ostream operator<<` overload formats the output (including the unit) based on the magnitude, for example: ~~~{.cpp} stringify(Seconds(42)); // Yields "42secs". @@ -492,7 +492,7 @@ Wraps `boost::lexical_cast` for converting strings to numbers but returns a `Try #### `stringify` -Converts arbitrary types into strings by attempting to use an overloaded `std::ostream operator <<` (otherwise compilation fails). Note that `stringify` aborts the program if the stringification process fails. +Converts arbitrary types into strings by attempting to use an overloaded `std::ostream operator<<` (otherwise compilation fails). Note that `stringify` aborts the program if the stringification process fails. #### `ThreadLocal` http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/bytes.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/bytes.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/bytes.hpp index 451a53d..e9cf856 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/bytes.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/bytes.hpp @@ -79,26 +79,26 @@ public: uint64_t gigabytes() const { return value / GIGABYTES; } uint64_t terabytes() const { return value / TERABYTES; } - bool operator < (const Bytes& that) const { return value < that.value; } - bool operator <= (const Bytes& that) const { return value <= that.value; } - bool operator > (const Bytes& that) const { return value > that.value; } - bool operator >= (const Bytes& that) const { return value >= that.value; } - bool operator == (const Bytes& that) const { return value == that.value; } - bool operator != (const Bytes& that) const { return value != that.value; } - - Bytes& operator += (const Bytes& that) + bool operator<(const Bytes& that) const { return value < that.value; } + bool operator<=(const Bytes& that) const { return value <= that.value; } + bool operator>(const Bytes& that) const { return value > that.value; } + bool operator>=(const Bytes& that) const { return value >= that.value; } + bool operator==(const Bytes& that) const { return value == that.value; } + bool operator!=(const Bytes& that) const { return value != that.value; } + + Bytes& operator+=(const Bytes& that) { value += that.value; return *this; } - Bytes& operator -= (const Bytes& that) + Bytes& operator-=(const Bytes& that) { value -= that.value; return *this; } - Bytes& operator *= (double multiplier) + Bytes& operator*=(double multiplier) { if (multiplier < 0) { ABORT("Multiplying Bytes by negative multiplier " @@ -109,7 +109,7 @@ public: return *this; } - Bytes& operator /= (double divisor) + Bytes& operator/=(double divisor) { if (divisor < 0) { ABORT("Dividing Bytes by negative divisor " @@ -160,7 +160,7 @@ public: }; -inline std::ostream& operator << (std::ostream& stream, const Bytes& bytes) +inline std::ostream& operator<<(std::ostream& stream, const Bytes& bytes) { // Only raise the unit when there is no loss of information. if (bytes.bytes() == 0) { @@ -179,7 +179,7 @@ inline std::ostream& operator << (std::ostream& stream, const Bytes& bytes) } -inline Bytes operator + (const Bytes& lhs, const Bytes& rhs) +inline Bytes operator+(const Bytes& lhs, const Bytes& rhs) { Bytes sum = lhs; sum += rhs; @@ -187,7 +187,7 @@ inline Bytes operator + (const Bytes& lhs, const Bytes& rhs) } -inline Bytes operator - (const Bytes& lhs, const Bytes& rhs) +inline Bytes operator-(const Bytes& lhs, const Bytes& rhs) { Bytes diff = lhs; diff -= rhs; @@ -195,7 +195,7 @@ inline Bytes operator - (const Bytes& lhs, const Bytes& rhs) } -inline Bytes operator * (const Bytes& lhs, double multiplier) +inline Bytes operator*(const Bytes& lhs, double multiplier) { if (multiplier < 0) { ABORT("Multiplying Bytes by negative multiplier " @@ -208,7 +208,7 @@ inline Bytes operator * (const Bytes& lhs, double multiplier) } -inline Bytes operator / (const Bytes& lhs, double divisor) +inline Bytes operator/(const Bytes& lhs, double divisor) { if (divisor < 0) { ABORT("Dividing Bytes by negative divisor " http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/cache.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/cache.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/cache.hpp index 9672018..b1cc42f 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/cache.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/cache.hpp @@ -33,9 +33,7 @@ class Cache; // Outputs the key/value pairs from least to most-recently used. template <typename Key, typename Value> -std::ostream& operator << ( - std::ostream& stream, - const Cache<Key, Value>& c); +std::ostream& operator<<(std::ostream& stream, const Cache<Key, Value>& c); // Provides a least-recently used (LRU) cache of some predefined @@ -92,10 +90,10 @@ public: private: // Not copyable, not assignable. Cache(const Cache&); - Cache& operator = (const Cache&); + Cache& operator=(const Cache&); // Give the operator access to our internals. - friend std::ostream& operator << <>( + friend std::ostream& operator<<( std::ostream& stream, const Cache<Key, Value>& c); @@ -144,9 +142,7 @@ private: template <typename Key, typename Value> -std::ostream& operator << ( - std::ostream& stream, - const Cache<Key, Value>& c) +std::ostream& operator<<(std::ostream& stream, const Cache<Key, Value>& c) { typename Cache<Key, Value>::list::const_iterator i1; for (i1 = c.keys.begin(); i1 != c.keys.end(); i1++) { http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/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 35fb034..9055154 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp @@ -103,59 +103,59 @@ public: return t; } - bool operator < (const Duration& d) const { return nanos < d.nanos; } - bool operator <= (const Duration& d) const { return nanos <= d.nanos; } - bool operator > (const Duration& d) const { return nanos > d.nanos; } - bool operator >= (const Duration& d) const { return nanos >= d.nanos; } - bool operator == (const Duration& d) const { return nanos == d.nanos; } - bool operator != (const Duration& d) const { return nanos != d.nanos; } - - Duration& operator += (const Duration& that) + bool operator<(const Duration& d) const { return nanos < d.nanos; } + bool operator<=(const Duration& d) const { return nanos <= d.nanos; } + bool operator>(const Duration& d) const { return nanos > d.nanos; } + bool operator>=(const Duration& d) const { return nanos >= d.nanos; } + bool operator==(const Duration& d) const { return nanos == d.nanos; } + bool operator!=(const Duration& d) const { return nanos != d.nanos; } + + Duration& operator+=(const Duration& that) { nanos += that.nanos; return *this; } - Duration& operator -= (const Duration& that) + Duration& operator-=(const Duration& that) { nanos -= that.nanos; return *this; } - Duration& operator *= (double multiplier) + Duration& operator*=(double multiplier) { nanos = static_cast<int64_t>(nanos * multiplier); return *this; } - Duration& operator /= (double divisor) + Duration& operator/=(double divisor) { nanos = static_cast<int64_t>(nanos / divisor); return *this; } - Duration operator + (const Duration& that) const + Duration operator+(const Duration& that) const { Duration sum = *this; sum += that; return sum; } - Duration operator - (const Duration& that) const + Duration operator-(const Duration& that) const { Duration diff = *this; diff -= that; return diff; } - Duration operator * (double multiplier) const + Duration operator*(double multiplier) const { Duration product = *this; product *= multiplier; return product; } - Duration operator / (double divisor) const + Duration operator/(double divisor) const { Duration quotient = *this; quotient /= divisor; @@ -197,7 +197,7 @@ private: int64_t nanos; - friend std::ostream& operator << ( + friend std::ostream& operator<<( std::ostream& stream, const Duration& duration); }; @@ -314,9 +314,7 @@ public: }; -inline std::ostream& operator << ( - std::ostream& stream, - const Duration& duration_) +inline std::ostream& operator<<(std::ostream& stream, const Duration& duration_) { long precision = stream.precision(); http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp index ae54566..9da213f 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp @@ -238,7 +238,7 @@ private: // Need to declare/define some explicit subclasses of FlagsBase so -// that we can overload the 'Flags::operator FlagsN () const' +// that we can overload the 'Flags::operator FlagsN() const' // functions for each possible type. class _Flags1 : public virtual FlagsBase {}; class _Flags2 : public virtual FlagsBase {}; @@ -833,7 +833,7 @@ inline std::string FlagsBase::usage( const Option<std::string>& message) const } -inline std::ostream& operator << (std::ostream& stream, const FlagsBase& flags) +inline std::ostream& operator<<(std::ostream& stream, const FlagsBase& flags) { std::vector<std::string> _flags; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp index e969b09..2dd1905 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp @@ -121,7 +121,7 @@ const hashset<Elem, Hash, Equal>& hashset<Elem, Hash, Equal>::EMPTY = // Union operator. template <typename Elem, typename Hash, typename Equal> -hashset<Elem, Hash, Equal> operator | ( +hashset<Elem, Hash, Equal> operator|( const hashset<Elem, Hash, Equal>& left, const hashset<Elem, Hash, Equal>& right) { http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp index 89e77bf..c4cf01a 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/interval.hpp @@ -54,7 +54,7 @@ public: // (3, 4]: (Bound<int>::open(3), Bound<int>::closed(4)) // [0, 5): (Bound<int>::closed(0), Bound<int>::open(5)) // [1, 2]: (Bound<int>::closed(1), Bound<int>::closed(2)) - Interval<T> operator , (const Bound<T>& right) const; + Interval<T> operator,(const Bound<T>& right) const; private: enum Type @@ -92,21 +92,21 @@ public: // Checks if this interval intersects with an interval set. bool intersects(const IntervalSet<T>& set) const; - bool operator == (const Interval<T>& that) const + bool operator==(const Interval<T>& that) const { return data == that.data; } - bool operator != (const Interval<T>& that) const + bool operator!=(const Interval<T>& that) const { - return !operator == (that); + return !(*this == that); } private: friend class Bound<T>; template <typename X> - friend std::ostream& operator << ( + friend std::ostream& operator<<( std::ostream& stream, const Interval<X>& interval); @@ -121,14 +121,14 @@ private: template <typename T> -std::ostream& operator << (std::ostream& stream, const Interval<T>& interval) +std::ostream& operator<<(std::ostream& stream, const Interval<T>& interval) { return stream << interval.data; } template <typename T> -Interval<T> Bound<T>::operator , (const Bound<T>& right) const +Interval<T> Bound<T>::operator,(const Bound<T>& right) const { if (type == OPEN) { if (right.type == OPEN) { @@ -238,65 +238,65 @@ public: } // Overloaded operators. - bool operator == (const IntervalSet<T>& that) const + bool operator==(const IntervalSet<T>& that) const { return static_cast<const Base&>(*this) == static_cast<const Base&>(that); } - bool operator != (const IntervalSet<T>& that) const + bool operator!=(const IntervalSet<T>& that) const { - return !operator == (that); + return !(*this == that); } - IntervalSet<T>& operator += (const T& value) + IntervalSet<T>& operator+=(const T& value) { static_cast<Base&>(*this) += value; return *this; } - IntervalSet<T>& operator += (const Interval<T>& interval) + IntervalSet<T>& operator+=(const Interval<T>& interval) { static_cast<Base&>(*this) += interval; return *this; } - IntervalSet<T>& operator += (const IntervalSet<T>& set) + IntervalSet<T>& operator+=(const IntervalSet<T>& set) { static_cast<Base&>(*this) += static_cast<const Base&>(set); return *this; } - IntervalSet<T>& operator -= (const T& value) + IntervalSet<T>& operator-=(const T& value) { static_cast<Base&>(*this) -= value; return *this; } - IntervalSet<T>& operator -= (const Interval<T>& interval) + IntervalSet<T>& operator-=(const Interval<T>& interval) { static_cast<Base&>(*this) -= interval; return *this; } - IntervalSet<T>& operator -= (const IntervalSet<T>& set) + IntervalSet<T>& operator-=(const IntervalSet<T>& set) { static_cast<Base&>(*this) -= static_cast<const Base&>(set); return *this; } - IntervalSet<T>& operator &= (const T& value) + IntervalSet<T>& operator&=(const T& value) { static_cast<Base&>(*this) &= value; return *this; } - IntervalSet<T>& operator &= (const Interval<T>& interval) + IntervalSet<T>& operator&=(const Interval<T>& interval) { static_cast<Base&>(*this) &= interval; return *this; } - IntervalSet<T>& operator &= (const IntervalSet<T>& set) + IntervalSet<T>& operator&=(const IntervalSet<T>& set) { static_cast<Base&>(*this) &= static_cast<const Base&>(set); return *this; @@ -304,7 +304,7 @@ public: private: template <typename X> - friend std::ostream& operator << ( + friend std::ostream& operator<<( std::ostream& stream, const IntervalSet<X>& set); @@ -314,7 +314,7 @@ private: template <typename T> -std::ostream& operator << (std::ostream& stream, const IntervalSet<T>& set) +std::ostream& operator<<(std::ostream& stream, const IntervalSet<T>& set) { return stream << static_cast<const typename IntervalSet<T>::Base&>(set); } @@ -335,7 +335,7 @@ bool Interval<T>::intersects(const IntervalSet<T>& set) const template <typename T, typename X> -IntervalSet<T> operator + (const IntervalSet<T>& set, const X& x) +IntervalSet<T> operator+(const IntervalSet<T>& set, const X& x) { IntervalSet<T> result(set); result += x; @@ -344,7 +344,7 @@ IntervalSet<T> operator + (const IntervalSet<T>& set, const X& x) template <typename T, typename X> -IntervalSet<T> operator - (const IntervalSet<T>& set, const X& x) +IntervalSet<T> operator-(const IntervalSet<T>& set, const X& x) { IntervalSet<T> result(set); result -= x; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp index 4910ca3..0b74586 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp @@ -143,7 +143,7 @@ public: } } - bool operator == (const IP& that) const + bool operator==(const IP& that) const { if (family_ != that.family_) { return false; @@ -152,12 +152,12 @@ public: } } - bool operator != (const IP& that) const + bool operator!=(const IP& that) const { - return !operator == (that); + return !(*this == that); } - bool operator < (const IP& that) const + bool operator<(const IP& that) const { if (family_ != that.family_) { return family_ < that.family_; @@ -166,7 +166,7 @@ public: } } - bool operator > (const IP& that) const + bool operator>(const IP& that) const { if (family_ != that.family_) { return family_ > that.family_; @@ -234,7 +234,7 @@ inline Try<IP> IP::create(const struct sockaddr& _storage) // Returns the string representation of the given IP using the // canonical dot-decimal form. For example: "10.0.0.1". -inline std::ostream& operator << (std::ostream& stream, const IP& ip) +inline std::ostream& operator<<(std::ostream& stream, const IP& ip) { switch (ip.family()) { case AF_INET: { @@ -322,14 +322,14 @@ public: } } - bool operator == (const IPNetwork& that) const + bool operator==(const IPNetwork& that) const { return address_ == that.address_ && netmask_ == that.netmask_; } - bool operator != (const IPNetwork& that) const + bool operator!=(const IPNetwork& that) const { - return !operator == (that); + return !(*this == that); } private: @@ -487,9 +487,7 @@ inline Result<IPNetwork> IPNetwork::fromLinkDevice( // Returns the string representation of the given IP network using the // canonical dot-decimal form with prefix. For example: "10.0.0.1/8". -inline std::ostream& operator << ( - std::ostream& stream, - const IPNetwork& network) +inline std::ostream& operator<<(std::ostream& stream, const IPNetwork& network) { stream << network.address() << "/" << network.prefix(); http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp index 6e0a178..8f848ad 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp @@ -215,12 +215,12 @@ private: explicit ContainmentComparator(const Value& _self) : self(_self) {} - bool operator () (const Object& other) const; - bool operator () (const Array& other) const; - bool operator () (const String& other) const; - bool operator () (const Number& other) const; - bool operator () (const Boolean& other) const; - bool operator () (const Null&) const; + bool operator()(const Object& other) const; + bool operator()(const Array& other) const; + bool operator()(const String& other) const; + bool operator()(const Number& other) const; + bool operator()(const Boolean& other) const; + bool operator()(const Null&) const; private: const Value& self; @@ -335,8 +335,7 @@ inline bool Value::contains(const Value& other) const } -inline bool Value::ContainmentComparator::operator () ( - const Object& other) const +inline bool Value::ContainmentComparator::operator()(const Object& other) const { if (!self.is<Object>()) { return false; @@ -371,8 +370,7 @@ inline bool Value::ContainmentComparator::operator () ( } -inline bool Value::ContainmentComparator::operator () ( - const String& other) const +inline bool Value::ContainmentComparator::operator()(const String& other) const { if (!self.is<String>()) { return false; @@ -381,8 +379,7 @@ inline bool Value::ContainmentComparator::operator () ( } -inline bool Value::ContainmentComparator::operator () ( - const Number& other) const +inline bool Value::ContainmentComparator::operator()(const Number& other) const { if (!self.is<Number>()) { return false; @@ -391,7 +388,7 @@ inline bool Value::ContainmentComparator::operator () ( } -inline bool Value::ContainmentComparator::operator () (const Array& other) const +inline bool Value::ContainmentComparator::operator()(const Array& other) const { if (!self.is<Array>()) { return false; @@ -413,8 +410,7 @@ inline bool Value::ContainmentComparator::operator () (const Array& other) const } -inline bool Value::ContainmentComparator::operator () ( - const Boolean& other) const +inline bool Value::ContainmentComparator::operator()(const Boolean& other) const { if (!self.is<Boolean>()) { return false; @@ -423,7 +419,7 @@ inline bool Value::ContainmentComparator::operator () ( } -inline bool Value::ContainmentComparator::operator () (const Null&) const +inline bool Value::ContainmentComparator::operator()(const Null&) const { return self.is<Null>(); } @@ -434,7 +430,7 @@ struct Comparator : boost::static_visitor<bool> Comparator(const Value& _value) : value(_value) {} - bool operator () (const Object& object) const + bool operator()(const Object& object) const { if (value.is<Object>()) { return value.as<Object>().values == object.values; @@ -442,7 +438,7 @@ struct Comparator : boost::static_visitor<bool> return false; } - bool operator () (const String& string) const + bool operator()(const String& string) const { if (value.is<String>()) { return value.as<String>().value == string.value; @@ -450,7 +446,7 @@ struct Comparator : boost::static_visitor<bool> return false; } - bool operator () (const Number& number) const + bool operator()(const Number& number) const { if (value.is<Number>()) { return value.as<Number>().value == number.value; @@ -458,7 +454,7 @@ struct Comparator : boost::static_visitor<bool> return false; } - bool operator () (const Array& array) const + bool operator()(const Array& array) const { if (value.is<Array>()) { return value.as<Array>().values == array.values; @@ -466,7 +462,7 @@ struct Comparator : boost::static_visitor<bool> return false; } - bool operator () (const Boolean& boolean) const + bool operator()(const Boolean& boolean) const { if (value.is<Boolean>()) { return value.as<Boolean>().value == boolean.value; @@ -474,7 +470,7 @@ struct Comparator : boost::static_visitor<bool> return false; } - bool operator () (const Null&) const + bool operator()(const Null&) const { return value.is<Null>(); } @@ -484,19 +480,19 @@ private: }; -inline bool operator == (const Value& lhs, const Value& rhs) +inline bool operator==(const Value& lhs, const Value& rhs) { return boost::apply_visitor(Comparator(lhs), rhs); } -inline bool operator != (const Value& lhs, const Value& rhs) +inline bool operator!=(const Value& lhs, const Value& rhs) { return !(lhs == rhs); } -inline std::ostream& operator << (std::ostream& out, const String& string) +inline std::ostream& operator<<(std::ostream& out, const String& string) { // TODO(benh): This escaping DOES NOT handle unicode, it encodes as ASCII. // See RFC4627 for the JSON string specificiation. @@ -534,7 +530,7 @@ inline std::ostream& operator << (std::ostream& out, const String& string) } -inline std::ostream& operator << (std::ostream& out, const Number& number) +inline std::ostream& operator<<(std::ostream& out, const Number& number) { // Use the guaranteed accurate precision, see: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf @@ -543,7 +539,7 @@ inline std::ostream& operator << (std::ostream& out, const Number& number) } -inline std::ostream& operator << (std::ostream& out, const Object& object) +inline std::ostream& operator<<(std::ostream& out, const Object& object) { out << "{"; std::map<std::string, Value>::const_iterator iterator; @@ -559,7 +555,7 @@ inline std::ostream& operator << (std::ostream& out, const Object& object) } -inline std::ostream& operator << (std::ostream& out, const Array& array) +inline std::ostream& operator<<(std::ostream& out, const Array& array) { out << "["; std::vector<Value>::const_iterator iterator; @@ -575,13 +571,13 @@ inline std::ostream& operator << (std::ostream& out, const Array& array) } -inline std::ostream& operator << (std::ostream& out, const Boolean& boolean) +inline std::ostream& operator<<(std::ostream& out, const Boolean& boolean) { return out << (boolean.value ? "true" : "false"); } -inline std::ostream& operator << (std::ostream& out, const Null&) +inline std::ostream& operator<<(std::ostream& out, const Null&) { return out << "null"; } http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/mac.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/mac.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/mac.hpp index 30baa65..9428717 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/mac.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/mac.hpp @@ -81,16 +81,16 @@ public: // Returns the byte at the given index. For example, for a MAC // address 01:23:45:67:89:ab, mac[0] = 01, mac[1] = 23 and etc. - uint8_t operator [] (size_t index) const + uint8_t operator[](size_t index) const { if (index >= 6) { - ABORT("Invalid index specified in MAC::operator []\n"); + ABORT("Invalid index specified in MAC::operator[]\n"); } return bytes[index]; } - bool operator == (const MAC& that) const + bool operator==(const MAC& that) const { for (size_t i = 0; i < 6; i++) { if (bytes[i] != that.bytes[i]) { @@ -100,9 +100,9 @@ public: return true; } - bool operator != (const MAC& that) const + bool operator!=(const MAC& that) const { - return !operator == (that); + return !(*this == that); } private: @@ -115,7 +115,7 @@ private: // address, which contains six groups of two hexadecimal digits, // separated by colons, in transmission order (e.g., // 01:23:45:67:89:ab). -inline std::ostream& operator << (std::ostream& stream, const MAC& mac) +inline std::ostream& operator<<(std::ostream& stream, const MAC& mac) { char buffer[18]; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp index 549fc46..54d08e7 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp @@ -73,7 +73,7 @@ public: } } - Option<T>& operator = (const Option<T>& that) + Option<T>& operator=(const Option<T>& that) { if (this != &that) { if (isSome()) { @@ -88,7 +88,7 @@ public: return *this; } - Option<T>& operator = (Option<T>&& that) + Option<T>& operator=(Option<T>&& that) { if (this != &that) { if (isSome()) { @@ -103,25 +103,25 @@ public: return *this; } - bool operator == (const Option<T>& that) const + bool operator==(const Option<T>& that) const { return (isNone() && that.isNone()) || (isSome() && that.isSome() && t == that.t); } - bool operator != (const Option<T>& that) const + bool operator!=(const Option<T>& that) const { - return !operator == (that); + return !(*this == that); } - bool operator == (const T& that) const + bool operator==(const T& that) const { return isSome() && t == that; } - bool operator != (const T& that) const + bool operator!=(const T& that) const { - return !operator == (that); + return !(*this == that); } bool isSome() const { return state == SOME; } http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp index 24c26e9..5592e10 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp @@ -257,7 +257,7 @@ private: { SharedMemoryDeleter(int _fd) : fd(_fd) {} - void operator () (Tree::Memory* process) const + void operator()(Tree::Memory* process) const { if (munmap(process, sizeof(Tree::Memory)) == -1) { ABORT(std::string("Failed to unmap memory: ") + strerror(errno)); @@ -417,7 +417,7 @@ private: public: // Prepares and instantiates the process tree. - Try<ProcessTree> operator () () const + Try<ProcessTree> operator()() const { Try<Tree> tree = prepare(); http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/process.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/process.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/process.hpp index 5d7404b..99afbf8 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/process.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/process.hpp @@ -63,12 +63,12 @@ struct Process // TODO(bmahler): Add additional data as needed. - bool operator < (const Process& p) const { return pid < p.pid; } - bool operator <= (const Process& p) const { return pid <= p.pid; } - bool operator > (const Process& p) const { return pid > p.pid; } - bool operator >= (const Process& p) const { return pid >= p.pid; } - bool operator == (const Process& p) const { return pid == p.pid; } - bool operator != (const Process& p) const { return pid != p.pid; } + bool operator<(const Process& p) const { return pid < p.pid; } + bool operator<=(const Process& p) const { return pid <= p.pid; } + bool operator>(const Process& p) const { return pid > p.pid; } + bool operator>=(const Process& p) const { return pid >= p.pid; } + bool operator==(const Process& p) const { return pid == p.pid; } + bool operator!=(const Process& p) const { return pid != p.pid; } }; @@ -99,12 +99,12 @@ public: return find(pid).isSome(); } - operator Process () const + operator Process() const { return process; } - operator pid_t () const + operator pid_t() const { return process.pid; } @@ -124,9 +124,7 @@ private: }; -inline std::ostream& operator << ( - std::ostream& stream, - const ProcessTree& tree) +inline std::ostream& operator<<(std::ostream& stream, const ProcessTree& tree) { if (tree.children.empty()) { stream << "--- " << tree.process.pid << " "; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/signals.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/signals.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/signals.hpp index 420d5bb..e9b05ef 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/signals.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/signals.hpp @@ -168,8 +168,7 @@ struct Suppressor } // Needed for the suppress() macro. - operator bool () { return true; } - + operator bool() { return true; } private: const int signal; bool pending; // Whether the signal is already pending. http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/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 0e94e22..8a8ede3 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/sysctl.hpp @@ -101,7 +101,7 @@ private: Integer(int _levels, int* _name); template <typename T> - operator Try<T> (); + operator Try<T>(); const int levels; int* name; @@ -112,7 +112,7 @@ private: Table(int _levels, int* _name, const Option<size_t>& _length); template <typename T> - operator Try<std::vector<T> > (); + operator Try<std::vector<T>>(); const int levels; int* name; @@ -242,7 +242,7 @@ inline sysctl::Integer::Integer( template <typename T> -sysctl::Integer::operator Try<T> () +sysctl::Integer::operator Try<T>() { T i; size_t size = sizeof(i); @@ -264,7 +264,7 @@ inline sysctl::Table::Table( template <typename T> -sysctl::Table::operator Try<std::vector<T> > () +sysctl::Table::operator Try<std::vector<T>>() { size_t size = 0; if (length.isNone()) { http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/process.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/process.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/process.hpp index bbb796d..e823838 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/process.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/process.hpp @@ -33,9 +33,7 @@ class ProcessTree }; -inline std::ostream& operator << ( - std::ostream& stream, - const ProcessTree& tree) +inline std::ostream& operator<<(std::ostream& stream, const ProcessTree& tree) { UNIMPLEMENTED; } http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/signals.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/signals.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/signals.hpp index 70e9b15..8361a13 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/signals.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/signals.hpp @@ -80,7 +80,7 @@ struct Suppressor } // Needed for the suppress() macro. - operator bool () { return true; } + operator bool() { return true; } }; } // namespace internal { http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp index 5af9be8..6a13b13 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp @@ -149,7 +149,7 @@ public: } // Implicit conversion from Path to string. - operator std::string () const + operator std::string() const { return value; } @@ -158,7 +158,7 @@ public: }; -inline std::ostream& operator << ( +inline std::ostream& operator<<( std::ostream& stream, const Path& path) { http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/proc.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/proc.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/proc.hpp index 0004fa5..66ece4d 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/proc.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/proc.hpp @@ -405,14 +405,14 @@ struct CPU }; -inline bool operator == (const CPU& lhs, const CPU& rhs) +inline bool operator==(const CPU& lhs, const CPU& rhs) { return (lhs.id == rhs.id) && (lhs.core == rhs.core) && (lhs.socket == rhs.socket); } -inline bool operator < (const CPU& lhs, const CPU& rhs) +inline bool operator<(const CPU& lhs, const CPU& rhs) { // Sort by (socket, core, id). if (lhs.socket != rhs.socket) { @@ -429,7 +429,7 @@ inline bool operator < (const CPU& lhs, const CPU& rhs) } -inline std::ostream& operator << (std::ostream& out, const CPU& cpu) +inline std::ostream& operator<<(std::ostream& out, const CPU& cpu) { return out << "CPU (id:" << cpu.id << ", " << "core:" << cpu.core << ", " http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp index a7de91f..82eae87 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp @@ -154,7 +154,7 @@ namespace internal { template <typename T> struct Read { - Result<T> operator () (int fd, bool ignorePartial, bool undoFailed) + Result<T> operator()(int fd, bool ignorePartial, bool undoFailed) { off_t offset = 0; @@ -245,7 +245,7 @@ struct Read template <typename T> struct Read<google::protobuf::RepeatedPtrField<T>> { - Result<google::protobuf::RepeatedPtrField<T>> operator () ( + Result<google::protobuf::RepeatedPtrField<T>> operator()( int fd, bool ignorePartial, bool undoFailed) { google::protobuf::RepeatedPtrField<T> result; @@ -324,7 +324,7 @@ struct Parser : boost::static_visitor<Try<Nothing> > reflection(message->GetReflection()), field(_field) {} - Try<Nothing> operator () (const JSON::Object& object) const + Try<Nothing> operator()(const JSON::Object& object) const { switch (field->type()) { case google::protobuf::FieldDescriptor::TYPE_MESSAGE: @@ -341,7 +341,7 @@ struct Parser : boost::static_visitor<Try<Nothing> > return Nothing(); } - Try<Nothing> operator () (const JSON::String& string) const + Try<Nothing> operator()(const JSON::String& string) const { switch (field->type()) { case google::protobuf::FieldDescriptor::TYPE_STRING: @@ -374,7 +374,7 @@ struct Parser : boost::static_visitor<Try<Nothing> > return Nothing(); } - Try<Nothing> operator () (const JSON::Number& number) const + Try<Nothing> operator()(const JSON::Number& number) const { switch (field->type()) { case google::protobuf::FieldDescriptor::TYPE_DOUBLE: @@ -462,7 +462,7 @@ struct Parser : boost::static_visitor<Try<Nothing> > return Nothing(); } - Try<Nothing> operator () (const JSON::Array& array) const + Try<Nothing> operator()(const JSON::Array& array) const { if (!field->is_repeated()) { return Error("Not expecting a JSON array for field '" + @@ -481,7 +481,7 @@ struct Parser : boost::static_visitor<Try<Nothing> > return Nothing(); } - Try<Nothing> operator () (const JSON::Boolean& boolean) const + Try<Nothing> operator()(const JSON::Boolean& boolean) const { switch (field->type()) { case google::protobuf::FieldDescriptor::TYPE_BOOL: @@ -498,7 +498,7 @@ struct Parser : boost::static_visitor<Try<Nothing> > return Nothing(); } - Try<Nothing> operator () (const JSON::Null&) const + Try<Nothing> operator()(const JSON::Null&) const { return Error("Not expecting a JSON null"); } @@ -720,7 +720,7 @@ struct Protobuf } } - operator Object () const { return object; } + operator Object() const { return object; } private: JSON::Object object; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp index f0b0a48..d5c562d 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp @@ -90,7 +90,7 @@ public: // Try<Option<T>>. Result(const Result<T>& that) = default; ~Result() = default; - Result<T>& operator = (const Result<T>& that) = default; + Result<T>& operator=(const Result<T>& that) = default; // 'isSome', 'isNone', and 'isError' are mutually exclusive. They // correspond to the underlying unioned state of the Option and Try. http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/set.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/set.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/set.hpp index ea8a13f..85466db 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/set.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/set.hpp @@ -53,7 +53,7 @@ public: template <typename T> -std::set<T> operator | (const std::set<T>& left, const std::set<T>& right) +std::set<T> operator|(const std::set<T>& left, const std::set<T>& right) { // Note, we're not using 'set_union' since it affords us no benefit // in efficiency and is more complicated to use given we have sets. @@ -64,7 +64,7 @@ std::set<T> operator | (const std::set<T>& left, const std::set<T>& right) template <typename T> -std::set<T> operator + (const std::set<T>& left, const T& t) +std::set<T> operator+(const std::set<T>& left, const T& t) { std::set<T> result = left; result.insert(t); @@ -73,7 +73,7 @@ std::set<T> operator + (const std::set<T>& left, const T& t) template <typename T> -std::set<T> operator & (const std::set<T>& left, const std::set<T>& right) +std::set<T> operator&(const std::set<T>& left, const std::set<T>& right) { std::set<T> result; std::set_intersection( http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp index 5ad6114..0e0e19e 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp @@ -64,7 +64,7 @@ public: // Option<T>. Try(const Try<T>& that) = default; ~Try() = default; - Try<T>& operator = (const Try<T>& that) = default; + Try<T>& operator=(const Try<T>& that) = default; // 'isSome' and 'isError' are mutually exclusive. They correspond // to the underlying state of the Option. http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp index 450b3a7..5101084 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp @@ -76,19 +76,19 @@ struct Version minorVersion(_minorVersion), patchVersion(_patchVersion) {} - bool operator == (const Version& other) const + bool operator==(const Version& other) const { return majorVersion == other.majorVersion && - minorVersion == other.minorVersion && - patchVersion == other.patchVersion; + minorVersion == other.minorVersion && + patchVersion == other.patchVersion; } - bool operator != (const Version& other) const + bool operator!=(const Version& other) const { return !(*this == other); } - bool operator < (const Version& other) const + bool operator<(const Version& other) const { // Lexicographic ordering. if (majorVersion != other.majorVersion) { @@ -100,7 +100,7 @@ struct Version } } - bool operator > (const Version& other) const + bool operator>(const Version& other) const { // Lexicographic ordering. if (majorVersion != other.majorVersion) { @@ -112,17 +112,17 @@ struct Version } } - bool operator <= (const Version& other) const + bool operator<=(const Version& other) const { return *this < other || *this == other; } - bool operator >= (const Version& other) const + bool operator>=(const Version& other) const { return *this > other || *this == other; } - friend inline std::ostream& operator << (std::ostream& s, const Version& v); + friend inline std::ostream& operator<<(std::ostream& s, const Version& v); const int majorVersion; const int minorVersion; @@ -130,7 +130,7 @@ struct Version }; -inline std::ostream& operator << (std::ostream& s, const Version& v) +inline std::ostream& operator<<(std::ostream& s, const Version& v) { return s << v.majorVersion << "." << v.minorVersion << "." << v.patchVersion; } http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp index 984c02c..42f7d98 100644 --- a/3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp +++ b/3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp @@ -107,7 +107,7 @@ TEST(HashMapTest, CustomHashAndEqual) { struct CaseInsensitiveHash { - size_t operator () (const string& key) const + size_t operator()(const string& key) const { size_t seed = 0; foreach (const char c, key) { @@ -119,7 +119,7 @@ TEST(HashMapTest, CustomHashAndEqual) struct CaseInsensitiveEqual { - bool operator () (const string& left, const string& right) const + bool operator()(const string& left, const string& right) const { if (left.size() != right.size()) { return false; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/tests/hashset_tests.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/tests/hashset_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/hashset_tests.cpp index 341c5e0..3802a29 100644 --- a/3rdparty/libprocess/3rdparty/stout/tests/hashset_tests.cpp +++ b/3rdparty/libprocess/3rdparty/stout/tests/hashset_tests.cpp @@ -77,7 +77,7 @@ TEST(HashsetTest, CustomHashAndEqual) { struct CaseInsensitiveHash { - size_t operator () (const string& key) const + size_t operator()(const string& key) const { size_t seed = 0; foreach (const char c, key) { @@ -89,7 +89,7 @@ TEST(HashsetTest, CustomHashAndEqual) struct CaseInsensitiveEqual { - bool operator () (const string& left, const string& right) const + bool operator()(const string& left, const string& right) const { if (left.size() != right.size()) { return false; http://git-wip-us.apache.org/repos/asf/mesos/blob/bce0a371/3rdparty/libprocess/3rdparty/stout/tests/recordio_tests.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/tests/recordio_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/recordio_tests.cpp index d036785..49c09de 100644 --- a/3rdparty/libprocess/3rdparty/stout/tests/recordio_tests.cpp +++ b/3rdparty/libprocess/3rdparty/stout/tests/recordio_tests.cpp @@ -29,7 +29,7 @@ using std::string; template <typename T> -bool operator == (Try<T> lhs, Try<T> rhs) +bool operator==(Try<T> lhs, Try<T> rhs) { if (lhs.isSome() != rhs.isSome()) { return false; @@ -44,14 +44,14 @@ bool operator == (Try<T> lhs, Try<T> rhs) template <typename T> -bool operator != (Try<T> lhs, Try<T> rhs) +bool operator!=(Try<T> lhs, Try<T> rhs) { return !(lhs == rhs); } template <typename T> -bool operator == (deque<T> rhs, deque<T> lhs) +bool operator==(deque<T> rhs, deque<T> lhs) { if (rhs.size() != lhs.size()) { return false;
