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

@@ -28,6 +28,7 @@
#include <config.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <errno.h>
@@ -217,7 +218,7 @@ table_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer) {
result = isc_buffer_reserve(buffer, 1 + len);
if (result != ISC_R_SUCCESS)
return (ISC_R_NOSPACE);
isc_buffer_putuint8(*buffer, (isc_uint8_t)len);
isc_buffer_putuint8(*buffer, (uint8_t)len);
isc_buffer_putmem(*buffer, (const unsigned char *) ks, len);
/*
* Emit the value.
@@ -246,7 +247,7 @@ list_towire(isccc_sexpr_t *list, isc_buffer_t **buffer) {
static isc_result_t
sign(unsigned char *data, unsigned int length, unsigned char *hmac,
isc_uint32_t algorithm, isccc_region_t *secret)
uint32_t algorithm, isccc_region_t *secret)
{
union {
isc_hmacmd5_t hmd5;
@@ -336,7 +337,7 @@ sign(unsigned char *data, unsigned int length, unsigned char *hmac,
isc_result_t
isccc_cc_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer,
isc_uint32_t algorithm, isccc_region_t *secret)
uint32_t algorithm, isccc_region_t *secret)
{
unsigned int hmac_base, signed_base;
isc_result_t result;
@@ -398,7 +399,7 @@ isccc_cc_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer,
static isc_result_t
verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length,
isc_uint32_t algorithm, isccc_region_t *secret)
uint32_t algorithm, isccc_region_t *secret)
{
union {
isc_hmacmd5_t hmd5;
@@ -512,7 +513,7 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length,
} else {
isccc_region_t *region;
unsigned char *value;
isc_uint32_t valalg;
uint32_t valalg;
region = isccc_sexpr_tobinary(hmac);
@@ -534,7 +535,7 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length,
static isc_result_t
table_fromwire(isccc_region_t *source, isccc_region_t *secret,
isc_uint32_t algorithm, isccc_sexpr_t **alistp);
uint32_t algorithm, isccc_sexpr_t **alistp);
static isc_result_t
list_fromwire(isccc_region_t *source, isccc_sexpr_t **listp);
@@ -542,7 +543,7 @@ list_fromwire(isccc_region_t *source, isccc_sexpr_t **listp);
static isc_result_t
value_fromwire(isccc_region_t *source, isccc_sexpr_t **valuep) {
unsigned int msgtype;
isc_uint32_t len;
uint32_t len;
isccc_sexpr_t *value;
isccc_region_t active;
isc_result_t result;
@@ -575,10 +576,10 @@ value_fromwire(isccc_region_t *source, isccc_sexpr_t **valuep) {
static isc_result_t
table_fromwire(isccc_region_t *source, isccc_region_t *secret,
isc_uint32_t algorithm, isccc_sexpr_t **alistp)
uint32_t algorithm, isccc_sexpr_t **alistp)
{
char key[256];
isc_uint32_t len;
uint32_t len;
isc_result_t result;
isccc_sexpr_t *alist, *value;
isc_boolean_t first_tag;
@@ -660,10 +661,10 @@ list_fromwire(isccc_region_t *source, isccc_sexpr_t **listp) {
isc_result_t
isccc_cc_fromwire(isccc_region_t *source, isccc_sexpr_t **alistp,
isc_uint32_t algorithm, isccc_region_t *secret)
uint32_t algorithm, isccc_region_t *secret)
{
unsigned int size;
isc_uint32_t version;
uint32_t version;
size = REGION_SIZE(*source);
if (size < 4)
@@ -676,8 +677,8 @@ isccc_cc_fromwire(isccc_region_t *source, isccc_sexpr_t **alistp,
}
static isc_result_t
createmessage(isc_uint32_t version, const char *from, const char *to,
isc_uint32_t serial, isccc_time_t now,
createmessage(uint32_t version, const char *from, const char *to,
uint32_t serial, isccc_time_t now,
isccc_time_t expires, isccc_sexpr_t **alistp,
isc_boolean_t want_expires)
{
@@ -734,8 +735,8 @@ createmessage(isc_uint32_t version, const char *from, const char *to,
}
isc_result_t
isccc_cc_createmessage(isc_uint32_t version, const char *from, const char *to,
isc_uint32_t serial, isccc_time_t now,
isccc_cc_createmessage(uint32_t version, const char *from, const char *to,
uint32_t serial, isccc_time_t now,
isccc_time_t expires, isccc_sexpr_t **alistp)
{
return (createmessage(version, from, to, serial, now, expires,
@@ -747,7 +748,7 @@ isccc_cc_createack(isccc_sexpr_t *message, isc_boolean_t ok,
isccc_sexpr_t **ackp)
{
char *_frm, *_to;
isc_uint32_t serial;
uint32_t serial;
isccc_sexpr_t *ack, *_ctrl;
isc_result_t result;
isccc_time_t t;
@@ -823,7 +824,7 @@ isccc_cc_createresponse(isccc_sexpr_t *message, isccc_time_t now,
isccc_time_t expires, isccc_sexpr_t **alistp)
{
char *_frm, *_to, *type = NULL;
isc_uint32_t serial;
uint32_t serial;
isccc_sexpr_t *alist, *_ctrl, *_data;
isc_result_t result;
@@ -892,7 +893,7 @@ isccc_cc_definestring(isccc_sexpr_t *alist, const char *key, const char *str) {
}
isccc_sexpr_t *
isccc_cc_defineuint32(isccc_sexpr_t *alist, const char *key, isc_uint32_t i) {
isccc_cc_defineuint32(isccc_sexpr_t *alist, const char *key, uint32_t i) {
char b[100];
size_t len;
isccc_region_t r;
@@ -927,7 +928,7 @@ isccc_cc_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp) {
isc_result_t
isccc_cc_lookupuint32(isccc_sexpr_t *alist, const char *key,
isc_uint32_t *uintp)
uint32_t *uintp)
{
isccc_sexpr_t *kv, *v;
@@ -936,7 +937,7 @@ isccc_cc_lookupuint32(isccc_sexpr_t *alist, const char *key,
v = ISCCC_SEXPR_CDR(kv);
if (isccc_sexpr_binaryp(v)) {
if (uintp != NULL)
*uintp = (isc_uint32_t)
*uintp = (uint32_t)
strtoul(isccc_sexpr_tostring(v),
NULL, 10);
return (ISC_R_SUCCESS);