Guest User

Untitled

a guest
Jun 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. - (VALUE)toRuby {
  2. switch ([self objCType]) {
  3. case @encode(char):
  4. case @encode(unsigned char): return CHR2FIX([self charValue]); break;
  5. case @encode(short):
  6. case @encode(long):
  7. case @encode(int): return INT2FIX([self intValue]); break;
  8. case @encode(unsigned short):
  9. case @encode(unsigned long):
  10. case @encode(unsigned int): return UINT2NUM([self unsignedIntValue]); break;
  11. case @encode(unsigned float):
  12. case @encode(float): return rb_float_new([self floatValue]); break;
  13. case @encode(unsigned double):
  14. case @encode(double): return rb_float_new([self doubleValue]); break;
  15. }
  16. }
Add Comment
Please, Sign In to add comment