Michael Stefaniuc : ws2_32: Use better types for some variables.

Alexandre Julliard julliard at winehq.org
Mon Apr 20 11:33:06 CDT 2009


Module: wine
Branch: master
Commit: 0847e7d826567aa3a8502fa6c4913d1343d37cf9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0847e7d826567aa3a8502fa6c4913d1343d37cf9

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Apr 17 10:35:21 2009 +0200

ws2_32: Use better types for some variables.

---

 dlls/ws2_32/socket.c     |    2 +-
 dlls/ws2_32/tests/sock.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index cabe191..0031ad2 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2382,7 +2382,7 @@ INT WINAPI WSAIoctl(SOCKET s,
 int WINAPI WS_ioctlsocket(SOCKET s, LONG cmd, WS_u_long *argp)
 {
     int fd;
-    long newcmd  = cmd;
+    LONG newcmd  = cmd;
 
     TRACE("socket %04lx, cmd %08x, ptr %p\n", s, cmd, argp);
     /* broken apps like defcon pass the argp value directly instead of a pointer to it */
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index ffc7ba9..c46a3f1 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1996,8 +1996,8 @@ static void test_ioctlsocket(void)
 {
     SOCKET sock;
     int ret;
-    long cmds[] = {FIONBIO, FIONREAD, SIOCATMARK};
-    int i;
+    static const LONG cmds[] = {FIONBIO, FIONREAD, SIOCATMARK};
+    UINT i;
 
     sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
     ok(sock != INVALID_SOCKET, "Creating the socket failed: %d\n", WSAGetLastError());
@@ -2007,7 +2007,7 @@ static void test_ioctlsocket(void)
         return;
     }
 
-    for(i = 0; i < sizeof(cmds)/sizeof(long); i++)
+    for(i = 0; i < sizeof(cmds)/sizeof(cmds[0]); i++)
     {
         /* broken apps like defcon pass the argp value directly instead of a pointer to it */
         ret = ioctlsocket(sock, cmds[i], (u_long *)1);




More information about the wine-cvs mailing list