]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
change 'expr == true' to 'expr' in conditionals
authorEvan Hunt <each@isc.org>
Mon, 30 Mar 2020 20:47:58 +0000 (13:47 -0700)
committerEvan Hunt <each@isc.org>
Tue, 26 May 2020 00:03:59 +0000 (17:03 -0700)
(cherry picked from commit 68a1c9d679c0b9b51605fad09e4a74561d52723d)

29 files changed:
bin/dnssec/dnssec-keygen.c
bin/named/server.c
contrib/dlz/bin/dlzbdb/dlzbdb.c
contrib/dlz/drivers/sdlz_helper.c
contrib/dlz/modules/common/dlz_dbi.c
lib/dns/catz.c
lib/dns/compress.c
lib/dns/db.c
lib/dns/dispatch.c
lib/dns/dst_api.c
lib/dns/dyndb.c
lib/dns/keymgr.c
lib/dns/message.c
lib/dns/rdata.c
lib/dns/rpz.c
lib/dns/tkey.c
lib/isc/app.c
lib/isc/httpd.c
lib/isc/netmgr/netmgr.c
lib/isc/task.c
lib/isc/win32/fsaccess.c
lib/ns/client.c
lib/ns/interfacemgr.c
lib/ns/query.c
lib/ns/tests/query_test.c
lib/ns/update.c
lib/ns/xfrout.c
lib/samples/nsprobe.c
lib/samples/sample-async.c

index 36724bec963777dd88f22421af94c6259420cca9..2b81e40656177da816ff09a58ea412b5d7efc9b1 100644 (file)
@@ -815,7 +815,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 "
index 5ef496c988d4799711a60bf4b7e205dee29a527d..6149739cea8dfe356ccf2e858c352fa4028642d3 100644 (file)
@@ -2667,7 +2667,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,
index 4dc99954092482a4ea50373952185d99a2df18c9..13bdca3f02cfc50bd825a41100c4a9ff25c31a62 100644 (file)
@@ -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);
index 3f5a88ca183d2f3e491d6de7d6268f472c8e5db6..e496587f51c9f0059f84edf0b222f483b915ad49 100644 (file)
@@ -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 {
index 7d0567644dd6787cca61e7bea3ff5ba4b1c0d4fd..c31ade455b9d226ec8b438095e4465f8b94649cd 100644 (file)
@@ -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 {
index 265becf7d1683e2a0996a530c907d56bdef26180..454d075ff2e36debf43046f522aeeb4929039723 100644 (file)
@@ -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);
index 628da2eb88333b1a4f07b9460a1d1509393afd8c..0b38ba8620125bfa87cada8f504c2d0b5b43ce72 100644 (file)
@@ -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)) {
index e7dbb6098446745dd87661b2ddfda8a50e09363b..80946855904848521ced84a9cd4c00a90d0830cf 100644 (file)
@@ -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));
index bb5cd8d430c3f209c81e4f32e8383d3fe536918f..85c1c4648ad6438d275f58dacc961fc24661efef 100644 (file)
@@ -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);
index 94106a3fc17639f705587eec718f2a4cbd4789fc..4e587d24ea6e302c8747c43166176a8afb9423ff 100644 (file)
@@ -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);
@@ -413,7 +413,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);
 
@@ -441,7 +441,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 +490,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 +519,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 +572,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 +703,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 +806,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 +824,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 +893,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 +927,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 +969,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 +1138,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 +1234,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 +1243,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 +1253,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 +1263,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 +1311,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 +1365,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 +1416,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 +1841,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 +2264,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);
index fdc8ea59f87dd24b207c99e530a79310b1cc41b9..54adc4bc161975aefe4fc6cba8bd9177bcb1583b 100644 (file)
@@ -403,7 +403,7 @@ dns_dyndb_cleanup(bool exiting) {
        }
        UNLOCK(&dyndb_lock);
 
-       if (exiting == true) {
+       if (exiting) {
                isc_mutex_destroy(&dyndb_lock);
        }
 }
index 5c5bba8e3ba1c73c139c21dfe456675ee331df35..efa07f4330bd7cb4a874ea6cdb7509541ff9a525 100644 (file)
@@ -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));
index a3b0ae4ea6b508d95987b872f8b582f2e63c5f90..bd10c7d6789af9fbf64deb85fb12a558ff145b1e 100644 (file)
@@ -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);
index 2a20a2ae01ef6a215ed8b67c93936964514bc511..7199ca58912b80be5ea25a1713eafb4be3b721ca 100644 (file)
@@ -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) {
index c90701a1efb2d451ace4f22b2191979474cebe32..ec4d77403a8dbe9662fdb46d6a615421c1bdfcaa 100644 (file)
@@ -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];
index 1e6fa5ae4c2d35fc5bebefa438ca0429ff02c592..cc58f911b5a10eea93cdaa34c14a12beed61ed5a 100644 (file)
@@ -1506,7 +1506,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 {
index 28f46568c72c5f0c4f69a7db4234198f8c09ab0e..d292d1c022368c1be6416cb99df57d6f96cdbeb5 100644 (file)
@@ -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).
@@ -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);
 
index 9b7b32dd3d1fddd5a28a1c3c10d8dfab091985ab..d3117d4d6a80277955c7389cedc38a389b125930 100644 (file)
@@ -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",
index 9c9f0717eab808d1903d9d383fa383b828fdda05..0c348d0c7422fc2138bca9312e5f9fad6e9d41eb 100644 (file)
@@ -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);
 }
index 859b50782642c38e44f4d8e32a14626c2972ec50..5d9cef42ecba27a1c0bbbc7a4e780265634bb4b0 100644 (file)
@@ -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);
index 030d8884e539d7764f957a968332c44dcbae7904..f6192da32562d047b1a1f58591765e6e156af56a 100644 (file)
@@ -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;
                }
index 04a8da7d3e9cbe505336bd52cbe206e8e4574b53..657495e4a58916bc99ccb99fc8d38e0eaa8e42f6 100644 (file)
@@ -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;
        }
 
index 006fd2fad5f8cd93c2e09530863efdbbaa033f54..d40edbcb1a7e0db4bc737c79b595a34e1bac2285 100644 (file)
@@ -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))
                {
@@ -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 == false && 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 == false && 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;
index f5caa198c9faa1917d64d8553cf861b91e9767bc..c36e6acd3974544b1ebe06399066605017bf05ea 100644 (file)
@@ -10899,7 +10899,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;
        }
index a82989e2c01707bab515cc73bb4d7fdc9e2d3d5a..209dd76fc11e8082db913651b0a88603cf38a991 100644 (file)
@@ -95,8 +95,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.
index 3c88115e0b04c2f83eb6ef7da9b8510e9e7f49bf..eaa6cb33cce0758a92a545dee2966fbf2d09692f 100644 (file)
@@ -900,7 +900,7 @@ typedef struct {
 static isc_result_t
 ssu_checkrule(void *data, dns_rdataset_t *rrset) {
        ssu_check_t *ssuinfo = data;
-       bool result;
+       bool rule_ok;
 
        /*
         * If we're deleting all records, it's ok to delete RRSIG and NSEC even
@@ -910,10 +910,11 @@ ssu_checkrule(void *data, dns_rdataset_t *rrset) {
            rrset->type == dns_rdatatype_nsec) {
                return (ISC_R_SUCCESS);
        }
-       result = dns_ssutable_checkrules(
+
+       rule_ok = dns_ssutable_checkrules(
                ssuinfo->table, ssuinfo->signer, ssuinfo->name, ssuinfo->addr,
                ssuinfo->tcp, ssuinfo->aclenv, rrset->type, ssuinfo->key);
-       return (result == true ? ISC_R_SUCCESS : ISC_R_FAILURE);
+       return (rule_ok ? ISC_R_SUCCESS : ISC_R_FAILURE);
 }
 
 static bool
index c91e992bceb7963d805c81a543c0b6982c3c5f0f..79f3cb7bb83136ca0800e4802d11fa34f0d16103 100644 (file)
@@ -1659,7 +1659,7 @@ 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");
@@ -1702,7 +1702,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) {
                /*
index 5ac09c8b67316ed114f0da759cc27c113d3571f3..ab46e6a448333afda790cc13d64e0a0687dc9b32 100644 (file)
@@ -532,7 +532,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);
@@ -786,7 +786,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);
 
@@ -924,7 +924,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;
index 302d31212df81e056e0ce0e213d6337d2b61c8ef..eb7ac09bc89192233fd013a5c7c678a46fb7048a 100644 (file)
@@ -157,7 +157,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);