From 649313625b94e6b879848fc19b607b74375100bf Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 17 May 2018 11:28:56 +0200 Subject: New o3tl::temporary to simplify calls of std::modf ...that ignore the out-parameter integral part Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca Reviewed-on: https://gerrit.libreoffice.org/54474 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- sal/rtl/random.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sal/rtl') diff --git a/sal/rtl/random.cxx b/sal/rtl/random.cxx index c9269abb837b..224a345a3094 100644 --- a/sal/rtl/random.cxx +++ b/sal/rtl/random.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -85,7 +86,7 @@ static double data(RandomData_Impl *pImpl) (static_cast(pImpl->m_nY) / 30269.0) + (static_cast(pImpl->m_nZ) / 30307.0) ); - return std::modf(random, &random); + return std::modf(random, &o3tl::temporary(double())); } static bool initPool(RandomPool_Impl *pImpl) -- cgit