Index: win32/win32.c =================================================================== --- win32/win32.c (revision 22794) +++ win32/win32.c (working copy) @@ -31,6 +31,7 @@ #include #if _MSC_VER >= 1400 #include +#include #endif #ifdef __MINGW32__ #include @@ -1596,7 +1597,7 @@ return NULL; if (!(sbuf.st_mode & S_IFDIR) && (!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' || - ((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) { + ((1 << ((filename[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) { errno = ENOTDIR; return NULL; } @@ -2136,14 +2137,14 @@ static int extract_fd(rb_fdset_t *dst, fd_set *src, int (*func)(SOCKET)) { - int s = 0; + unsigned int s = 0; if (!src || !dst) return 0; while (s < src->fd_count) { SOCKET fd = src->fd_array[s]; if (!func || (*func)(fd)) { /* move it to dst */ - int d; + unsigned int d; for (d = 0; d < dst->fdset->fd_count; d++) { if (dst->fdset->fd_array[d] == fd) @@ -2170,12 +2171,12 @@ static int copy_fd(fd_set *dst, fd_set *src) { - int s; + unsigned int s; if (!src || !dst) return 0; for (s = 0; s < src->fd_count; ++s) { SOCKET fd = src->fd_array[s]; - int d; + unsigned int d; for (d = 0; d < dst->fd_count; ++d) { if (dst->fd_array[d] == fd) break; @@ -2324,7 +2325,7 @@ rb_w32_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *timeout) { - int r; + unsigned int r; rb_fdset_t pipe_rd; rb_fdset_t cons_rd; rb_fdset_t else_rd; @@ -3193,7 +3194,7 @@ if (pid == -1) { int count = 0; - DWORD ret; + int ret; HANDLE events[MAXCHILDNUM]; FOREACH_CHILD(child) { @@ -3257,7 +3258,7 @@ lt /= 10; /* to usec */ lt -= (LONG_LONG)((1970-1601)*365.2425) * 24 * 60 * 60 * 1000 * 1000; - tv->tv_sec = lt / (1000 * 1000); + tv->tv_sec = (long)(lt / (1000 * 1000)); tv->tv_usec = lt % (1000 * 1000); return tv->tv_sec > 0 ? 0 : -1; @@ -4614,8 +4615,8 @@ CloseHandle(ol.hEvent); if (!(_osfile(fd) & (FDEV | FPIPE))) { - LONG high = ol.OffsetHigh; - LONG low = ol.Offset + read; + DWORD high = ol.OffsetHigh; + DWORD low = ol.Offset + read; if (low < ol.Offset) ++high; SetFilePointer((HANDLE)_osfhnd(fd), low, &high, FILE_BEGIN); @@ -4732,8 +4733,8 @@ CloseHandle(ol.hEvent); if (!(_osfile(fd) & (FDEV | FPIPE))) { - LONG high = ol.OffsetHigh; - LONG low = ol.Offset + written; + DWORD high = ol.OffsetHigh; + DWORD low = ol.Offset + written; if (low < ol.Offset) ++high; SetFilePointer((HANDLE)_osfhnd(fd), low, &high, FILE_BEGIN);