Author: Antonio Cuni <anto.c...@gmail.com> Branch: ffistruct Changeset: r51272:260c4a371fea Date: 2012-01-12 12:28 +0100 http://bitbucket.org/pypy/pypy/changeset/260c4a371fea/
Log: migrate the unichar case to GetFieldConverter diff --git a/pypy/module/_ffi/interp_struct.py b/pypy/module/_ffi/interp_struct.py --- a/pypy/module/_ffi/interp_struct.py +++ b/pypy/module/_ffi/interp_struct.py @@ -146,8 +146,7 @@ return converter.do_and_wrap(w_ffitype) # if w_ffitype.is_unichar(): - value = libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, offset) - return space.wrap(unichr(value)) + return converter.do_and_wrap(w_ffitype) # if w_ffitype.is_double(): value = libffi.struct_getfield_float(w_ffitype.ffitype, self.rawmem, offset) @@ -222,11 +221,10 @@ get_pointer = get_unsigned def get_char(self, w_ffitype): - value = libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, self.offset) - return value + return libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, self.offset) - ## def get_unichar(self, w_ffitype): - ## ... + def get_unichar(self, w_ffitype): + return libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, self.offset) ## def get_float(self, w_ffitype): ## ... _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit