Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c925b153
Commit
c925b153
authored
Jul 21, 2001
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence warnings in MSVC++: hide unused variables, add constness back to
inet_pton/ntop, convert htons argument to u_short.
parent
20f51a7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
Modules/getaddrinfo.c
Modules/getaddrinfo.c
+7
-2
Modules/getnameinfo.c
Modules/getnameinfo.c
+2
-0
Modules/socketmodule.c
Modules/socketmodule.c
+5
-5
No files found.
Modules/getaddrinfo.c
View file @
c925b153
...
...
@@ -343,7 +343,7 @@ getaddrinfo(hostname, servname, hints, res)
pai
->
ai_socktype
=
SOCK_DGRAM
;
pai
->
ai_protocol
=
IPPROTO_UDP
;
}
port
=
htons
(
atoi
(
servname
));
port
=
htons
(
(
u_short
)
atoi
(
servname
));
}
else
{
struct
servent
*
sp
;
char
*
proto
;
...
...
@@ -417,7 +417,9 @@ getaddrinfo(hostname, servname, hints, res)
for
(
i
=
0
;
gai_afdl
[
i
].
a_af
;
i
++
)
{
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
)
{
case
AF_INET
:
...
...
@@ -492,7 +494,10 @@ get_name(addr, gai_afd, res, numaddr, pai, port0)
u_short
port
=
port0
&
0xffff
;
struct
hostent
*
hp
;
struct
addrinfo
*
cur
;
int
error
=
0
,
h_error
;
int
error
=
0
;
#ifdef INET6
int
h_error
;
#endif
#ifdef INET6
hp
=
getipnodebyaddr
(
addr
,
gai_afd
->
a_addrlen
,
gai_afd
->
a_af
,
&
h_error
);
...
...
Modules/getnameinfo.c
View file @
c925b153
...
...
@@ -98,7 +98,9 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
int
family
,
len
,
i
;
char
*
addr
,
*
p
;
u_long
v4a
;
#ifdef INET6
u_char
pfx
;
#endif
int
h_error
;
char
numserv
[
512
];
char
numaddr
[
512
];
...
...
Modules/socketmodule.c
View file @
c925b153
...
...
@@ -207,8 +207,8 @@ Socket methods:
#endif
/* USE_SSL */
#ifndef HAVE_INET_PTON
int
inet_pton
(
int
af
,
char
*
src
,
void
*
dst
);
c
har
*
inet_ntop
(
int
af
,
void
*
src
,
char
*
dst
,
socklen_t
size
);
int
inet_pton
(
int
af
,
c
onst
c
har
*
src
,
void
*
dst
);
c
onst
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
,
c
onst
c
har
*
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
)
c
onst
c
har
*
inet_ntop
(
int
af
,
const
void
*
src
,
char
*
dst
,
socklen_t
size
)
{
if
(
af
==
AF_INET
)
{
struct
in_addr
packed_addr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment