Repository: mesos Updated Branches: refs/heads/master d1ee9c989 -> a626a2e4f
Fixed warnings in `numify.hpp`. When the template is instantiated for unsigned scalars the unary negation generates warnings. Review: https://reviews.apache.org/r/52062/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6a44a8ba Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6a44a8ba Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6a44a8ba Branch: refs/heads/master Commit: 6a44a8ba7d32fcab40505f27c984239de2f684b9 Parents: d1ee9c9 Author: Daniel Pravat <dpra...@outlook.com> Authored: Tue Sep 27 19:30:56 2016 +0200 Committer: Michael Park <mp...@apache.org> Committed: Wed Sep 28 00:40:12 2016 +0200 ---------------------------------------------------------------------- 3rdparty/stout/include/stout/numify.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/6a44a8ba/3rdparty/stout/include/stout/numify.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/numify.hpp b/3rdparty/stout/include/stout/numify.hpp index c174fcb..6db9a78 100644 --- a/3rdparty/stout/include/stout/numify.hpp +++ b/3rdparty/stout/include/stout/numify.hpp @@ -50,7 +50,17 @@ Try<T> numify(const std::string& s) if (strings::startsWith(s, "-")) { ss << std::hex << s.substr(1); ss >> result; + // Note: When numify is instantiated with unsigned scalars + // the expected behaviour is as follow: + // numify<T>("-1") == std::numeric_limits<T>::max(); + // Disabled unary negation warning for all types. +#ifdef __WINDOWS__ + #pragma warning(disable:4146) +#endif result = -result; +#ifdef __WINDOWS__ + #pragma warning(default:4146) +#endif } else { ss << std::hex << s; ss >> result;