From b07290078006f5a2a828b144c1d35fbe04162e32 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 28 Aug 2015 11:34:53 +0000 Subject: [PATCH] win32.c: suppress warnings * win32/win32.c (wrename): fix type of attributes to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index 70e95d1414..b10eebf885 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -5002,7 +5002,7 @@ static int wrename(const WCHAR *oldpath, const WCHAR *newpath) { int res = 0; - int oldatts = -1, newatts = -1; + DWORD oldatts, newatts = (DWORD)-1; DWORD oldvsn = 0, newvsn = 0, e; e = get_attr_vsn(oldpath, &oldatts, &oldvsn); @@ -5024,7 +5024,7 @@ wrename(const WCHAR *oldpath, const WCHAR *newpath) get_attr_vsn(newpath, &newatts, &newvsn); RUBY_CRITICAL({ - if (newatts != -1 && newatts & FILE_ATTRIBUTE_READONLY) + if (newatts != (DWORD)-1 && newatts & FILE_ATTRIBUTE_READONLY) SetFileAttributesW(newpath, newatts & ~ FILE_ATTRIBUTE_READONLY); if (!MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED))