Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 18790:7cd22bf56d7b legacy-trunk
Silence warnings in MSVC++: hide unused variables, add constness back to
inet_pton/ntop, convert htons argument to u_short.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sat, 21 Jul 2001 09:42:15 +0000 |
| parents | 01692bf02f97 |
| children | 4d0ea4c2386d |
line wrap: on
line diff
--- a/Modules/socketmodule.c Sat Jul 21 02:31:40 2001 +0000 +++ b/Modules/socketmodule.c Sat Jul 21 09:42:15 2001 +0000 @@ -207,8 +207,8 @@ #endif /* USE_SSL */ #ifndef HAVE_INET_PTON -int inet_pton (int af, char *src, void *dst); -char *inet_ntop(int af, void *src, char *dst, socklen_t size); +int inet_pton (int af, const char *src, void *dst); +const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif /* I know this is a bad practice, but it is the easiest... */ @@ -2948,7 +2948,7 @@ /* Simplistic emulation code for inet_pton that only works for IPv4 */ #ifndef HAVE_INET_PTON int -inet_pton (int af, char *src, void *dst) +inet_pton (int af, const char *src, void *dst) { if(af == AF_INET){ long packed_addr; @@ -2966,8 +2966,8 @@ return -1; } -char * -inet_ntop(int af, void *src, char *dst, socklen_t size) +const char * +inet_ntop(int af, const void *src, char *dst, socklen_t size) { if (af == AF_INET) { struct in_addr packed_addr;
