From 546c5651a61992befd3f2cddc9e86fa1ae6ffbe8ec864f6dfb535f513cd875dc Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 30 Jun 2017 12:06:28 +0000 Subject: [PATCH] Accepting request 507126 from home:tbechtold:branches:devel:languages:python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update to 1.10.0: * Issue #295: use calloc() directly instead of PyObject_Malloc()+memset() to handle ffi.new() with a default allocator. Speeds up ffi.new(large-array) where most of the time you never touch most of the array. * Some OS/X build fixes (“only with Xcode but without CLT”). * Improve a couple of error messages: when getting mismatched versions of cffi and its backend; and when calling functions which cannot be called with libffi because an argument is a struct that is “too complicated” (and not a struct pointer, which always works). * Add support for some unusual compilers (non-msvc, non-gcc, non-icc, non-clang) * Implemented the remaining cases for ffi.from_buffer. Now all buffer/memoryview objects can be passed. The one remaining check is against passing unicode strings in Python 2. (They support the buffer interface, but that gives the raw bytes behind the UTF16/UCS4 storage, which is most of the times not what you expect. In Python 3 this has been fixed and the unicode strings don’t support the memoryview interface any more.) * The C type _Bool or bool now converts to a Python boolean when reading, instead of the content of the byte as an integer. The potential incompatibility here is what occurs if the byte contains a value different from 0 and 1. Previously, it would just return it; with this change, CFFI raises an exception in this case. But this case means “undefined behavior” in C; if you really have to interface with a library relying on this, don’t use bool in the CFFI side. Also, it is still valid to use a byte string as initializer for a bool[], but now it must only contain \x00 or \x01. As an aside, ffi.string() no longer works on bool[] (but it never made much sense, as this function stops at the first zero). * ffi.buffer is now the name of cffi’s buffer type, and ffi.buffer() works like before but is the constructor of that type. * ffi.addressof(lib, "name") now works also in in-line mode, not only in out-of-line mode. This is useful for taking the address of global variables. OBS-URL: https://build.opensuse.org/request/show/507126 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=35 --- cffi-1.10.0.tar.gz | 3 +++ cffi-1.9.1.tar.gz | 3 --- python-cffi.changes | 45 +++++++++++++++++++++++++++++++++++++++++++++ python-cffi.spec | 2 +- 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 cffi-1.10.0.tar.gz delete mode 100644 cffi-1.9.1.tar.gz diff --git a/cffi-1.10.0.tar.gz b/cffi-1.10.0.tar.gz new file mode 100644 index 0000000..ca7dcac --- /dev/null +++ b/cffi-1.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3b02911eb1f6ada203b0763ba924234629b51586f72a21faacc638269f4ced5 +size 418131 diff --git a/cffi-1.9.1.tar.gz b/cffi-1.9.1.tar.gz deleted file mode 100644 index e7e8114..0000000 --- a/cffi-1.9.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:563e0bd53fda03c151573217b3a49b3abad8813de9dd0632e10090f6190fdaf8 -size 407108 diff --git a/python-cffi.changes b/python-cffi.changes index 80aaf14..c2de400 100644 --- a/python-cffi.changes +++ b/python-cffi.changes @@ -1,3 +1,48 @@ +------------------------------------------------------------------- +Thu Jun 29 16:03:46 UTC 2017 - tbechtold@suse.com + +- update to 1.10.0: + * Issue #295: use calloc() directly instead of PyObject_Malloc()+memset() + to handle ffi.new() with a default allocator. Speeds up ffi.new(large-array) + where most of the time you never touch most of the array. + * Some OS/X build fixes (“only with Xcode but without CLT”). + * Improve a couple of error messages: when getting mismatched versions of + cffi and its backend; and when calling functions which cannot be called with + libffi because an argument is a struct that is “too complicated” (and not + a struct pointer, which always works). + * Add support for some unusual compilers (non-msvc, non-gcc, non-icc, non-clang) + * Implemented the remaining cases for ffi.from_buffer. Now all + buffer/memoryview objects can be passed. The one remaining check is against + passing unicode strings in Python 2. (They support the buffer interface, but + that gives the raw bytes behind the UTF16/UCS4 storage, which is most of the + times not what you expect. In Python 3 this has been fixed and the unicode + strings don’t support the memoryview interface any more.) + * The C type _Bool or bool now converts to a Python boolean when reading, + instead of the content of the byte as an integer. The potential + incompatibility here is what occurs if the byte contains a value different + from 0 and 1. Previously, it would just return it; with this change, CFFI + raises an exception in this case. But this case means “undefined behavior” + in C; if you really have to interface with a library relying on this, + don’t use bool in the CFFI side. Also, it is still valid to use a byte + string as initializer for a bool[], but now it must only contain \x00 or + \x01. As an aside, ffi.string() no longer works on bool[] (but it never made + much sense, as this function stops at the first zero). + * ffi.buffer is now the name of cffi’s buffer type, and ffi.buffer() works + like before but is the constructor of that type. + * ffi.addressof(lib, "name") now works also in in-line mode, not only in + out-of-line mode. This is useful for taking the address of global variables. + * Issue #255: cdata objects of a primitive type (integers, floats, char) are + now compared and ordered by value. For example, compares + equal to 42 and compares equal to b'A'. Unlike C, + does not compare equal to ffi.cast("unsigned int", -1): it + compares smaller, because -1 < 4294967295. + * PyPy: ffi.new() and ffi.new_allocator()() did not record “memory pressure”, + causing the GC to run too infrequently if you call ffi.new() very often + and/or with large arrays. Fixed in PyPy 5.7. + * Support in ffi.cdef() for numeric expressions with + or -. Assumes that + there is no overflow; it should be fixed first before we add more general + support for arbitrary arithmetic on constants. + ------------------------------------------------------------------- Mon Mar 27 11:50:31 UTC 2017 - jmatejek@suse.com diff --git a/python-cffi.spec b/python-cffi.spec index 53a7c90..06b2f7f 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define modname cffi Name: python-%{modname} -Version: 1.9.1 +Version: 1.10.0 Release: 0 Summary: Foreign Function Interface for Python calling C code License: MIT