Esempio n. 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)
Esempio n. 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)
Esempio n. 3
0
File: types.py Progetto: njues/Sypy
 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)
Esempio n. 4
0
File: types.py Progetto: njues/Sypy
 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)
Esempio n. 5
0
 def pack_str(self, box):
     return struct.pack(self.format_code, byteswap(self.unbox(box)))
Esempio n. 6
0
File: types.py Progetto: njues/Sypy
 def pack_str(self, box):
     return struct.pack(self.format_code, byteswap(self.unbox(box)))