]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use the semantic patch to do the unsigned -> unsigned int change
authorOndřej Surý <ondrej@isc.org>
Wed, 7 Sep 2022 15:22:47 +0000 (17:22 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 19 Sep 2022 13:56:02 +0000 (15:56 +0200)
Apply the semantic patch on the whole code base to get rid of 'unsigned'
usage in favor of explicit 'unsigned int'.

34 files changed:
bin/dig/dighost.c
bin/dnssec/dnssec-dsfromkey.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssectool.c
bin/named/server.c
bin/tools/mdig.c
bin/tools/nsec3hash.c
contrib/dlz/example/dlz_example.c
lib/dns/badcache.c
lib/dns/dst_api.c
lib/dns/gen.c
lib/dns/include/dns/librpz.h
lib/dns/journal.c
lib/dns/masterdump.c
lib/dns/message.c
lib/dns/rbtdb.c
lib/dns/rcode.c
lib/dns/rdata/generic/hip_55.c
lib/dns/rdata/in_1/svcb_64.c
lib/dns/rdataslab.c
lib/dns/resolver.c
lib/dns/ttl.c
lib/isc/file.c
lib/isc/include/isc/ascii.h
lib/isc/log.c
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/udp.c
lib/ns/client.c
tests/bench/ascii.c
tests/dns/rdatasetstats_test.c
tests/dns/tsig_test.c
tests/isc/ascii_test.c
tests/isc/doh_test.c
tests/isc/netmgr_common.c

index b7657cdd0c42fdc8b09184826f850f9e13c6290a..3c9e50fad5435f55acbe49e7db89cfda032d829e 100644 (file)
@@ -2542,7 +2542,8 @@ setup_lookup(dig_lookup_t *lookup) {
                                        addr[addrl - 1] &= ~0U
                                                           << (8 - (plen % 8));
                                }
-                               isc_buffer_putmem(&b, addr, (unsigned)addrl);
+                               isc_buffer_putmem(&b, addr,
+                                                 (unsigned int)addrl);
                        }
 
                        opts[i].value = (uint8_t *)ecsbuf;
@@ -4680,7 +4681,7 @@ destroy_libs(void) {
 #ifdef HAVE_LIBIDN2
 
 static isc_result_t
-idn_filter(isc_buffer_t *buffer, unsigned start) {
+idn_filter(isc_buffer_t *buffer, unsigned int start) {
        char src[MXNAME];
        char *dst = NULL;
        size_t srclen, dstlen;
index 42aa9e5c7b0db565c540642ab4c6bf7420ee3277..9795c121e992835adcd10d6f358676c097ec5e18 100644 (file)
@@ -314,7 +314,7 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
 
 static void
 emits(bool showall, bool cds, dns_rdata_t *rdata) {
-       unsigned i, n;
+       unsigned int i, n;
 
        n = sizeof(dtype) / sizeof(dtype[0]);
        for (i = 0; i < n; i++) {
index 7bf82fdcd9ddee15c4a9f81a7045fdefc49bd45f..31697dc500408422e069c069eb88943fcd06534e 100644 (file)
@@ -215,7 +215,7 @@ dumpnode(dns_name_t *name, dns_dbnode_t *node) {
        isc_buffer_t *buffer = NULL;
        isc_region_t r;
        isc_result_t result;
-       unsigned bufsize = 4096;
+       unsigned int bufsize = 4096;
 
        if (outputformat != dns_masterformat_text) {
                return;
index 84acf4a4797d3342378fa5493b0c4f920c3602b2..5a39976490d7f5975d095afef2a8c85427c9abde 100644 (file)
@@ -406,7 +406,7 @@ cmp_dtype(const void *ap, const void *bp) {
 
 void
 add_dtype(unsigned int dt) {
-       unsigned i, n;
+       unsigned int i, n;
 
        /* ensure there is space for a zero terminator */
        n = sizeof(dtype) / sizeof(dtype[0]) - 1;
index 168007233acc3245fdacd4f17cba9d409d2d0275..138d7c0ad35b866bc4efead5d8d1569e9867164d 100644 (file)
@@ -7209,13 +7209,13 @@ get_tat_qname(dns_name_t *target, dns_name_t *keyname, dns_keynode_t *keynode) {
        r.base = label;
        r.length = sizeof(label);
        m = snprintf(r.base, r.length, "_ta");
-       if (m < 0 || (unsigned)m > r.length) {
+       if (m < 0 || (unsigned int)m > r.length) {
                return (ISC_R_FAILURE);
        }
        isc_textregion_consume(&r, m);
        for (i = 0; i < n; i++) {
                m = snprintf(r.base, r.length, "-%04x", ids[i]);
-               if (m < 0 || (unsigned)m > r.length) {
+               if (m < 0 || (unsigned int)m > r.length) {
                        return (ISC_R_FAILURE);
                }
                isc_textregion_consume(&r, m);
@@ -8615,7 +8615,7 @@ load_configuration(const char *filename, named_server_t *server,
 
        max = isc_quota_getmax(&server->sctx->recursionquota);
        if (max > 1000) {
-               unsigned margin = ISC_MAX(100, named_g_cpus + 1);
+               unsigned int margin = ISC_MAX(100, named_g_cpus + 1);
                if (margin + 100 > max) {
                        isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
                                      NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
@@ -12461,8 +12461,8 @@ named_server_status(named_server_t *server, isc_buffer_t **text) {
        CHECK(putstr(text, line));
 
        snprintf(line, sizeof(line), "TCP high-water: %u\n",
-                (unsigned)ns_stats_get_counter(server->sctx->nsstats,
-                                               ns_statscounter_tcphighwater));
+                (unsigned int)ns_stats_get_counter(
+                        server->sctx->nsstats, ns_statscounter_tcphighwater));
        CHECK(putstr(text, line));
 
        reload_status = atomic_load(&server->reload_status);
@@ -16793,7 +16793,7 @@ named_server_fetchlimit(named_server_t *server, isc_lex_t *lex,
                dns_adb_getquota(view->adb, &val, NULL, NULL, NULL, NULL);
                s = snprintf(tbuf, sizeof(tbuf),
                             " (fetches-per-server %u):", val);
-               if (s < 0 || (unsigned)s > sizeof(tbuf)) {
+               if (s < 0 || (unsigned int)s > sizeof(tbuf)) {
                        return (ISC_R_NOSPACE);
                }
                first = false;
@@ -16809,7 +16809,7 @@ named_server_fetchlimit(named_server_t *server, isc_lex_t *lex,
                val = dns_resolver_getfetchesperzone(view->resolver);
                s = snprintf(tbuf, sizeof(tbuf),
                             " (fetches-per-zone %u):", val);
-               if (s < 0 || (unsigned)s > sizeof(tbuf)) {
+               if (s < 0 || (unsigned int)s > sizeof(tbuf)) {
                        return (ISC_R_NOSPACE);
                }
                CHECK(putstr(text, tbuf));
index df7bc22e32d9f796e0af198406f520d09ae4d6e2..af7269480e8984b1b14401086ceaacd7f17af000 100644 (file)
@@ -701,7 +701,8 @@ sendquery(struct query *query) {
                        isc_buffer_putuint8(&b, 0);
                        /* address */
                        if (addrl > 0) {
-                               isc_buffer_putmem(&b, addr, (unsigned)addrl);
+                               isc_buffer_putmem(&b, addr,
+                                                 (unsigned int)addrl);
                        }
 
                        opts[i].value = (uint8_t *)ecsbuf;
index a6a5ec3a714002ddd18313bdec19aca92ce68a7f..fb74205afe2e50e0ce91ae13f887e7fc0bc2d4eb 100644 (file)
@@ -67,8 +67,8 @@ usage(void) {
 }
 
 typedef void
-nsec3printer(unsigned algo, unsigned flags, unsigned iters, const char *saltstr,
-            const char *domain, const char *digest);
+nsec3printer(unsigned int algo, unsigned int flags, unsigned int iters,
+            const char *saltstr, const char *domain, const char *digest);
 
 static void
 nsec3hash(nsec3printer *nsec3print, const char *algostr, const char *flagstr,
@@ -138,7 +138,7 @@ nsec3hash(nsec3printer *nsec3print, const char *algostr, const char *flagstr,
 }
 
 static void
-nsec3hash_print(unsigned algo, unsigned flags, unsigned iters,
+nsec3hash_print(unsigned int algo, unsigned int flags, unsigned int iters,
                const char *saltstr, const char *domain, const char *digest) {
        UNUSED(flags);
        UNUSED(domain);
@@ -148,7 +148,7 @@ nsec3hash_print(unsigned algo, unsigned flags, unsigned iters,
 }
 
 static void
-nsec3hash_rdata_print(unsigned algo, unsigned flags, unsigned iters,
+nsec3hash_rdata_print(unsigned int algo, unsigned int flags, unsigned int iters,
                      const char *saltstr, const char *domain,
                      const char *digest) {
        fprintf(stdout, "%s NSEC3 %u %u %u %s %s\n", domain, algo, flags, iters,
index 8be3afb1622f4c0488edbd026f19f8dd0c2c6339..4e3af35a9356e5ecba2995ba83e18eda59f4c6ac 100644 (file)
@@ -278,7 +278,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
        if (n < 0) {
                CHECK(ISC_R_FAILURE);
        }
-       if ((unsigned)n >= sizeof(soa_data)) {
+       if ((unsigned int)n >= sizeof(soa_data)) {
                CHECK(ISC_R_NOSPACE);
        }
 
index a0f52ec3cc571ae04953bf47185d703418cd8564..7c724686d307d0319d724060f00655aff191c04c 100644 (file)
@@ -254,7 +254,7 @@ dns_badcache_add(dns_badcache_t *bc, const dns_name_t *name,
        }
 
        if (bad == NULL) {
-               unsigned count;
+               unsigned int count;
                isc_buffer_t buffer;
 
                bad = isc_mem_get(bc->mctx, sizeof(*bad));
index 39fcbf1fa67066935fa4015cc51d19bc1f161658..bb98c16a4ebc538117e213244d80fd4807adebd8 100644 (file)
@@ -2205,7 +2205,7 @@ write_public_key(const dst_key_t *key, int type, const char *directory) {
        }
 
        isc_buffer_usedregion(&classb, &r);
-       if ((unsigned)fwrite(r.base, 1, r.length, fp) != r.length) {
+       if ((unsigned int)fwrite(r.base, 1, r.length, fp) != r.length) {
                ret = DST_R_WRITEERROR;
        }
 
@@ -2216,7 +2216,7 @@ write_public_key(const dst_key_t *key, int type, const char *directory) {
        }
 
        isc_buffer_usedregion(&textb, &r);
-       if ((unsigned)fwrite(r.base, 1, r.length, fp) != r.length) {
+       if ((unsigned int)fwrite(r.base, 1, r.length, fp) != r.length) {
                ret = DST_R_WRITEERROR;
        }
 
index e96a0adafb543080dd62895c3f18e791d5ec73cd..fcf905e86f4c261cb27811a87660af6c2533068f 100644 (file)
@@ -398,7 +398,7 @@ insert_into_typenames(int type, const char *typebuf, const char *attr) {
        if (attr == NULL) {
                n = snprintf(tmp, sizeof(tmp), "RRTYPE_%s_ATTRIBUTES",
                             upper(ttn->macroname));
-               INSIST(n > 0 && (unsigned)n < sizeof(tmp));
+               INSIST(n > 0 && (unsigned int)n < sizeof(tmp));
                attr = tmp;
        }
 
@@ -548,7 +548,7 @@ sd(unsigned int rdclass, const char *classbuf, const char *dirbuf,
                 */
                n = snprintf(buf, sizeof(buf), "%s_%u.%c", typebuf, type,
                             filetype);
-               INSIST(n > 0 && (unsigned)n < sizeof(buf));
+               INSIST(n > 0 && (unsigned int)n < sizeof(buf));
                if (strcmp(buf, dir.filename) != 0) {
                        continue;
                }
@@ -657,7 +657,7 @@ main(int argc, char **argv) {
                                exit(1);
                        }
                        n = snprintf(srcdir, sizeof(srcdir), "%s/", optarg);
-                       INSIST(n > 0 && (unsigned)n < sizeof(srcdir));
+                       INSIST(n > 0 && (unsigned int)n < sizeof(srcdir));
                        break;
                case 'F':
                        file = optarg;
@@ -674,7 +674,7 @@ main(int argc, char **argv) {
        }
 
        n = snprintf(buf, sizeof(buf), "%srdata", srcdir);
-       INSIST(n > 0 && (unsigned)n < sizeof(srcdir));
+       INSIST(n > 0 && (unsigned int)n < sizeof(srcdir));
 
        if (!start_directory(buf, &dir)) {
                exit(1);
@@ -693,7 +693,7 @@ main(int argc, char **argv) {
                 */
                n = snprintf(buf, sizeof(buf), "%srdata/%s_%u", srcdir,
                             classbuf, rdclass);
-               INSIST(n > 0 && (unsigned)n < sizeof(buf));
+               INSIST(n > 0 && (unsigned int)n < sizeof(buf));
                if (strcmp(buf + 6 + strlen(srcdir), dir.filename) != 0) {
                        continue;
                }
@@ -706,7 +706,7 @@ main(int argc, char **argv) {
        }
        end_directory(&dir);
        n = snprintf(buf, sizeof(buf), "%srdata/generic", srcdir);
-       INSIST(n > 0 && (unsigned)n < sizeof(srcdir));
+       INSIST(n > 0 && (unsigned int)n < sizeof(srcdir));
        sd(0, "", buf, filetype);
 
        source_date_epoch = getenv("SOURCE_DATE_EPOCH");
@@ -757,7 +757,7 @@ main(int argc, char **argv) {
                if (tm != NULL && tm->tm_year > 104) {
                        n = snprintf(year, sizeof(year), "-%d",
                                     tm->tm_year + 1900);
-                       INSIST(n > 0 && (unsigned)n < sizeof(year));
+                       INSIST(n > 0 && (unsigned int)n < sizeof(year));
                } else {
                        snprintf(year, sizeof(year), "-2016");
                }
index 8fdbe16db14b8ecd8dcc2b2de6319f22f81015d8..48718232cd152df7f5a4b244bc8bef281359a416 100644 (file)
@@ -244,10 +244,10 @@ typedef void(librpz_fatal_t)(int ex_code, const char *p, ...) LIBRPZ_PF(2, 3);
 extern void
 librpz_fatal(int ex_code, const char *p, ...) LIBRPZ_PF(2, 3) LIBRPZ_NORET;
 
-typedef void(librpz_rpz_assert_t)(const char *file, unsigned line,
+typedef void(librpz_rpz_assert_t)(const char *file, unsigned int line,
                                  const char *p, ...) LIBRPZ_PF(3, 4);
 extern void
-librpz_rpz_assert(const char *file, unsigned line, const char *p, ...)
+librpz_rpz_assert(const char *file, unsigned int line, const char *p, ...)
        LIBRPZ_PF(3, 4) LIBRPZ_NORET;
 
 typedef void(librpz_rpz_vassert_t)(const char *file, uint line, const char *p,
index 664ef23269fba3598a7f0bf4bf20c17e4ae158b3..80fe9c54d30c522efdc693427a6547442b6e7bf0 100644 (file)
@@ -1837,7 +1837,7 @@ read_one_rr(dns_journal_t *j);
  */
 
 static isc_result_t
-size_buffer(isc_mem_t *mctx, isc_buffer_t *b, unsigned size) {
+size_buffer(isc_mem_t *mctx, isc_buffer_t *b, unsigned int size) {
        if (b->length < size) {
                void *mem = isc_mem_get(mctx, size);
                if (mem == NULL) {
index 3b419446ecfdcc72ec610e29d0497f5174262b69..72ef134f276c5982c5214a5a39b688d64dc8a773 100644 (file)
@@ -307,7 +307,7 @@ indent(unsigned int *current, unsigned int to, int tabwidth,
 
        if (ntabs > 0) {
                isc_buffer_availableregion(target, &r);
-               if (r.length < (unsigned)ntabs) {
+               if (r.length < (unsigned int)ntabs) {
                        return (ISC_R_NOSPACE);
                }
                p = r.base;
@@ -330,7 +330,7 @@ indent(unsigned int *current, unsigned int to, int tabwidth,
        INSIST(nspaces >= 0);
 
        isc_buffer_availableregion(target, &r);
-       if (r.length < (unsigned)nspaces) {
+       if (r.length < (unsigned int)nspaces) {
                return (ISC_R_NOSPACE);
        }
        p = r.base;
index fc17d9f07949488d2a72ab812d173f824fd372c8..830d452a10ecebddcc9c13393323df6a775cbdd2 100644 (file)
@@ -54,7 +54,8 @@ hexdump(const char *msg, const char *msg2, void *base, size_t len) {
        p = base;
        cnt = 0;
 
-       printf("*** %s [%s] (%u bytes @ %p)\n", msg, msg2, (unsigned)len, base);
+       printf("*** %s [%s] (%u bytes @ %p)\n", msg, msg2, (unsigned int)len,
+              base);
 
        while (cnt < len) {
                if (cnt % 16 == 0) {
index 48e80d806c253b38828d43449444ff5ccd21fb52..f6e8444e176579a7e497294a8fb3909206000c93 100644 (file)
@@ -2421,7 +2421,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) {
        serial = version->serial;
        if (version->writer) {
                if (commit) {
-                       unsigned cur_ref;
+                       unsigned int cur_ref;
                        rbtdb_version_t *cur_version;
 
                        INSIST(version->commit_ok);
index 4954612d156cdaf89db3c7b616b107bb4881662d..b1459009d390c19fce925cc21380bdb5f13d77e5 100644 (file)
@@ -231,7 +231,7 @@ maybe_numeric(unsigned int *valuep, isc_textregion_t *source, unsigned int max,
         */
        v = snprintf(buffer, sizeof(buffer), "%.*s", (int)source->length,
                     source->base);
-       if (v < 0 || (unsigned)v != source->length) {
+       if (v < 0 || (unsigned int)v != source->length) {
                return (ISC_R_BADNUMBER);
        }
        INSIST(buffer[source->length] == '\0');
index 041f561d3e9c9429e0e98b19bc91cf9a948f2f21..c12d7da1ac420a13839d5ec2a08fa54f4d964b3f 100644 (file)
@@ -476,8 +476,8 @@ casecompare_hip(ARGS_COMPARE) {
        isc_region_consume(&r1, 2); /* key length */
        isc_region_consume(&r2, 4);
 
-       INSIST(r1.length >= (unsigned)(hit_len + key_len));
-       INSIST(r2.length >= (unsigned)(hit_len + key_len));
+       INSIST(r1.length >= (unsigned int)(hit_len + key_len));
+       INSIST(r2.length >= (unsigned int)(hit_len + key_len));
        order = memcmp(r1.base, r2.base, hit_len + key_len);
        if (order != 0) {
                return (order);
index ed9d2d6537ce981be4837be25553746bb5746bb3..7d119d6e4864509ec04b7d8b862ce0bac05595db 100644 (file)
@@ -363,7 +363,7 @@ svcparamkey(unsigned short value, enum encoding *encoding, char *buf,
                }
        }
        n = snprintf(buf, len, "key%u", value);
-       INSIST(n > 0 && (unsigned)n < len);
+       INSIST(n > 0 && (unsigned int)n < len);
        *encoding = sbpr_text;
        return (buf);
 }
@@ -630,7 +630,7 @@ generic_totext_in_svcb(ARGS_TOTEXT) {
        num = uint16_fromregion(&region);
        isc_region_consume(&region, 2);
        n = snprintf(buf, sizeof(buf), "%u ", num);
-       INSIST(n > 0 && (unsigned)n < sizeof(buf));
+       INSIST(n > 0 && (unsigned int)n < sizeof(buf));
        RETERR(str_totext(buf, target));
 
        /*
@@ -675,7 +675,7 @@ generic_totext_in_svcb(ARGS_TOTEXT) {
                        num = uint16_fromregion(&r);
                        isc_region_consume(&r, 2);
                        n = snprintf(buf, sizeof(buf), "%u", num);
-                       INSIST(n > 0 && (unsigned)n < sizeof(buf));
+                       INSIST(n > 0 && (unsigned int)n < sizeof(buf));
                        RETERR(str_totext(buf, target));
                        INSIST(r.length == 0U);
                        break;
index 9aed0ad4f1e3dc70c372431a8f16de142289c06a..74d9b5aa7f58eec3fc4f605434dfa2fc2c93a58f 100644 (file)
@@ -86,7 +86,7 @@ compare_rdata(const void *p1, const void *p2) {
 #if DNS_RDATASET_FIXED
 static void
 fillin_offsets(unsigned char *offsetbase, unsigned int *offsettable,
-              unsigned length) {
+              unsigned int length) {
        unsigned int i, j;
        unsigned char *raw;
 
index 9051fdc2019afe4d29f75528d15a606a34be110b..a22a68b0971c6126c64a00bfe3c03530feaf8dc3 100644 (file)
@@ -2468,7 +2468,7 @@ resquery_send(resquery_t *query) {
        bool secure_domain;
        bool tcp = ((query->options & DNS_FETCHOPT_TCP) != 0);
        dns_ednsopt_t ednsopts[DNS_EDNSOPTIONS];
-       unsigned ednsopt = 0;
+       unsigned int ednsopt = 0;
        uint16_t hint = 0, udpsize = 0; /* No EDNS */
 #ifdef HAVE_DNSTAP
        isc_sockaddr_t localaddr, *la = NULL;
@@ -5361,7 +5361,7 @@ validated(isc_task_t *task, isc_event_t *event) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_stdtime_t now;
        uint32_t ttl;
-       unsigned options;
+       unsigned int options;
        dns_fixedname_t fwild;
        dns_name_t *wild = NULL;
        dns_message_t *message = NULL;
index 0f6b5a5b7c6a056595a0515dca4b472f723c6f7f..012413d95b743e30fa1b677521100b5fba93dacc 100644 (file)
@@ -74,7 +74,7 @@ ttlfmt(unsigned int t, const char *s, bool verbose, bool space,
  */
 isc_result_t
 dns_ttl_totext(uint32_t src, bool verbose, bool upcase, isc_buffer_t *target) {
-       unsigned secs, mins, hours, days, weeks, x;
+       unsigned int secs, mins, hours, days, weeks, x;
 
        secs = src % 60;
        src /= 60;
index aca5e3ca89c416468dcf52fb5f4e17636f487304..6d457799cc43a4749b1eaf11224cff5b89193f08 100644 (file)
@@ -734,7 +734,7 @@ isc_file_sanitize(const char *dir, const char *base, const char *ext,
                l += strlen(ext) + 1;
        }
 
-       if (l > length || l > (unsigned)PATH_MAX) {
+       if (l > length || l > (unsigned int)PATH_MAX) {
                return (ISC_R_NOSPACE);
        }
 
index c11641b750482f2889ac031cfd89deea41b6075f..b63f46153498661f8780efbd1f61828582ca33fa 100644 (file)
@@ -44,7 +44,7 @@ isc__ascii_tolower1(uint8_t c) {
  * Copy `len` bytes from `src` to `dst`, converting to lower case.
  */
 static inline void
-isc_ascii_lowercopy(uint8_t *dst, const uint8_t *src, unsigned len) {
+isc_ascii_lowercopy(uint8_t *dst, const uint8_t *src, unsigned int len) {
        while (len-- > 0) {
                *dst++ = isc__ascii_tolower1(*src++);
        }
@@ -56,7 +56,7 @@ isc_ascii_lowercopy(uint8_t *dst, const uint8_t *src, unsigned len) {
 static inline void
 isc_ascii_strtolower(char *str) {
        isc_ascii_lowercopy((uint8_t *)str, (uint8_t *)str,
-                           (unsigned)strlen(str));
+                           (unsigned int)strlen(str));
 }
 
 /*
@@ -117,7 +117,7 @@ isc__ascii_load8(const uint8_t *ptr) {
  * Compare `len` bytes at `a` and `b` for case-insensitive equality
  */
 static inline bool
-isc_ascii_lowerequal(const uint8_t *a, const uint8_t *b, unsigned len) {
+isc_ascii_lowerequal(const uint8_t *a, const uint8_t *b, unsigned int len) {
        uint64_t a8 = 0, b8 = 0;
        while (len >= 8) {
                a8 = isc__ascii_tolower8(isc__ascii_load8(a));
@@ -144,7 +144,7 @@ isc_ascii_lowerequal(const uint8_t *a, const uint8_t *b, unsigned len) {
  * i.e. they treat the strings as big-endian numbers.
  */
 static inline int
-isc_ascii_lowercmp(const uint8_t *a, const uint8_t *b, unsigned len) {
+isc_ascii_lowercmp(const uint8_t *a, const uint8_t *b, unsigned int len) {
        uint64_t a8 = 0, b8 = 0;
        while (len >= 8) {
                a8 = isc__ascii_tolower8(htobe64(isc__ascii_load8(a)));
index e02479d0b71faa8adbe55b954cb899c0d9e69865..22c647ac471b173ad40a41a0d8e1fca540871434 100644 (file)
@@ -1236,7 +1236,7 @@ roll_increment(isc_logfile_t *file) {
                 */
                for (greatest = 0; greatest < INT_MAX; greatest++) {
                        n = snprintf(current, sizeof(current), "%s.%u", path,
-                                    (unsigned)greatest);
+                                    (unsigned int)greatest);
                        if (n >= (int)sizeof(current) || n < 0 ||
                            !isc_file_exists(current)) {
                                break;
@@ -1263,13 +1263,13 @@ roll_increment(isc_logfile_t *file) {
        for (i = greatest; i > 0; i--) {
                result = ISC_R_SUCCESS;
                n = snprintf(current, sizeof(current), "%s.%u", path,
-                            (unsigned)(i - 1));
+                            (unsigned int)(i - 1));
                if (n >= (int)sizeof(current) || n < 0) {
                        result = ISC_R_NOSPACE;
                }
                if (result == ISC_R_SUCCESS) {
                        n = snprintf(newpath, sizeof(newpath), "%s.%u", path,
-                                    (unsigned)i);
+                                    (unsigned int)i);
                        if (n >= (int)sizeof(newpath) || n < 0) {
                                result = ISC_R_NOSPACE;
                        }
index 25fee3a1f7a8e3f96437a887f1b93c6e73b6a829..4805223767a5742735e1d9a82c764fe192afe2f0 100644 (file)
@@ -1955,7 +1955,7 @@ isc__nm_alloc_cb(uv_handle_t *handle, size_t size, uv_buf_t *buf);
 
 void
 isc__nm_udp_read_cb(uv_udp_t *handle, ssize_t nrecv, const uv_buf_t *buf,
-                   const struct sockaddr *addr, unsigned flags);
+                   const struct sockaddr *addr, unsigned int flags);
 void
 isc__nm_tcp_read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf);
 void
index 58f31edc551bb4be4fa601ff659810251cc3e37b..c87c87e0df2bf69c4c28bf30ff5d3f0505aca67f 100644 (file)
@@ -506,7 +506,7 @@ isc__nm_async_udpstop(isc__networker_t *worker, isc__netievent_t *ev0) {
  */
 void
 isc__nm_udp_read_cb(uv_udp_t *handle, ssize_t nrecv, const uv_buf_t *buf,
-                   const struct sockaddr *addr, unsigned flags) {
+                   const struct sockaddr *addr, unsigned int flags) {
        isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)handle);
        isc__nm_uvreq_t *req = NULL;
        uint32_t maxudp;
index 70e091a45b7e102e34745ee7deb05b666d9608cf..699264d7cb16329a3f3d9101a97c2eb422f4b933 100644 (file)
@@ -1090,7 +1090,7 @@ no_nsid:
                        if ((plen % 8) != 0) {
                                addr[addrl - 1] &= ~0U << (8 - (plen % 8));
                        }
-                       isc_buffer_putmem(&buf, addr, (unsigned)addrl);
+                       isc_buffer_putmem(&buf, addr, (unsigned int)addrl);
                }
 
                ednsopts[count].code = DNS_OPT_CLIENT_SUBNET;
index dbc62d3efb13a5eafcd16ea9fc7cf5740ecd6282..3cbe08d13613e4810ab6a1d7422a76516b2238e5 100644 (file)
@@ -23,7 +23,7 @@
 #define SIZE (1024 * 1024)
 
 typedef void
-copy_fn(void *a, void *b, unsigned len);
+copy_fn(void *a, void *b, unsigned int len);
 
 static void
 time_it(copy_fn *copier, void *a, void *b, const char *name) {
@@ -40,12 +40,12 @@ time_it(copy_fn *copier, void *a, void *b, const char *name) {
 }
 
 static void
-copy_raw(void *a, void *b, unsigned size) {
+copy_raw(void *a, void *b, unsigned int size) {
        memmove(a, b, size);
 }
 
 static void
-copy_toupper(void *va, void *vb, unsigned size) {
+copy_toupper(void *va, void *vb, unsigned int size) {
        uint8_t *a = va, *b = vb;
        while (size-- > 0) {
                *a++ = isc_ascii_toupper(*b++);
@@ -53,21 +53,21 @@ copy_toupper(void *va, void *vb, unsigned size) {
 }
 
 static void
-copy_tolower8(void *a, void *b, unsigned size) {
+copy_tolower8(void *a, void *b, unsigned int size) {
        isc_ascii_lowercopy(a, b, size);
 }
 
 #define TOLOWER(c) ((c) + ('a' - 'A') * (((c) >= 'A') ^ ((c) > 'Z')))
 
 static void
-copy_tolower1(void *va, void *vb, unsigned size) {
+copy_tolower1(void *va, void *vb, unsigned int size) {
        for (uint8_t *a = va, *b = vb; size-- > 0; a++, b++) {
                *a = TOLOWER(*b);
        }
 }
 
 static bool
-cmp_tolower1(void *va, void *vb, unsigned size) {
+cmp_tolower1(void *va, void *vb, unsigned int size) {
        for (uint8_t *a = va, *b = vb; size-- > 0; a++, b++) {
                if (TOLOWER(*a) != TOLOWER(*b)) {
                        return false;
@@ -79,7 +79,7 @@ cmp_tolower1(void *va, void *vb, unsigned size) {
 static bool oldskool_result;
 
 static void
-cmp_oldskool(void *va, void *vb, unsigned size) {
+cmp_oldskool(void *va, void *vb, unsigned int size) {
        uint8_t *a = va, *b = vb, c;
 
        while (size > 3) {
@@ -119,22 +119,22 @@ diff:
 static bool tolower1_result;
 
 static void
-vcmp_tolower1(void *a, void *b, unsigned size) {
+vcmp_tolower1(void *a, void *b, unsigned int size) {
        tolower1_result = cmp_tolower1(a, b, size);
 }
 
 static bool swar_result;
 
 static void
-cmp_swar(void *a, void *b, unsigned size) {
+cmp_swar(void *a, void *b, unsigned int size) {
        swar_result = isc_ascii_lowerequal(a, b, size);
 }
 
 static bool chunk_result;
-static unsigned chunk_size;
+static unsigned int chunk_size;
 
 static void
-cmp_chunks1(void *va, void *vb, unsigned size) {
+cmp_chunks1(void *va, void *vb, unsigned int size) {
        uint8_t *a = va, *b = vb;
 
        chunk_result = false;
@@ -150,7 +150,7 @@ cmp_chunks1(void *va, void *vb, unsigned size) {
 }
 
 static void
-cmp_chunks8(void *va, void *vb, unsigned size) {
+cmp_chunks8(void *va, void *vb, unsigned int size) {
        uint8_t *a = va, *b = vb;
 
        while (size >= chunk_size) {
@@ -169,7 +169,7 @@ diff:
 }
 
 static void
-cmp_oldchunks(void *va, void *vb, unsigned size) {
+cmp_oldchunks(void *va, void *vb, unsigned int size) {
        uint8_t *a = va, *b = vb;
 
        while (size >= chunk_size) {
index 743803474c3f233fa4a8f716987057351a9d2a68..1c5bba9373cd55271bb7ca2cd48445279b6782c7 100644 (file)
@@ -112,7 +112,7 @@ verify_active_counters(dns_rdatastatstype_t which, uint64_t value, void *arg) {
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_ANCIENT) ? "~" : " ",
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ",
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ",
-               type, (unsigned)value);
+               type, (unsigned int)value);
 #endif /* if debug */
        if ((attributes & DNS_RDATASTATSTYPE_ATTR_ANCIENT) == 0 &&
            (attributes & DNS_RDATASTATSTYPE_ATTR_STALE) == 0)
@@ -143,7 +143,7 @@ verify_stale_counters(dns_rdatastatstype_t which, uint64_t value, void *arg) {
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_ANCIENT) ? "~" : " ",
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ",
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ",
-               type, (unsigned)value);
+               type, (unsigned int)value);
 #endif /* if debug */
        if ((attributes & DNS_RDATASTATSTYPE_ATTR_STALE) != 0) {
                assert_int_equal(value, 1);
@@ -172,7 +172,7 @@ verify_ancient_counters(dns_rdatastatstype_t which, uint64_t value, void *arg) {
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_ANCIENT) ? "~" : " ",
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ",
                ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ",
-               type, (unsigned)value);
+               type, (unsigned int)value);
 #endif /* if debug */
        if ((attributes & DNS_RDATASTATSTYPE_ATTR_ANCIENT) != 0) {
                assert_int_equal(value, 1);
index 15d33ca46c25af9a2ba2fb837a768f7389d70ec4..303ed94e372147965ba456c235bf9a1be6609390 100644 (file)
@@ -207,7 +207,7 @@ printmessage(dns_message_t *msg) {
 }
 
 static void
-render(isc_buffer_t *buf, unsigned flags, dns_tsigkey_t *key,
+render(isc_buffer_t *buf, unsigned int flags, dns_tsigkey_t *key,
        isc_buffer_t **tsigin, isc_buffer_t **tsigout, dst_context_t *tsigctx) {
        dns_message_t *msg = NULL;
        dns_compress_t cctx;
index 43be4ce6bce295c325e665cc112bf60d96b487bb..239e77b6c79bf8926cc3bc50f03a1bdd6ff66229 100644 (file)
@@ -111,13 +111,13 @@ ISC_RUN_TEST_IMPL(lowerequal) {
        for (size_t n = 0; n < ARRAY_SIZE(same); n++) {
                const uint8_t *a = (void *)same[n][0];
                const uint8_t *b = (void *)same[n][1];
-               unsigned len = (unsigned)strlen(same[n][0]);
+               unsigned int len = (unsigned int)strlen(same[n][0]);
                assert_true(isc_ascii_lowerequal(a, b, len));
        }
        for (size_t n = 0; n < ARRAY_SIZE(diff); n++) {
                const uint8_t *a = (void *)diff[n].a;
                const uint8_t *b = (void *)diff[n].b;
-               unsigned len = (unsigned)strlen(diff[n].a);
+               unsigned int len = (unsigned int)strlen(diff[n].a);
                assert_true(!isc_ascii_lowerequal(a, b, len));
        }
 }
@@ -126,13 +126,13 @@ ISC_RUN_TEST_IMPL(lowercmp) {
        for (size_t n = 0; n < ARRAY_SIZE(same); n++) {
                const uint8_t *a = (void *)same[n][0];
                const uint8_t *b = (void *)same[n][1];
-               unsigned len = (unsigned)strlen(same[n][0]);
+               unsigned int len = (unsigned int)strlen(same[n][0]);
                assert_true(isc_ascii_lowercmp(a, b, len) == 0);
        }
        for (size_t n = 0; n < ARRAY_SIZE(diff); n++) {
                const uint8_t *a = (void *)diff[n].a;
                const uint8_t *b = (void *)diff[n].b;
-               unsigned len = (unsigned)strlen(diff[n].a);
+               unsigned int len = (unsigned int)strlen(diff[n].a);
                assert_true(isc_ascii_lowercmp(a, b, len) == diff[n].cmp);
        }
 }
index d0510d9be24a4f26eea44fa1c0df7bb7b16c9396..a36893557e0e9270bdd57a979c3d45db529e0bdd 100644 (file)
@@ -377,7 +377,7 @@ static isc_quota_t *
 init_listener_quota(size_t nthreads) {
        isc_quota_t *quotap = NULL;
        if (atomic_load(&check_listener_quota)) {
-               unsigned max_quota = ISC_MAX(nthreads / 2, 1);
+               unsigned int max_quota = ISC_MAX(nthreads / 2, 1);
                isc_quota_max(&listener_quota, max_quota);
                quotap = &listener_quota;
        }
index d6ef968d9a79d7511e86e062e3a470c7dbd711bd..7079c41861326b23521f06796aadd026a4cf625b 100644 (file)
@@ -574,7 +574,7 @@ isc_quota_t *
 tcp_listener_init_quota(size_t nthreads) {
        isc_quota_t *quotap = NULL;
        if (atomic_load(&check_listener_quota)) {
-               unsigned max_quota = ISC_MAX(nthreads / 2, 1);
+               unsigned int max_quota = ISC_MAX(nthreads / 2, 1);
                isc_quota_max(&listener_quota, max_quota);
                quotap = &listener_quota;
        }