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
This commit is contained in:
nobu 2015-08-28 11:34:53 +00:00
parent 94c5f5a77c
commit b072900780

View File

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