Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 def pack_str(self, box):
     return struct.pack(self.format_code, byteswap(self.unbox(box)))
Beispiel #6
0
 def pack_str(self, box):
     return struct.pack(self.format_code, byteswap(self.unbox(box)))