fiddle-sparcv9.patch

Naohisa Goto, 08/08/2011 10:37 PM

Download (2.13 KB)

View differences:

trunk/ext/fiddle/closure.c 2011-08-08 21:37:57.586535000 +0900
110 110
	*(long *)resp = NUM2LONG(ret);
111 111
	break;
112 112
      case TYPE_CHAR:
113
	*(char *)resp = NUM2INT(ret);
113
      case TYPE_SHORT:
114
      case TYPE_INT:
115
	*(ffi_sarg *)resp = NUM2INT(ret);
114 116
	break;
115 117
      case TYPE_VOIDP:
116 118
	*(void **)resp = NUM2PTR(ret);
117 119
	break;
118
      case TYPE_INT:
119
	*(int *)resp = NUM2INT(ret);
120
	break;
121 120
      case TYPE_DOUBLE:
122 121
	*(double *)resp = NUM2DBL(ret);
123 122
	break;
trunk/ext/fiddle/conversions.c 2011-08-08 22:32:01.208345000 +0900
56 56
	dst->pointer = NUM2PTR(rb_Integer(src));
57 57
	break;
58 58
      case TYPE_CHAR:
59
	dst->schar = NUM2INT(src);
60
	break;
59 61
      case TYPE_SHORT:
62
	dst->sshort = NUM2INT(src);
63
	break;
60 64
      case TYPE_INT:
61 65
	dst->sint = NUM2INT(src);
62 66
	break;
......
103 107
        return rb_funcall(cPointer, rb_intern("[]"), 1,
104 108
          PTR2NUM((void *)retval.pointer));
105 109
      case TYPE_CHAR:
110
	if (signed_p) return INT2NUM((char)retval.fffi_sarg);
111
	return INT2NUM((unsigned char)retval.fffi_arg);
106 112
      case TYPE_SHORT:
113
	if (signed_p) return INT2NUM((short)retval.fffi_sarg);
114
	return INT2NUM((unsigned short)retval.fffi_arg);
107 115
      case TYPE_INT:
108
	return INT2NUM(retval.sint);
116
	if (signed_p) return INT2NUM((int)retval.fffi_sarg);
117
	return UINT2NUM((unsigned int)retval.fffi_arg);
109 118
      case TYPE_LONG:
110 119
	if (signed_p) return LONG2NUM(retval.slong);
111 120
	return ULONG2NUM(retval.ulong);
trunk/ext/fiddle/conversions.h 2011-08-08 21:40:43.368062000 +0900
5 5

  
6 6
typedef union
7 7
{
8
    ffi_arg fffi_arg;
9
    ffi_sarg fffi_sarg;
8 10
    unsigned char uchar;   /* ffi_type_uchar */
9 11
    signed char   schar;   /* ffi_type_schar */
10 12
    unsigned short ushort; /* ffi_type_sshort */