Author: Antonio Cuni <anto.c...@gmail.com> Branch: ffistruct Changeset: r51271:43112b2a9723 Date: 2012-01-12 12:25 +0100 http://bitbucket.org/pypy/pypy/changeset/43112b2a9723/
Log: migrate the char 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 @@ -143,8 +143,7 @@ return converter.do_and_wrap(w_ffitype) # if w_ffitype.is_char(): - value = libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, offset) - return space.wrap(chr(value)) + return converter.do_and_wrap(w_ffitype) # if w_ffitype.is_unichar(): value = libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, offset) @@ -222,8 +221,9 @@ get_unsigned_which_fits_into_a_signed = get_signed get_pointer = get_unsigned - ## def get_char(self, w_ffitype): - ## ... + def get_char(self, w_ffitype): + value = libffi.struct_getfield_int(w_ffitype.ffitype, self.rawmem, self.offset) + return value ## def get_unichar(self, w_ffitype): ## ... _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit