diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-09 19:36:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-10 12:06:13 +0900 |
commit | b7e8876704648cee6866591ac1aca7a54faff742 (patch) | |
tree | e21c0a9176378eedfdcc46a64ba12456fa03429f /ext | |
parent | 6eaed20e145c1ab4c9c4ccf669d0ebea934f4d36 (diff) | |
download | ruby-b7e8876704648cee6866591ac1aca7a54faff742.tar.gz |
[Bug #19100] Add `init_int32` function to `rb_random_interface_t`
Distinguish initialization by single word from initialization by
array.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/-test-/random/bad_version.c | 3 | ||||
-rw-r--r-- | ext/-test-/random/loop.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/ext/-test-/random/bad_version.c b/ext/-test-/random/bad_version.c index b6bf2ac5af..dae63a6d19 100644 --- a/ext/-test-/random/bad_version.c +++ b/ext/-test-/random/bad_version.c @@ -20,6 +20,9 @@ bad_version_init(rb_random_t *rnd, const uint32_t *buf, size_t len) must_not_reach(); } +NORETURN(static void bad_version_init_int32(rb_random_t *, uint32_t)); +RB_RANDOM_DEFINE_INIT_INT32_FUNC(bad_version) + NORETURN(static void bad_version_get_bytes(rb_random_t *, void *, size_t)); static void bad_version_get_bytes(rb_random_t *rnd, void *p, size_t n) diff --git a/ext/-test-/random/loop.c b/ext/-test-/random/loop.c index 0572096403..805c8e9122 100644 --- a/ext/-test-/random/loop.c +++ b/ext/-test-/random/loop.c @@ -13,6 +13,7 @@ static const rb_random_interface_t random_loop_if = { RB_RANDOM_INTERFACE_DEFINE_WITH_REAL(loop) }; +RB_RANDOM_DEFINE_INIT_INT32_FUNC(loop); static size_t random_loop_memsize(const void *ptr) { |