diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-02-14 13:40:30 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-02-14 13:40:30 (GMT) |
commit | d5fdc069faeb7efc57584abe96010aba82cc83c8 (patch) | |
tree | 5f6d6c2802cf1efbac6f75fff05d0cb89cf066a9 /Include | |
parent | f0f6bd633217f04c5e64354b5640da98ed28540a (diff) | |
download | cpython-d5fdc069faeb7efc57584abe96010aba82cc83c8.zip cpython-d5fdc069faeb7efc57584abe96010aba82cc83c8.tar.gz cpython-d5fdc069faeb7efc57584abe96010aba82cc83c8.tar.bz2 |
Silence more 'comparison between signed and unsigned' warnings.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pymem.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Include/pymem.h b/Include/pymem.h index 966c0f5..10b5bea 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -90,10 +90,10 @@ PyAPI_FUNC(void) PyMem_Free(void *); */ #define PyMem_New(type, n) \ - ( ((n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ ( (type *) PyMem_Malloc((n) * sizeof(type)) ) ) #define PyMem_NEW(type, n) \ - ( ((n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) ) /* @@ -103,10 +103,10 @@ PyAPI_FUNC(void) PyMem_Free(void *); * caller's memory error handler to not lose track of it. */ #define PyMem_Resize(p, type, n) \ - ( (p) = ((n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ (type *) PyMem_Realloc((p), (n) * sizeof(type)) ) #define PyMem_RESIZE(p, type, n) \ - ( (p) = ((n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ (type *) PyMem_REALLOC((p), (n) * sizeof(type)) ) /* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used |