From: Wolfgang Bangerth Date: Thu, 1 Nov 2018 12:55:23 +0000 (-0600) Subject: Ensure a left-shift operation happens in the right data type. X-Git-Tag: v9.1.0-rc1~589^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7400%2Fhead;p=dealii.git Ensure a left-shift operation happens in the right data type. --- 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) {