def sizeof(tp): assert isinstance(tp, Type) if tp.size == 0 or tp.align == 0: raise unwind(LTypeError(u"cannot determine size of opaque type")) return tp.size
def cast_to_ffitype(self): for rtype in signed_types: if self.size == rffi.sizeof(rtype): return clibffi.cast_type_to_ffitype(rtype) else: raise unwind(LTypeError(u"undefined ffi type: %s" % self.repr()))
def store(self, pool, offset, value): raise unwind(LTypeError(u".store method missing"))
def load(self, offset, copy): for rtype in floating_types: if self.size == rffi.sizeof(rtype): return Float(rffi.cast(rffi.DOUBLE, rffi.cast(rffi.CArrayPtr(rtype), offset)[0])) else: raise unwind(LTypeError(u"undefined ffi type: %s" % self.repr()))
def load(self, offset, copy): raise unwind(LTypeError(u".load method missing"))
def cast_to_ffitype(self): raise unwind(LTypeError(u".cast_to_ffitype method missing"))
def load(self, offset, copy): for rtype in unsigned_types: if self.size == rffi.sizeof(rtype): return Integer(rffi.cast(rffi.LONG, rffi.cast(rffi.CArrayPtr(rtype), offset)[0])) else: raise unwind(LTypeError(u"undefined ffi type: %s" % self.repr()))