summaryrefslogtreecommitdiff
path: root/cffi/vengine_cpy.py
diff options
context:
space:
mode:
authorLisandro Dalcin <dalcinl@gmail.com>2014-04-23 18:58:42 +0300
committerLisandro Dalcin <dalcinl@gmail.com>2014-04-23 18:58:42 +0300
commita5253fc39d5fa7bc2e09c766135ee96e5efe7dce (patch)
tree48d5ffb80db5bdd3825ce26b7cb79907c17c5c53 /cffi/vengine_cpy.py
parent636886c90a17ff3235aa3614a9da441173a12ad2 (diff)
downloadcffi-a5253fc39d5fa7bc2e09c766135ee96e5efe7dce.tar.gz
CPython: Add explicit typecasts in _cffi_to_c_int()
- Silent GCC -Wsign-compare warning: signed and unsigned type in conditional expression
Diffstat (limited to 'cffi/vengine_cpy.py')
-rw-r--r--cffi/vengine_cpy.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
index 5f5dec9..5d83f25 100644
--- a/cffi/vengine_cpy.py
+++ b/cffi/vengine_cpy.py
@@ -824,14 +824,14 @@ typedef unsigned char _Bool;
PyLong_FromLongLong(x)))
#define _cffi_to_c_int(o, type) \
- (sizeof(type) == 1 ? (((type)-1) > 0 ? _cffi_to_c_u8(o) \
- : _cffi_to_c_i8(o)) : \
- sizeof(type) == 2 ? (((type)-1) > 0 ? _cffi_to_c_u16(o) \
- : _cffi_to_c_i16(o)) : \
- sizeof(type) == 4 ? (((type)-1) > 0 ? _cffi_to_c_u32(o) \
- : _cffi_to_c_i32(o)) : \
- sizeof(type) == 8 ? (((type)-1) > 0 ? _cffi_to_c_u64(o) \
- : _cffi_to_c_i64(o)) : \
+ (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)) : \
+ sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \
+ : (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), 0))
#define _cffi_to_c_i8 \