Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
fb6d3b88
Kaydet (Commit)
fb6d3b88
authored
Eki 07, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
disambiguate uniform_int_distribution
Change-Id: Ifa0c1b1983d1cc7f22d55b15dee88b7f709dbcf8
üst
75a23240
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
20 deletions
+12
-20
boxclipper.cxx
basegfx/test/boxclipper.cxx
+1
-1
random.cxx
comphelper/source/misc/random.cxx
+2
-6
cfg.cxx
cui/source/customize/cfg.cxx
+1
-1
random.hxx
include/comphelper/random.hxx
+2
-6
interpr3.cxx
sc/source/core/tool/interpr3.cxx
+1
-1
CustomAnimationPreset.cxx
sd/source/core/CustomAnimationPreset.cxx
+3
-3
tools.hxx
slideshow/source/inc/tools.hxx
+1
-1
uwriter.cxx
sw/qa/core/uwriter.cxx
+1
-1
No files found.
basegfx/test/boxclipper.cxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -48,7 +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
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
n
-
1
);
return
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
n
-
1
);
}
inline
bool
compare
(
const
B2DPoint
&
left
,
const
B2DPoint
&
right
)
...
...
comphelper/source/misc/random.cxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -60,23 +60,19 @@ int uniform_int_distribution(int a, int b)
}
// uniform ints [a,b] distribution
unsigned
int
uniform_int_distribution
(
unsigned
int
a
,
unsigned
int
b
)
unsigned
int
uniform_
u
int_distribution
(
unsigned
int
a
,
unsigned
int
b
)
{
boost
::
random
::
uniform_int_distribution
<
unsigned
int
>
dist
(
a
,
b
);
return
dist
(
theRandomNumberGenerator
::
get
().
global_rng
);
}
#if SAL_TYPES_SIZEOFLONG == 8
// uniform size_t [a,b] distribution
size_t
uniform_
int
_distribution
(
size_t
a
,
size_t
b
)
size_t
uniform_
size
_distribution
(
size_t
a
,
size_t
b
)
{
boost
::
random
::
uniform_int_distribution
<
size_t
>
dist
(
a
,
b
);
return
dist
(
theRandomNumberGenerator
::
get
().
global_rng
);
}
#endif
// uniform size_t [a,b) distribution
double
uniform_real_distribution
(
double
a
,
double
b
)
{
...
...
cui/source/customize/cfg.cxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -298,7 +298,7 @@ generateCustomName(
sal_uInt32
generateRandomValue
()
{
return
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
unsigned
int
>
(
0
)
,
std
::
numeric_limits
<
unsigned
int
>::
max
());
return
comphelper
::
rng
::
uniform_
uint_distribution
(
0
,
std
::
numeric_limits
<
unsigned
int
>::
max
());
}
OUString
...
...
include/comphelper/random.hxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -32,14 +32,10 @@ COMPHELPER_DLLPUBLIC double uniform_real_distribution(double a = 0.0, double b =
COMPHELPER_DLLPUBLIC
int
uniform_int_distribution
(
int
a
,
int
b
);
/// uniform distribution in [a,b]
COMPHELPER_DLLPUBLIC
unsigned
int
uniform_int_distribution
(
unsigned
int
a
,
unsigned
int
b
);
#if SAL_TYPES_SIZEOFLONG == 8
COMPHELPER_DLLPUBLIC
unsigned
int
uniform_uint_distribution
(
unsigned
int
a
,
unsigned
int
b
);
/// uniform distribution in [a,b]
COMPHELPER_DLLPUBLIC
size_t
uniform_int_distribution
(
size_t
a
,
size_t
b
);
#endif
COMPHELPER_DLLPUBLIC
size_t
uniform_size_distribution
(
size_t
a
,
size_t
b
);
}
// namespace
...
...
sc/source/core/tool/interpr3.cxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -3820,7 +3820,7 @@ void ScInterpreter::QuickSort( vector<double>& rSortArray, vector<long>* pIndexO
size_t
nValCount
=
rSortArray
.
size
();
for
(
size_t
i
=
0
;
(
i
+
4
)
<=
nValCount
-
1
;
i
+=
4
)
{
size_t
nInd
=
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
nValCount
-
2
);
size_t
nInd
=
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
nValCount
-
2
);
::
std
::
swap
(
rSortArray
[
i
],
rSortArray
[
nInd
]);
if
(
pIndexOrder
)
::
std
::
swap
(
pIndexOrder
->
at
(
i
),
pIndexOrder
->
at
(
nInd
));
...
...
sd/source/core/CustomAnimationPreset.cxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -577,12 +577,12 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n
if
(
pCategoryList
&&
pCategoryList
->
size
()
)
{
sal_Int32
nCategory
=
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
pCategoryList
->
size
()
-
1
);
sal_Int32
nCategory
=
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
pCategoryList
->
size
()
-
1
);
PresetCategoryPtr
pCategory
=
(
*
pCategoryList
)[
nCategory
];
if
(
pCategory
.
get
()
&&
!
pCategory
->
maEffects
.
empty
()
)
{
sal_Int32
nDescriptor
=
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
pCategory
->
maEffects
.
size
()
-
1
);
sal_Int32
nDescriptor
=
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
pCategory
->
maEffects
.
size
()
-
1
);
CustomAnimationPresetPtr
pPreset
=
pCategory
->
maEffects
[
nDescriptor
];
if
(
pPreset
.
get
()
)
{
...
...
@@ -591,7 +591,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n
OUString
aSubType
;
if
(
!
aSubTypes
.
empty
()
)
{
size_t
nSubType
=
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
aSubTypes
.
size
()
-
1
);
size_t
nSubType
=
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
aSubTypes
.
size
()
-
1
);
aSubType
=
aSubTypes
[
nSubType
];
}
xNode
=
pPreset
->
create
(
aSubType
);
...
...
slideshow/source/inc/tools.hxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -293,7 +293,7 @@ namespace slideshow
/// Gets a random ordinal [0,n)
inline
::
std
::
size_t
getRandomOrdinal
(
const
::
std
::
size_t
n
)
{
return
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
n
-
1
);
return
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
n
-
1
);
}
/// To work around ternary operator in initializer lists
...
...
sw/qa/core/uwriter.cxx
Dosyayı görüntüle @
fb6d3b88
...
...
@@ -965,7 +965,7 @@ getRandomPosition(SwDoc *pDoc, int /* nOffset */)
{
const
SwPosition
aPos
(
pDoc
->
GetNodes
().
GetEndOfContent
());
size_t
nNodes
=
aPos
.
nNode
.
GetNode
().
GetIndex
()
-
aPos
.
nNode
.
GetNode
().
StartOfSectionIndex
();
size_t
n
=
comphelper
::
rng
::
uniform_
int_distribution
(
static_cast
<
size_t
>
(
0
)
,
nNodes
);
size_t
n
=
comphelper
::
rng
::
uniform_
size_distribution
(
0
,
nNodes
);
SwPaM
pam
(
aPos
);
for
(
sal_uLong
i
=
0
;
i
<
n
;
++
i
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment