1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2000-08-30 02:36:07 +00:00
parent 68bc47726b
commit 3c89a278e3
2 changed files with 38 additions and 25 deletions

View file

@ -1,3 +1,8 @@
Wed Aug 30 11:31:47 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* ext/Win32API/Win32API.c (Win32API_initialize): add the
arguments checking.
Tue Aug 29 16:29:15 2000 Yukihiro Matsumoto <matz@ruby-lang.org> Tue Aug 29 16:29:15 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (assignable): remove NODE_CVASGN3. * parse.y (assignable): remove NODE_CVASGN3.

View file

@ -70,36 +70,44 @@ Win32API_initialize(self, dllname, proc, import, export)
rb_iv_set(self, "__proc__", UINT2NUM((unsigned long)hproc)); rb_iv_set(self, "__proc__", UINT2NUM((unsigned long)hproc));
a_import = rb_ary_new(); a_import = rb_ary_new();
ptr = RARRAY(import)->ptr; if (!NIL_P(import)) {
for (i = 0, len = RARRAY(import)->len; i < len; i++) { Check_Type(import, T_ARRAY);
int c = *(char *)RSTRING(ptr[i])->ptr; ptr = RARRAY(import)->ptr;
switch (c) { for (i = 0, len = RARRAY(import)->len; i < len; i++) {
case 'N': case 'n': case 'L': case 'l': Check_Type(ptr[i], T_STRING);
rb_ary_push(a_import, INT2FIX(_T_NUMBER)); switch (*(char *)RSTRING(ptr[i])->ptr) {
break; case 'N': case 'n': case 'L': case 'l':
case 'P': case 'p': rb_ary_push(a_import, INT2FIX(_T_NUMBER));
rb_ary_push(a_import, INT2FIX(_T_POINTER)); break;
break; case 'P': case 'p':
case 'I': case 'i': rb_ary_push(a_import, INT2FIX(_T_POINTER));
rb_ary_push(a_import, INT2FIX(_T_INTEGER)); break;
break; case 'I': case 'i':
rb_ary_push(a_import, INT2FIX(_T_INTEGER));
break;
}
} }
} }
rb_iv_set(self, "__import__", a_import); rb_iv_set(self, "__import__", a_import);
switch (*RSTRING(export)->ptr) { if (NIL_P(export)) {
case 'V': case 'v':
ex = _T_VOID; ex = _T_VOID;
break; } else {
case 'N': case 'n': case 'L': case 'l': Check_Type(export, T_STRING);
ex = _T_NUMBER; switch (*RSTRING(export)->ptr) {
break; case 'V': case 'v':
case 'P': case 'p': ex = _T_VOID;
ex = _T_POINTER; break;
break; case 'N': case 'n': case 'L': case 'l':
case 'I': case 'i': ex = _T_NUMBER;
ex = _T_INTEGER; break;
break; case 'P': case 'p':
ex = _T_POINTER;
break;
case 'I': case 'i':
ex = _T_INTEGER;
break;
}
} }
rb_iv_set(self, "__export__", INT2FIX(ex)); rb_iv_set(self, "__export__", INT2FIX(ex));