summaryrefslogtreecommitdiff
path: root/ext/Win32API/Win32API.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-02 14:42:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-02 14:42:08 +0000
commit2156870525be05f0bd769af141c3f6cff9fff8c4 (patch)
tree3e6db7f9ecee480edff058e18bc7211a53296f64 /ext/Win32API/Win32API.c
parent8581164ea67a13fad5e7d56aa4aa75a87f9eafb3 (diff)
* ruby.h (struct RArray): embed small arrays.
(RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/Win32API/Win32API.c')
-rw-r--r--ext/Win32API/Win32API.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
index 221a46df1b..9a2de01f2d 100644
--- a/ext/Win32API/Win32API.c
+++ b/ext/Win32API/Win32API.c
@@ -72,8 +72,8 @@ Win32API_initialize(self, dllname, proc, import, export)
case T_NIL:
break;
case T_ARRAY:
- ptr = RARRAY(import)->ptr;
- for (i = 0, len = RARRAY(import)->len; i < len; i++) {
+ ptr = RARRAY_PTR(import);
+ for (i = 0, len = RARRAY_LEN(import); i < len; i++) {
SafeStringValue(ptr[i]);
switch (*(char *)RSTRING_PTR(ptr[i])) {
case 'N': case 'n': case 'L': case 'l':
@@ -107,8 +107,8 @@ Win32API_initialize(self, dllname, proc, import, export)
break;
}
- if (16 < RARRAY(a_import)->len) {
- rb_raise(rb_eRuntimeError, "too many parameters: %d\n", RARRAY(a_import)->len);
+ if (16 < RARRAY_LEN(a_import)) {
+ rb_raise(rb_eRuntimeError, "too many parameters: %d\n", RARRAY_LEN(a_import));
}
rb_iv_set(self, "__import__", a_import);
@@ -159,7 +159,7 @@ Win32API_Call(argc, argv, obj)
VALUE obj_export = rb_iv_get(obj, "__export__");
FARPROC ApiFunction = (FARPROC)NUM2ULONG(obj_proc);
int items = rb_scan_args(argc, argv, "0*", &args);
- int nimport = RARRAY(obj_import)->len;
+ int nimport = RARRAY_LEN(obj_import);
if (items != nimport)