mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
Silence more 'comparison between signed and unsigned' warnings.
This commit is contained in:
parent
f0f6bd6332
commit
d5fdc069fa
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue