2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Replace custom isc_u?intNN_t types with C99 u?intNN_t types

This commit is contained in:
Ondřej Surý
2018-03-28 14:19:37 +02:00
parent 055278c936
commit cb6a185c69
390 changed files with 2812 additions and 2528 deletions

View File

@@ -30,7 +30,7 @@
#include <config.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -69,21 +69,21 @@ isc_random_initialize(void) {
isc_entropy_get(seed, sizeof(seed));
}
isc_uint8_t
uint8_t
isc_random8(void) {
RUNTIME_CHECK(isc_once_do(&isc_random_once,
isc_random_initialize) == ISC_R_SUCCESS);
return (next() & 0xff);
}
isc_uint16_t
uint16_t
isc_random16(void) {
RUNTIME_CHECK(isc_once_do(&isc_random_once,
isc_random_initialize) == ISC_R_SUCCESS);
return (next() & 0xffff);
}
isc_uint32_t
uint32_t
isc_random32(void) {
RUNTIME_CHECK(isc_once_do(&isc_random_once,
isc_random_initialize) == ISC_R_SUCCESS);
@@ -93,7 +93,7 @@ isc_random32(void) {
void
isc_random_buf(void *buf, size_t buflen) {
int i;
isc_uint32_t r;
uint32_t r;
REQUIRE(buf);
REQUIRE(buflen > 0);
@@ -114,10 +114,10 @@ isc_random_buf(void *buf, size_t buflen) {
return;
}
isc_uint32_t
uint32_t
isc_random_uniform(uint32_t upper_bound) {
/* Copy of arc4random_uniform from OpenBSD */
isc_uint32_t r, min;
uint32_t r, min;
RUNTIME_CHECK(isc_once_do(&isc_random_once,
isc_random_initialize) == ISC_R_SUCCESS);