diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-21 20:04:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-21 20:04:48 +0000 |
commit | d154673f93ad95197bce8cadb995daa5bc39f5d8 (patch) | |
tree | 191522aa88f9f845a9c27b1ddb86116b87033c4b /src/modules/netlib/netlibsock.cpp | |
parent | be50a70bfd8b3f3daf0c3351fdce6e2fea515bd7 (diff) |
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@7820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib/netlibsock.cpp')
-rw-r--r-- | src/modules/netlib/netlibsock.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index 1bb6a2b936..e3afd442cd 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -39,12 +39,12 @@ INT_PTR NetlibSend(WPARAM wParam, LPARAM lParam) return SOCKET_ERROR;
}
- if ( !NetlibEnterNestedCS(nlc, NLNCS_SEND))
+ if (!NetlibEnterNestedCS(nlc, NLNCS_SEND))
return SOCKET_ERROR;
if (nlc->usingHttpGateway && !(nlb->flags & MSG_RAW))
{
- if ( !(nlb->flags & MSG_NOHTTPGATEWAYWRAP) && nlc->nlu->user.pfnHttpGatewayWrapSend)
+ if (!(nlb->flags & MSG_NOHTTPGATEWAYWRAP) && nlc->nlu->user.pfnHttpGatewayWrapSend)
{
NetlibDumpData(nlc, (PBYTE)nlb->buf, nlb->len, 1, nlb->flags);
result = nlc->nlu->user.pfnHttpGatewayWrapSend((HANDLE)nlc, (PBYTE)nlb->buf, nlb->len, nlb->flags | MSG_NOHTTPGATEWAYWRAP, NetlibSend);
@@ -77,7 +77,7 @@ INT_PTR NetlibRecv(WPARAM wParam, LPARAM lParam) return SOCKET_ERROR;
}
- if ( !NetlibEnterNestedCS(nlc, NLNCS_RECV))
+ if (!NetlibEnterNestedCS(nlc, NLNCS_RECV))
return SOCKET_ERROR;
if (nlc->usingHttpGateway && !(nlb->flags & MSG_RAW))
@@ -139,7 +139,7 @@ INT_PTR NetlibSelect(WPARAM, LPARAM lParam) int pending = 0;
fd_set readfd, writefd, exceptfd;
WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
- if ( !ConnectionListToSocketList(nls->hReadConns, &readfd, pending)
+ if (!ConnectionListToSocketList(nls->hReadConns, &readfd, pending)
|| !ConnectionListToSocketList(nls->hWriteConns, &writefd, pending)
|| !ConnectionListToSocketList(nls->hExceptConns, &exceptfd, pending))
{
@@ -169,7 +169,7 @@ INT_PTR NetlibSelectEx(WPARAM, LPARAM lParam) int pending = 0;
fd_set readfd, writefd, exceptfd;
- if ( !ConnectionListToSocketList(nls->hReadConns, &readfd, pending)
+ if (!ConnectionListToSocketList(nls->hReadConns, &readfd, pending)
|| !ConnectionListToSocketList(nls->hWriteConns, &writefd, pending)
|| !ConnectionListToSocketList(nls->hExceptConns, &exceptfd, pending))
{
@@ -216,7 +216,7 @@ INT_PTR NetlibSelectEx(WPARAM, LPARAM lParam) bool NetlibStringToAddress(const char* str, SOCKADDR_INET_M* addr)
{
- if ( !str) return false;
+ if (!str) return false;
int len = sizeof(SOCKADDR_INET_M);
return !WSAStringToAddressA((char*)str, AF_INET6, NULL, (PSOCKADDR)addr, &len);
@@ -226,7 +226,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) {
char saddr[128];
DWORD len = sizeof(saddr);
- if ( !WSAAddressToStringA((PSOCKADDR)addr, sizeof(*addr), NULL, saddr, &len))
+ if (!WSAAddressToStringA((PSOCKADDR)addr, sizeof(*addr), NULL, saddr, &len))
return mir_strdup(saddr);
if (addr->si_family == AF_INET) {
@@ -242,12 +242,12 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo)
{
- if ( !nlc || !connInfo || connInfo->cbSize < sizeof(NETLIBCONNINFO)) return;
+ if (!nlc || !connInfo || connInfo->cbSize < sizeof(NETLIBCONNINFO)) return;
SOCKADDR_INET_M sin = {0};
int len = sizeof(sin);
- if ( !getsockname(nlc->s, (PSOCKADDR)&sin, &len)) {
+ if (!getsockname(nlc->s, (PSOCKADDR)&sin, &len)) {
connInfo->wPort = ntohs(sin.Ipv4.sin_port);
connInfo->dwIpv4 = sin.si_family == AF_INET ? htonl(sin.Ipv4.sin_addr.s_addr) : 0;
@@ -281,7 +281,7 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags) SOCKADDR_INET_M* iaddr = (SOCKADDR_INET_M*)ai->ai_addr;
if (ai->ai_family == AF_INET ||
(ai->ai_family == AF_INET6 &&
- ( !(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr))))
+ (!(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr))))
++n;
}
@@ -294,7 +294,7 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags) SOCKADDR_INET_M* iaddr = (SOCKADDR_INET_M*)ai->ai_addr;
if (ai->ai_family == AF_INET ||
(ai->ai_family == AF_INET6 &&
- ( !(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr))))
+ (!(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr))))
{
char* szIp = NetlibAddressToString(iaddr);
|