summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-05 08:51:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-05 08:51:12 +0000
commit4bcae18e375dcfc880be52f7b89ef2d45f75b57b (patch)
tree0ff69053347c1d9dd898a0221166cc2969ac378d /win32
parent29b94d77529fe7190eabef0b393753e361724408 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c9
1 files changed, 5 insertions, 4 deletions
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);
}