예제 #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)
예제 #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)
예제 #3
0
파일: types.py 프로젝트: 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)
예제 #4
0
파일: types.py 프로젝트: 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)
예제 #5
0
 def pack_str(self, box):
     return struct.pack(self.format_code, byteswap(self.unbox(box)))
예제 #6
0
파일: types.py 프로젝트: njues/Sypy
 def pack_str(self, box):
     return struct.pack(self.format_code, byteswap(self.unbox(box)))