diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c index 696892d438..65823b1cd3 100644 --- a/bin/dnssec/dnssec-keygen.c +++ b/bin/dnssec/dnssec-keygen.c @@ -816,7 +816,7 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) { dst_key_free(&key); } - } while (conflict == true); + } while (conflict); if (conflict) { fatal("cannot generate a null key due to possible key ID " diff --git a/bin/named/server.c b/bin/named/server.c index a3453d5fc2..5cb08d2e46 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -2672,7 +2672,7 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) { result = dns_zt_find(ev->view->zonetable, dns_catz_entry_getname(ev->entry), 0, NULL, &zone); - if (ev->mod == true) { + if (ev->mod) { if (result != ISC_R_SUCCESS) { isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, diff --git a/bin/named/unix/dlz_dlopen_driver.c b/bin/named/unix/dlz_dlopen_driver.c index 605055f66a..b6eb20768e 100644 --- a/bin/named/unix/dlz_dlopen_driver.c +++ b/bin/named/unix/dlz_dlopen_driver.c @@ -62,14 +62,14 @@ typedef struct dlopen_data { #define MAYBE_LOCK(cd) \ do { \ if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \ - cd->in_configure == false) \ + !cd->in_configure) \ LOCK(&cd->lock); \ } while (0) #define MAYBE_UNLOCK(cd) \ do { \ if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \ - cd->in_configure == false) \ + !cd->in_configure) \ UNLOCK(&cd->lock); \ } while (0) diff --git a/bin/named/win32/dlz_dlopen_driver.c b/bin/named/win32/dlz_dlopen_driver.c index cf18fc3318..1688c49926 100644 --- a/bin/named/win32/dlz_dlopen_driver.c +++ b/bin/named/win32/dlz_dlopen_driver.c @@ -62,14 +62,14 @@ typedef struct dlopen_data { #define MAYBE_LOCK(cd) \ do { \ if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \ - cd->in_configure == false) \ + !cd->in_configure) \ LOCK(&cd->lock); \ } while (0) #define MAYBE_UNLOCK(cd) \ do { \ if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \ - cd->in_configure == false) \ + !cd->in_configure) \ UNLOCK(&cd->lock); \ } while (0) diff --git a/contrib/dlz/bin/dlzbdb/dlzbdb.c b/contrib/dlz/bin/dlzbdb/dlzbdb.c index 4dc9995409..f77ebb1505 100644 --- a/contrib/dlz/bin/dlzbdb/dlzbdb.c +++ b/contrib/dlz/bin/dlzbdb/dlzbdb.c @@ -434,7 +434,7 @@ bdb_opendb(DBTYPE db_type, DB **db_out, const char *db_name, int flags) { return (ISC_R_FAILURE); } - if (create_allowed == true) { + if (create_allowed) { createFlag = DB_CREATE; } /* open the database. */ @@ -537,7 +537,7 @@ insert_data(void) { data_type = 'b'; } } else if (data_type == 'c' || data_type == 'C') { - if (have_czone == true) { + if (have_czone) { isc_buffer_putstr( &buf2, token.value.as_pointer); /* add string terminator to buffer */ @@ -634,7 +634,7 @@ openBDB(void) { } /* open BDB environment */ - if (create_allowed == true) { + if (create_allowed) { /* allowed to create new files */ bdbres = db.dbenv->open(db.dbenv, db_envdir, DB_INIT_CDB | DB_INIT_MPOOL | DB_CREATE, @@ -917,7 +917,7 @@ operation_listOrDelete(bool dlt) { int curIndex = 0; /* verify that only allowed parameters were passed. */ - if (dlt == true) { + if (dlt) { checkInvalidParam(zone, "z", "for delete operation"); checkInvalidParam(host, "h", "for delete operation"); checkInvalidOption(list_everything, true, "e", @@ -944,7 +944,7 @@ operation_listOrDelete(bool dlt) { memset(&bdbdata, 0, sizeof(bdbdata)); /* Dump database in "dlzbdb" bulk format */ - if (list_everything == true) { + if (list_everything) { if (bulk_write('c', db.client, db.cursor, &bdbkey, &bdbdata) != ISC_R_SUCCESS) { return; @@ -969,7 +969,7 @@ operation_listOrDelete(bool dlt) { bdbkey.data = &recno; bdbkey.size = sizeof(recno); - if (dlt == true) { + if (dlt) { bdbres = db.data->del(db.data, NULL, &bdbkey, 0); } else { bdbdata.flags = DB_DBT_REALLOC; @@ -1082,7 +1082,7 @@ operation_listOrDelete(bool dlt) { /* if client_zone was passed */ if (c_zone != NULL) { /* create a cursor and make sure it worked. */ - if (dlt == true) { + if (dlt) { /* open read-write cursor */ bdbres = db.client->cursor(db.client, NULL, &db.cursor, DB_WRITECURSOR); @@ -1116,7 +1116,7 @@ operation_listOrDelete(bool dlt) { } while (bdbres == 0) { - if (dlt == false) { + if (!dlt) { printf("%.*s | %.*s\n", (int)bdbkey.size, (char *)bdbkey.data, (int)bdbdata.size, (char *)bdbdata.data); diff --git a/contrib/dlz/drivers/dlz_filesystem_driver.c b/contrib/dlz/drivers/dlz_filesystem_driver.c index 779ab1c789..8ed1af1b33 100644 --- a/contrib/dlz/drivers/dlz_filesystem_driver.c +++ b/contrib/dlz/drivers/dlz_filesystem_driver.c @@ -489,7 +489,7 @@ process_dir(isc_dir_t *dir, void *passback, config_data_t *cd, * are performing a zone xfr and we * could not find a host entry. */ - } else if (dir_list != NULL && foundHost == false) { + } else if (dir_list != NULL && !foundHost) { continue; } } else { /* if we cannot stat entry, skip it. */ diff --git a/contrib/dlz/drivers/sdlz_helper.c b/contrib/dlz/drivers/sdlz_helper.c index 3f5a88ca18..e496587f51 100644 --- a/contrib/dlz/drivers/sdlz_helper.c +++ b/contrib/dlz/drivers/sdlz_helper.c @@ -83,7 +83,7 @@ destroy_querylist(isc_mem_t *mctx, query_list_t **querylist) { * was really a query segment, and not a pointer to * %zone%, or %record%, or %client% */ - if (tseg->sql != NULL && tseg->direct == true) { + if (tseg->sql != NULL && tseg->direct) { isc_mem_free(mctx, tseg->sql); } /* get the next query segment, before we destroy this one. */ @@ -281,7 +281,7 @@ sdlzh_build_querystring(isc_mem_t *mctx, query_list_t *querylist) { * if this is a query segment, use the * precalculated string length */ - if (tseg->direct == true) { + if (tseg->direct) { length += tseg->strlen; } else { /* calculate string length for dynamic segments. */ length += strlen(*(char **)tseg->sql); @@ -297,7 +297,7 @@ sdlzh_build_querystring(isc_mem_t *mctx, query_list_t *querylist) { /* start at the top of the list again */ tseg = ISC_LIST_HEAD(*querylist); while (tseg != NULL) { - if (tseg->direct == true) { + if (tseg->direct) { /* query segments */ strcat(qs, tseg->sql); } else { diff --git a/contrib/dlz/modules/common/dlz_dbi.c b/contrib/dlz/modules/common/dlz_dbi.c index 7d0567644d..c31ade455b 100644 --- a/contrib/dlz/modules/common/dlz_dbi.c +++ b/contrib/dlz/modules/common/dlz_dbi.c @@ -79,7 +79,7 @@ destroy_querylist(query_list_t **querylist) { * was really a query segment, and not a pointer to * %zone%, or %record%, or %client% */ - if (tseg->cmd != NULL && tseg->direct == true) { + if (tseg->cmd != NULL && tseg->direct) { free(tseg->cmd); } /* get the next query segment, before we destroy this one. */ @@ -283,7 +283,7 @@ build_querystring(query_list_t *querylist) { * if this is a query segment, use the * precalculated string length */ - if (tseg->direct == true) { + if (tseg->direct) { length += tseg->strlen; } else { /* calculate string length for dynamic segments. */ length += strlen(*(char **)tseg->cmd); @@ -301,7 +301,7 @@ build_querystring(query_list_t *querylist) { /* start at the top of the list again */ tseg = DLZ_LIST_HEAD(*querylist); while (tseg != NULL) { - if (tseg->direct == true) { + if (tseg->direct) { /* query segments */ strcat(qs, tseg->cmd); } else { diff --git a/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c b/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c index a6049c2849..ceb5dfe3cd 100644 --- a/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c +++ b/contrib/dlz/modules/filesystem/dlz_filesystem_dynamic.c @@ -502,7 +502,7 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list, * are performing a zone xfr and we * could not find a host entry. */ - } else if (dir_list != NULL && foundHost == false) { + } else if (dir_list != NULL && !foundHost) { continue; } } else { /* if we cannot stat entry, skip it. */ diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 9e761f4832..fab4239f44 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -812,7 +812,7 @@ check_recursionacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions, continue; } - if (recursion == false && !dns_acl_isnone(acl)) { + if (!recursion && !dns_acl_isnone(acl)) { cfg_obj_log(aclobj, logctx, ISC_LOG_WARNING, "both \"recursion no;\" and " "\"%s\" active%s%s", diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 8df418d189..14c40eb4b9 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -1111,7 +1111,7 @@ kill_name(dns_adbname_t **n, isc_eventtype_t ev) { * just kill the name here. */ if (!NAME_FETCH(name)) { - INSIST(result == false); + INSIST(!result); result = unlink_name(adb, name); free_adbname(adb, &name); if (result) { @@ -1302,7 +1302,7 @@ shutdown_names(dns_adb_t *adb) { * irefcnt ourselves, since it will not be * automatically triggered by a name being unlinked. */ - INSIST(result == false); + INSIST(!result); result = dec_adb_irefcnt(adb); } else { /* @@ -1313,7 +1313,7 @@ shutdown_names(dns_adb_t *adb) { */ while (name != NULL) { next_name = ISC_LIST_NEXT(name, plink); - INSIST(result == false); + INSIST(!result); result = kill_name(&name, DNS_EVENT_ADBSHUTDOWN); name = next_name; @@ -2442,8 +2442,7 @@ check_stale_name(dns_adb_t *adb, int bucket, isc_stdtime_t now) { (overmem || victim->last_used + ADB_STALE_MARGIN <= now)) { RUNTIME_CHECK( - kill_name(&victim, DNS_EVENT_ADBCANCELED) == - false); + !kill_name(&victim, DNS_EVENT_ADBCANCELED)); victims++; } @@ -2507,7 +2506,7 @@ cleanup_names(dns_adb_t *adb, int bucket, isc_stdtime_t now) { name = ISC_LIST_HEAD(adb->names[bucket]); while (name != NULL) { next_name = ISC_LIST_NEXT(name, plink); - INSIST(result == false); + INSIST(!result); result = check_expire_namehooks(name, now); if (!result) { result = check_expire_name(&name, now); @@ -2532,7 +2531,7 @@ cleanup_entries(dns_adb_t *adb, int bucket, isc_stdtime_t now) { entry = ISC_LIST_HEAD(adb->entries[bucket]); while (entry != NULL) { next_entry = ISC_LIST_NEXT(entry, plink); - INSIST(result == false); + INSIST(!result); result = check_expire_entry(adb, &entry, now); entry = next_entry; } @@ -3087,7 +3086,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action, if (adb->name_sd[bucket]) { DP(DEF_LEVEL, "dns_adb_createfind: returning " "ISC_R_SHUTTINGDOWN"); - RUNTIME_CHECK(free_adbfind(adb, &find) == false); + RUNTIME_CHECK(!free_adbfind(adb, &find)); result = ISC_R_SHUTTINGDOWN; goto out; } @@ -3104,7 +3103,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action, adbname = new_adbname(adb, name); if (adbname == NULL) { - RUNTIME_CHECK(free_adbfind(adb, &find) == false); + RUNTIME_CHECK(!free_adbfind(adb, &find)); result = ISC_R_NOMEMORY; goto out; } @@ -3128,7 +3127,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action, /* * Expire old entries, etc. */ - RUNTIME_CHECK(check_expire_namehooks(adbname, now) == false); + RUNTIME_CHECK(!check_expire_namehooks(adbname, now)); /* * Do we know that the name is an alias? @@ -3408,8 +3407,7 @@ dns_adb_destroyfind(dns_adbfind_t **findp) { entry = ai->entry; ai->entry = NULL; INSIST(DNS_ADBENTRY_VALID(entry)); - RUNTIME_CHECK(dec_entry_refcnt(adb, overmem, entry, true) == - false); + RUNTIME_CHECK(!dec_entry_refcnt(adb, overmem, entry, true)); free_adbaddrinfo(adb, &ai); ai = ISC_LIST_HEAD(find->list); } @@ -3506,10 +3504,10 @@ dns_adb_dump(dns_adb_t *adb, FILE *f) { isc_stdtime_get(&now); for (i = 0; i < adb->nnames; i++) { - RUNTIME_CHECK(cleanup_names(adb, i, now) == false); + RUNTIME_CHECK(!cleanup_names(adb, i, now)); } for (i = 0; i < adb->nentries; i++) { - RUNTIME_CHECK(cleanup_entries(adb, i, now) == false); + RUNTIME_CHECK(!cleanup_entries(adb, i, now)); } dump_adb(adb, f, false, now); @@ -4823,10 +4821,10 @@ dns_adb_flush(dns_adb_t *adb) { * Call our cleanup routines. */ for (i = 0; i < adb->nnames; i++) { - RUNTIME_CHECK(cleanup_names(adb, i, INT_MAX) == false); + RUNTIME_CHECK(!cleanup_names(adb, i, INT_MAX)); } for (i = 0; i < adb->nentries; i++) { - RUNTIME_CHECK(cleanup_entries(adb, i, INT_MAX) == false); + RUNTIME_CHECK(!cleanup_entries(adb, i, INT_MAX)); } #ifdef DUMP_ADB_AFTER_CLEANING @@ -4854,8 +4852,7 @@ dns_adb_flushname(dns_adb_t *adb, const dns_name_t *name) { if (!NAME_DEAD(adbname) && dns_name_equal(name, &adbname->name)) { RUNTIME_CHECK( - kill_name(&adbname, DNS_EVENT_ADBCANCELED) == - false); + !kill_name(&adbname, DNS_EVENT_ADBCANCELED)); } adbname = nextname; } @@ -4882,7 +4879,7 @@ dns_adb_flushnames(dns_adb_t *adb, const dns_name_t *name) { dns_name_issubdomain(&adbname->name, name)) { ret = kill_name(&adbname, DNS_EVENT_ADBCANCELED); - RUNTIME_CHECK(ret == false); + RUNTIME_CHECK(!ret); } adbname = nextname; } diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 265becf7d1..f66bec7af9 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -819,7 +819,7 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) { } zone->magic = 0; isc_timer_detach(&zone->updatetimer); - if (zone->db_registered == true) { + if (zone->db_registered) { INSIST(dns_db_updatenotify_unregister( zone->db, dns_catz_dbupdate_callback, zone->catzs) == ISC_R_SUCCESS); @@ -1668,7 +1668,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *zone, dns_catz_entry_t *entry, isc_buffer_putstr(buffer, "; "); } isc_buffer_putstr(buffer, "}; "); - if (entry->opts.in_memory == false) { + if (!entry->opts.in_memory) { isc_buffer_putstr(buffer, "file \""); result = dns_catz_generate_masterfilename(zone, entry, &buffer); if (result != ISC_R_SUCCESS) { @@ -1758,7 +1758,7 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) { dns_db_attach(db, &zone->db); } - if (zone->updatepending == false) { + if (!zone->updatepending) { zone->updatepending = true; isc_time_now(&now); tdiff = isc_time_microdiff(&now, &zone->lastupdated) / 1000000; @@ -1981,7 +1981,7 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) { * update callback in zone_startload or axfr_makedb, but we will * call onupdate() artificially so we can register the callback here. */ - if (oldzone->db_registered == false) { + if (!oldzone->db_registered) { result = dns_db_updatenotify_register( db, dns_catz_dbupdate_callback, oldzone->catzs); if (result == ISC_R_SUCCESS) { @@ -2025,7 +2025,7 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) { dns_catz_zone_t *zone = NULL; isc_ht_iter_current(iter, (void **)&zone); - if (zone->active == false) { + if (!zone->active) { char cname[DNS_NAME_FORMATSIZE]; dns_name_format(&zone->name, cname, DNS_NAME_FORMATSIZE); diff --git a/lib/dns/compress.c b/lib/dns/compress.c index 628da2eb88..0b38ba8620 100644 --- a/lib/dns/compress.c +++ b/lib/dns/compress.c @@ -224,7 +224,7 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, unsigned char *p; REQUIRE(VALID_CCTX(cctx)); - REQUIRE(dns_name_isabsolute(name) == true); + REQUIRE(dns_name_isabsolute(name)); REQUIRE(offset != NULL); if (ISC_UNLIKELY((cctx->allowed & DNS_COMPRESS_ENABLED) == 0)) { diff --git a/lib/dns/db.c b/lib/dns/db.c index e7dbb60984..8094685590 100644 --- a/lib/dns/db.c +++ b/lib/dns/db.c @@ -410,7 +410,7 @@ dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) { (db->methods->closeversion)(db, versionp, commit); - if (commit == true) { + if (commit) { for (listener = ISC_LIST_HEAD(db->update_listeners); listener != NULL; listener = ISC_LIST_NEXT(listener, link)) { @@ -890,7 +890,7 @@ dns_db_unregister(dns_dbimplementation_t **dbimp) { isc_result_t dns_db_getoriginnode(dns_db_t *db, dns_dbnode_t **nodep) { REQUIRE(DNS_DB_VALID(db)); - REQUIRE(dns_db_iszone(db) == true); + REQUIRE(dns_db_iszone(db)); REQUIRE(nodep != NULL && *nodep == NULL); if (db->methods->getoriginnode != NULL) { @@ -928,7 +928,7 @@ dns_db_getnsec3parameters(dns_db_t *db, dns_dbversion_t *version, uint16_t *iterations, unsigned char *salt, size_t *salt_length) { REQUIRE(DNS_DB_VALID(db)); - REQUIRE(dns_db_iszone(db) == true); + REQUIRE(dns_db_iszone(db)); if (db->methods->getnsec3parameters != NULL) { return ((db->methods->getnsec3parameters)(db, version, hash, @@ -943,7 +943,7 @@ isc_result_t dns_db_getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records, uint64_t *bytes) { REQUIRE(DNS_DB_VALID(db)); - REQUIRE(dns_db_iszone(db) == true); + REQUIRE(dns_db_iszone(db)); if (db->methods->getsize != NULL) { return ((db->methods->getsize)(db, version, records, bytes)); diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index bb5cd8d430..85c1c4648a 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -3272,7 +3272,7 @@ dns_dispatch_getnext(dns_dispentry_t *resp, dns_dispatchevent_t **sockevent) { LOCK(&disp->lock); - REQUIRE(resp->item_out == true); + REQUIRE(resp->item_out); resp->item_out = false; if (ev->buffer.base != NULL) { @@ -3379,7 +3379,7 @@ dns_dispatch_removeresponse(dns_dispentry_t **resp, } if (ev != NULL) { - REQUIRE(res->item_out == true); + REQUIRE(res->item_out); res->item_out = false; if (ev->buffer.base != NULL) { free_buffer(disp, ev->buffer.base, ev->buffer.length); diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index 2466bb734f..7e297ab976 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -186,7 +186,7 @@ dst_lib_init(isc_mem_t *mctx, const char *engine) { isc_result_t result; REQUIRE(mctx != NULL); - REQUIRE(dst_initialized == false); + REQUIRE(!dst_initialized); UNUSED(engine); @@ -248,7 +248,7 @@ out: void dst_lib_destroy(void) { int i; - RUNTIME_CHECK(dst_initialized == true); + RUNTIME_CHECK(dst_initialized); dst_initialized = false; for (i = 0; i < DST_MAX_ALGS; i++) { @@ -264,7 +264,7 @@ dst_lib_destroy(void) { bool dst_algorithm_supported(unsigned int alg) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); if (alg >= DST_MAX_ALGS || dst_t_func[alg] == NULL) { return (false); @@ -285,7 +285,7 @@ dst_context_create(dst_key_t *key, isc_mem_t *mctx, isc_logcategory_t *category, dst_context_t *dctx; isc_result_t result; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE(mctx != NULL); REQUIRE(dctxp != NULL && *dctxp == NULL); @@ -366,8 +366,7 @@ dst_context_sign(dst_context_t *dctx, isc_buffer_t *sig) { if (key->func->sign == NULL) { return (DST_R_NOTPRIVATEKEY); } - if (key->func->isprivate == NULL || key->func->isprivate(key) == false) - { + if (key->func->isprivate == NULL || !key->func->isprivate(key)) { return (DST_R_NOTPRIVATEKEY); } @@ -413,7 +412,7 @@ dst_context_verify2(dst_context_t *dctx, unsigned int maxbits, isc_result_t dst_key_computesecret(const dst_key_t *pub, const dst_key_t *priv, isc_buffer_t *secret) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(pub) && VALID_KEY(priv)); REQUIRE(secret != NULL); @@ -430,7 +429,7 @@ dst_key_computesecret(const dst_key_t *pub, const dst_key_t *priv, return (DST_R_KEYCANNOTCOMPUTESECRET); } - if (dst_key_isprivate(priv) == false) { + if (!dst_key_isprivate(priv)) { return (DST_R_NOTPRIVATEKEY); } @@ -441,7 +440,7 @@ isc_result_t dst_key_tofile(const dst_key_t *key, int type, const char *directory) { isc_result_t ret = ISC_R_SUCCESS; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE((type & (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_STATE)) != 0); @@ -490,7 +489,7 @@ dst_key_getfilename(dns_name_t *name, dns_keytag_t id, unsigned int alg, isc_buffer_t *buf) { isc_result_t result; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(dns_name_isabsolute(name)); REQUIRE((type & (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_STATE)) != 0); @@ -519,7 +518,7 @@ dst_key_fromfile(dns_name_t *name, dns_keytag_t id, unsigned int alg, int type, isc_buffer_t buf; dst_key_t *key; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(dns_name_isabsolute(name)); REQUIRE((type & (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC)) != 0); REQUIRE(mctx != NULL); @@ -572,7 +571,7 @@ dst_key_fromnamedfile(const char *filename, const char *dirname, int type, int newfilenamelen = 0; isc_lex_t *lex = NULL; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(filename != NULL); REQUIRE((type & (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC)) != 0); REQUIRE(mctx != NULL); @@ -703,7 +702,7 @@ out: isc_result_t dst_key_todns(const dst_key_t *key, isc_buffer_t *target) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE(target != NULL); @@ -806,7 +805,7 @@ dst_key_frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags, isc_result_t dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE(target != NULL); @@ -824,7 +823,7 @@ dst_key_privatefrombuffer(dst_key_t *key, isc_buffer_t *buffer) { isc_lex_t *lex = NULL; isc_result_t result = ISC_R_SUCCESS; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE(!dst_key_isprivate(key)); REQUIRE(buffer != NULL); @@ -893,7 +892,7 @@ dst_key_buildinternal(const dns_name_t *name, unsigned int alg, dst_key_t *key; isc_result_t result; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(dns_name_isabsolute(name)); REQUIRE(mctx != NULL); REQUIRE(keyp != NULL && *keyp == NULL); @@ -927,7 +926,7 @@ dst_key_fromlabel(const dns_name_t *name, int alg, unsigned int flags, dst_key_t *key; isc_result_t result; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(dns_name_isabsolute(name)); REQUIRE(mctx != NULL); REQUIRE(keyp != NULL && *keyp == NULL); @@ -969,7 +968,7 @@ dst_key_generate(const dns_name_t *name, unsigned int alg, unsigned int bits, dst_key_t *key; isc_result_t ret; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(dns_name_isabsolute(name)); REQUIRE(mctx != NULL); REQUIRE(keyp != NULL && *keyp == NULL); @@ -1138,7 +1137,7 @@ static bool comparekeys(const dst_key_t *key1, const dst_key_t *key2, bool match_revoked_key, bool (*compare)(const dst_key_t *key1, const dst_key_t *key2)) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key1)); REQUIRE(VALID_KEY(key2)); @@ -1234,7 +1233,7 @@ dst_key_pubcompare(const dst_key_t *key1, const dst_key_t *key2, bool dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key1)); REQUIRE(VALID_KEY(key2)); @@ -1243,7 +1242,7 @@ dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2) { } if (key1->key_alg == key2->key_alg && key1->func->paramcompare != NULL && - key1->func->paramcompare(key1, key2) == true) + key1->func->paramcompare(key1, key2)) { return (true); } else { @@ -1253,7 +1252,7 @@ dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2) { void dst_key_attach(dst_key_t *source, dst_key_t **target) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(target != NULL && *target == NULL); REQUIRE(VALID_KEY(source)); @@ -1263,7 +1262,7 @@ dst_key_attach(dst_key_t *source, dst_key_t **target) { void dst_key_free(dst_key_t **keyp) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(keyp != NULL && VALID_KEY(*keyp)); dst_key_t *key = *keyp; *keyp = NULL; @@ -1311,7 +1310,7 @@ dst_key_buildfilename(const dst_key_t *key, int type, const char *directory, isc_result_t dst_key_sigsize(const dst_key_t *key, unsigned int *n) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE(n != NULL); @@ -1365,7 +1364,7 @@ dst_key_sigsize(const dst_key_t *key, unsigned int *n) { isc_result_t dst_key_secretsize(const dst_key_t *key, unsigned int *n) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); REQUIRE(n != NULL); @@ -1416,7 +1415,7 @@ dst_key_restore(dns_name_t *name, unsigned int alg, unsigned int flags, isc_result_t result; dst_key_t *key; - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(keyp != NULL && *keyp == NULL); if (alg >= DST_MAX_ALGS || dst_t_func[alg] == NULL) { @@ -1841,7 +1840,7 @@ cleanup: static bool issymmetric(const dst_key_t *key) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); REQUIRE(VALID_KEY(key)); /* XXXVIX this switch statement is too sparse to gen a jump table. */ @@ -2264,7 +2263,7 @@ frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags, static isc_result_t algorithm_status(unsigned int alg) { - REQUIRE(dst_initialized == true); + REQUIRE(dst_initialized); if (dst_algorithm_supported(alg)) { return (ISC_R_SUCCESS); diff --git a/lib/dns/dyndb.c b/lib/dns/dyndb.c index 93bc9c712b..edb5784550 100644 --- a/lib/dns/dyndb.c +++ b/lib/dns/dyndb.c @@ -261,7 +261,7 @@ dns_dyndb_cleanup(bool exiting) { } UNLOCK(&dyndb_lock); - if (exiting == true) { + if (exiting) { isc_mutex_destroy(&dyndb_lock); } } diff --git a/lib/dns/keymgr.c b/lib/dns/keymgr.c index 5c5bba8e3b..efa07f4330 100644 --- a/lib/dns/keymgr.c +++ b/lib/dns/keymgr.c @@ -304,7 +304,7 @@ keymgr_createkey(dns_kasp_key_t *kkey, const dns_name_t *origin, dst_key_free(&newkey); } } - } while (conflict == true); + } while (conflict); INSIST(!conflict); dst_key_setnum(newkey, DST_NUM_LIFETIME, dns_kasp_key_lifetime(kkey)); diff --git a/lib/dns/lib.c b/lib/dns/lib.c index 39faac2f0d..9b39fdf70b 100644 --- a/lib/dns/lib.c +++ b/lib/dns/lib.c @@ -46,7 +46,7 @@ static void initialize(void) { isc_result_t result; - REQUIRE(initialize_done == false); + REQUIRE(!initialize_done); isc_refcount_init(&references, 0); diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 12376b50d1..0d1bed1a29 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -643,7 +643,7 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name, */ if ((ctx->style.flags & DNS_STYLEFLAG_NO_CLASS) == 0 && ((ctx->style.flags & DNS_STYLEFLAG_OMIT_CLASS) == 0 || - ctx->class_printed == false)) + !ctx->class_printed)) { unsigned int class_start; INDENT_TO(class_column); @@ -919,7 +919,7 @@ dump_rdataset(isc_mem_t *mctx, const dns_name_t *name, dns_rdataset_t *rdataset, */ if ((ctx->style.flags & DNS_STYLEFLAG_TTL) != 0) { - if (ctx->current_ttl_valid == false || + if (!ctx->current_ttl_valid || ctx->current_ttl != rdataset->ttl) { if ((ctx->style.flags & DNS_STYLEFLAG_COMMENT) != 0) { isc_buffer_clear(buffer); diff --git a/lib/dns/message.c b/lib/dns/message.c index a3b0ae4ea6..1448fd1df6 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -1652,8 +1652,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, } free_name = free_rdataset = false; } - INSIST(free_name == false); - INSIST(free_rdataset == false); + INSIST(!free_name); + INSIST(!free_rdataset); } /* @@ -1806,7 +1806,7 @@ truncated: if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) { return (DNS_R_RECOVERABLE); } - if (seen_problem == true) { + if (seen_problem) { return (DNS_R_RECOVERABLE); } return (ISC_R_SUCCESS); diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 2a20a2ae01..7199ca5891 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -907,7 +907,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass, unsigned int length; bool unknown; - REQUIRE(origin == NULL || dns_name_isabsolute(origin) == true); + REQUIRE(origin == NULL || dns_name_isabsolute(origin)); if (rdata != NULL) { REQUIRE(DNS_RDATA_INITIALIZED(rdata)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata)); @@ -1075,8 +1075,7 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx, unsigned int cur; REQUIRE(rdata != NULL); - REQUIRE(tctx->origin == NULL || - dns_name_isabsolute(tctx->origin) == true); + REQUIRE(tctx->origin == NULL || dns_name_isabsolute(tctx->origin)); /* * Some DynDNS meta-RRs have empty rdata. @@ -1407,7 +1406,7 @@ txt_totext(isc_region_t *source, bool quote, isc_buffer_t *target) { REQUIRE(n + 1 <= source->length); if (n == 0U) { - REQUIRE(quote == true); + REQUIRE(quote); } if (quote) { diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index c90701a1ef..ec4d77403a 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -1787,7 +1787,7 @@ finish_update(dns_rpz_zone_t *rpz) { /* * If there's an update pending, schedule it. */ - if (rpz->updatepending == true) { + if (rpz->updatepending) { if (rpz->min_update_interval > 0) { uint64_t defer = rpz->min_update_interval; char dname[DNS_NAME_FORMATSIZE]; diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index 2d85032a31..ffc53f758d 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -606,7 +606,7 @@ attachversion(dns_db_t *db, dns_dbversion_t *source, static void closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) { REQUIRE(versionp != NULL && *versionp == (void *)&dummy); - REQUIRE(commit == false); + REQUIRE(!commit); UNUSED(db); UNUSED(commit); @@ -763,7 +763,6 @@ findnodeext(dns_db_t *db, const dns_name_t *name, bool create, unsigned int labels; REQUIRE(VALID_SDB(sdb)); - REQUIRE(create == false); REQUIRE(nodep != NULL && *nodep == NULL); UNUSED(name); diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index fcdf0e66d8..172d21d782 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -529,7 +529,7 @@ getnodedata(dns_db_t *db, const dns_name_t *name, bool create, REQUIRE(nodep != NULL && *nodep == NULL); if (sdlz->dlzimp->methods->newversion == NULL) { - REQUIRE(create == false); + REQUIRE(!create); } isc_buffer_init(&b, namestr, sizeof(namestr)); diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c index 97209ff7b1..d004bd1bc6 100644 --- a/lib/dns/tkey.c +++ b/lib/dns/tkey.c @@ -1514,7 +1514,7 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg, RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL)); freertkey = true; - if (win2k == true) { + if (win2k) { RETERR(find_tkey(qmsg, &tkeyname, &qtkeyrdata, DNS_SECTION_ANSWER)); } else { diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index c940469520..591dfca77a 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -144,7 +144,7 @@ tsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...) { char namestr[DNS_NAME_FORMATSIZE]; char creatorstr[DNS_NAME_FORMATSIZE]; - if (isc_log_wouldlog(dns_lctx, level) == false) { + if (!isc_log_wouldlog(dns_lctx, level)) { return; } if (key != NULL) { diff --git a/lib/dns/update.c b/lib/dns/update.c index 76d4cee4ef..49f177002b 100644 --- a/lib/dns/update.c +++ b/lib/dns/update.c @@ -210,7 +210,7 @@ update_log(dns_update_log_t *callback, dns_zone_t *zone, int level, return; } - if (isc_log_wouldlog(dns_lctx, level) == false) { + if (!isc_log_wouldlog(dns_lctx, level)) { return; } diff --git a/lib/dns/view.c b/lib/dns/view.c index 719aa6850d..4db7f4f537 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -1512,7 +1512,7 @@ dns_viewlist_findzone(dns_viewlist_t *list, const dns_name_t *name, for (view = ISC_LIST_HEAD(*list); view != NULL; view = ISC_LIST_NEXT(view, link)) { - if (allclasses == false && view->rdclass != rdclass) { + if (!allclasses && view->rdclass != rdclass) { continue; } diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 657ee4a5d4..7ad2de0f56 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -1615,7 +1615,7 @@ xfrin_log1(int level, const char *zonetext, const isc_sockaddr_t *masteraddr, const char *fmt, ...) { va_list ap; - if (isc_log_wouldlog(dns_lctx, level) == false) { + if (!isc_log_wouldlog(dns_lctx, level)) { return; } @@ -1633,7 +1633,7 @@ xfrin_log(dns_xfrin_ctx_t *xfr, int level, const char *fmt, ...) { va_list ap; char zonetext[DNS_NAME_MAXTEXT + 32]; - if (isc_log_wouldlog(dns_lctx, level) == false) { + if (!isc_log_wouldlog(dns_lctx, level)) { return; } diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 05121323af..90a8ea44a3 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -156,11 +156,11 @@ typedef struct dns_include dns_include_t; #define DNS_ZONE_CHECKLOCK #ifdef DNS_ZONE_CHECKLOCK -#define LOCK_ZONE(z) \ - do { \ - LOCK(&(z)->lock); \ - INSIST((z)->locked == false); \ - (z)->locked = true; \ +#define LOCK_ZONE(z) \ + do { \ + LOCK(&(z)->lock); \ + INSIST(!(z)->locked); \ + (z)->locked = true; \ } while (0) #define UNLOCK_ZONE(z) \ do { \ @@ -172,7 +172,7 @@ typedef struct dns_include dns_include_t; do { \ result = isc_mutex_trylock(&(z)->lock); \ if (result == ISC_R_SUCCESS) { \ - INSIST((z)->locked == false); \ + INSIST(!(z)->locked); \ (z)->locked = true; \ } \ } while (0) @@ -10775,7 +10775,7 @@ zone_refreshkeys(dns_zone_t *zone) { */ #ifdef ENABLE_AFL - if (dns_fuzzing_resolver == false) { + if (!dns_fuzzing_resolver) { #endif /* ifdef ENABLE_AFL */ result = dns_resolver_createfetch( zone->view->resolver, kname, @@ -12779,7 +12779,7 @@ next_master: * Did we get a good answer from all the masters? */ for (j = 0; j < zone->masterscnt; j++) { - if (zone->mastersok[j] == false) { + if (!zone->mastersok[j]) { { done = false; break; @@ -13303,7 +13303,7 @@ next_master: * Did we get a good answer from all the masters? */ for (j = 0; j < zone->masterscnt; j++) { - if (zone->mastersok[j] == false) { + if (!zone->mastersok[j]) { { done = false; break; @@ -17018,7 +17018,7 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) { if (peer == NULL || result != ISC_R_SUCCESS) { use_ixfr = zone->requestixfr; } - if (use_ixfr == false) { + if (!use_ixfr) { dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_DEBUG(1), "IXFR disabled, " diff --git a/lib/isc/app.c b/lib/isc/app.c index 3211d7785f..40213784f3 100644 --- a/lib/isc/app.c +++ b/lib/isc/app.c @@ -233,8 +233,8 @@ isc_app_ctxrun(isc_appctx_t *ctx) { REQUIRE(main_thread == GetCurrentThread()); #endif /* ifdef WIN32 */ - if (atomic_compare_exchange_strong_acq_rel( - &ctx->running, &(bool){ false }, true) == true) + if (atomic_compare_exchange_strong_acq_rel(&ctx->running, + &(bool){ false }, true)) { /* * Post any on-run events (in FIFO order). @@ -266,7 +266,7 @@ isc_app_ctxrun(isc_appctx_t *ctx) { * simply be made pending and we will get it when we call * sigwait(). */ - while (atomic_load_acquire(&ctx->want_shutdown) == false) { + while (!atomic_load_acquire(&ctx->want_shutdown)) { #ifdef WIN32 DWORD dwWaitResult = WaitForMultipleObjects( NUM_EVENTS, ctx->hEvents, FALSE, INFINITE); @@ -360,8 +360,8 @@ isc_result_t isc_app_run(void) { isc_result_t result; - REQUIRE(atomic_compare_exchange_strong_acq_rel( - &is_running, &(bool){ false }, true) == true); + REQUIRE(atomic_compare_exchange_strong_acq_rel(&is_running, + &(bool){ false }, true)); result = isc_app_ctxrun(&isc_g_appctx); atomic_store_release(&is_running, false); @@ -424,7 +424,7 @@ isc_app_ctxsuspend(isc_appctx_t *ctx) { /* * Don't send the reload signal if we're shutting down. */ - if (atomic_load_acquire(&ctx->shutdown_requested) == false) { + if (!atomic_load_acquire(&ctx->shutdown_requested)) { #ifdef WIN32 SetEvent(ctx->hEvents[RELOAD_EVENT]); #else /* WIN32 */ diff --git a/lib/isc/astack.c b/lib/isc/astack.c index 8ae0d515d5..1c9c324c66 100644 --- a/lib/isc/astack.c +++ b/lib/isc/astack.c @@ -43,7 +43,7 @@ isc_astack_new(isc_mem_t *mctx, size_t size) { bool isc_astack_trypush(isc_astack_t *stack, void *obj) { - if (isc_mutex_trylock(&stack->lock) == false) { + if (!isc_mutex_trylock(&stack->lock)) { if (stack->pos >= stack->size) { UNLOCK(&stack->lock); return (false); diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c index 9b7b32dd3d..d3117d4d6a 100644 --- a/lib/isc/httpd.c +++ b/lib/isc/httpd.c @@ -1041,7 +1041,7 @@ isc_httpd_recvdone(isc_task_t *task, isc_event_t *ev) { isc_httpd_addheader(httpd, "Server: libisc", NULL); - if (is_compressed == true) { + if (is_compressed) { isc_httpd_addheader(httpd, "Content-Encoding", "deflate"); isc_httpd_addheaderuint( httpd, "Content-Length", diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 538022a9ae..3f7723a1b4 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -1416,7 +1416,7 @@ isc__nm_drop_interlocked(isc_nm_t *mgr) { LOCK(&mgr->lock); bool success = atomic_compare_exchange_strong(&mgr->interlocked, &(bool){ true }, false); - INSIST(success == true); + INSIST(success); BROADCAST(&mgr->wkstatecond); UNLOCK(&mgr->lock); } diff --git a/lib/isc/pthreads/mutex.c b/lib/isc/pthreads/mutex.c index 899406ef73..3cc02bbb64 100644 --- a/lib/isc/pthreads/mutex.c +++ b/lib/isc/pthreads/mutex.c @@ -92,7 +92,7 @@ isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) { RUNTIME_CHECK(pthread_mutex_lock(&statslock) == 0); - if (stats_init == false) { + if (!stats_init) { stats_init = true; } diff --git a/lib/isc/task.c b/lib/isc/task.c index 859b507826..5d9cef42ec 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -195,8 +195,8 @@ void isc__taskmgr_resume(isc_taskmgr_t *manager0); #define DEFAULT_DEFAULT_QUANTUM 25 -#define FINISHED(m) \ - (atomic_load_relaxed(&((m)->exiting)) == true && \ +#define FINISHED(m) \ + (atomic_load_relaxed(&((m)->exiting)) && \ atomic_load(&(m)->tasks_count) == 0) /*% @@ -1677,7 +1677,7 @@ isc_task_endexclusive(isc_task_t *task0) { isc_nm_resume(manager->nm); } LOCK(&manager->halt_lock); - REQUIRE(atomic_load_relaxed(&manager->exclusive_req) == true); + REQUIRE(atomic_load_relaxed(&manager->exclusive_req)); atomic_store_relaxed(&manager->exclusive_req, false); while (manager->halted > 0) { BROADCAST(&manager->halt_cond); diff --git a/lib/isc/win32/fsaccess.c b/lib/isc/win32/fsaccess.c index 030d8884e5..f6192da325 100644 --- a/lib/isc/win32/fsaccess.c +++ b/lib/isc/win32/fsaccess.c @@ -204,7 +204,7 @@ NTFS_Access_Control(const char *filename, const char *user, int access, } /* For directories check the directory-specific bits */ - if (isdir == true) { + if (isdir) { if ((caccess & ISC_FSACCESS_CREATECHILD) != 0) { NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE; } diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index 487515e003..af55eb843a 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -1463,7 +1463,7 @@ consistent(isc_socket_t *sock) { socket_log(__LINE__, sock, NULL, CREATION, "SOCKET INCONSISTENT: %s", crash_reason); sock_dump(sock); - INSIST(crash == false); + INSIST(!crash); } } diff --git a/lib/ns/client.c b/lib/ns/client.c index 04a8da7d3e..14f9618b07 100644 --- a/lib/ns/client.c +++ b/lib/ns/client.c @@ -518,7 +518,7 @@ ns_client_send(ns_client_t *client) { dns_compress_setsensitive(&cctx, true); } - if (client->view->msgcompression == false) { + if (!client->view->msgcompression) { dns_compress_disable(&cctx); } } @@ -2148,7 +2148,7 @@ ns__client_request(isc_nmhandle_t *handle, isc_region_t *region, void *arg) { * cache there is no point in setting RA. */ ra = false; - if (client->view->resolver != NULL && client->view->recursion == true && + if (client->view->resolver != NULL && client->view->recursion && ns_client_checkaclsilent(client, NULL, client->view->recursionacl, true) == ISC_R_SUCCESS && ns_client_checkaclsilent(client, NULL, client->view->cacheacl, @@ -2163,7 +2163,7 @@ ns__client_request(isc_nmhandle_t *handle, isc_region_t *region, void *arg) { ra = true; } - if (ra == true) { + if (ra) { client->attributes |= NS_CLIENTATTR_RA; } diff --git a/lib/ns/interfacemgr.c b/lib/ns/interfacemgr.c index 006fd2fad5..633485f647 100644 --- a/lib/ns/interfacemgr.c +++ b/lib/ns/interfacemgr.c @@ -504,7 +504,7 @@ ns_interface_setup(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr, isc_result_t result; ns_interface_t *ifp = NULL; REQUIRE(ifpret != NULL && *ifpret == NULL); - REQUIRE(addr_in_use == NULL || *addr_in_use == false); + REQUIRE(addr_in_use == NULL || !*addr_in_use); result = ns_interface_create(mgr, addr, name, &ifp); if (result != ISC_R_SUCCESS) { @@ -521,8 +521,7 @@ ns_interface_setup(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr, goto cleanup_interface; } - if (((mgr->sctx->options & NS_SERVER_NOTCP) == 0) && accept_tcp == true) - { + if (((mgr->sctx->options & NS_SERVER_NOTCP) == 0) && accept_tcp) { result = ns_interface_listentcp(ifp); if (result != ISC_R_SUCCESS) { if ((result == ISC_R_ADDRINUSE) && @@ -817,16 +816,16 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { * unless explicitly allowed. */ #ifndef ISC_ALLOW_MAPPED - if (scan_ipv6 == true && isc_net_probe_ipv6only() != ISC_R_SUCCESS) { + if (scan_ipv6 && isc_net_probe_ipv6only() != ISC_R_SUCCESS) { ipv6only = false; log_explicit = true; } #endif /* ifndef ISC_ALLOW_MAPPED */ - if (scan_ipv6 == true && isc_net_probe_ipv6pktinfo() != ISC_R_SUCCESS) { + if (scan_ipv6 && isc_net_probe_ipv6pktinfo() != ISC_R_SUCCESS) { ipv6pktinfo = false; log_explicit = true; } - if (scan_ipv6 == true && ipv6only && ipv6pktinfo) { + if (scan_ipv6 && ipv6only && ipv6pktinfo) { for (le = ISC_LIST_HEAD(mgr->listenon6->elts); le != NULL; le = ISC_LIST_NEXT(le, link)) { @@ -883,7 +882,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { return (result); } - if (adjusting == false) { + if (!adjusting) { result = clearacl(mgr->mctx, &mgr->aclenv.localhost); if (result != ISC_R_SUCCESS) { goto cleanup_iter; @@ -913,10 +912,10 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { if (family != AF_INET && family != AF_INET6) { continue; } - if (scan_ipv4 == false && family == AF_INET) { + if (!scan_ipv4 && family == AF_INET) { continue; } - if (scan_ipv6 == false && family == AF_INET6) { + if (!scan_ipv6 && family == AF_INET6) { continue; } @@ -936,7 +935,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { continue; } - if (adjusting == false) { + if (!adjusting) { /* * If running with -T fixedlocal, then we only * want 127.0.0.1 and ::1 in the localhost ACL. @@ -991,7 +990,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { continue; } - if (adjusting == false && dolistenon == true) { + if (!adjusting && dolistenon) { setup_listenon(mgr, &interface, le->port); dolistenon = false; } @@ -1012,7 +1011,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { * interface, we need to listen on the address * explicitly. */ - if (adjusting == true) { + if (adjusting) { ns_listenelt_t *ele; match = 0; @@ -1031,7 +1030,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { match = 0; } } - if (ipv6_wildcard == true && match == 0) { + if (ipv6_wildcard && match == 0) { continue; } } @@ -1054,8 +1053,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { } else { bool addr_in_use = false; - if (adjusting == false && ipv6_wildcard == true) - { + if (!adjusting && ipv6_wildcard) { continue; } @@ -1078,15 +1076,13 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, bool verbose) { "%s" "listening on %s interface " "%s, %s", - (adjusting == true) ? "additionally " - : "", + (adjusting) ? "additionally " : "", (family == AF_INET) ? "IPv4" : "IPv6", interface.name, sabuf); result = ns_interface_setup( mgr, &listen_sockaddr, interface.name, - &ifp, - (adjusting == true) ? false : true, + &ifp, (adjusting) ? false : true, le->dscp, &addr_in_use); tried_listening = true; diff --git a/lib/ns/lib.c b/lib/ns/lib.c index 6d9d7c177c..4613b6432d 100644 --- a/lib/ns/lib.c +++ b/lib/ns/lib.c @@ -41,7 +41,7 @@ static isc_refcount_t references; static void initialize(void) { - REQUIRE(initialize_done == false); + REQUIRE(!initialize_done); isc_mem_create(&ns_g_mctx); diff --git a/lib/ns/query.c b/lib/ns/query.c index 9d3ca90df9..c25abd20e4 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -5910,7 +5910,7 @@ ns_query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname, sigrdataset = NULL; } - if (client->query.timerset == false) { + if (!client->query.timerset) { ns_client_settimeout(client, 60); } @@ -10906,7 +10906,7 @@ ns_query_done(query_ctx_t *qctx) { query_glueanswer(qctx); if (qctx->client->message->rcode == dns_rcode_nxdomain && - qctx->view->auth_nxdomain == true) + qctx->view->auth_nxdomain) { qctx->client->message->flags |= DNS_MESSAGEFLAG_AA; } diff --git a/lib/ns/tests/query_test.c b/lib/ns/tests/query_test.c index 9d4243625e..cd96294009 100644 --- a/lib/ns/tests/query_test.c +++ b/lib/ns/tests/query_test.c @@ -94,8 +94,7 @@ run_sfcache_test(const ns__query_sfcache_test_params_t *test) { REQUIRE(test != NULL); REQUIRE(test->id.description != NULL); - REQUIRE(test->cache_entry_present == true || - test->cache_entry_flags == 0); + REQUIRE(test->cache_entry_present || test->cache_entry_flags == 0); /* * Interrupt execution if ns_query_done() is called. diff --git a/lib/ns/update.c b/lib/ns/update.c index 84e1c7e129..790b10eb6e 100644 --- a/lib/ns/update.c +++ b/lib/ns/update.c @@ -280,7 +280,7 @@ update_log(ns_client_t *client, dns_zone_t *zone, int level, const char *fmt, return; } - if (isc_log_wouldlog(ns_lctx, level) == false) { + if (!isc_log_wouldlog(ns_lctx, level)) { return; } @@ -910,9 +910,9 @@ typedef struct { static isc_result_t ssu_checkrule(void *data, dns_rdataset_t *rrset) { - bool result; const dns_ssurule_t *rule = NULL; ssu_check_t *ssuinfo = data; + bool rule_ok; /* * If we're deleting all records, it's ok to delete RRSIG and NSEC even @@ -922,11 +922,12 @@ ssu_checkrule(void *data, dns_rdataset_t *rrset) { rrset->type == dns_rdatatype_nsec) { return (ISC_R_SUCCESS); } - result = dns_ssutable_checkrules(ssuinfo->table, ssuinfo->signer, - ssuinfo->name, ssuinfo->addr, - ssuinfo->tcp, ssuinfo->aclenv, - rrset->type, ssuinfo->key, &rule); - return (result == true ? ISC_R_SUCCESS : ISC_R_FAILURE); + + rule_ok = dns_ssutable_checkrules(ssuinfo->table, ssuinfo->signer, + ssuinfo->name, ssuinfo->addr, + ssuinfo->tcp, ssuinfo->aclenv, + rrset->type, ssuinfo->key, &rule); + return (rule_ok ? ISC_R_SUCCESS : ISC_R_FAILURE); } static bool diff --git a/lib/ns/xfrout.c b/lib/ns/xfrout.c index 01db8f3051..9becd639a2 100644 --- a/lib/ns/xfrout.c +++ b/lib/ns/xfrout.c @@ -1691,11 +1691,11 @@ xfrout_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) { (void)isc_timer_touch(xfr->client->timer); #endif /* if 0 */ - if (xfr->shuttingdown == true) { + if (xfr->shuttingdown) { xfrout_maybe_destroy(xfr); } else if (result != ISC_R_SUCCESS) { xfrout_fail(xfr, result, "send"); - } else if (xfr->end_of_stream == false) { + } else if (!xfr->end_of_stream) { sendstream(xfr); } else { /* End of zone transfer stream. */ @@ -1735,7 +1735,7 @@ xfrout_fail(xfrout_ctx_t *xfr, isc_result_t result, const char *msg) { static void xfrout_maybe_destroy(xfrout_ctx_t *xfr) { - INSIST(xfr->shuttingdown == true); + INSIST(xfr->shuttingdown); #if 0 if (xfr->sends > 0) { /* diff --git a/lib/samples/nsprobe.c b/lib/samples/nsprobe.c index debf75165a..ebabfb447e 100644 --- a/lib/samples/nsprobe.c +++ b/lib/samples/nsprobe.c @@ -533,7 +533,7 @@ request_done(isc_task_t *task, isc_event_t *event) { dns_rdatatype_t type; REQUIRE(task == probe_task); - REQUIRE(trans != NULL && trans->inuse == true); + REQUIRE(trans != NULL && trans->inuse); rmessage = rev->rmessage; REQUIRE(rmessage == trans->rmessage); INSIST(outstanding_probes > 0); @@ -787,7 +787,7 @@ resolve_nsaddress(isc_task_t *task, isc_event_t *event) { isc_result_t result; REQUIRE(task == probe_task); - REQUIRE(trans->inuse == true); + REQUIRE(trans->inuse); REQUIRE(pns != NULL); INSIST(outstanding_probes > 0); @@ -925,7 +925,7 @@ resolve_ns(isc_task_t *task, isc_event_t *event) { struct probe_ns *pns; REQUIRE(task == probe_task); - REQUIRE(trans->inuse == true); + REQUIRE(trans->inuse); INSIST(outstanding_probes > 0); for (name = ISC_LIST_HEAD(rev->answerlist); name != NULL; @@ -998,7 +998,7 @@ probe_domain(struct probe_trans *trans) { char *cp; REQUIRE(trans != NULL); - REQUIRE(trans->inuse == false); + REQUIRE(!trans->inuse); REQUIRE(outstanding_probes < MAX_PROBES); /* Construct domain */ diff --git a/lib/samples/sample-async.c b/lib/samples/sample-async.c index 769a5382e7..edda231e55 100644 --- a/lib/samples/sample-async.c +++ b/lib/samples/sample-async.c @@ -158,7 +158,7 @@ process_answer(isc_task_t *task, isc_event_t *event) { isc_result_t result; REQUIRE(task == query_task); - REQUIRE(trans->inuse == true); + REQUIRE(trans->inuse); REQUIRE(outstanding_queries > 0); printf("answer[%2d]\n", trans->id); @@ -212,7 +212,7 @@ dispatch_query(struct query_trans *trans) { char *cp; REQUIRE(trans != NULL); - REQUIRE(trans->inuse == false); + REQUIRE(!trans->inuse); REQUIRE(ISC_LIST_EMPTY(trans->answerlist)); REQUIRE(outstanding_queries < MAX_QUERIES); @@ -396,7 +396,7 @@ main(int argc, char *argv[]) { /* Sanity check */ for (i = 0; i < MAX_QUERIES; i++) { - INSIST(query_array[i].inuse == false); + INSIST(!query_array[i].inuse); } /* Cleanup */