From 0014f950bd1eebf68b78a8e3cdfe61747ecb70eb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 1 Nov 2018 06:55:23 -0600 Subject: [PATCH] Ensure a left-shift operation happens in the right data type. --- source/base/utilities.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/base/utilities.cc b/source/base/utilities.cc index 659f82b45c..eed85074c3 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -132,7 +132,7 @@ namespace Utilities // based on that get the maximum integer: const Integer max_int = (min_bits == std::numeric_limits::digits ? std::numeric_limits::max() : - ((Integer)1 << min_bits) - 1); + (Integer(1) << min_bits) - 1); std::vector> int_points(points.size()); @@ -193,7 +193,7 @@ namespace Utilities ExcMessage("This integer type can not hold " + std::to_string(bits_per_dim) + " bits.")); - const Integer M = 1 << (bits_per_dim - 1); // largest bit + const Integer M = Integer(1) << (bits_per_dim - 1); // largest bit for (unsigned int index = 0; index < int_points.size(); ++index) { -- 2.39.5