mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macros
multiprocessing.h: remove unused MIN and MAX macros
This commit is contained in:
parent
e0b99ba140
commit
640c35ce13
9 changed files with 25 additions and 66 deletions
|
@ -95,9 +95,6 @@ Local naming conventions:
|
|||
#include "Python.h"
|
||||
#include "structmember.h"
|
||||
|
||||
#undef MAX
|
||||
#define MAX(x, y) ((x) < (y) ? (y) : (x))
|
||||
|
||||
/* Socket object documentation */
|
||||
PyDoc_STRVAR(sock_doc,
|
||||
"socket([family[, type[, proto]]]) -> socket object\n\
|
||||
|
@ -4819,7 +4816,7 @@ socket_inet_pton(PyObject *self, PyObject *args)
|
|||
char* ip;
|
||||
int retval;
|
||||
#ifdef ENABLE_IPV6
|
||||
char packed[MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
|
||||
char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
|
||||
#else
|
||||
char packed[sizeof(struct in_addr)];
|
||||
#endif
|
||||
|
@ -4870,7 +4867,7 @@ socket_inet_ntop(PyObject *self, PyObject *args)
|
|||
int len;
|
||||
const char* retval;
|
||||
#ifdef ENABLE_IPV6
|
||||
char ip[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
|
||||
char ip[Py_MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
|
||||
#else
|
||||
char ip[INET_ADDRSTRLEN + 1];
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue