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

@@ -15,6 +15,7 @@
#include <config.h>
#include <stddef.h>
#include <inttypes.h>
#include <isc/atomic.h>
#include <isc/magic.h>
@@ -262,7 +263,7 @@ isc_rwlock_destroy(isc_rwlock_t *rwl) {
static isc_result_t
isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_int32_t cntflag;
int32_t cntflag;
REQUIRE(VALID_RWLOCK(rwl));
@@ -336,7 +337,7 @@ isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
*/
rwl->write_granted = 0;
} else {
isc_int32_t prev_writer;
int32_t prev_writer;
/* enter the waiting queue, and wait for our turn */
#if defined(ISC_RWLOCK_USESTDATOMIC)
@@ -363,7 +364,7 @@ isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
(&rwl->cnt_and_flag, &cntflag2, WRITER_ACTIVE,
memory_order_relaxed, memory_order_relaxed);
#else
isc_int32_t cntflag2;
int32_t cntflag2;
cntflag2 = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0,
WRITER_ACTIVE);
#endif
@@ -392,8 +393,8 @@ isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_result_t
isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_int32_t cnt = 0;
isc_int32_t max_cnt = rwl->spins * 2 + 10;
int32_t cnt = 0;
int32_t max_cnt = rwl->spins * 2 + 10;
isc_result_t result = ISC_R_SUCCESS;
if (max_cnt > RWLOCK_MAX_ADAPTIVE_COUNT)
@@ -416,7 +417,7 @@ isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_result_t
isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_int32_t cntflag;
int32_t cntflag;
REQUIRE(VALID_RWLOCK(rwl));
@@ -533,7 +534,7 @@ isc_rwlock_tryupgrade(isc_rwlock_t *rwl) {
}
#else
{
isc_int32_t prevcnt;
int32_t prevcnt;
/* Try to acquire write access. */
prevcnt = isc_atomic_cmpxchg(&rwl->cnt_and_flag,
@@ -561,7 +562,7 @@ isc_rwlock_tryupgrade(isc_rwlock_t *rwl) {
void
isc_rwlock_downgrade(isc_rwlock_t *rwl) {
isc_int32_t prev_readers;
int32_t prev_readers;
REQUIRE(VALID_RWLOCK(rwl));
@@ -602,7 +603,7 @@ isc_rwlock_downgrade(isc_rwlock_t *rwl) {
isc_result_t
isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_int32_t prev_cnt;
int32_t prev_cnt;
REQUIRE(VALID_RWLOCK(rwl));
@@ -757,8 +758,8 @@ doit(isc_rwlock_t *rwl, isc_rwlocktype_t type, isc_boolean_t nonblock) {
isc_result_t
isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
isc_int32_t cnt = 0;
isc_int32_t max_cnt = rwl->spins * 2 + 10;
int32_t cnt = 0;
int32_t max_cnt = rwl->spins * 2 + 10;
isc_result_t result = ISC_R_SUCCESS;
if (max_cnt > RWLOCK_MAX_ADAPTIVE_COUNT)