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

Bugfix for PR#1196

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ttate 2003-10-22 14:29:20 +00:00
parent f136a3225e
commit 79c3e2d004

View file

@ -340,18 +340,14 @@ rb_dlptr_to_array(int argc, VALUE argv[], VALUE self)
case 'D': case 'D':
n = data->size / sizeof(double); n = data->size / sizeof(double);
break; break;
case 'S': case 'P': case 'P': case 'p':
n = data->size / sizeof(void*); n = data->size / sizeof(void*);
break; break;
case 'S': case 's':
for (n=0; ((void**)(data->ptr))[n]; n++) {};
break;
default: default:
if (t == 'p' || t == 's') {
int i;
for (i=0; ((void**)(data->ptr))[i]; i++) {};
n = i;
}
else{
n = 0; n = 0;
}
} }
break; break;
default: default:
@ -376,6 +372,7 @@ rb_dlptr_to_array(int argc, VALUE argv[], VALUE self)
break; break;
case 'D': case 'D':
rb_ary_push(ary, rb_float_new(((double*)(data->ptr))[i])); rb_ary_push(ary, rb_float_new(((double*)(data->ptr))[i]));
break;
case 'F': case 'F':
rb_ary_push(ary, rb_float_new(((float*)(data->ptr))[i])); rb_ary_push(ary, rb_float_new(((float*)(data->ptr))[i]));
break; break;