| 137 | } |
| 138 | |
| 139 | uintptr_t _mi_random_next(mi_random_ctx_t* ctx) { |
| 140 | mi_assert_internal(mi_random_is_initialized(ctx)); |
| 141 | uintptr_t r; |
| 142 | do { |
| 143 | #if MI_INTPTR_SIZE <= 4 |
| 144 | r = chacha_next32(ctx); |
| 145 | #elif MI_INTPTR_SIZE == 8 |
| 146 | r = (((uintptr_t)chacha_next32(ctx) << 32) | chacha_next32(ctx)); |
| 147 | #else |
| 148 | # error "define mi_random_next for this platform" |
| 149 | #endif |
| 150 | } while (r==0); |
| 151 | return r; |
| 152 | } |
| 153 | |
| 154 | |
| 155 | /* ---------------------------------------------------------------------------- |
no test coverage detected