diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-07-21 09:42:15 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-07-21 09:42:15 (GMT) |
commit | c925b1538a8b6efb752579b416c29a7738218b11 (patch) | |
tree | 6582f3108870174199eb83b17d7d03247ea6917b /Modules/socketmodule.c | |
parent | 20f51a7b3845fc8534d4f89cbf847dded027565f (diff) | |
download | cpython-c925b1538a8b6efb752579b416c29a7738218b11.zip cpython-c925b1538a8b6efb752579b416c29a7738218b11.tar.gz cpython-c925b1538a8b6efb752579b416c29a7738218b11.tar.bz2 |
Silence warnings in MSVC++: hide unused variables, add constness back to
inet_pton/ntop, convert htons argument to u_short.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 1841024..e4bdf41 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -207,8 +207,8 @@ Socket methods: #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 @@ init_socket(void) /* 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 @@ inet_pton (int af, char *src, void *dst) 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; |