diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f8fa23..7fd83548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Parenthesise all uses of min() and max(). * Extend Drone MSVC tests. * Fix MSVC build error. diff --git a/example/http/server/fast/http_server_fast.cpp b/example/http/server/fast/http_server_fast.cpp index 66c27cad..0c7ca453 100644 --- a/example/http/server/fast/http_server_fast.cpp +++ b/example/http/server/fast/http_server_fast.cpp @@ -297,7 +297,7 @@ private: // Sleep indefinitely until we're given a new deadline. request_deadline_.expires_at( - std::chrono::steady_clock::time_point::max()); + (std::chrono::steady_clock::time_point::max)()); } request_deadline_.async_wait( diff --git a/test/beast/http/file_body.cpp b/test/beast/http/file_body.cpp index a84ca899..3a7f788b 100644 --- a/test/beast/http/file_body.cpp +++ b/test/beast/http/file_body.cpp @@ -154,7 +154,7 @@ public: std::size_t to_write = 4097; while (written < to_write) { - auto size = std::min(ten.size(), to_write - written); + auto size = (std::min)(ten.size(), to_write - written); fstemp << ten.substr(0, size); BEAST_EXPECT(fstemp.good()); written += size; diff --git a/test/beast/websocket/_detail_prng.cpp b/test/beast/websocket/_detail_prng.cpp index 882940e0..bf826bd9 100644 --- a/test/beast/websocket/_detail_prng.cpp +++ b/test/beast/websocket/_detail_prng.cpp @@ -42,20 +42,20 @@ public: void testPrng(F const& f) { - auto const min = std::numeric_limits::min(); - auto const max = std::numeric_limits::max(); + auto const mn = (std::numeric_limits::min)(); + auto const mx = (std::numeric_limits::max)(); { auto v = f()(); BEAST_EXPECT( - v >= min && - v <= max); + v >= mn && + v <= mx); } { auto v = f()(); BEAST_EXPECT( - v >= min && - v <= max); + v >= mn && + v <= mx); } } diff --git a/test/beast/zlib/inflate_stream.cpp b/test/beast/zlib/inflate_stream.cpp index 0f1e9d1d..6207f047 100644 --- a/test/beast/zlib/inflate_stream.cpp +++ b/test/beast/zlib/inflate_stream.cpp @@ -525,13 +525,13 @@ public: zs.next_in = &*in.begin(); zs.next_out = &out[0]; - zs.avail_in = std::min(in.size(), len); + zs.avail_in = (std::min)(in.size(), len); zs.avail_out = out.size(); while (zs.avail_in > 0 && !ec) { is.write(zs, Flush::sync, ec); - auto n = std::min(zs.avail_in, len); + auto n = (std::min)(zs.avail_in, len); zs.next_in = static_cast(zs.next_in) + n; zs.avail_in -= n; }