diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-04 08:47:22 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-04 08:47:22 +0000 |
commit | ca27f47e6cdaef69d3ab504a1643f692e5ca3c47 (patch) | |
tree | 200f24446d5f4886e3e17011ec80150b284a412d | |
parent | dae2b9333862d151194249ca678c3e80d5ef9767 (diff) |
small cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@5937 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/MRA/Mra_10.vcxproj | 1 | ||||
-rw-r--r-- | protocols/MRA/Mra_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/MRA/Mra_11.vcxproj | 1 | ||||
-rw-r--r-- | protocols/MRA/Mra_11.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/MRA/src/Mra.h | 1 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/Sdk/SocketFunctions.h | 56 |
9 files changed, 5 insertions, 70 deletions
diff --git a/protocols/MRA/Mra_10.vcxproj b/protocols/MRA/Mra_10.vcxproj index 9f29309ec3..4a56a12fab 100644 --- a/protocols/MRA/Mra_10.vcxproj +++ b/protocols/MRA/Mra_10.vcxproj @@ -238,7 +238,6 @@ <ClInclude Include="src\Sdk\MemoryFindByte.h" />
<ClInclude Include="src\Sdk\RC4.h" />
<ClInclude Include="src\Sdk\SHA1.h" />
- <ClInclude Include="src\Sdk\SocketFunctions.h" />
<ClInclude Include="src\Sdk\StrHexToNum.h" />
<ClInclude Include="src\Sdk\StrToNum.h" />
<ClInclude Include="src\Sdk\timefuncs.h" />
diff --git a/protocols/MRA/Mra_10.vcxproj.filters b/protocols/MRA/Mra_10.vcxproj.filters index 66245e8c6b..f03c9721c8 100644 --- a/protocols/MRA/Mra_10.vcxproj.filters +++ b/protocols/MRA/Mra_10.vcxproj.filters @@ -173,9 +173,6 @@ <ClInclude Include="src\Sdk\SHA1.h">
<Filter>Header Files\SDK</Filter>
</ClInclude>
- <ClInclude Include="src\Sdk\SocketFunctions.h">
- <Filter>Header Files\SDK</Filter>
- </ClInclude>
<ClInclude Include="src\Sdk\StrHexToNum.h">
<Filter>Header Files\SDK</Filter>
</ClInclude>
diff --git a/protocols/MRA/Mra_11.vcxproj b/protocols/MRA/Mra_11.vcxproj index 368ba88a2f..0e5ce82319 100644 --- a/protocols/MRA/Mra_11.vcxproj +++ b/protocols/MRA/Mra_11.vcxproj @@ -241,7 +241,6 @@ <ClInclude Include="src\Sdk\MemoryFindByte.h" />
<ClInclude Include="src\Sdk\RC4.h" />
<ClInclude Include="src\Sdk\SHA1.h" />
- <ClInclude Include="src\Sdk\SocketFunctions.h" />
<ClInclude Include="src\Sdk\StrHexToNum.h" />
<ClInclude Include="src\Sdk\StrToNum.h" />
<ClInclude Include="src\Sdk\timefuncs.h" />
diff --git a/protocols/MRA/Mra_11.vcxproj.filters b/protocols/MRA/Mra_11.vcxproj.filters index 66245e8c6b..f03c9721c8 100644 --- a/protocols/MRA/Mra_11.vcxproj.filters +++ b/protocols/MRA/Mra_11.vcxproj.filters @@ -173,9 +173,6 @@ <ClInclude Include="src\Sdk\SHA1.h">
<Filter>Header Files\SDK</Filter>
</ClInclude>
- <ClInclude Include="src\Sdk\SocketFunctions.h">
- <Filter>Header Files\SDK</Filter>
- </ClInclude>
<ClInclude Include="src\Sdk\StrHexToNum.h">
<Filter>Header Files\SDK</Filter>
</ClInclude>
diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 9805c91346..a0d859e903 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -77,7 +77,6 @@ #include "..\xstatus_MRA\src\resource.h"
#include "Sdk/DebugFunctions.h"
-#include "Sdk/SocketFunctions.h"
#include "Sdk/MemoryFind.h"
#include "Sdk/MemoryFindByte.h"
#include "Sdk/BuffToLowerCase.h"
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index aa0c907ae2..3c3c6b9ce6 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -243,7 +243,7 @@ size_t CMraProto::MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBu size_t dwAdapter = 0;
hostent *sh;
- dwSelfExternalIP = NTOHL(getDword("IP", 0));
+ dwSelfExternalIP = ntohl(getDword("IP", 0));
if (dwSelfExternalIP) {
memmove(&btAddress, &dwSelfExternalIP, sizeof(DWORD));
lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%lu.%lu.%lu.%lu:%lu;", btAddress[0], btAddress[1], btAddress[2], btAddress[3], dwPort);
@@ -493,7 +493,7 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) if (MraFilesQueueHandCheck(dat->m_hConnection, dat)) {
// связь установленная с тем кем нужно
setDword(dat->hContact, "OldIP", getDword(dat->hContact, "IP", 0));
- setDword(dat->hContact, "IP", HTONL(dat->malAddrList.pMailAddress[i].dwAddr));
+ setDword(dat->hContact, "IP", ntohl(dat->malAddrList.pMailAddress[i].dwAddr));
break;
}
else {
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index b388e7af40..8e03a93c70 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -155,10 +155,10 @@ void CMraProto::MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAd return;
setDword(hContact, "OldIP", getDword(hContact, "IP", 0));
- setDword(hContact, "IP", HTONL(pmalAddrList->pMailAddress[0].dwAddr));
+ setDword(hContact, "IP", ntohl(pmalAddrList->pMailAddress[0].dwAddr));
if (pmalAddrList->dwAddrCount > 1) {
setDword(hContact, "OldRealIP", getDword(hContact, "RealIP", 0));
- setDword(hContact, "RealIP", HTONL(pmalAddrList->pMailAddress[1].dwAddr));
+ setDword(hContact, "RealIP", ntohl(pmalAddrList->pMailAddress[1].dwAddr));
}
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 73b9d683f2..052cb10e8d 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -512,7 +512,7 @@ bool CMraProto::CmdUserInfo(BinBuffer &buf) int lpszDelimiter = szString.Find(':');
if (lpszDelimiter != -1) {
CMStringA szAddr(szString, lpszDelimiter);
- setDword("IP", HTONL(inet_addr(szAddr.c_str())));
+ setDword("IP", ntohl(inet_addr(szAddr.c_str())));
}
}
else if ( !_strnicmp(szString, "connect.xml", 11)) {
diff --git a/protocols/MRA/src/Sdk/SocketFunctions.h b/protocols/MRA/src/Sdk/SocketFunctions.h deleted file mode 100644 index 72e8042896..0000000000 --- a/protocols/MRA/src/Sdk/SocketFunctions.h +++ /dev/null @@ -1,56 +0,0 @@ -/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */ -
-
-
-#if !defined(AFX_SOCKET_FUNCTIONS__H__INCLUDED_)
-#define AFX_SOCKET_FUNCTIONS__H__INCLUDED_
-
-#ifndef NTOHL
-
-__inline u_long ULONG_FLIP(u_long ulIn)
-{
-#if defined (_M_IA64) || defined (_M_AMD64)
-return((((ulIn<<8) & 0x00ff0000) | (ulIn<<24) | ((ulIn>>8) & 0x0000ff00) | (ulIn>>24)));
-#else
- __asm
- {
- mov eax,ulIn
- bswap eax
- mov ulIn,eax
- };
-return(ulIn);
-#endif
-}
-
-#define NTOHL(in) ULONG_FLIP(in)
-#define HTONL(in) ULONG_FLIP(in)
-
-#endif
-
-
-#endif //AFX_SOCKET_FUNCTIONS__H__INCLUDED_
\ No newline at end of file |