summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-05-17 11:28:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-05-17 21:03:12 +0200
commit649313625b94e6b879848fc19b607b74375100bf (patch)
treedaa8993fe967cbfdad18aabac1635f7ded1977c2 /sal
parent3a667101987ccbc75024942d779c8c62a4d0a296 (diff)
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 <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/random.cxx3
1 files changed, 2 insertions, 1 deletions
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 <cmath>
#include <sal/types.h>
+#include <o3tl/temporary.hxx>
#include <osl/thread.h>
#include <osl/thread.hxx>
#include <osl/time.h>
@@ -85,7 +86,7 @@ static double data(RandomData_Impl *pImpl)
(static_cast<double>(pImpl->m_nY) / 30269.0) +
(static_cast<double>(pImpl->m_nZ) / 30307.0) );
- return std::modf(random, &random);
+ return std::modf(random, &o3tl::temporary(double()));
}
static bool initPool(RandomPool_Impl *pImpl)