Commit 6adc40b3 authored by Mark Andrews's avatar Mark Andrews

4704. [cleanup] Silence Visual Studio compiler warnings. [RT #45898]

parent 7e40d627
4704. [cleanup] Silence Visual Studio compiler warnings. [RT #45898]
4703. [bug] BINDInstall.exe was missing some buffer length checks.
[RT #45898]
......
......@@ -258,7 +258,7 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
unsigned char ch, llen;
unsigned int firstoffset, length;
firstoffset = p - name->ndata;
firstoffset = (unsigned int)(p - name->ndata);
length = name->length - firstoffset;
/*
......
......@@ -38,7 +38,7 @@ dns_ecs_format(dns_ecs_t *ecs, char *buf, size_t size) {
REQUIRE(buf != NULL);
REQUIRE(size >= DNS_ECS_FORMATSIZE);
isc_netaddr_format(&ecs->addr, buf, size);
isc_netaddr_format(&ecs->addr, buf, (unsigned int)size);
len = strlen(buf);
INSIST(size >= len);
buf += len;
......
......@@ -979,7 +979,7 @@ dns_name_getlabelsequence(const dns_name_t *source,
l = *p;
p += l + 1;
}
firstoffset = p - source->ndata;
firstoffset = (unsigned int)(p - source->ndata);
}
if (ISC_LIKELY(first + n == source->labels))
......@@ -989,7 +989,7 @@ dns_name_getlabelsequence(const dns_name_t *source,
l = *p;
p += l + 1;
}
endoffset = p - source->ndata;
endoffset = (unsigned int)(p - source->ndata);
}
target->ndata = &source->ndata[firstoffset];
......
......@@ -1582,7 +1582,7 @@ dns_rpz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
"rpz: %s: new zone version came "
"too soon, deferring update for "
"%llu seconds", dname, defer);
isc_interval_set(&interval, defer, 0);
isc_interval_set(&interval, (unsigned int)defer, 0);
dns_db_currentversion(zone->db, &zone->dbversion);
result = isc_timer_reset(zone->updatetimer,
isc_timertype_once,
......@@ -1748,7 +1748,7 @@ finish_update(dns_rpz_zone_t *rpz) {
isc_ht_iter_currentkey(iter, &key, &keysize);
region.base = key;
region.length = keysize;
region.length = (unsigned int)keysize;
dns_name_fromregion(name, &region);
dns_rpz_delete(rpz->rpzs, rpz->num, name);
}
......@@ -1772,7 +1772,7 @@ finish_update(dns_rpz_zone_t *rpz) {
"rpz: %s: new zone version came "
"too soon, deferring update for "
"%llu seconds", dname, defer);
isc_interval_set(&interval, defer, 0);
isc_interval_set(&interval, (unsigned int)defer, 0);
result = isc_timer_reset(rpz->updatetimer,
isc_timertype_once,
NULL, &interval, ISC_TRUE);
......
......@@ -931,8 +931,8 @@ ISC_LANG_ENDDECLS
REQUIRE(isc_buffer_availablelength(_b) >= 2U); \
_cp = isc_buffer_used(_b); \
(_b)->used += 2; \
_cp[0] = _val2 >> 8; \
_cp[1] = _val2; \
_cp[0] = (unsigned char)(_val2 >> 8); \
_cp[1] = (unsigned char)_val2; \
} while (0)
#define ISC__BUFFER_PUTUINT24(_b, _val) \
......@@ -948,9 +948,9 @@ ISC_LANG_ENDDECLS
REQUIRE(isc_buffer_availablelength(_b) >= 3U); \
_cp = isc_buffer_used(_b); \
(_b)->used += 3; \
_cp[0] = _val2 >> 16; \
_cp[1] = _val2 >> 8; \
_cp[2] = _val2; \
_cp[0] = (unsigned char)(_val2 >> 16); \
_cp[1] = (unsigned char)(_val2 >> 8); \
_cp[2] = (unsigned char)_val2; \
} while (0)
#define ISC__BUFFER_PUTUINT32(_b, _val) \
......@@ -966,10 +966,10 @@ ISC_LANG_ENDDECLS
REQUIRE(isc_buffer_availablelength(_b) >= 4U); \
_cp = isc_buffer_used(_b); \
(_b)->used += 4; \
_cp[0] = _val2 >> 24; \
_cp[1] = _val2 >> 16; \
_cp[2] = _val2 >> 8; \
_cp[3] = _val2; \
_cp[0] = (unsigned char)(_val2 >> 24); \
_cp[1] = (unsigned char)(_val2 >> 16); \
_cp[2] = (unsigned char)(_val2 >> 8); \
_cp[3] = (unsigned char)_val2; \
} while (0)
#if defined(ISC_BUFFER_USEINLINE)
......
......@@ -1051,7 +1051,7 @@ build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
}
static void
set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock,
set_dev_address(const isc_sockaddr_t *address, isc_socket_t *sock,
isc_socketevent_t *dev)
{
if (sock->type == isc_sockettype_udp) {
......
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