From 311748ee09bd727678107a9081810741c6347b23 Mon Sep 17 00:00:00 2001 From: pchome Date: Mon, 2 Apr 2018 19:49:19 +0300 Subject: [PATCH] [dxgi] Replace UINT_MAX with std::numeric_limits (#234) `limits.h` required for `UINT_MAX` and not always used, so better to use standard C++ variant from ``. Some compilers may simply return `UINT_MAX` value, gcc version: `max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; }`. --- src/dxgi/dxgi_output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxgi/dxgi_output.cpp b/src/dxgi/dxgi_output.cpp index 5159ee0f3..9018fc9bb 100644 --- a/src/dxgi/dxgi_output.cpp +++ b/src/dxgi/dxgi_output.cpp @@ -115,7 +115,7 @@ namespace dxvk { return DXGI_ERROR_NOT_FOUND; // Select mode with minimal height+width difference - UINT minDifference = UINT_MAX; + UINT minDifference = std::numeric_limits::max(); for (auto& mode : modes) { UINT currDifference = std::abs(int(pModeToMatch->Width - mode.Width))