aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_eal/common/include/rte_random.h
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-02-26 09:17:37 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-02-26 09:21:27 +0100
commit597cb1874068054d4c0be41f161a72ef37888930 (patch)
tree8899c19634bd8e393a8eac05f33925e4d75bd77d /lib/librte_eal/common/include/rte_random.h
parent6e7cbd63706f3435b9d9a2057a37db1da01db9a7 (diff)
New upstream version 17.11.5upstream-17.11-stable
Change-Id: I8d2aa1aee2a9a78614dff5a01008f91e88e810c7 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_eal/common/include/rte_random.h')
-rw-r--r--lib/librte_eal/common/include/rte_random.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/librte_eal/common/include/rte_random.h b/lib/librte_eal/common/include/rte_random.h
index aeff1f05..bfbfd13a 100644
--- a/lib/librte_eal/common/include/rte_random.h
+++ b/lib/librte_eal/common/include/rte_random.h
@@ -60,7 +60,7 @@ extern "C" {
static inline void
rte_srand(uint64_t seedval)
{
- srand48((long unsigned int)seedval);
+ srand48((long)seedval);
}
/**
@@ -77,9 +77,9 @@ static inline uint64_t
rte_rand(void)
{
uint64_t val;
- val = lrand48();
+ val = (uint64_t)lrand48();
val <<= 32;
- val += lrand48();
+ val += (uint64_t)lrand48();
return val;
}