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

ruby-changes:41278

From: suke <ko1@a...>
Date: Sun, 27 Dec 2015 23:34:19 +0900 (JST)
Subject: [ruby-changes:41278] suke:r53350 (trunk): * ext/win32ole/win32ole.c (ole_variant2val): refactoring.

suke	2015-12-27 23:34:11 +0900 (Sun, 27 Dec 2015)

  New Revision: 53350

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

  Log:
    * ext/win32ole/win32ole.c (ole_variant2val): refactoring.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53349)
+++ ChangeLog	(revision 53350)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Dec 27 23:32:26 2015  Masaki Suketa <masaki.suketa@n...>
+
+	* ext/win32ole/win32ole.c (ole_variant2val): refactoring.
+
 Sun Dec 27 21:14:42 2015  NAKAMURA Usaku  <usa@r...>
 
 	* process.c (rb_execarg_parent_start1): need to convert the encoding to
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 53349)
+++ ext/win32ole/win32ole.c	(revision 53350)
@@ -1574,16 +1574,14 @@ ole_variant2val(VARIANT *pvar) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1574
 
     case VT_BSTR:
     {
-        if(V_ISBYREF(pvar)) {
-            obj = (SysStringLen(*V_BSTRREF(pvar)) == 0)
-                ? rb_str_new2("")
-                : ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
-        }
-        else {
-            obj = (SysStringLen(V_BSTR(pvar)) == 0)
-                ? rb_str_new2("")
-                : ole_wc2vstr(V_BSTR(pvar), FALSE);
-        }
+        BSTR bstr;
+        if(V_ISBYREF(pvar)) 
+            bstr = *V_BSTRREF(pvar);
+        else
+            bstr = V_BSTR(pvar);
+        obj = (SysStringLen(bstr) == 0)
+            ? rb_str_new2("")
+            : ole_wc2vstr(bstr, FALSE);
         break;
     }
 

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

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