Skip to content

Commit 8102c49

Browse files
authored
Merge pull request dlang#3839 from schveiguy/trustedwinsock
Mark all functions with a @safe interface as @trusted
2 parents 20ee98a + 8b5a7a4 commit 8102c49

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/core/sys/windows/winsock2.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ enum NI_MAXSERV = 32;
4545
@nogc
4646
{
4747
int WSAStartup(ushort wVersionRequested, LPWSADATA lpWSAData);
48-
int WSACleanup();
49-
SOCKET socket(int af, int type, int protocol);
48+
@trusted int WSACleanup();
49+
@trusted SOCKET socket(int af, int type, int protocol);
5050
int ioctlsocket(SOCKET s, int cmd, uint* argp);
5151
int bind(SOCKET s, const(sockaddr)* name, socklen_t namelen);
5252
int connect(SOCKET s, const(sockaddr)* name, socklen_t namelen);
53-
int listen(SOCKET s, int backlog);
53+
@trusted int listen(SOCKET s, int backlog);
5454
SOCKET accept(SOCKET s, sockaddr* addr, socklen_t* addrlen);
55-
int closesocket(SOCKET s);
56-
int shutdown(SOCKET s, int how);
55+
@trusted int closesocket(SOCKET s);
56+
@trusted int shutdown(SOCKET s, int how);
5757
int getpeername(SOCKET s, sockaddr* name, socklen_t* namelen);
5858
int getsockname(SOCKET s, sockaddr* name, socklen_t* namelen);
5959
int send(SOCKET s, const(void)* buf, int len, int flags);
@@ -64,11 +64,11 @@ int getsockopt(SOCKET s, int level, int optname, void* optval, socklen_t* optlen
6464
int setsockopt(SOCKET s, int level, int optname, const(void)* optval, socklen_t optlen);
6565
uint inet_addr(const char* cp);
6666
int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds, const(timeval)* timeout);
67-
char* inet_ntoa(in_addr ina);
67+
@trusted char* inet_ntoa(in_addr ina);
6868
hostent* gethostbyname(const char* name);
6969
hostent* gethostbyaddr(const(void)* addr, int len, int type);
7070
protoent* getprotobyname(const char* name);
71-
protoent* getprotobynumber(int number);
71+
@trusted protoent* getprotobynumber(int number);
7272
servent* getservbyname(const char* name, const char* proto);
7373
servent* getservbyport(int port, const char* proto);
7474
}

0 commit comments

Comments
 (0)