[libcxx-commits] [pstl] r356945 - [pstl][NFC] Remove some warnings

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 25 13:44:08 PDT 2019


Author: ldionne
Date: Mon Mar 25 13:44:07 2019
New Revision: 356945

URL: http://llvm.org/viewvc/llvm-project?rev=356945&view=rev
Log:
[pstl][NFC] Remove some warnings

Modified:
    pstl/trunk/include/pstl/internal/parallel_backend_tbb.h
    pstl/trunk/include/pstl/internal/unseq_backend_simd.h

Modified: pstl/trunk/include/pstl/internal/parallel_backend_tbb.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/parallel_backend_tbb.h?rev=356945&r1=356944&r2=356945&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/parallel_backend_tbb.h (original)
+++ pstl/trunk/include/pstl/internal/parallel_backend_tbb.h Mon Mar 25 13:44:07 2019
@@ -233,7 +233,7 @@ class trans_scan_body
     sum() const
     {
         __TBB_ASSERT(_M_has_sum, "sum expected");
-        return *(_Tp*)_M_sum_storage;
+        return *const_cast<_Tp*>(reinterpret_cast<_Tp const*>(_M_sum_storage));
     }
 
     void

Modified: pstl/trunk/include/pstl/internal/unseq_backend_simd.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/unseq_backend_simd.h?rev=356945&r1=356944&r2=356945&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/unseq_backend_simd.h (original)
+++ pstl/trunk/include/pstl/internal/unseq_backend_simd.h Mon Mar 25 13:44:07 2019
@@ -456,7 +456,7 @@ template <typename _Size, typename _Tp,
 typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
 simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept
 {
-    const std::size_t __block_size = __lane_size / sizeof(_Tp);
+    const _Size __block_size = __lane_size / sizeof(_Tp);
     if (__n > 2 * __block_size && __block_size > 1)
     {
         alignas(__lane_size) char __lane_[__lane_size];




More information about the libcxx-commits mailing list