diff options
author | Armin Rigo <arigo@tunes.org> | 2015-05-26 10:20:46 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2015-05-26 10:20:46 +0200 |
commit | 2c2f746727ec9d19d18a47f7b567ee24b4c11ed4 (patch) | |
tree | 6941f07ef9ecd8afbb1c10db41886617a99186c3 /cffi/vengine_cpy.py | |
parent | d7baab52f219766a6aab73b08c31080796b5350e (diff) | |
download | cffi-2c2f746727ec9d19d18a47f7b567ee24b4c11ed4.tar.gz |
Silence some warnings with gcc 5.1: if T is a type smaller than 'int',
then the C expression "condition ? (T)x : (T)y" is typed not as a T, but
as a larger 'int' --- which means there was an implicit cast from the
final 'int' to the T-typed target of the assignment whenever this macro
was used.
Diffstat (limited to 'cffi/vengine_cpy.py')
-rw-r--r-- | cffi/vengine_cpy.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py index 9d5bf67..98e4ada 100644 --- a/cffi/vengine_cpy.py +++ b/cffi/vengine_cpy.py @@ -886,7 +886,8 @@ cffimod_header = r''' PyLong_FromLongLong((long long)x))) #define _cffi_to_c_int(o, type) \ - (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ : (type)_cffi_to_c_i8(o)) : \ sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ : (type)_cffi_to_c_i16(o)) : \ @@ -894,7 +895,7 @@ cffimod_header = r''' : (type)_cffi_to_c_i32(o)) : \ sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ : (type)_cffi_to_c_i64(o)) : \ - (Py_FatalError("unsupported size for type " #type), (type)0)) + (Py_FatalError("unsupported size for type " #type), (type)0))) #define _cffi_to_c_i8 \ ((int(*)(PyObject *))_cffi_exports[1]) |