6729881: Compiler warning in networking native code
authorchegar
Mon, 28 Jul 2008 13:02:11 +0100
changeset 910 1f53246fb014
parent 909 c7bb1699d1b0
child 911 9edd1b9607e2
6729881: Compiler warning in networking native code Summary: Cleanup compiler warnings Reviewed-by: alanb, jccollet, michaelm
jdk/src/solaris/native/java/net/Inet4AddressImpl.c
jdk/src/solaris/native/java/net/Inet6AddressImpl.c
jdk/src/solaris/native/java/net/NetworkInterface.c
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
jdk/src/solaris/native/java/net/PlainSocketImpl.c
jdk/src/solaris/native/java/net/SocketInputStream.c
jdk/src/solaris/native/java/net/SocketOutputStream.c
jdk/src/solaris/native/java/net/linux_close.c
jdk/src/solaris/native/java/net/net_util_md.c
jdk/src/windows/native/java/net/Inet4AddressImpl.c
jdk/src/windows/native/java/net/Inet6AddressImpl.c
jdk/src/windows/native/java/net/NetworkInterface.c
jdk/src/windows/native/java/net/NetworkInterface.h
jdk/src/windows/native/java/net/NetworkInterface_win9x.c
jdk/src/windows/native/java/net/NetworkInterface_winXP.c
jdk/src/windows/native/java/net/SocketOutputStream.c
jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c
jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c
jdk/src/windows/native/java/net/net_util_md.c
jdk/src/windows/native/java/net/net_util_md.h
jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c
jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c
--- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -201,7 +201,6 @@
     }
     if (hp != NULL) {
         struct in_addr **addrp = (struct in_addr **) hp->h_addr_list;
-        int len = sizeof(struct in_addr);
         int i = 0;
 
         while (*addrp != (struct in_addr *) 0) {
--- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -143,7 +143,6 @@
     const char *hostname;
     jobjectArray ret = 0;
     int retLen = 0;
-    jclass byteArrayCls;
     jboolean preferIPv6Address;
 
     int error=0;
@@ -219,7 +218,7 @@
         } else {
             int i = 0;
             int inetCount = 0, inet6Count = 0, inetIndex, inet6Index;
-            struct addrinfo *itr, *last, *iterator = res;
+            struct addrinfo *itr, *last = NULL, *iterator = res;
             while (iterator != NULL) {
                 int skip = 0;
                 itr = resNew;
@@ -393,10 +392,7 @@
 
 #ifdef AF_INET6
     char host[NI_MAXHOST+1];
-    jfieldID fid;
     int error = 0;
-    jint family;
-    struct sockaddr *him ;
     int len = 0;
     jbyte caddr[16];
 
@@ -459,11 +455,10 @@
 ping6(JNIEnv *env, jint fd, struct sockaddr_in6* him, jint timeout,
       struct sockaddr_in6* netif, jint ttl) {
     jint size;
-    jint n, len, hlen1, icmplen;
+    jint n, len;
     char sendbuf[1500];
     unsigned char recvbuf[1500];
     struct icmp6_hdr *icmp6;
-    struct ip6_hdr *ip6;
     struct sockaddr_in6 sa_recv;
     jbyte *caddr, *recv_caddr;
     jchar pid;
@@ -561,7 +556,6 @@
                                            jbyteArray ifArray,
                                            jint ttl, jint if_scope) {
 #ifdef AF_INET6
-    jint addr;
     jbyte caddr[16];
     jint fd, sz;
     struct sockaddr_in6 him6;
--- a/jdk/src/solaris/native/java/net/NetworkInterface.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/NetworkInterface.c	Mon Jul 28 13:02:11 2008 +0100
@@ -398,7 +398,6 @@
     jobjectArray addrArr;
     jobjectArray bindArr;
     jobjectArray childArr;
-    netaddr *addrs;
     jint addr_index, addr_count, bind_index;
     jint child_count, child_index;
     netaddr *addrP;
@@ -815,8 +814,6 @@
                       addr6p[0], addr6p[1], addr6p[2], addr6p[3],
                       addr6p[4], addr6p[5], addr6p[6], addr6p[7],
                   &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
-            struct netif *ifs_ptr = NULL;
-            struct netif *last_ptr = NULL;
             struct sockaddr_in6 addr;
 
             sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
@@ -852,7 +849,6 @@
  */
 void freeif(netif *ifs) {
     netif *currif = ifs;
-    netif *child = NULL;
 
     while (currif != NULL) {
         netaddr *addrP = currif->addr;
@@ -1158,10 +1154,9 @@
  */
 static struct sockaddr *getBroadcast(JNIEnv *env, const char *ifname) {
   int sock;
-  unsigned int mask;
   struct sockaddr *ret = NULL;
   struct ifreq if2;
-  short flag;
+  short flag = 0;
 
   sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
   if (sock < 0) {
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -89,7 +89,6 @@
 static jobject createInteger(JNIEnv *env, int i) {
     static jclass i_class;
     static jmethodID i_ctrID;
-    static jfieldID i_valueID;
 
     if (i_class == NULL) {
         jclass c = (*env)->FindClass(env, "java/lang/Integer");
@@ -109,7 +108,6 @@
 static jobject createBoolean(JNIEnv *env, int b) {
     static jclass b_class;
     static jmethodID b_ctrID;
-    static jfieldID b_valueID;
 
     if (b_class == NULL) {
         jclass c = (*env)->FindClass(env, "java/lang/Boolean");
@@ -148,8 +146,6 @@
 #ifdef __linux__
     struct utsname sysinfo;
 #endif
-    char *s;
-
     pdsi_fdID = (*env)->GetFieldID(env, cls, "fd",
                                    "Ljava/io/FileDescriptor;");
     CHECK_NULL(pdsi_fdID);
@@ -373,7 +369,7 @@
         if (JVM_GetSockName(fd, (struct sockaddr *)&addr, &len) == -1) {
             return;
         }
-        localPort = NET_GetPortFromSockaddr(&addr);
+        localPort = NET_GetPortFromSockaddr((struct sockaddr *)&addr);
         if (localPort == 0) {
             localPort = (*env)->GetIntField(env, this, pdsi_localPortID);
 #ifdef AF_INET6
@@ -416,7 +412,6 @@
     /* The fdObj'fd */
     jint fd;
 
-    ssize_t n = -1;
     SOCKADDR rmtaddr, *rmtaddrP=&rmtaddr;
     int len;
 
@@ -633,9 +628,7 @@
     jint packetBufferOffset, packetBufferLen;
 
     int fd;
-    jbyteArray data;
 
-    int datalen;
     int n;
     SOCKADDR remote_addr;
     int len;
@@ -812,9 +805,7 @@
     jint packetBufferOffset, packetBufferLen;
 
     int fd;
-    jbyteArray data;
 
-    int datalen;
     int n;
     SOCKADDR remote_addr;
     int len;
@@ -1059,7 +1050,6 @@
     jobject fdObj = (*env)->GetObjectField(env, this, pdsi_fdID);
     int fd;
 
-    int arg = -1;
     int t = 1;
 
     if (IS_NULL(fdObj)) {
--- a/jdk/src/solaris/native/java/net/PlainSocketImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/PlainSocketImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -136,8 +136,6 @@
  */
 JNIEXPORT void JNICALL
 Java_java_net_PlainSocketImpl_initProto(JNIEnv *env, jclass cls) {
-    char *s;
-
     psi_fdID = (*env)->GetFieldID(env, cls , "fd",
                                   "Ljava/io/FileDescriptor;");
     CHECK_NULL(psi_fdID);
@@ -183,7 +181,6 @@
                                            jboolean stream) {
     jobject fdObj, ssObj;
     int fd;
-    int arg = -1;
 
     if (socketExceptionCls == NULL) {
         jclass c = (*env)->FindClass(env, "java/net/SocketException");
@@ -290,7 +287,6 @@
             while (1) {
 #ifndef USE_SELECT
                 {
-fprintf(stdout,"\nNATIVE: fd = %d] ", fd);
                     struct pollfd pfd;
                     pfd.fd = fd;
                     pfd.events = POLLOUT;
@@ -673,8 +669,6 @@
     /* accepted fd */
     jint newfd;
 
-    jthrowable error;
-
     SOCKADDR him;
     int len;
 
@@ -1087,7 +1081,6 @@
 JNIEXPORT void JNICALL
 Java_java_net_PlainSocketImpl_socketSendUrgentData(JNIEnv *env, jobject this,
                                              jint data) {
-    char *buf;
     /* The fd field */
     jobject fdObj = (*env)->GetObjectField(env, this, psi_fdID);
     int n, fd;
--- a/jdk/src/solaris/native/java/net/SocketInputStream.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/SocketInputStream.c	Mon Jul 28 13:02:11 2008 +0100
@@ -65,7 +65,6 @@
     char BUF[MAX_BUFFER_LEN];
     char *bufP;
     jint fd, nread;
-    jint n;
 
     if (IS_NULL(fdObj)) {
         /* should't this be a NullPointerException? -br */
--- a/jdk/src/solaris/native/java/net/SocketOutputStream.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/SocketOutputStream.c	Mon Jul 28 13:02:11 2008 +0100
@@ -67,7 +67,6 @@
     char BUF[MAX_BUFFER_LEN];
     int buflen;
     int fd;
-    jint n = 0;
 
     if (IS_NULL(fdObj)) {
         JNU_ThrowByName(env, "java/net/SocketException", "Socket closed");
--- a/jdk/src/solaris/native/java/net/linux_close.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/linux_close.c	Mon Jul 28 13:02:11 2008 +0100
@@ -281,7 +281,7 @@
 
 int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
        struct sockaddr *from, int *fromlen) {
-    BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) );
+    BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, (socklen_t)fromlen) );
 }
 
 int NET_Send(int s, void *msg, int len, unsigned int flags) {
@@ -298,7 +298,7 @@
 }
 
 int NET_Accept(int s, struct sockaddr *addr, int *addrlen) {
-    BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) );
+    BLOCKING_IO_RETURN_INT( s, accept(s, addr, (socklen_t)addrlen) );
 }
 
 int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
@@ -323,7 +323,7 @@
  * signal other than our wakeup signal.
  */
 int NET_Timeout(int s, long timeout) {
-    long prevtime,newtime;
+    long prevtime = 0, newtime;
     struct timeval t;
     fdEntry_t *fdEntry = getFdEntry(s);
 
--- a/jdk/src/solaris/native/java/net/net_util_md.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/solaris/native/java/net/net_util_md.c	Mon Jul 28 13:02:11 2008 +0100
@@ -229,7 +229,7 @@
     int fd;
     void *ipv6_fn;
     SOCKADDR sa;
-    int sa_len = sizeof(sa);
+    socklen_t sa_len = sizeof(sa);
 
     fd = JVM_Socket(AF_INET6, SOCK_STREAM, 0) ;
     if (fd < 0) {
@@ -447,7 +447,6 @@
     char dest_str[40];
     struct in6_addr dest_addr;
     char device[16];
-    jboolean match = JNI_FALSE;
 
     if (loRoutes != 0) {
         free (loRoutes);
@@ -525,7 +524,7 @@
     {
         /* now find the scope_id for "lo" */
 
-        char addr6[40], devname[20];
+        char devname[20];
         char addr6p[8][5];
         int plen, scope, dad_status, if_idx;
 
@@ -1019,7 +1018,7 @@
      * index.
      */
     if (match) {
-        char addr6[40], devname[20];
+        char devname[20];
         char addr6p[8][5];
         int plen, scope, dad_status, if_idx;
 
@@ -1086,7 +1085,7 @@
     }
 #endif
 
-    rv = getsockopt(fd, level, opt, result, len);
+    rv = getsockopt(fd, level, opt, result, (socklen_t)len);
     if (rv < 0) {
         return rv;
     }
--- a/jdk/src/windows/native/java/net/Inet4AddressImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/Inet4AddressImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <malloc.h>
 #include <sys/types.h>
+#include <process.h>
 
 #include "java_net_InetAddress.h"
 #include "java_net_Inet4AddressImpl.h"
@@ -141,7 +142,6 @@
     unsigned int addr[4];
 
     jobjectArray ret = NULL;
-    jclass byteArrayCls;
 
     if (!initialized) {
       ni_iacls = (*env)->FindClass(env, "java/net/InetAddress");
@@ -315,7 +315,7 @@
     seq = ((unsigned short)rand()) >> 1;
 
     /* icmp_id is a 16 bit data type, therefore down cast the pid */
-    pid = (u_short) getpid();
+    pid = (u_short) _getpid();
     size = 60*1024;
     setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (const char *) &size, sizeof(size));
     /**
--- a/jdk/src/windows/native/java/net/Inet6AddressImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/Inet6AddressImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <malloc.h>
 #include <sys/types.h>
+#include <process.h>
 
 #include "java_net_InetAddress.h"
 #include "java_net_Inet4AddressImpl.h"
@@ -307,10 +308,7 @@
     jstring ret = NULL;
 
     char host[NI_MAXHOST+1];
-    jfieldID fid;
     int error = 0;
-    jint family;
-    struct sockaddr *him ;
     int len = 0;
     jbyte caddr[16];
 
@@ -374,7 +372,7 @@
 ping6(JNIEnv *env, jint fd, struct SOCKADDR_IN6* him, jint timeout,
       struct SOCKADDR_IN6* netif, jint ttl) {
     jint size;
-    jint n, len, hlen1, icmplen, i;
+    jint n, len, i;
     char sendbuf[1500];
     char auxbuf[1500];
     unsigned char recvbuf[1500];
@@ -392,7 +390,7 @@
     seq = ((unsigned short)rand()) >> 1;
 
     /* icmp_id is a 16 bit data type, therefore down cast the pid */
-    pid = (unsigned short) getpid();
+    pid = (unsigned short) _getpid();
 
     size = 60*1024;
     setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (const char *)&size, sizeof(size));
@@ -520,7 +518,6 @@
                                            jbyteArray ifArray,
                                            jint ttl, jint if_scope) {
 #ifdef AF_INET6
-    jint addr;
     jbyte caddr[16];
     jint fd, sz;
     struct sockaddr_in6 him6;
--- a/jdk/src/windows/native/java/net/NetworkInterface.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/NetworkInterface.c	Mon Jul 28 13:02:11 2008 +0100
@@ -75,7 +75,6 @@
 extern int enumAddresses_win9x(JNIEnv *, netif *, netaddr **);
 extern int init_win9x(void);
 #endif
-extern int enumInterfaces_win(JNIEnv *env, netif **netifPP);
 
 
 /* Windows 95/98/ME running */
@@ -209,7 +208,6 @@
     int count;
     netif *netifP;
     DWORD i;
-    wchar_t wName[128];
     int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, net=0;
 
     /*
--- a/jdk/src/windows/native/java/net/NetworkInterface.h	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/NetworkInterface.h	Mon Jul 28 13:02:11 2008 +0100
@@ -87,6 +87,8 @@
 extern jfieldID ni_ibbroadcastID;   /* InterfaceAddress.broadcast */
 extern jfieldID ni_ibmaskID;        /* InterfaceAddress.maskLength */
 
+int enumInterfaces_win(JNIEnv *env, netif **netifPP);
+
 /* We have included iphlpapi.h which includes iptypes.h which has the definition
  * for MAX_ADAPTER_DESCRIPTION_LENGTH (along with the other definitions in this
  * ifndef block). Therefore if MAX_ADAPTER_DESCRIPTION_LENGTH is defined we can
@@ -379,6 +381,9 @@
     UINT EnableProxy;
     UINT EnableDns;
 } FIXED_INFO, *PFIXED_INFO;
+
+#pragma warning(pop)
+
 #endif /*!MAX_ADAPTER_DESCRIPTION_LENGTH*/
 
 #ifndef IP_INTERFACE_NAME_INFO_DEFINED
@@ -397,7 +402,6 @@
 
 #endif
 
-#pragma warning(pop)
 
 /* from ipifcons.h */
 
--- a/jdk/src/windows/native/java/net/NetworkInterface_win9x.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/NetworkInterface_win9x.c	Mon Jul 28 13:02:11 2008 +0100
@@ -417,8 +417,8 @@
         return -1;
     }
     curr->index = ++adapterCount;
-    curr->name = strdup("lo");
-    curr->displayName = strdup("TCP Loopback interface");
+    curr->name = _strdup("lo");
+    curr->displayName = _strdup("TCP Loopback interface");
     curr->next = adapterP;
     *adapterPP = curr;
 
@@ -513,12 +513,11 @@
     HKEY enumKey, bindingKey;
     DWORD dwLen;
     ULONG ulType;
-    TCHAR driver[MAX_STR_LEN];
     char addresses[MAX_STR_LEN];
     unsigned long addr;     /* IPv4 address */
     unsigned char byte;
     netaddr *netaddrP, *curr;
-    int i, addrCount, if_count;
+    int i, addrCount;
 
     /*
      * Open the HKEY_LOCAL_MACHINE\Enum\%s\%s\%s key
@@ -1055,8 +1054,8 @@
             return -1;
         }
 
-        ifs->name = strdup(adapterP->name);
-        ifs->displayName = strdup(adapterP->displayName);
+        ifs->name = _strdup(adapterP->name);
+        ifs->displayName = _strdup(adapterP->displayName);
         ifs->dwIndex = adapterP->index;
         ifs->index = adapterP->index;
         ifs->next = netifP;
--- a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c	Mon Jul 28 13:02:11 2008 +0100
@@ -41,6 +41,7 @@
  */
 
 extern int enumAddresses_win(JNIEnv *env, netif *netifP, netaddr **netaddrPP);
+int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP);
 
 /* IP helper library routines */
 int (PASCAL FAR *GetIpAddrTable_fn)();
@@ -168,11 +169,10 @@
  */
 int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP)
 {
-    DWORD ret, numInterfaces;
-    IP_ADAPTER_ADDRESSES *ptr, *ptr1, *adapters=0;
+    DWORD ret;
+    IP_ADAPTER_ADDRESSES *ptr, *adapters=0;
     ULONG len=ipinflen, count=0;
     netif *nif=0, *dup_nif, *last=0, *loopif=0;
-    netaddr *addr, *addr1;
     int tun=0, net=0;
 
     *netifPP = 0;
@@ -330,7 +330,7 @@
 
 static int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP) {
     LPSOCKADDR                   sock;
-    int                          ret, count = 0;
+    int                          count = 0;
     netaddr                     *curr, *start=0, *prev=0;
     PIP_ADAPTER_UNICAST_ADDRESS uni_addr;
     PIP_ADAPTER_ANYCAST_ADDRESS any_addr;
@@ -364,7 +364,7 @@
             sock = uni_addr->Address.lpSockaddr;
             SOCKETADDRESS_COPY (&curr->addr, sock);
             if (prefix != NULL) {
-              curr->mask = prefix->PrefixLength;
+              curr->mask = (short)prefix->PrefixLength;
               if (sock->sa_family == AF_INET) {
                 sock = prefix->Address.lpSockaddr;
                 SOCKETADDRESS_COPY(&curr->brdcast, sock);
--- a/jdk/src/windows/native/java/net/SocketOutputStream.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/SocketOutputStream.c	Mon Jul 28 13:02:11 2008 +0100
@@ -64,7 +64,6 @@
     char BUF[MAX_BUFFER_LEN];
     int buflen;
     int fd;
-    jint n;
 
     if (IS_NULL(fdObj)) {
         JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
--- a/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -651,7 +651,6 @@
     SOCKETADDRESS rmtaddr;
     SOCKETADDRESS *addrp = &rmtaddr;
     int addrlen;
-    int x; /* DELETE ME */
 
 
     if (IS_NULL(packet)) {
@@ -883,7 +882,7 @@
                  */
                 if (timeout) {
                     jlong newTime = JVM_CurrentTimeMillis(env, 0);
-                    timeout -= (newTime - prevTime);
+                    timeout -= (jint)(newTime - prevTime);
                     if (timeout <= 0) {
                         JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
                                 "Receive timed out");
@@ -929,9 +928,8 @@
 
     int fd, fd1, fduse, nsockets=0, errorCode;
     int port;
-    jbyteArray data;
 
-    int checkBoth = 0, datalen;
+    int checkBoth = 0;
     int n;
     SOCKETADDRESS remote_addr;
     jint remote_addrsize=sizeof(remote_addr);
@@ -1101,7 +1099,7 @@
                  */
                 if (timeout) {
                     jlong newTime = JVM_CurrentTimeMillis(env, 0);
-                    timeout -= (newTime - prevTime);
+                    timeout -= (jint)(newTime - prevTime);
                     if (timeout <= 0) {
                         JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
                                 "Receive timed out");
@@ -1203,9 +1201,7 @@
      * must be called prior to receive() so that fduse can be set.
      */
     int fd, fd1, fduse, errorCode;
-    jbyteArray data;
 
-    int datalen;
     int n, nsockets=0;
     SOCKETADDRESS remote_addr;
     jint remote_addrsize=sizeof(remote_addr);
@@ -1376,7 +1372,7 @@
                 if (timeout) {
                     int ret;
                     jlong newTime = JVM_CurrentTimeMillis(env, 0);
-                    timeout -= (newTime - prevTime);
+                    timeout -= (jint)(newTime - prevTime);
                     prevTime = newTime;
 
                     if (timeout <= 0) {
--- a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -966,7 +966,8 @@
 
                 if (on) {
                     optval.ling.l_onoff = 1;
-                    optval.ling.l_linger = (*env)->GetIntField(env, value, fid);
+                    optval.ling.l_linger =
+                        (unsigned short)(*env)->GetIntField(env, value, fid);
                 } else {
                     optval.ling.l_onoff = 0;
                     optval.ling.l_linger = 0;
--- a/jdk/src/windows/native/java/net/net_util_md.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/net_util_md.c	Mon Jul 28 13:02:11 2008 +0100
@@ -985,7 +985,7 @@
         read_rv = select(fd+1, &rd, &wr, &ex, &t);
 
         newTime = JVM_CurrentTimeMillis(env, 0);
-        timeout -= (newTime - prevTime);
+        timeout -= (jint)(newTime - prevTime);
         if (timeout <= 0) {
           return read_rv > 0 ? 0 : -1;
         }
--- a/jdk/src/windows/native/java/net/net_util_md.h	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/java/net/net_util_md.h	Mon Jul 28 13:02:11 2008 +0100
@@ -294,6 +294,15 @@
 
 JNIEXPORT int JNICALL NET_Timeout(int fd, long timeout);
 
+int NET_Socket(int domain, int type, int protocol);
+
+void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
+         const char *defaultDetail);
+
+void NET_ThrowSocketException(JNIEnv *env, char* msg);
+
+jboolean NET_addrtransAvailable();
+
 /*
  * differs from NET_Timeout() as follows:
  *
--- a/jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/sun/net/dns/ResolverConfigurationImpl.c	Mon Jul 28 13:02:11 2008 +0100
@@ -159,7 +159,6 @@
     DWORD dwLen;
     ULONG ulType;
     char result[MAX_STR_LEN];
-    int index;
     int sts = STS_NO_CONFIG;
 
     ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
@@ -275,7 +274,7 @@
      * the DHCP packet - see RFC 2132).
      */
     if (ret == ERROR_SUCCESS) {
-        int pos = 0;
+        unsigned int pos = 0;
 
         while (pos < dwLen) {
             int code, len;
--- a/jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c	Sun Jul 27 19:16:15 2008 +0800
+++ b/jdk/src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c	Mon Jul 28 13:02:11 2008 +0100
@@ -40,7 +40,6 @@
 
 #define SECURITY_WIN32
 #include "sspi.h"
-#include "issperr.h"
 
 
 /*