1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
suke 2014-08-16 10:34:24 +00:00
parent 2fd7e29255
commit bd6e27dc47
2 changed files with 10 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Sat Aug 16 19:32:06 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole_event.c (evs_length): use RARRAY_LEN instead
of calling Array#length method.
Sat Aug 16 10:20:17 2014 Eric Wong <e@80x24.org> Sat Aug 16 10:20:17 2014 Eric Wong <e@80x24.org>
* time.c (time_timespec): fix tv_nsec overflow * time.c (time_timespec): fix tv_nsec overflow

View file

@ -51,7 +51,7 @@ typedef struct tagIEVENTSINKOBJ {
IEventSinkVtbl *lpVtbl; IEventSinkVtbl *lpVtbl;
DWORD m_cRef; DWORD m_cRef;
IID m_iid; IID m_iid;
int m_event_id; long m_event_id;
ITypeInfo *pTypeInfo; ITypeInfo *pTypeInfo;
}IEVENTSINKOBJ, *PIEVENTSINKOBJ; }IEVENTSINKOBJ, *PIEVENTSINKOBJ;
@ -102,7 +102,7 @@ static VALUE fev_get_handler(VALUE self);
static VALUE evs_push(VALUE ev); static VALUE evs_push(VALUE ev);
static VALUE evs_delete(long i); static VALUE evs_delete(long i);
static VALUE evs_entry(long i); static VALUE evs_entry(long i);
static VALUE evs_length(void); static long evs_length(void);
STDMETHODIMP EVENTSINK_Invoke( STDMETHODIMP EVENTSINK_Invoke(
PEVENTSINK pEventSink, PEVENTSINK pEventSink,
@ -942,8 +942,7 @@ ev_advise(int argc, VALUE *argv, VALUE self)
} }
Data_Get_Struct(self, struct oleeventdata, poleev); Data_Get_Struct(self, struct oleeventdata, poleev);
pIEV->m_event_id pIEV->m_event_id = evs_length();
= NUM2INT(evs_length());
pIEV->pTypeInfo = pTypeInfo; pIEV->pTypeInfo = pTypeInfo;
poleev->dwCookie = dwCookie; poleev->dwCookie = dwCookie;
poleev->pConnectionPoint = pConnectionPoint; poleev->pConnectionPoint = pConnectionPoint;
@ -1171,10 +1170,10 @@ evs_entry(long i)
return rb_ary_entry(ary_ole_event, i); return rb_ary_entry(ary_ole_event, i);
} }
static VALUE static long
evs_length(void) evs_length(void)
{ {
return rb_funcall(ary_ole_event, rb_intern("length"), 0); return RARRAY_LEN(ary_ole_event);
} }
/* /*