Many bug fixes to Ruby module
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@855 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
843485d7fa
commit
48bc25b91e
5 changed files with 214 additions and 103 deletions
|
|
@ -88,13 +88,13 @@ static VALUE ptrvalue(VALUE _PTRVALUE, int index, char *type) {
|
|||
}
|
||||
/* Now we have a datatype. Try to figure out what to do about it */
|
||||
if (strcmp(type,"int") == 0) {
|
||||
obj = LONG2NUM((long) *(((int *) ptr) + index));
|
||||
obj = INT2NUM((long) *(((int *) ptr) + index));
|
||||
} else if (strcmp(type,"double") == 0) {
|
||||
obj = rb_float_new((double) *(((double *) ptr)+index));
|
||||
} else if (strcmp(type,"short") == 0) {
|
||||
obj = LONG2NUM((long) *(((short *) ptr)+index));
|
||||
obj = INT2NUM((long) *(((short *) ptr)+index));
|
||||
} else if (strcmp(type,"long") == 0) {
|
||||
obj = LONG2NUM((long) *(((long *) ptr)+index));
|
||||
obj = INT2NUM((long) *(((long *) ptr)+index));
|
||||
} else if (strcmp(type,"float") == 0) {
|
||||
obj = rb_float_new((double) *(((float *) ptr)+index));
|
||||
} else if (strcmp(type,"char") == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue