From 5cf50c1c1afe4a3829f29f4af31d325ca305626f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 7 Aug 2017 12:34:59 +0300 Subject: Fix 'truncation of constant value' warning (VC) --- libbutl/path.hxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libbutl/path.hxx b/libbutl/path.hxx index 342a188..e26d545 100644 --- a/libbutl/path.hxx +++ b/libbutl/path.hxx @@ -1192,9 +1192,13 @@ namespace std for (size_t i (0), n (s.size ()); i != n; ++i) { hash ^= static_cast (butl::lcase (s[i])); + + // We are using C-style cast to suppress VC warning for 32-bit target + // (the value is compiled but not used). + // hash *= sizeof (size_t) == 4 - ? static_cast(16777619UL) - : static_cast(1099511628211ULL); + ? static_cast (16777619UL) + : (size_t) 1099511628211ULL; } return hash; #endif -- cgit v1.1