diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-25 22:46:15 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-25 22:46:15 +0000 |
commit | 5d2ce2fb40fecc7ad8431886d2bc3ab2aa0a69ec (patch) | |
tree | 5dd041e781038b14ace319df575d081bdd797dfb /ext/win32ole/win32ole.c | |
parent | 1fe90db5380117580ae41be4f3d01686aaa73697 (diff) | |
download | ruby-5d2ce2fb40fecc7ad8431886d2bc3ab2aa0a69ec.tar.gz |
ext/win32ole/win32ole.c (ole_val2variant, ole_invoke): refactoring.
use ole_variant2variant to convert WIN32OLE_VARIANT object to
VARIANT object.
ext/win32ole/win32ole_variant.c: refactoring. add
ole_variant2variant.
ext/win32ole/win32ole_variant.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole.c')
-rw-r--r-- | ext/win32ole/win32ole.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index d239d9caf8..bb59752ff7 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -1217,7 +1217,6 @@ void ole_val2variant(VALUE val, VARIANT *var) { struct oledata *pole; - struct olevariantdata *pvar; if(rb_obj_is_kind_of(val, cWIN32OLE)) { Data_Get_Struct(val, struct oledata, pole); OLE_ADDREF(pole->pDispatch); @@ -1226,8 +1225,7 @@ ole_val2variant(VALUE val, VARIANT *var) return; } if (rb_obj_is_kind_of(val, cWIN32OLE_VARIANT)) { - Data_Get_Struct(val, struct olevariantdata, pvar); - VariantCopy(var, &(pvar->var)); + ole_variant2variant(val, var); return; } if (rb_obj_is_kind_of(val, cWIN32OLE_RECORD)) { @@ -2538,7 +2536,6 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) unsigned int cNamedArgs; int n; struct oleparam op; - struct olevariantdata *pvar; memset(&excepinfo, 0, sizeof(EXCEPINFO)); VariantInit(&result); @@ -2633,8 +2630,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) VariantInit(&op.dp.rgvarg[n]); param = rb_ary_entry(paramS, i-cNamedArgs); if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) { - Data_Get_Struct(param, struct olevariantdata, pvar); - VariantCopy(&op.dp.rgvarg[n], &(pvar->var)); + ole_variant2variant(param, &op.dp.rgvarg[n]); } else { ole_val2variant(param, &realargs[n]); V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF; |