[前][次][番号順一覧][スレッド一覧]

ruby-changes:39692

From: nobu <ko1@a...>
Date: Sun, 6 Sep 2015 08:14:46 +0900 (JST)
Subject: [ruby-changes:39692] nobu:r51773 (trunk): win32.c: suppress a warning

nobu	2015-09-06 08:14:25 +0900 (Sun, 06 Sep 2015)

  New Revision: 51773

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51773

  Log:
    win32.c: suppress a warning
    
    * win32/win32.c (get_attr_vsn): assume GetLastError() never return
      0, to suppress a maybe-uninitialized warning in wrename().

  Modified files:
    trunk/win32/win32.c
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 51772)
+++ win32/win32.c	(revision 51773)
@@ -4981,9 +4981,12 @@ get_attr_vsn(const WCHAR *path, DWORD *a https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4981
     DWORD e = 0;
     HANDLE h = open_special(path, 0, FILE_FLAG_OPEN_REPARSE_POINT);
 
-    if (h == INVALID_HANDLE_VALUE) return GetLastError();
+    if (h == INVALID_HANDLE_VALUE) {
+	ASSUME(e = GetLastError());
+	return e;
+    }
     if (!GetFileInformationByHandle(h, &st)) {
-	e = GetLastError();
+	ASSUME(e = GetLastError());
     }
     else {
 	*atts = st.dwFileAttributes;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]