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:
parent
94c5f5a77c
commit
b072900780
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user