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

ruby-changes:35746

From: suke <ko1@a...>
Date: Tue, 7 Oct 2014 21:45:08 +0900 (JST)
Subject: [ruby-changes:35746] suke:r47828 (trunk): ext/win32ole/win32ole_method.c: refactoring. add

suke	2014-10-07 21:44:53 +0900 (Tue, 07 Oct 2014)

  New Revision: 47828

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

  Log:
    ext/win32ole/win32ole_method.c: refactoring. add
    olemethod_data_get_struct to wrap Data_Get_Struct.
    ext/win32ole/win32ole_method.h: ditto.
    
    ext/win32ole/win32ole_param.c (oleparam_ole_param):
    call olemethod_data_get_struct instead of Data_Get_Struct.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole_method.c
    trunk/ext/win32ole/win32ole_method.h
    trunk/ext/win32ole/win32ole_param.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47827)
+++ ChangeLog	(revision 47828)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Oct  7 21:40:17 2014  Masaki Suketa <masaki.suketa@n...>
+
+	* ext/win32ole/win32ole_method.c: refactoring. add
+	  olemethod_data_get_struct to wrap Data_Get_Struct.
+	* ext/win32ole/win32ole_method.h: ditto.
+	
+	* ext/win32ole/win32ole_param.c (oleparam_ole_param):
+	  call olemethod_data_get_struct instead of Data_Get_Struct.
+
 Tue Oct  7 11:17:08 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/etc/etc.c (etc_systmpdir): try user temporary directory by
Index: ext/win32ole/win32ole_method.c
===================================================================
--- ext/win32ole/win32ole_method.c	(revision 47827)
+++ ext/win32ole/win32ole_method.c	(revision 47828)
@@ -48,6 +48,14 @@ olemethod_free(struct olemethoddata *pol https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_method.c#L48
     OLE_FREE(polemethod->pOwnerTypeInfo);
     free(polemethod);
 }
+ 
+struct olemethoddata *
+olemethod_data_get_struct(VALUE obj)
+{
+    struct olemethoddata *pmethod;
+    Data_Get_Struct(obj, struct olemethoddata, pmethod);
+    return pmethod;
+}
 
 static VALUE
 ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name)
Index: ext/win32ole/win32ole_method.h
===================================================================
--- ext/win32ole/win32ole_method.h	(revision 47827)
+++ ext/win32ole/win32ole_method.h	(revision 47828)
@@ -11,5 +11,6 @@ VALUE cWIN32OLE_METHOD; https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_method.h#L11
 VALUE folemethod_s_allocate(VALUE klass);
 VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
 VALUE create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name);
+struct olemethoddata *olemethod_data_get_struct(VALUE obj);
 void Init_win32ole_method(void);
 #endif
Index: ext/win32ole/win32ole_param.c
===================================================================
--- ext/win32ole/win32ole_param.c	(revision 47827)
+++ ext/win32ole/win32ole_param.c	(revision 47828)
@@ -124,8 +124,7 @@ oleparam_ole_param_from_index(VALUE self https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_param.c#L124
 
 static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n)
 {
-    struct olemethoddata *pmethod;
-    Data_Get_Struct(olemethod, struct olemethoddata, pmethod);
+    struct olemethoddata *pmethod = olemethod_data_get_struct(olemethod);
     return oleparam_ole_param_from_index(self, pmethod->pTypeInfo, pmethod->index, n);
 }
 

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

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