Commit d20f0472 authored by Evan Hunt's avatar Evan Hunt

[master] silence clang warnings

4422.	[port]		Silence clang warnings in dig.c and dighost.c.
			[RT #42451]
parent 02991b68
4422. [port] Silence clang warnings in dig.c and dighost.c.
[RT #42451]
4421. [func] When built with LMDB (Lightning Memory-mapped
Database), named will now use a database to store
the configuration for zones added by "rndc addzone"
......
......@@ -697,7 +697,7 @@ cleanup:
static void
printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
int i;
int remaining;
size_t remaining;
static isc_boolean_t first = ISC_TRUE;
char append[MXNAME];
......@@ -1566,7 +1566,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
}
*open_type_class = ISC_FALSE;
tr.base = value;
tr.length = strlen(value);
tr.length = (unsigned int) strlen(value);
result = dns_rdataclass_fromtext(&rdclass,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS) {
......@@ -1617,7 +1617,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
result = ISC_R_SUCCESS;
} else {
tr.base = value;
tr.length = strlen(value);
tr.length = (unsigned int) strlen(value);
result = dns_rdatatype_fromtext(&rdtype,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS &&
......@@ -1912,7 +1912,8 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
result = ISC_R_SUCCESS;
} else {
tr.base = rv[0];
tr.length = strlen(rv[0]);
tr.length =
(unsigned int) strlen(rv[0]);
result = dns_rdatatype_fromtext(&rdtype,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS &&
......
......@@ -464,9 +464,9 @@ reverse_octets(const char *in, char **p, char *end) {
result = append(".", 1, p, end);
if (result != ISC_R_SUCCESS)
return (result);
len = (int)(dot - in);
len = (int) (dot - in);
} else {
len = strlen(in);
len = (int) strlen(in);
}
return (append(in, len, p, end));
}
......@@ -970,7 +970,7 @@ setup_text_key(void) {
isc_result_t result;
dns_name_t keyname;
isc_buffer_t secretbuf;
int secretsize;
unsigned int secretsize;
unsigned char *secretstore;
debug("setup_text_key()");
......@@ -979,7 +979,7 @@ setup_text_key(void) {
dns_name_init(&keyname, NULL);
check_result(result, "dns_name_init");
isc_buffer_putstr(namebuf, keynametext);
secretsize = strlen(keysecret) * 3 / 4;
secretsize = (unsigned int) strlen(keysecret) * 3 / 4;
secretstore = isc_mem_allocate(mctx, secretsize);
if (secretstore == NULL)
fatal("memory allocation failure in %s:%d",
......@@ -1001,8 +1001,8 @@ setup_text_key(void) {
goto failure;
result = dns_tsigkey_create(&keyname, hmacname, secretstore,
secretsize, ISC_FALSE, NULL, 0, 0, mctx,
NULL, &key);
(int)secretsize, ISC_FALSE, NULL, 0, 0,
mctx, NULL, &key);
failure:
if (result != ISC_R_SUCCESS)
printf(";; Couldn't create key %s: %s\n",
......@@ -1131,13 +1131,13 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) {
void
parse_hmac(const char *hmac) {
char buf[20];
int len;
size_t len;
REQUIRE(hmac != NULL);
len = strlen(hmac);
if (len >= (int) sizeof(buf))
fatal("unknown key type '%.*s'", len, hmac);
if (len >= sizeof(buf))
fatal("unknown key type '%.*s'", (int)len, hmac);
strlcpy(buf, hmac, sizeof(buf));
digestbits = 0;
......@@ -1571,7 +1571,7 @@ save_opt(dig_lookup_t *lookup, char *code, char *value) {
buf = isc_mem_allocate(mctx, strlen(value)/2 + 1);
if (buf == NULL)
fatal("out of memory");
isc_buffer_init(&b, buf, strlen(value)/2 + 1);
isc_buffer_init(&b, buf, (unsigned int) strlen(value)/2 + 1);
result = isc_hex_decodestring(value, &b);
check_result(result, "isc_hex_decodestring");
ednsopts[ednsoptscnt].value = isc_buffer_base(&b);
......@@ -2203,7 +2203,7 @@ isc_boolean_t
setup_lookup(dig_lookup_t *lookup) {
isc_result_t result;
isc_uint32_t id;
int len;
unsigned int len;
dig_server_t *serv;
dig_query_t *query;
isc_buffer_t b;
......@@ -2310,7 +2310,7 @@ setup_lookup(dig_lookup_t *lookup) {
check_result(result, "dns_message_gettempname");
dns_name_init(lookup->oname, NULL);
/* XXX Helper funct to conv char* to name? */
len = strlen(lookup->origin->origin);
len = (unsigned int) strlen(lookup->origin->origin);
isc_buffer_init(&b, lookup->origin->origin, len);
isc_buffer_add(&b, len);
result = dns_name_fromtext(lookup->oname, &b, dns_rootname,
......@@ -2332,7 +2332,7 @@ setup_lookup(dig_lookup_t *lookup) {
dns_fixedname_init(&fixed);
name = dns_fixedname_name(&fixed);
len = strlen(lookup->textname);
len = (unsigned int) strlen(lookup->textname);
isc_buffer_init(&b, lookup->textname, len);
isc_buffer_add(&b, len);
result = dns_name_fromtext(name, &b, NULL, 0, NULL);
......@@ -2366,14 +2366,14 @@ setup_lookup(dig_lookup_t *lookup) {
dns_name_clone(dns_rootname, lookup->name);
else {
#ifdef WITH_IDN
len = strlen(idn_textname);
len = (unsigned int) strlen(idn_textname);
isc_buffer_init(&b, idn_textname, len);
isc_buffer_add(&b, len);
result = dns_name_fromtext(lookup->name, &b,
dns_rootname, 0,
&lookup->namebuf);
#else
len = strlen(lookup->textname);
len = (unsigned int) strlen(lookup->textname);
isc_buffer_init(&b, lookup->textname, len);
isc_buffer_add(&b, len);
result = dns_name_fromtext(lookup->name, &b,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment