Author: Armin Rigo <[email protected]>
Branch:
Changeset: r498:e054ffd34e50
Date: 2012-06-23 16:31 +0200
http://bitbucket.org/cffi/cffi/changeset/e054ffd34e50/
Log: Support bitfields here too.
diff --git a/c/_ffi_backend.c b/c/_ffi_backend.c
--- a/c/_ffi_backend.c
+++ b/c/_ffi_backend.c
@@ -872,10 +872,8 @@
PyErr_SetObject(PyExc_KeyError, d_key);
return -1;
}
- if (bitfield_not_supported(cf) < 0)
- return -1;
- if (convert_from_object(data + cf->cf_offset,
- cf->cf_type, d_value) < 0)
+ if (convert_field_from_object(data + cf->cf_offset,
+ cf, d_value) < 0)
return -1;
}
return 0;
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -843,6 +843,8 @@
complete_struct_or_union(BStruct, [('a1', BInt, 1)])
p = newp(new_pointer_type(BStruct), [-1])
assert p.a1 == -1
+ p = newp(new_pointer_type(BStruct), {'a1': -1})
+ assert p.a1 == -1
def test_weakref():
import weakref
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit