]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Merged VS 2015 64 bit warnings (#40373)
authorFrancis Dupont <fdupont@isc.org>
Mon, 16 Nov 2015 16:47:10 +0000 (17:47 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 16 Nov 2015 16:47:10 +0000 (17:47 +0100)
15 files changed:
bin/dig/dighost.c
bin/named/client.c
bin/named/server.c
bin/tools/mdig.c
lib/dns/dyndb.c
lib/dns/masterdump.c
lib/dns/win32/libdns.dsp.in
lib/dns/win32/libdns.mak.in
lib/dns/win32/libdns.vcxproj.filters.in
lib/dns/win32/libdns.vcxproj.in
lib/isc/include/isc/hash.h
lib/isc/win32/libisc.def.in
lib/isc/win32/socket.c
lib/isccfg/namedconf.c
lib/isccfg/parser.c

index 7dc536c9284c84314ad0f8cb09d5bb5efeb8fe87..2fb7283721388be88044142fe0275c1dfdbb116f 100644 (file)
@@ -2534,7 +2534,8 @@ setup_lookup(dig_lookup_t *lookup) {
                                isc_buffer_putuint8(&b, 0);
                                /* address */
                                if (addrl > 0) {
-                                       isc_buffer_putmem(&b, addr, addrl - 1);
+                                       isc_buffer_putmem(&b, addr,
+                                                         (unsigned)addrl - 1);
                                        isc_buffer_putuint8(&b,
                                                            (addr[addrl - 1] &
                                                             mask));
@@ -2550,7 +2551,8 @@ setup_lookup(dig_lookup_t *lookup) {
                                isc_buffer_putuint8(&b, 0);
                                /* address */
                                if (addrl > 0) {
-                                       isc_buffer_putmem(&b, addr, addrl - 1);
+                                       isc_buffer_putmem(&b, addr,
+                                                         (unsigned)addrl - 1);
                                        isc_buffer_putuint8(&b,
                                                            (addr[addrl - 1] &
                                                             mask));
index 0fa461f62f7584782e96da819e04c6ba345b1218..26b57b9b028cd990213a70ca1e896cc740fe4db6 100644 (file)
@@ -1178,7 +1178,7 @@ client_send(ns_client_t *client) {
 #endif /* HAVE_DNSTAP */
 
                isc_stats_increment(ns_g_server->tcpoutstats,
-                                   ISC_MIN(respsize / 16, 256));
+                                   ISC_MIN((int)respsize / 16, 256));
        } else {
                respsize = isc_buffer_usedlength(&buffer);
                result = client_sendpkg(client, &buffer);
@@ -1192,7 +1192,7 @@ client_send(ns_client_t *client) {
 #endif /* HAVE_DNSTAP */
 
                isc_stats_increment(ns_g_server->udpoutstats,
-                                   ISC_MIN(respsize / 16, 256));
+                                   ISC_MIN((int)respsize / 16, 256));
        }
 
        /* update statistics (XXXJT: is it okay to access message->xxxkey?) */
@@ -1736,7 +1736,7 @@ compute_cookie(ns_client_t *client, isc_uint32_t when, isc_uint32_t nonce,
                isc_netaddr_t netaddr;
                unsigned char *cp;
                isc_hmacsha1_t hmacsha1;
-               size_t length;
+               unsigned int length;
 
                cp = isc_buffer_used(buf);
                isc_buffer_putmem(buf, client->cookie, 8);
@@ -1774,7 +1774,7 @@ compute_cookie(ns_client_t *client, isc_uint32_t when, isc_uint32_t nonce,
                isc_netaddr_t netaddr;
                unsigned char *cp;
                isc_hmacsha256_t hmacsha256;
-               size_t length;
+               unsigned int length;
 
                cp = isc_buffer_used(buf);
                isc_buffer_putmem(buf, client->cookie, 8);
@@ -2261,10 +2261,10 @@ client_request(isc_task_t *task, isc_event_t *event) {
                isc_stats_increment(ns_g_server->nsstats,
                                    dns_nsstatscounter_requesttcp);
                isc_stats_increment(ns_g_server->tcpinstats,
-                                   ISC_MIN(reqsize / 16, 18));
+                                   ISC_MIN((int)reqsize / 16, 18));
        } else {
                isc_stats_increment(ns_g_server->udpinstats,
-                                   ISC_MIN(reqsize / 16, 18));
+                                   ISC_MIN((int)reqsize / 16, 18));
        }
 
        /*
index ee55db269328ea4a5a890ae0e282c07c8bc2c1a3..06559ec1e9e6c0972c9723b2b2abbfa473ce65f9 100644 (file)
@@ -2860,7 +2860,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
 
        if (max_cache_size == SIZE_AS_PERCENT) {
                isc_uint64_t totalphys = isc_meminfo_totalphys();
-               max_cache_size = totalphys * max_cache_size_percent/100;
+
+               max_cache_size =
+                       (size_t) (totalphys * max_cache_size_percent/100);
                if (totalphys == 0) {
                        cfg_obj_log(obj, ns_g_lctx,
                                ISC_LOG_WARNING,
@@ -2871,10 +2873,10 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
                        cfg_obj_log(obj, ns_g_lctx,
                                ISC_LOG_INFO,
                                "'max-cache-size %d%%' "
-                               "- setting to %zuMB (out of %luMB)",
+                               "- setting to %zuMB (out of %zuMB)",
                                max_cache_size_percent,
                                max_cache_size / (1024*1024),
-                               (unsigned long) totalphys / (1024*1024));
+                               (size_t) (totalphys / (1024*1024)));
                }
        }
 
index c1fe59ec2116a143f698b8a5272ccd3d59d29105..71102453a97ffcbb136450cef74af7dcba124513 100644 (file)
@@ -619,7 +619,8 @@ sendquery(struct query *query, isc_task_t *task)
                                isc_buffer_putuint8(&b, 0);
                                /* address */
                                if (addrl > 0) {
-                                       isc_buffer_putmem(&b, addr, addrl - 1);
+                                       isc_buffer_putmem(&b, addr,
+                                                         (unsigned)addrl - 1);
                                        isc_buffer_putuint8(&b,
                                                            (addr[addrl - 1] &
                                                             mask));
@@ -635,7 +636,8 @@ sendquery(struct query *query, isc_task_t *task)
                                isc_buffer_putuint8(&b, 0);
                                /* address */
                                if (addrl > 0) {
-                                       isc_buffer_putmem(&b, addr, addrl - 1);
+                                       isc_buffer_putmem(&b, addr,
+                                                         (unsigned)addrl - 1);
                                        isc_buffer_putuint8(&b,
                                                            (addr[addrl - 1] &
                                                             mask));
index 8e40cd0c4dfbb09ce1092d35c9fa33a5e3331d72..03b35a671286d04ce4bfd8578a50c2aa80a2a273 100644 (file)
@@ -225,7 +225,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
 
        isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
                      ISC_LOG_ERROR,
-                     "dynamic database support is not implemented")
+                     "dynamic database support is not implemented");
 
        return (ISC_R_NOTIMPLEMENTED);
 }
@@ -233,18 +233,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
 static void
 unload_library(dyndb_implementation_t **impp)
 {
-       dyndb_implementation_t *imp;
-
-       REQUIRE(impp != NULL && *impp != NULL);
-
-       imp = *impp;
-
-       if (imp->handle != NULL)
-               dlclose(imp->handle);
-
-       isc_mem_putanddetach(&imp->mctx, imp, sizeof(dyndb_implementation_t));
-
-       *impp = NULL;
+       UNUSED(impp);
 }
 #endif /* HAVE_DLFCN_H */
 
index 7b8019793aab954c10a8f75c465ff53f73f075e8..bd6a92ecf923def5df536cb02c461c4fe07c80d9 100644 (file)
@@ -331,7 +331,7 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) {
                isc_buffer_add(&buf, 1);
 
                if ((ctx->style.flags & DNS_STYLEFLAG_INDENT) != 0) {
-                       size_t ilen = strlen(dns_master_indentstr);
+                       unsigned int ilen = strlen(dns_master_indentstr);
                        isc_buffer_availableregion(&buf, &r);
                        if (r.length < ilen)
                                return (DNS_R_TEXTTOOLONG);
index cccae1fcef7108265845b46d1e28c049974fb0af..11197c1c6172be01c59b295c58855f6982d366dc 100644 (file)
@@ -186,6 +186,10 @@ SOURCE=..\include\dns\ds.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\include\dns\dyndb.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\include\dns\ecdb.h
 # End Source File
 # Begin Source File
@@ -556,6 +560,10 @@ SOURCE=..\ds.c
 # End Source File
 # Begin Source File
 
+SOURCE=..\dyndb.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\ecdb.c
 # End Source File
 # Begin Source File
index ca8c74527e4c367a032d5cbfc942343bf660b9c2..97fd8b34f6d0b39c91e6e3c78a0ae3a5a945a777 100644 (file)
@@ -144,6 +144,7 @@ CLEAN :
        -@erase "$(INTDIR)\dst_lib.obj"
        -@erase "$(INTDIR)\dst_parse.obj"
        -@erase "$(INTDIR)\dst_result.obj"
+       -@erase "$(INTDIR)\dyndb.obj"
        -@erase "$(INTDIR)\ecdb.obj"
        -@erase "$(INTDIR)\forward.obj"
 @IF GEOIP
@@ -299,6 +300,7 @@ LINK32_OBJS= \
        "$(INTDIR)\dns64.obj" \
        "$(INTDIR)\dnssec.obj" \
        "$(INTDIR)\ds.obj" \
+       "$(INTDIR)\dyndb.obj" \
        "$(INTDIR)\ecdb.obj" \
        "$(INTDIR)\forward.obj" \
 @IF GEOIP
@@ -464,6 +466,8 @@ CLEAN :
        -@erase "$(INTDIR)\dst_parse.sbr"
        -@erase "$(INTDIR)\dst_result.obj"
        -@erase "$(INTDIR)\dst_result.sbr"
+       -@erase "$(INTDIR)\dyndb.obj"
+       -@erase "$(INTDIR)\dyndb.sbr"
        -@erase "$(INTDIR)\ecdb.obj"
        -@erase "$(INTDIR)\ecdb.sbr"
        -@erase "$(INTDIR)\forward.obj"
@@ -695,6 +699,7 @@ BSC32_SBRS= \
        "$(INTDIR)\dns64.sbr" \
        "$(INTDIR)\dnssec.sbr" \
        "$(INTDIR)\ds.sbr" \
+       "$(INTDIR)\dyndb.sbr" \
        "$(INTDIR)\ecdb.sbr" \
        "$(INTDIR)\forward.sbr" \
 @IF GEOIP
@@ -812,6 +817,7 @@ LINK32_OBJS= \
        "$(INTDIR)\dns64.obj" \
        "$(INTDIR)\dnssec.obj" \
        "$(INTDIR)\ds.obj" \
+       "$(INTDIR)\dyndb.obj" \
        "$(INTDIR)\ecdb.obj" \
        "$(INTDIR)\forward.obj" \
 @IF GEOIP
@@ -1279,6 +1285,24 @@ SOURCE=..\ds.c
        $(CPP) $(CPP_PROJ) $(SOURCE)
 
 
+!ENDIF 
+
+SOURCE=..\dyndb.c
+
+!IF  "$(CFG)" == "libdns - @PLATFORM@ Release"
+
+
+"$(INTDIR)\dyndb.obj" : $(SOURCE) "$(INTDIR)"
+       $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF  "$(CFG)" == "libdns - @PLATFORM@ Debug"
+
+
+"$(INTDIR)\dyndb.obj"  "$(INTDIR)\dyndb.sbr" : $(SOURCE) "$(INTDIR)"
+       $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
 !ENDIF 
 
 SOURCE=..\ecdb.c
index 1cdf90e2bda1cdfcc9f7c064adb23da77971abc5..5cd1987a34e92a189d3d3a9ceb885b3a6fe16b9f 100644 (file)
@@ -87,6 +87,9 @@
     <ClCompile Include="..\ds.c">
       <Filter>Library Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\dyndb.c">
+      <Filter>Library Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="..\ecdb.c">
       <Filter>Library Source Files</Filter>
     </ClCompile>
     <ClInclude Include="..\include\dns\dsdigest.h">
       <Filter>Library Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\include\dns\dyndb.h">
+      <Filter>Library Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="..\include\dns\ecdb.h">
       <Filter>Library Header Files</Filter>
     </ClInclude>
index 48257e29068d8751001ed80e1ce8baeb020e32a6..f532bea6dc38b2d2ec42831f8060f7ac6bfb58bc 100644 (file)
     <ClCompile Include="..\dst_lib.c" />
     <ClCompile Include="..\dst_parse.c" />
     <ClCompile Include="..\dst_result.c" />
+    <ClCompile Include="..\dyndb.c" />
     <ClCompile Include="..\ecdb.c" />
     <ClCompile Include="..\forward.c" />
 @IF GEOIP
     <ClInclude Include="..\include\dns\dnssec.h" />
     <ClInclude Include="..\include\dns\ds.h" />
     <ClInclude Include="..\include\dns\dsdigest.h" />
+    <ClInclude Include="..\include\dns\dyndb.h" />
     <ClInclude Include="..\include\dns\ecdb.h" />
     <ClInclude Include="..\include\dns\enumclass.h" />
     <ClInclude Include="..\include\dns\enumtype.h" />
index b68e108151c6bbdab93042d5b48cbd096928e2f4..a53677ece597a06ee16df671879eeb8e88e856e7 100644 (file)
@@ -81,7 +81,7 @@
  ***/
 ISC_LANG_BEGINDECLS
 
-LIBDNS_EXTERNAL_DATA extern isc_hash_t *isc_hashctx;
+LIBISC_EXTERNAL_DATA extern isc_hash_t *isc_hashctx;
 
 isc_result_t
 isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit,
index 010a7ef4d62a48bc30dc615ad3774ce3b58662c5..d982c5db27565178003f03fffb8ea963d7ff8736 100644 (file)
@@ -262,7 +262,6 @@ isc_hash_ctxdetach
 isc_hash_ctxinit
 isc_hash_destroy
 isc_hash_init
-isc_hashctx
 isc_heap_create
 isc_heap_decreased
 isc_heap_delete
@@ -779,5 +778,6 @@ isc_commandline_index               DATA
 isc_commandline_option         DATA
 isc_commandline_progname       DATA
 isc_commandline_reset          DATA
+isc_hashctx                    DATA
 isc_mem_debugging              DATA
 @END NOLONGER
index fe3bac3b5ffef1a49f89994c12f11b8ec323a7cb..fe1ad63a923a42a61d53eb9134707b4c0c5ba895 100644 (file)
@@ -409,7 +409,7 @@ sock_dump(isc_socket_t *sock) {
 #endif
 
        printf("\n\t\tSock Dump\n");
-       printf("\t\tfd: %u\n", sock->fd);
+       printf("\t\tfd: %Iu\n", sock->fd);
        printf("\t\treferences: %d\n", sock->references);
        printf("\t\tpending_accept: %d\n", sock->pending_accept);
        printf("\t\tconnecting: %d\n", sock->pending_connect);
@@ -1114,7 +1114,7 @@ static void
 dump_msg(struct msghdr *msg, isc_socket_t *sock) {
        unsigned int i;
 
-       printf("MSGHDR %p, Socket #: %u\n", msg, sock->fd);
+       printf("MSGHDR %p, Socket #: %Iu\n", msg, sock->fd);
        printf("\tname %p, namelen %d\n", msg->msg_name, msg->msg_namelen);
        printf("\tiov %p, iovlen %d\n", msg->msg_iov, msg->msg_iovlen);
        for (i = 0; i < (unsigned int)msg->msg_iovlen; i++)
index 69d619257fa6abbabd8499c82bc8d999898beb32..d236ed0caef19b182c1fbd4a8040cc99de8808e4 100644 (file)
@@ -2170,7 +2170,7 @@ parse_sizeval_percent(cfg_parser_t *pctx, const cfg_type_t *type,
        isc_result_t  result;
        cfg_obj_t *obj = NULL;
        isc_uint64_t val;
-       isc_uint32_t percent;
+       isc_uint64_t percent;
 
        UNUSED(type);
 
@@ -2184,7 +2184,7 @@ parse_sizeval_percent(cfg_parser_t *pctx, const cfg_type_t *type,
 
        if (*endp == '%' && *(endp+1) == 0) {
                CHECK(cfg_create_obj(pctx, &cfg_type_percentage, &obj));
-               obj->value.uint32 = percent;
+               obj->value.uint32 = (isc_uint32_t)percent;
                *ret = obj;
                return (ISC_R_SUCCESS);
        } else {
index f486acbf595dabf7c5526c95133df6030849858e..b9621ef43a4ffd794078a58096c6998538d940c2 100644 (file)
@@ -661,7 +661,7 @@ cfg_parse_percentage(cfg_parser_t *pctx, const cfg_type_t *type,
        char *endp;
        isc_result_t result;
        cfg_obj_t *obj = NULL;
-       isc_uint32_t percent;
+       isc_uint64_t percent;
 
        UNUSED(type);
 
@@ -680,7 +680,7 @@ cfg_parse_percentage(cfg_parser_t *pctx, const cfg_type_t *type,
        }
 
        CHECK(cfg_create_obj(pctx, &cfg_type_percentage, &obj));
-       obj->value.uint32 = percent;
+       obj->value.uint32 = (isc_uint32_t)percent;
        *ret = obj;
 
  cleanup: