summaryrefslogtreecommitdiff
path: root/ext/dl/ptr.c
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-09 04:08:22 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-09 04:08:22 +0000
commitf51bd1d018f16c0da82f05973879e2080d9cc783 (patch)
tree01c0a0622d79e0c4d86cc4dbbaab748015ceea14 /ext/dl/ptr.c
parentf9e069336095b3dbcb6826177d3437f410c9a310 (diff)
Fix the conversion method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/ptr.c')
-rw-r--r--ext/dl/ptr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c
index ac50f80124..d90054c9c0 100644
--- a/ext/dl/ptr.c
+++ b/ext/dl/ptr.c
@@ -660,6 +660,7 @@ cary2ary(void *ptr, char t, int len)
ptr = (char *)ptr + sizeof(long);
break;
case 'P':
+ case 'S':
elem = rb_dlptr_new(*((void**)ptr),0, 0);
ptr = (char *)ptr + sizeof(void*);
break;
@@ -697,6 +698,7 @@ cary2ary(void *ptr, char t, int len)
ptr = (char *)ptr + sizeof(long);
break;
case 'P':
+ case 'S':
elem = rb_dlptr_new(*((void**)ptr), 0, 0);
ptr = (char *)ptr + sizeof(void*);
break;
@@ -764,6 +766,7 @@ rb_dlptr_aref(int argc, VALUE argv[], VALUE self)
DLALIGN(data->ptr,offset,LONG_ALIGN);
break;
case 'P':
+ case 'S':
DLALIGN(data->ptr,offset,VOIDP_ALIGN);
break;
case 'F':
@@ -790,6 +793,7 @@ rb_dlptr_aref(int argc, VALUE argv[], VALUE self)
offset += sizeof(long) * data->ssize[i];
break;
case 'P':
+ case 'S':
offset += sizeof(void*) * data->ssize[i];
break;
case 'F':
@@ -895,6 +899,7 @@ rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
DLALIGN(data->ptr,offset,LONG_ALIGN);
break;
case 'P':
+ case 'S':
DLALIGN(data->ptr,offset,VOIDP_ALIGN);
break;
case 'D':
@@ -926,6 +931,8 @@ rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
break;
case 'P':
case 'p':
+ case 'S':
+ case 's':
offset += sizeof(void*) * data->ssize[i];
break;
case 'D':
@@ -961,6 +968,7 @@ rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
memsize = sizeof(long) * data->ssize[i];
break;
case 'P': case 'p':
+ case 'S': case 's':
memsize = sizeof(void*) * data->ssize[i];
break;
case 'F': case 'f':