[libcxx-commits] [PATCH] D66422: [libcxx] Explicitly cast in generate_canonical

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 20 08:38:58 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL369393: [libc++] Explicitly cast in generate_canonical (authored by ldionne, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66422?vs=215919&id=216164#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66422/new/

https://reviews.llvm.org/D66422

Files:
  libcxx/trunk/include/random


Index: libcxx/trunk/include/random
===================================================================
--- libcxx/trunk/include/random
+++ libcxx/trunk/include/random
@@ -3645,7 +3645,7 @@
     const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
 #endif
     const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0);
-    const _RealType _Rp = _URNG::max() - _URNG::min() + _RealType(1);
+    const _RealType _Rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
     _RealType __base = _Rp;
     _RealType _Sp = __g() - _URNG::min();
     for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66422.216164.patch
Type: text/x-patch
Size: 662 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190820/d5dc7eaa/attachment.bin>


More information about the libcxx-commits mailing list