[Python-checkins] CVS: python/dist/src/Modules getaddrinfo.c,1.2,1.3 getnameinfo.c,1.2,1.3 socketmodule.c,1.151,1.152

Martin v. L?wis loewis@users.sourceforge.net
2001年7月21日 02:42:17 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv6767
Modified Files:
	getaddrinfo.c getnameinfo.c socketmodule.c 
Log Message:
Silence warnings in MSVC++: hide unused variables, add constness back to
inet_pton/ntop, convert htons argument to u_short.
Index: getaddrinfo.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/getaddrinfo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** getaddrinfo.c	2001年07月19日 17:37:46	1.2
--- getaddrinfo.c	2001年07月21日 09:42:15	1.3
***************
*** 344,348 ****
 				pai->ai_protocol = IPPROTO_UDP;
 			}
! 			port = htons(atoi(servname));
 		} else {
 			struct servent *sp;
--- 344,348 ----
 				pai->ai_protocol = IPPROTO_UDP;
 			}
! 			port = htons((u_short)atoi(servname));
 		} else {
 			struct servent *sp;
***************
*** 418,422 ****
--- 418,424 ----
 		if (inet_pton(gai_afdl[i].a_af, hostname, pton)) {
 			u_long v4a;
+ #ifdef INET6
 			u_char pfx;
+ #endif
 
 			switch (gai_afdl[i].a_af) {
***************
*** 493,497 ****
 	struct hostent *hp;
 	struct addrinfo *cur;
! 	int error = 0, h_error;
 	
 #ifdef INET6
--- 495,502 ----
 	struct hostent *hp;
 	struct addrinfo *cur;
! 	int error = 0;
! #ifdef INET6
! 	int h_error;
! #endif
 	
 #ifdef INET6
Index: getnameinfo.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/getnameinfo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** getnameinfo.c	2001年06月25日 06:37:02	1.2
--- getnameinfo.c	2001年07月21日 09:42:15	1.3
***************
*** 99,103 ****
--- 99,105 ----
 	char *addr, *p;
 	u_long v4a;
+ #ifdef INET6
 	u_char pfx;
+ #endif
 	int h_error;
 	char numserv[512];
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -C2 -r1.151 -r1.152
*** socketmodule.c	2001年07月19日 21:16:41	1.151
--- socketmodule.c	2001年07月21日 09:42:15	1.152
***************
*** 208,213 ****
 
 #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);
 #endif
 
--- 208,213 ----
 
 #ifndef HAVE_INET_PTON
! 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
 
***************
*** 2949,2953 ****
 #ifndef HAVE_INET_PTON
 int 
! inet_pton (int af, char *src, void *dst)
 {
 	if(af == AF_INET){
--- 2949,2953 ----
 #ifndef HAVE_INET_PTON
 int 
! inet_pton (int af, const char *src, void *dst)
 {
 	if(af == AF_INET){
***************
*** 2967,2972 ****
 }
 
! char *
! inet_ntop(int af, void *src, char *dst, socklen_t size)
 {
 	if (af == AF_INET) {
--- 2967,2972 ----
 }
 
! const char *
! inet_ntop(int af, const void *src, char *dst, socklen_t size)
 {
 	if (af == AF_INET) {

AltStyle によって変換されたページ (->オリジナル) /