summaryrefslogtreecommitdiff
path: root/sal/rtl/random.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:17:51 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:17:51 +0100
commit5a3bb76cd384fa3760fe8481ce008791258595ad (patch)
tree8544fecc06b73cb43000143339c06ad880b56db4 /sal/rtl/random.cxx
parentacd1696a066b8fa6fb94a0613939565799413769 (diff)
More loplugin:cstylecast: sal
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
Diffstat (limited to 'sal/rtl/random.cxx')
-rw-r--r--sal/rtl/random.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sal/rtl/random.cxx b/sal/rtl/random.cxx
index 1c28c47db43b..1046b7000069 100644
--- a/sal/rtl/random.cxx
+++ b/sal/rtl/random.cxx
@@ -77,11 +77,11 @@ static double data(RandomData_Impl *pImpl)
double random;
RTL_RANDOM_RNG (pImpl->m_nX, pImpl->m_nY, pImpl->m_nZ);
- random = (((double)(pImpl->m_nX) / 30328.0) +
- ((double)(pImpl->m_nY) / 30269.0) +
- ((double)(pImpl->m_nZ) / 30307.0) );
+ random = ((static_cast<double>(pImpl->m_nX) / 30328.0) +
+ (static_cast<double>(pImpl->m_nY) / 30269.0) +
+ (static_cast<double>(pImpl->m_nZ) / 30307.0) );
- random -= ((double)((sal_uInt32)random));
+ random -= static_cast<double>(static_cast<sal_uInt32>(random));
return random;
}
@@ -115,9 +115,9 @@ static bool initPool(RandomPool_Impl *pImpl)
tv.Nanosec = RTL_RANDOM_RNG_2(tv.Nanosec);
seedPool (pImpl, reinterpret_cast< sal_uInt8* >(&tv), sizeof(tv));
- rd.m_nX = (sal_Int16)(((tid >> 1) << 1) + 1);
- rd.m_nY = (sal_Int16)(((tv.Seconds >> 1) << 1) + 1);
- rd.m_nZ = (sal_Int16)(((tv.Nanosec >> 1) << 1) + 1);
+ rd.m_nX = static_cast<sal_Int16>(((tid >> 1) << 1) + 1);
+ rd.m_nY = static_cast<sal_Int16>(((tv.Seconds >> 1) << 1) + 1);
+ rd.m_nZ = static_cast<sal_Int16>(((tv.Nanosec >> 1) << 1) + 1);
seedPool (pImpl, reinterpret_cast< sal_uInt8* >(&rd), sizeof(rd));
while (pImpl->m_nData < RTL_RANDOM_SIZE_POOL)