aboutsummaryrefslogtreecommitdiff
path: root/core/math/big/helpers.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-06-15 15:43:57 +0100
committergingerBill <bill@gingerbill.org>2024-06-15 15:43:57 +0100
commit149ecafdeff6ff2b579ab1c979c147fd04fe4228 (patch)
tree58645f16c27ca623907d8ab778be958ba96efaaa /core/math/big/helpers.odin
parent7ec17ecf98c5151b31f7b0a3e090d6b5a4d12c54 (diff)
Remove the need for `rand` in `core:math/big`
Diffstat (limited to 'core/math/big/helpers.odin')
-rw-r--r--core/math/big/helpers.odin10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/math/big/helpers.odin b/core/math/big/helpers.odin
index 1969fac49..ee09bb2c7 100644
--- a/core/math/big/helpers.odin
+++ b/core/math/big/helpers.odin
@@ -362,11 +362,11 @@ platform_count_lsb :: #force_inline proc(a: $T) -> (count: int)
count_lsb :: proc { int_count_lsb, platform_count_lsb, }
-int_random_digit :: proc(r: ^rnd.Rand = nil) -> (res: DIGIT) {
+int_random_digit :: proc() -> (res: DIGIT) {
when _DIGIT_BITS == 60 { // DIGIT = u64
- return DIGIT(rnd.uint64(r)) & _MASK
+ return DIGIT(rnd.uint64()) & _MASK
} else when _DIGIT_BITS == 28 { // DIGIT = u32
- return DIGIT(rnd.uint32(r)) & _MASK
+ return DIGIT(rnd.uint32()) & _MASK
} else {
panic("Unsupported DIGIT size.")
}
@@ -374,12 +374,12 @@ int_random_digit :: proc(r: ^rnd.Rand = nil) -> (res: DIGIT) {
return 0 // We shouldn't get here.
}
-int_random :: proc(dest: ^Int, bits: int, r: ^rnd.Rand = nil, allocator := context.allocator) -> (err: Error) {
+int_random :: proc(dest: ^Int, bits: int, allocator := context.allocator) -> (err: Error) {
/*
Check that `a` is usable.
*/
assert_if_nil(dest)
- return #force_inline internal_int_random(dest, bits, r, allocator)
+ return #force_inline internal_int_random(dest, bits, allocator)
}
random :: proc { int_random, }