Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


On Thu, 2014-10-02 at 16:44 +0100, Caolán McNamara wrote:
The latest coverity has taken a dislike to "rand" and we've a big block
of cids, cid#1242372 to cid#1242410 now marked with
static_checker_DC.WEAK_CRYPTO "Don't call".

We have our own random pool stuff in sal, is there a drop in replacement
for rand in there somewhere or a common pattern we could follow in
replacing those ?

FYI, this change

 double random(double min, double max)
 {
-    return floor(((double)rand() / ((unsigned int)RAND_MAX + 1)) * (max - min + 1) + min);
+    return comphelper::rng::uniform_real_distribution(min, max);
 }

in sc/source/core/opencl/opencl_device.cxx has made the opencl cppunit
test run extremely slow, if not hanging.  I think I waited about 5
minutes before deciding to Ctrl-C.  Switching it back to the rand()
based solution makes the test run normally.

Kohei


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.