mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aabdfeaca3
commit
abd783434a
4 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Tue Oct 7 21:40:17 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Tue Oct 7 11:17:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/etc/etc.c (etc_systmpdir): try user temporary directory by
|
* ext/etc/etc.c (etc_systmpdir): try user temporary directory by
|
||||||
|
|
|
@ -49,6 +49,14 @@ olemethod_free(struct olemethoddata *polemethod)
|
||||||
free(polemethod);
|
free(polemethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct olemethoddata *
|
||||||
|
olemethod_data_get_struct(VALUE obj)
|
||||||
|
{
|
||||||
|
struct olemethoddata *pmethod;
|
||||||
|
Data_Get_Struct(obj, struct olemethoddata, pmethod);
|
||||||
|
return pmethod;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name)
|
ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,5 +11,6 @@ VALUE cWIN32OLE_METHOD;
|
||||||
VALUE folemethod_s_allocate(VALUE klass);
|
VALUE folemethod_s_allocate(VALUE klass);
|
||||||
VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
|
VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
|
||||||
VALUE create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name);
|
VALUE create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name);
|
||||||
|
struct olemethoddata *olemethod_data_get_struct(VALUE obj);
|
||||||
void Init_win32ole_method(void);
|
void Init_win32ole_method(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -124,8 +124,7 @@ oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_inde
|
||||||
|
|
||||||
static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n)
|
static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n)
|
||||||
{
|
{
|
||||||
struct olemethoddata *pmethod;
|
struct olemethoddata *pmethod = olemethod_data_get_struct(olemethod);
|
||||||
Data_Get_Struct(olemethod, struct olemethoddata, pmethod);
|
|
||||||
return oleparam_ole_param_from_index(self, pmethod->pTypeInfo, pmethod->index, n);
|
return oleparam_ole_param_from_index(self, pmethod->pTypeInfo, pmethod->index, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue