summaryrefslogtreecommitdiff
path: root/ext/win32ole/win32ole_event.c
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-16 10:34:24 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-16 10:34:24 +0000
commitbd6e27dc47a0d4ef1bbd72639dbf3765a282cfaf (patch)
treeea658ac72ef69616af64fbdf5f640a8beb2115db /ext/win32ole/win32ole_event.c
parent2fd7e2925588d691c9966806071466934dabcd66 (diff)
* ext/win32ole/win32ole_event.c (evs_length): use RARRAY_LEN instead
of calling Array#length method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole_event.c')
-rw-r--r--ext/win32ole/win32ole_event.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/win32ole/win32ole_event.c b/ext/win32ole/win32ole_event.c
index 79602ee..77b3626 100644
--- a/ext/win32ole/win32ole_event.c
+++ b/ext/win32ole/win32ole_event.c
@@ -51,7 +51,7 @@ typedef struct tagIEVENTSINKOBJ {
IEventSinkVtbl *lpVtbl;
DWORD m_cRef;
IID m_iid;
- int m_event_id;
+ long m_event_id;
ITypeInfo *pTypeInfo;
}IEVENTSINKOBJ, *PIEVENTSINKOBJ;
@@ -102,7 +102,7 @@ static VALUE fev_get_handler(VALUE self);
static VALUE evs_push(VALUE ev);
static VALUE evs_delete(long i);
static VALUE evs_entry(long i);
-static VALUE evs_length(void);
+static long evs_length(void);
STDMETHODIMP EVENTSINK_Invoke(
PEVENTSINK pEventSink,
@@ -942,8 +942,7 @@ ev_advise(int argc, VALUE *argv, VALUE self)
}
Data_Get_Struct(self, struct oleeventdata, poleev);
- pIEV->m_event_id
- = NUM2INT(evs_length());
+ pIEV->m_event_id = evs_length();
pIEV->pTypeInfo = pTypeInfo;
poleev->dwCookie = dwCookie;
poleev->pConnectionPoint = pConnectionPoint;
@@ -1171,10 +1170,10 @@ evs_entry(long i)
return rb_ary_entry(ary_ole_event, i);
}
-static VALUE
+static long
evs_length(void)
{
- return rb_funcall(ary_ole_event, rb_intern("length"), 0);
+ return RARRAY_LEN(ary_ole_event);
}
/*