]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
misc x64 VS 2015 CTP fixes [#39308]
authorFrancis Dupont <fdupont@isc.org>
Fri, 17 Apr 2015 09:39:26 +0000 (11:39 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 17 Apr 2015 09:39:26 +0000 (11:39 +0200)
CHANGES
bin/named/client.c
bin/named/server.c
bin/named/win32/os.c
lib/dns/rdata.c
lib/dns/view.c
lib/isc/entropy.c
lib/isccc/cc.c

diff --git a/CHANGES b/CHANGES
index a769298ca9f4d9fd94fafdef8fd57d99f35e25ac..25767e1c93755a93ac4f35d354ee299a71bb3d06 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4105.  [port]          Misc fixes for Microsoft Visual Studio
+                       2015 CTP6 in 64 bit mode. [RT #39308]
+
 4104.  [bug]           Address uninitialized elements. [RT #39252]
 
 4103.  [port]          Misc fixes for Microsoft Visual Studio
index 62ef45c64908041caf00c27757977336653dae40..21afbbd3fc3677bbfea337d02292700b846dccec 100644 (file)
@@ -1875,7 +1875,7 @@ process_ecs(ns_client_t *client, isc_buffer_t *buf, size_t optlen) {
        client->ecs_scope = 0;
        client->attributes |= NS_CLIENTATTR_HAVEECS;
 
-       isc_buffer_forward(buf, optlen);
+       isc_buffer_forward(buf, (unsigned int)optlen);
        return (ISC_R_SUCCESS);
 }
 
index 1e42634adf3b62db240d4cc23c77b9902bf24613..bb7e0878043aa2d8c6a97e87b2b10068661b6c8d 100644 (file)
@@ -10122,11 +10122,11 @@ static isc_result_t
 putmem(isc_buffer_t **b, const char *str, size_t len) {
        isc_result_t result;
 
-       result = isc_buffer_reserve(b, len);
+       result = isc_buffer_reserve(b, (unsigned int)len);
        if (result != ISC_R_SUCCESS)
                return (ISC_R_NOSPACE);
 
-       isc_buffer_putmem(*b, (const unsigned char *)str, len);
+       isc_buffer_putmem(*b, (const unsigned char *)str, (unsigned int)len);
        return (ISC_R_SUCCESS);
 }
 
index 45ed5501b59bb6bc9d70cdddc39b119739636331..34a4fbf772917a65845ea9d6f11bcededab4d230 100644 (file)
@@ -50,7 +50,7 @@
 static char *lockfile = NULL;
 static char *pidfile = NULL;
 static int devnullfd = -1;
-static int singletonfd = -1;
+static int lockfilefd = -1;
 
 static BOOL Initialized = FALSE;
 
@@ -212,9 +212,9 @@ cleanup_pidfile(void) {
 
 static void
 cleanup_lockfile(void) {
-       if (singletonfd != -1) {
-               close(singletonfd);
-               singletonfd = -1;
+       if (lockfilefd != -1) {
+               close(lockfilefd);
+               lockfilefd = -1;
        }
 
        if (lockfile != NULL) {
@@ -307,7 +307,7 @@ ns_os_issingleton(const char *filename) {
        char strbuf[ISC_STRERRORSIZE];
        OVERLAPPED o;
 
-       if (singletonfd != -1)
+       if (lockfilefd != -1)
                return (ISC_TRUE);
 
        if (strcasecmp(filename, "none") == 0)
@@ -324,16 +324,16 @@ ns_os_issingleton(const char *filename) {
         * ns_os_openfile() uses safeopen() which removes any existing
         * files. We can't use that here.
         */
-       singletonfd = open(filename, O_WRONLY | O_CREAT,
-                          S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
-       if (singletonfd == -1) {
+       lockfilefd = open(filename, O_WRONLY | O_CREAT,
+                         S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+       if (lockfilefd == -1) {
                cleanup_lockfile();
                return (ISC_FALSE);
        }
 
        memset(&o, 0, sizeof(o));
        /* Expect ERROR_LOCK_VIOLATION if already locked */
-       if (!LockFileEx((HANDLE) _get_osfhandle(singletonfd),
+       if (!LockFileEx((HANDLE) _get_osfhandle(lockfilefd),
                        LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY,
                        0, 0, 1, &o)) {
                cleanup_lockfile();
@@ -349,11 +349,11 @@ ns_os_shutdown(void) {
        closelog();
        cleanup_pidfile();
 
-       if (singletonfd != -1) {
-               (void) UnlockFile((HANDLE) _get_osfhandle(singletonfd),
+       if (lockfilefd != -1) {
+               (void) UnlockFile((HANDLE) _get_osfhandle(lockfilefd),
                                  0, 0, 0, 1);
-               close(singletonfd);
-               singletonfd = -1;
+               close(lockfilefd);
+               lockfilefd = -1;
        }
        ntservice_shutdown();   /* This MUST be the last thing done */
 }
index 42a966c62cee2f484fc1778c7359e0f7b0145927..d00b2e4dcb86c1f17fcfcd5f58e69ef0cdf2609a 100644 (file)
@@ -1397,7 +1397,7 @@ multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target) {
                if (escape)
                        return (DNS_R_SYNTAX);
 
-               isc_buffer_add(target, t - t0);
+               isc_buffer_add(target, (unsigned int)(t - t0));
        } while (n != 0);
        return (ISC_R_SUCCESS);
 }
index c31df78b1696d26199bf8b4f1f0f285a2cbd75a8..84c00640f780f9e0020294f143fa0af6c0b6eeb9 100644 (file)
@@ -2150,8 +2150,8 @@ dns_view_loadnta(dns_view_t *view) {
                        dns_fixedname_init(&fn);
                        ntaname = dns_fixedname_name(&fn);
 
-                       isc_buffer_init(&b, name, len);
-                       isc_buffer_add(&b, len);
+                       isc_buffer_init(&b, name, (unsigned int)len);
+                       isc_buffer_add(&b, (unsigned int)len);
                        CHECK(dns_name_fromtext(ntaname, &b, dns_rootname,
                                                0, NULL));
                }
index 389038637ba5d47a3b016d38411d4ada73e155c5..ffdd88f19679a038efb9dd2cd9807a64a027564b 100644 (file)
@@ -319,7 +319,12 @@ entropypool_adddata(isc_entropy_t *ent, void *p, unsigned int len,
        unsigned long addr;
        isc_uint8_t *buf;
 
+       /* Silly MSVC in 64 bit mode complains here... */
+#ifdef _WIN64
+       addr = (unsigned long)((unsigned long long)p);
+#else
        addr = (unsigned long)p;
+#endif
        buf = p;
 
        if ((addr & 0x03U) != 0U) {
index 8b8cc3a380bb76f913dab1da9cd3d2337c2cfad9..400108e3a41ea38df689dfb45cb91908a39ed0b8 100644 (file)
@@ -207,7 +207,7 @@ table_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer) {
        isccc_sexpr_t *kv, *elt, *k, *v;
        char *ks;
        isc_result_t result;
-       size_t len;
+       unsigned int len;
 
        for (elt = isccc_alist_first(alist);
             elt != NULL;
@@ -216,7 +216,7 @@ table_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer) {
                k = ISCCC_SEXPR_CAR(kv);
                ks = isccc_sexpr_tostring(k);
                v = ISCCC_SEXPR_CDR(kv);
-               len = strlen(ks);
+               len = (unsigned int)strlen(ks);
                INSIST(len <= 255U);
                /*
                 * Emit the key name.