diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | win32/win32.c | 9 |
3 files changed, 14 insertions, 5 deletions
@@ -1,3 +1,11 @@ +Fri Mar 5 17:51:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (pipe_open): suppressed a warning. + + * win32/win32.c (rb_w32_map_errno, winnt_stat, rb_chsize): ditto. + + * win32/win32.c (rb_w32_aspawn): get rid of overflow. + Fri Mar 5 11:59:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * win32/win32.c (signbit): defined on mingw. @@ -5006,7 +5006,7 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode, if (argc) { int i; - if (argc >= FIXNUM_MAX / sizeof(char *)) { + if (argc >= (int)(FIXNUM_MAX / sizeof(char *))) { rb_raise(rb_eArgError, "too many arguments"); } argbuf = rb_str_tmp_new((argc+1) * sizeof(char *)); diff --git a/win32/win32.c b/win32/win32.c index 2ccb9d1511..518982678a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -181,7 +181,7 @@ rb_w32_map_errno(DWORD winerr) return 0; } - for (i = 0; i < sizeof(errmap) / sizeof(*errmap); i++) { + for (i = 0; i < (int)(sizeof(errmap) / sizeof(*errmap)); i++) { if (errmap[i].winerr == winerr) { return errmap[i].err; } @@ -1115,7 +1115,8 @@ rb_w32_spawn(int mode, const char *cmd, const char *prog) rb_pid_t rb_w32_aspawn(int mode, const char *prog, char *const *argv) { - int len, c_switch = 0; + int c_switch = 0; + size_t len; BOOL ntcmd = FALSE, tmpnt; const char *shell; char *cmd, fbuf[MAXPATHLEN]; @@ -3975,7 +3976,7 @@ winnt_stat(const char *path, struct stati64 *st) // If runtime stat(2) is called for network shares, it fails on WinNT. // Because GetDriveType returns 1 for network shares. (Win98 returns 4) DWORD attr = GetFileAttributes(path); - if (attr == -1) { + if (attr == (DWORD)-1L) { errno = map_errno(GetLastError()); return -1; } @@ -4091,7 +4092,7 @@ rb_chsize(HANDLE h, off_t size) end = ((off_t)uend << 32) | (unsigned long)lend; usize = (long)(size >> 32); lsize = (long)size; - if (SetFilePointer(h, lsize, &usize, SEEK_SET) == -1L && + if (SetFilePointer(h, lsize, &usize, SEEK_SET) == (DWORD)-1L && (e = GetLastError())) { errno = map_errno(e); } |