* 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
This commit is contained in:
nobu 2010-03-05 08:51:12 +00:00
Родитель 29b94d7752
Коммит 4bcae18e37
3 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -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.

2
io.c
Просмотреть файл

@ -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 *));

Просмотреть файл

@ -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);
}