Browse Source

Optimizing use of USES_CONVERSION

Source commit: 41bec5877bfdf64a71ff054abe8849b94744330f
Martin Prikryl 3 years ago
parent
commit
85b1e9cb3d

+ 0 - 2
source/filezilla/AsyncProxySocketLayer.cpp

@@ -47,7 +47,6 @@ CAsyncProxySocketLayer::~CAsyncProxySocketLayer()
 
 void CAsyncProxySocketLayer::SetProxy(int nProxyType, const char * pProxyHost, int ProxyPort, bool bUseLogon, const char * pProxyUser, const char * pProxyPass)
 {
-  USES_CONVERSION;
   //Validate the parameters
   DebugAssert(!m_nProxyOpID);
   DebugAssert(pProxyHost && *pProxyHost);
@@ -781,7 +780,6 @@ void CAsyncProxySocketLayer::OnConnect(int nErrorCode)
       }
       delete [] pHost;
 
-      USES_CONVERSION;
       CString status;
       status.Format(L"HTTP proxy command: %s", UnicodeString(str).c_str());
       LogSocketMessageRaw(FZ_LOG_PROGRESS, status);

+ 0 - 1
source/filezilla/AsyncSslSocketLayer.cpp

@@ -1155,7 +1155,6 @@ void CAsyncSslSocketLayer::apps_ssl_info_callback(const SSL *s, int where, int r
       sprintf(buffer + strlen(buffer), " [%s]", debug);
       OPENSSL_free(debug);
     }
-    USES_CONVERSION;
     pLayer->LogSocketMessageRaw(FZ_LOG_INFO, A2T(buffer));
     delete[] buffer;
   }

+ 1 - 10
source/filezilla/FtpControlSocket.cpp

@@ -453,8 +453,6 @@ int CFtpControlSocket::InitConnectState()
 
 void CFtpControlSocket::Connect(t_server &server)
 {
-  USES_CONVERSION;
-
   if (m_Operation.nOpMode)
   {
     ShowStatus(L"Internal error: m_Operation.nOpMode not zero in Connect", FZ_LOG_ERROR);
@@ -914,8 +912,8 @@ void CFtpControlSocket::LogOnToServer(BOOL bSkipReply /*=FALSE*/)
   if (m_CurrentServer.port != 21)
     hostname.Format(hostname+  L":%d", m_CurrentServer.port); // add port to hostname (only if port is not 21)
 
-  USES_CONVERSION;
 #ifndef MPEXT_NO_GSS
+  USES_CONVERSION;
   //**** GSS Authentication ****
   if (m_Operation.nOpState==CONNECT_GSS_INIT)  //authenticate
   {
@@ -2239,7 +2237,6 @@ void CFtpControlSocket::List(BOOL bFinish, int nError /*=FALSE*/, CServerPath pa
           host = GetOption(OPTION_TRANSFERIP6);
           if (host != L"")
           {
-            USES_CONVERSION;
             addrinfo hints, *res;
             memset(&hints, 0, sizeof(addrinfo));
             hints.ai_family = AF_INET6;
@@ -2342,8 +2339,6 @@ bool CFtpControlSocket::ConnectTransferSocket(const CString & host, UINT port)
 
 void CFtpControlSocket::ListFile(CString filename, const CServerPath &path)
 {
-  USES_CONVERSION;
-
   #define LISTFILE_INIT  -1
   #define LISTFILE_MLST  1
   #define LISTFILE_TYPE  2
@@ -2410,7 +2405,6 @@ void CFtpControlSocket::ListFile(CString filename, const CServerPath &path)
     }
     else
     {
-      USES_CONVERSION;
       CStringA Buf = m_ListFile + '\n';
       const bool mlst = true;
       CFtpListResult * pListResult = CreateListResult(mlst);
@@ -5734,8 +5728,6 @@ int CFtpControlSocket::OnLayerCallback(std::list<t_callbackMsg>& callbacks)
 #endif
       else if (iter->pLayer == m_pSslLayer)
       {
-        USES_CONVERSION;
-
         switch (iter->nParam1)
         {
         case SSL_INFO:
@@ -6120,7 +6112,6 @@ void CFtpControlSocket::DiscardLine(CStringA line)
     }
     else if (line.Left(4) == "MLST")
     {
-      USES_CONVERSION;
       std::string facts;
       if (line.GetLength() > 5)
       {

+ 1 - 7
source/filezilla/FtpListResult.cpp

@@ -257,8 +257,6 @@ t_directory::t_direntry * CFtpListResult::getList(int & Num)
 
 BOOL CFtpListResult::parseLine(const char *lineToParse, const int linelen, t_directory::t_direntry &direntry)
 {
-  USES_CONVERSION;
-
   direntry.ownergroup = L"";
   direntry.owner = L"";
   direntry.group = L"";
@@ -931,9 +929,6 @@ BOOL CFtpListResult::parseAsEPLF(const char *line, const int linelen, t_director
 
 BOOL CFtpListResult::parseAsMlsd(const char *line, const int linelen, t_directory::t_direntry &direntry)
 {
-  #ifdef _DEBUG
-  USES_CONVERSION;
-  #endif
   // MLSD format as described here: https://datatracker.ietf.org/doc/html/rfc3659
   // Parsing is done strict, abort on slightest error.
 
@@ -1204,6 +1199,7 @@ void CFtpListResult::GuessYearIfUnknown(t_directory::t_direntry::t_date & Date)
 
 BOOL CFtpListResult::parseAsUnix(const char *line, const int linelen, t_directory::t_direntry &direntry)
 {
+  USES_CONVERSION;
   int pos = 0;
   int tokenlen = 0;
 
@@ -1329,7 +1325,6 @@ BOOL CFtpListResult::parseAsUnix(const char *line, const int linelen, t_director
     tmpstr[tokenlen] = 0;
     strlwr(tmpstr);
 
-    USES_CONVERSION;
     iter = m_MonthNamesMap.find(A2T(tmpstr));
     delete [] tmpstr;
     if (iter != m_MonthNamesMap.end())
@@ -1684,7 +1679,6 @@ BOOL CFtpListResult::parseAsUnix(const char *line, const int linelen, t_director
   else
   {
     //Try if we can recognize the month name
-    USES_CONVERSION;
     iter = m_MonthNamesMap.find(A2T(lwr));
     delete [] lwr;
     if (iter == m_MonthNamesMap.end())