Index: /trunk/openjdk/jdk/src/windows/hpi/src/socket_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/hpi/src/socket_md.c	(revision 30)
+++ /trunk/openjdk/jdk/src/windows/hpi/src/socket_md.c	(revision 31)
@@ -60,5 +60,7 @@
 #define FN_SOCKETAVAILABLE 24
 
-static int (PASCAL FAR *sockfnptrs[])() =
+typedef int (PASCAL FAR *PSOCKFN)();
+
+static PSOCKFN sockfnptrs[] =
     {NULL, NULL, NULL, NULL, NULL,
      NULL, NULL, NULL, NULL, NULL,
@@ -117,5 +119,6 @@
 static void
 initSockFnTable() {
-    int (PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA);
+    typedef int (PASCAL FAR* WSAStartupPtr_t)(WORD, LPWSADATA);
+    WSAStartupPtr_t WSAStartupPtr;
     WSADATA wsadata;
     OSVERSIONINFO info;
@@ -141,6 +144,5 @@
 
         /* If we loaded a DLL, then we might as well initialize it.  */
-        WSAStartupPtr = (int (PASCAL FAR *)(WORD, LPWSADATA))
-                            GetProcAddress(hWinsock, "WSAStartup");
+        WSAStartupPtr = (WSAStartupPtr_t)GetProcAddress(hWinsock, "WSAStartup");
         if (WSAStartupPtr(MAKEWORD(1,1), &wsadata) != 0) {
             VM_CALL(jio_fprintf)(stderr, "Could not initialize Winsock\n");
@@ -148,58 +150,58 @@
 
         sockfnptrs[FN_RECV]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "recv");
+            = (PSOCKFN)GetProcAddress(hWinsock, "recv");
         sockfnptrs[FN_SEND]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "send");
+            = (PSOCKFN)GetProcAddress(hWinsock, "send");
         sockfnptrs[FN_LISTEN]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "listen");
+            = (PSOCKFN)GetProcAddress(hWinsock, "listen");
         sockfnptrs[FN_BIND]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "bind");
+            = (PSOCKFN)GetProcAddress(hWinsock, "bind");
         sockfnptrs[FN_ACCEPT]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "accept");
+            = (PSOCKFN)GetProcAddress(hWinsock, "accept");
         sockfnptrs[FN_RECVFROM]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "recvfrom");
+            = (PSOCKFN)GetProcAddress(hWinsock, "recvfrom");
         sockfnptrs[FN_SENDTO]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "sendto");
+            = (PSOCKFN)GetProcAddress(hWinsock, "sendto");
         sockfnptrs[FN_SELECT]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "select");
+            = (PSOCKFN)GetProcAddress(hWinsock, "select");
         sockfnptrs[FN_CONNECT]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "connect");
+            = (PSOCKFN)GetProcAddress(hWinsock, "connect");
         sockfnptrs[FN_CLOSESOCKET]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "closesocket");
+            = (PSOCKFN)GetProcAddress(hWinsock, "closesocket");
         /* we don't use this */
         sockfnptrs[FN_SHUTDOWN]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "shutdown");
+            = (PSOCKFN)GetProcAddress(hWinsock, "shutdown");
         sockfnptrs[FN_GETHOSTNAME]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "gethostname");
+            = (PSOCKFN)GetProcAddress(hWinsock, "gethostname");
         sockfnptrs[FN_GETHOSTBYADDR]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "gethostbyaddr");
+            = (PSOCKFN)GetProcAddress(hWinsock, "gethostbyaddr");
         sockfnptrs[FN_GETHOSTBYNAME]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "gethostbyname");
+            = (PSOCKFN)GetProcAddress(hWinsock, "gethostbyname");
         sockfnptrs[FN_HTONS]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "htons");
+            = (PSOCKFN)GetProcAddress(hWinsock, "htons");
         sockfnptrs[FN_HTONL]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "htonl");
+            = (PSOCKFN)GetProcAddress(hWinsock, "htonl");
         sockfnptrs[FN_NTOHS]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "ntohs");
+            = (PSOCKFN)GetProcAddress(hWinsock, "ntohs");
         sockfnptrs[FN_NTOHL]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "ntohl");
+            = (PSOCKFN)GetProcAddress(hWinsock, "ntohl");
         sockfnptrs[FN_GETSOCKOPT]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "getsockopt");
+            = (PSOCKFN)GetProcAddress(hWinsock, "getsockopt");
         sockfnptrs[FN_SETSOCKOPT]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "setsockopt");
+            = (PSOCKFN)GetProcAddress(hWinsock, "setsockopt");
         sockfnptrs[FN_GETPROTOBYNAME]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "getprotobyname");
+            = (PSOCKFN)GetProcAddress(hWinsock, "getprotobyname");
         sockfnptrs[FN_GETSOCKNAME]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "getsockname");
+            = (PSOCKFN)GetProcAddress(hWinsock, "getsockname");
 
         sockfnptrs[FN_SOCKET]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "socket");
+            = (PSOCKFN)GetProcAddress(hWinsock, "socket");
         /* in winsock 1, this will simply be 0 */
         sockfnptrs[FN_WSASENDDISCONNECT]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock,
-                                                   "WSASendDisconnect");
+            = (PSOCKFN)GetProcAddress(hWinsock,
+                                      "WSASendDisconnect");
         sockfnptrs[FN_SOCKETAVAILABLE]
-            = (int (PASCAL FAR *)())GetProcAddress(hWinsock,
-                                                   "ioctlsocket");
+            = (PSOCKFN)GetProcAddress(hWinsock,
+                                      "ioctlsocket");
     }
 
@@ -245,5 +247,5 @@
 int
 sysListen(int fd, int count) {
-    int (PASCAL FAR *listenfn)();
+    PSOCKFN listenfn;
     if ((listenfn = sockfnptrs[FN_LISTEN]) == NULL) {
         initSockFnTable();
@@ -256,5 +258,5 @@
 int
 sysConnect(int fd, struct sockaddr *name, int namelen) {
-    int (PASCAL FAR *connectfn)();
+    PSOCKFN connectfn;
     if ((connectfn = sockfnptrs[FN_CONNECT]) == NULL) {
         initSockFnTable();
@@ -268,5 +270,5 @@
 int
 sysBind(int fd, struct sockaddr *name, int namelen) {
-    int (PASCAL FAR *bindfn)();
+    PSOCKFN bindfn;
     if ((bindfn = sockfnptrs[FN_BIND]) == NULL) {
         initSockFnTable();
@@ -280,5 +282,5 @@
 int
 sysAccept(int fd, struct sockaddr *name, int *namelen) {
-    int (PASCAL FAR *acceptfn)();
+    PSOCKFN acceptfn;
     if ((acceptfn = sockfnptrs[FN_ACCEPT]) == NULL) {
         initSockFnTable();
@@ -292,5 +294,5 @@
 sysRecvFrom(int fd, char *buf, int nBytes,
                   int flags, struct sockaddr *from, int *fromlen) {
-    int (PASCAL FAR *recvfromfn)();
+    PSOCKFN recvfromfn;
     if ((recvfromfn = sockfnptrs[FN_RECVFROM]) == NULL) {
         initSockFnTable();
@@ -304,5 +306,5 @@
 sysSendTo(int fd, char *buf, int len,
                 int flags, struct sockaddr *to, int tolen) {
-    int (PASCAL FAR *sendtofn)();
+    PSOCKFN sendtofn;
     if ((sendtofn = sockfnptrs[FN_SENDTO]) == NULL) {
         initSockFnTable();
@@ -315,5 +317,5 @@
 int
 sysRecv(int fd, char *buf, int nBytes, int flags) {
-    int (PASCAL FAR *recvfn)();
+    PSOCKFN recvfn;
     if ((recvfn = sockfnptrs[FN_RECV]) == NULL) {
         initSockFnTable();
@@ -326,5 +328,5 @@
 int
 sysSend(int fd, char *buf, int nBytes, int flags) {
-    int (PASCAL FAR *sendfn)();
+    PSOCKFN sendfn;
     if ((sendfn = sockfnptrs[FN_SEND]) == NULL) {
         initSockFnTable();
@@ -338,5 +340,5 @@
 int
 sysGetHostName(char *hostname, int namelen) {
-    int (PASCAL FAR *fn)();
+    PSOCKFN fn;
     if ((fn = sockfnptrs[FN_GETHOSTNAME]) == NULL) {
         initSockFnTable();
@@ -349,8 +351,9 @@
 struct hostent *
 sysGetHostByAddr(const char *hostname, int len, int type) {
-    struct hostent * (PASCAL FAR *fn)();
-    if ((fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYADDR]) == NULL) {
-        initSockFnTable();
-        fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYADDR];
+    typedef struct hostent * (PASCAL FAR *fn_t)();
+    fn_t fn;
+    if ((fn = (fn_t) sockfnptrs[FN_GETHOSTBYADDR]) == NULL) {
+        initSockFnTable();
+        fn = (fn_t) sockfnptrs[FN_GETHOSTBYADDR];
     }
     sysAssert(sockfnptrs_initialized == TRUE && fn != NULL);
@@ -360,8 +363,9 @@
 struct hostent *
 sysGetHostByName(char *hostname) {
-    struct hostent * (PASCAL FAR *fn)();
-    if ((fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYNAME]) == NULL) {
-        initSockFnTable();
-        fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYNAME];
+    typedef struct hostent * (PASCAL FAR *fn_t)();
+    fn_t fn;
+    if ((fn = (fn_t) sockfnptrs[FN_GETHOSTBYNAME]) == NULL) {
+        initSockFnTable();
+        fn = (fn_t) sockfnptrs[FN_GETHOSTBYNAME];
     }
     sysAssert(sockfnptrs_initialized == TRUE && fn != NULL);
@@ -372,5 +376,5 @@
 sysSocket(int domain, int type, int protocol) {
     int sock;
-    int (PASCAL FAR *socketfn)();
+    PSOCKFN socketfn;
     if ((socketfn = sockfnptrs[FN_SOCKET]) == NULL) {
         initSockFnTable();
@@ -387,5 +391,5 @@
 int sysSocketShutdown(int fd, int how)  {
     if (fd > 0) {
-        int (PASCAL FAR *shutdownfn)();
+        PSOCKFN shutdownfn;
         if ((shutdownfn = sockfnptrs[FN_SHUTDOWN]) == NULL) {
             initSockFnTable();
@@ -407,6 +411,6 @@
 
     if (fd > 0) {
-        int (PASCAL FAR *closesocketfn)();
-        int (PASCAL FAR *wsasenddisconnectfn)();
+        PSOCKFN closesocketfn;
+        PSOCKFN wsasenddisconnectfn;
         int dynamic_ref = -1;
 
@@ -445,5 +449,5 @@
     fd_set tbl;
     struct timeval t;
-    int (PASCAL FAR *selectfn)();
+    PSOCKFN selectfn;
 
     t.tv_sec = timeout / 1000;
@@ -464,5 +468,5 @@
 sysSocketAvailable(int fd, jint *pbytes)
 {
-    int (PASCAL FAR *socketfn)();
+    PSOCKFN socketfn;
     if ((socketfn = sockfnptrs[FN_SOCKETAVAILABLE]) == NULL) {
         initSockFnTable();
@@ -475,5 +479,5 @@
 int
 sysGetSockName(int fd, struct sockaddr *name, int *namelen) {
-    int (PASCAL FAR *getsocknamefn)();
+    PSOCKFN getsocknamefn;
     if ((getsocknamefn = sockfnptrs[FN_GETSOCKNAME]) == NULL) {
         initSockFnTable();
@@ -487,5 +491,5 @@
 int
 sysGetSockOpt(int fd, int level, int optname, char *optval, int *optlen ) {
-    int (PASCAL FAR *getsockoptfn)();
+    PSOCKFN getsockoptfn;
     if ((getsockoptfn = sockfnptrs[FN_GETSOCKOPT]) == NULL) {
         initSockFnTable();
@@ -507,5 +511,5 @@
 int
 sysSetSockOpt(int fd, int level, int optname, const char *optval, int optlen ) {
-    int (PASCAL FAR *setsockoptfn)();
+    PSOCKFN setsockoptfn;
     if ((setsockoptfn = sockfnptrs[FN_SETSOCKOPT]) == NULL) {
         initSockFnTable();
@@ -528,8 +532,9 @@
 struct protoent *
 sysGetProtoByName(char *name) {
-    struct protoent * (PASCAL FAR *getprotobynamefn)();
-    if ((getprotobynamefn = (struct protoent * (PASCAL FAR *)()) sockfnptrs[FN_GETPROTOBYNAME]) == NULL) {
-        initSockFnTable();
-        getprotobynamefn = (struct protoent * (PASCAL FAR *)()) sockfnptrs[FN_GETPROTOBYNAME];
+    typedef struct protoent * (PASCAL FAR *getprotobynamefn_t)();
+    getprotobynamefn_t getprotobynamefn;
+    if ((getprotobynamefn = (getprotobynamefn_t) sockfnptrs[FN_GETPROTOBYNAME]) == NULL) {
+        initSockFnTable();
+        getprotobynamefn = (getprotobynamefn_t) sockfnptrs[FN_GETPROTOBYNAME];
     }
     sysAssert(sockfnptrs_initialized == TRUE);
