def _write(self, storage, width, i, offset, value): value = byteswap(value) if we_are_translated(): libffi.array_setitem(clibffi.cast_type_to_ffitype(self.T), width, storage, i, offset, value) else: libffi.array_setitem_T(self.T, width, storage, i, offset, value)
def _read(self, storage, width, i, offset): if we_are_translated(): res = libffi.array_getitem(clibffi.cast_type_to_ffitype(self.T), width, storage, i, offset) else: res = libffi.array_getitem_T(self.T, width, storage, i, offset) return byteswap(res)
def _write(self, storage, width, i, offset, value): value = byteswap(value) if we_are_translated(): libffi.array_setitem(clibffi.cast_type_to_ffitype(self.T), width, storage, i, offset, value) else: libffi.array_setitem_T(self.T, width, storage, i, offset, value)
def _read(self, storage, width, i, offset): if we_are_translated(): res = libffi.array_getitem(clibffi.cast_type_to_ffitype(self.T), width, storage, i, offset) else: res = libffi.array_getitem_T(self.T, width, storage, i, offset) return byteswap(res)
def pack_str(self, box): return struct.pack(self.format_code, byteswap(self.unbox(box)))
def pack_str(self, box): return struct.pack(self.format_code, byteswap(self.unbox(box)))