summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-03 17:12:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-06 14:13:27 +0100
commit8f436d3de7e99268a8862664d2cb2574231c3b18 (patch)
tree0a07dd3cecbd7bc5b0293006bb8691e33c5cca75 /basegfx
parente5ab3685550cf35c3eb9cb47530044f2d86433d5 (diff)
use comphelper::rng::uniform_*_distribution everywhere
and automatically seed from time on first use coverity#1242393 Don't call rand coverity#1242404 Don't call rand coverity#1242410 Don't call rand and additionally allow 0xFF as a value coverity#1242409 Don't call rand coverity#1242399 Don't call rand coverity#1242372 Don't call rand coverity#1242377 Don't call rand coverity#1242378 Don't call rand coverity#1242379 Don't call rand coverity#1242382 Don't call rand coverity#1242383 Don't call rand coverity#1242402 Don't call rand coverity#1242397 Don't call rand coverity#1242390 Don't call rand coverity#1242389 Don't call rand coverity#1242388 Don't call rand coverity#1242386 Don't call rand coverity#1242384 Don't call rand coverity#1242394 Don't call rand Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/CppunitTest_basegfx.mk1
-rw-r--r--basegfx/test/boxclipper.cxx4
2 files changed, 3 insertions, 2 deletions
diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk
index d3bb56f088fb..8f34f3bb6728 100644
--- a/basegfx/CppunitTest_basegfx.mk
+++ b/basegfx/CppunitTest_basegfx.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_CppunitTest_use_api,basegfx,\
$(eval $(call gb_CppunitTest_use_libraries,basegfx,\
basegfx \
+ comphelper \
cppu \
cppuhelper \
sal \
diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx
index 7ce2acf719e9..54e5e96071ac 100644
--- a/basegfx/test/boxclipper.cxx
+++ b/basegfx/test/boxclipper.cxx
@@ -33,6 +33,7 @@
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <comphelper/random.hxx>
#include <boost/bind.hpp>
@@ -47,8 +48,7 @@ double getRandomOrdinal( const ::std::size_t n )
{
// use this one when displaying polygons in OOo, which still sucks
// great rocks when trying to import non-integer svg:d attributes
- // return sal_Int64(double(n) * rand() / (RAND_MAX + 1.0));
- return double(n) * rand() / (RAND_MAX + 1.0);
+ return comphelper::rng::uniform_int_distribution(static_cast<size_t>(0), n-1);
}
inline bool compare(const B2DPoint& left, const B2DPoint& right)