summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/util/rand48.h
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/vespa/searchlib/util/rand48.h')
-rw-r--r--searchlib/src/vespa/searchlib/util/rand48.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/searchlib/src/vespa/searchlib/util/rand48.h b/searchlib/src/vespa/searchlib/util/rand48.h
index d8bfa683f15..6d27d179a74 100644
--- a/searchlib/src/vespa/searchlib/util/rand48.h
+++ b/searchlib/src/vespa/searchlib/util/rand48.h
@@ -1,9 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
#pragma once
+#include <cstdlib>
+#include <cstdint>
namespace search {
@@ -26,14 +26,14 @@ public:
{
srand48(0x1234abcd);
};
- void iterate(void) {
+ void iterate() {
_state = (UINT64_C(0x5DEECE66D) * _state + 0xb) &
UINT64_C(0xFFFFFFFFFFFF);
}
/*
* Return value from 0 to 2^31 - 1
*/
- long lrand48(void) {
+ long lrand48() {
iterate();
return static_cast<long>(_state >> 17);
}