targets/typemapping.py
changeset 1847 6198190bc121
parent 1835 7533061a6d82
child 1881 091005ec69c4
equal deleted inserted replaced
1846:14b40afccd69 1847:6198190bc121
    98     res = []
    98     res = []
    99     buffoffset = 0
    99     buffoffset = 0
   100     buffsize = len(buff)
   100     buffsize = len(buff)
   101     buffptr = cast(ctypes.pythonapi.PyString_AsString(id(buff)), c_void_p).value
   101     buffptr = cast(ctypes.pythonapi.PyString_AsString(id(buff)), c_void_p).value
   102     for iectype in indexes:
   102     for iectype in indexes:
   103         c_type, unpack_func, pack_func = \
   103         c_type, unpack_func, _pack_func = \
   104             TypeTranslator.get(iectype, (None, None, None))
   104             TypeTranslator.get(iectype, (None, None, None))
   105         if c_type is not None and buffoffset < buffsize:
   105         if c_type is not None and buffoffset < buffsize:
   106             cursor = c_void_p(buffptr + buffoffset)
   106             cursor = c_void_p(buffptr + buffoffset)
   107             value = unpack_func(cast(cursor,
   107             value = unpack_func(cast(cursor,
   108                                      POINTER(c_type)).contents)
   108                                      POINTER(c_type)).contents)