Generate 8 bit random numbers using a 32 bit buffer. */
| 1100 | |
| 1101 | /* Generate 8 bit random numbers using a 32 bit buffer. */ |
| 1102 | static inline uint8_t buffered_uint8(bitgen_t *bitgen_state, int *bcnt, |
| 1103 | uint32_t *buf) { |
| 1104 | if (!(bcnt[0])) { |
| 1105 | buf[0] = next_uint32(bitgen_state); |
| 1106 | bcnt[0] = 3; |
| 1107 | } else { |
| 1108 | buf[0] >>= 8; |
| 1109 | bcnt[0] -= 1; |
| 1110 | } |
| 1111 | |
| 1112 | return (uint8_t)buf[0]; |
| 1113 | } |
| 1114 | |
| 1115 | /* Static `masked rejection` function called by random_bounded_uint64(...) */ |
| 1116 | static inline uint64_t bounded_masked_uint64(bitgen_t *bitgen_state, |
no test coverage detected