Ticket #5023: VS2008StaticCodeAnalyzer.patch
File VS2008StaticCodeAnalyzer.patch, 17.0 KB (added by , 14 years ago) |
---|
-
AsyncSocketEx.cpp
805 805 #ifndef NOLAYERS 806 806 if (m_pFirstLayer) 807 807 { 808 BOOLres = m_pFirstLayer->Create(nSocketPort, nSocketType, lEvent, lpszSocketAddress, nFamily, reusable);808 res = m_pFirstLayer->Create(nSocketPort, nSocketType, lEvent, lpszSocketAddress, nFamily, reusable); 809 809 #ifndef NOSOCKETSTATES 810 810 if (res) 811 811 SetState(unconnected); … … 1300 1300 1301 1301 addrinfo hints; 1302 1302 int error; 1303 BOOL ret ;1303 BOOL ret = FALSE; 1304 1304 char port[10]; 1305 1305 1306 1306 memset(&hints, 0, sizeof(addrinfo)); … … 1425 1425 return m_pFirstLayer->GetPeerName(rPeerAddress, rPeerPort); 1426 1426 #endif NOLAYERS 1427 1427 1428 SOCKADDR* sockAddr ;1429 int nSockAddrLen ;1428 SOCKADDR* sockAddr = NULL; 1429 int nSockAddrLen = 0; 1430 1430 1431 1431 if (m_SocketData.nFamily == AF_INET6) 1432 1432 { … … 1485 1485 #ifdef _AFX 1486 1486 BOOL CAsyncSocketEx::GetSockName(CString& rSocketAddress, UINT& rSocketPort) 1487 1487 { 1488 SOCKADDR* sockAddr ;1489 int nSockAddrLen ;1488 SOCKADDR* sockAddr = NULL; 1489 int nSockAddrLen = 0; 1490 1490 1491 1491 if (m_SocketData.nFamily == AF_INET6) 1492 1492 { -
AsyncSocketExLayer.cpp
483 483 return m_pNextLayer->GetPeerName(rPeerAddress, rPeerPort); 484 484 else 485 485 { 486 SOCKADDR* sockAddr ;487 int nSockAddrLen ;486 SOCKADDR* sockAddr = NULL; 487 int nSockAddrLen = 0; 488 488 489 489 if (m_nFamily == AF_INET6) 490 490 { … … 562 562 return m_pNextLayer->GetSockName(rSockAddress, rSockPort); 563 563 else 564 564 { 565 SOCKADDR* sockAddr ;566 int nSockAddrLen ;565 SOCKADDR* sockAddr = NULL; 566 int nSockAddrLen = 0; 567 567 568 568 if (m_nFamily == AF_INET6) 569 569 { -
AsyncSslSocketLayer.cpp
505 505 // will stall. Perhaps it triggers some internal processing. 506 506 // Also, ignore return value, don't do any error checking. This function 507 507 // can report errors, even though a later call can succeed. 508 char buffer;509 pBIO_read(m_sslbio, & buffer, 0);508 char dummy; 509 pBIO_read(m_sslbio, &dummy, 0); 510 510 } 511 511 else if (!numread) 512 512 { -
Interface/AdminSocket.cpp
181 181 } 182 182 if (m_nRecvBufferPos < 5) 183 183 return FALSE; 184 intlen = m_pRecvBuffer[3] * 256 + m_pRecvBuffer[4];184 len = m_pRecvBuffer[3] * 256 + m_pRecvBuffer[4]; 185 185 if (len != 4) 186 186 { 187 187 CString str; -
Interface/ConnectDialog.cpp
73 73 { 74 74 CDialog::OnInitDialog(); 75 75 76 m_ServerAddress 77 m_ServerPort.Format(_T("%d"), m_pOptions->GetOptionVal(IOPTION_LASTSERVERPORT));78 m_ServerPassword 76 m_ServerAddress = m_pOptions->GetOption(IOPTION_LASTSERVERADDRESS); 77 m_ServerPort.Format(_T("%d"), static_cast<int>(m_pOptions->GetOptionVal(IOPTION_LASTSERVERPORT))); 78 m_ServerPassword = m_pOptions->GetOption(IOPTION_LASTSERVERPASS); 79 79 m_bAlways = m_pOptions->GetOptionVal(IOPTION_ALWAYS) != 0; 80 80 UpdateData(FALSE); 81 81 -
Interface/GroupsDlg.cpp
330 330 331 331 if (!dlg.m_action) 332 332 { 333 for (unsigned int i = 0; i < m_UsersList.size(); i++)333 for (unsigned int k = 0; k < m_UsersList.size(); k++) 334 334 { 335 t_user& user = m_UsersList[ i];335 t_user& user = m_UsersList[k]; 336 336 if (user.group.CompareNoCase(oldName)) 337 337 continue; 338 338 user.group = dlg.m_groupName; … … 342 342 { 343 343 // Delete affected users 344 344 t_UsersList newList; 345 for (unsigned int i = 0; i < m_UsersList.size(); i++)345 for (unsigned int k = 0; k < m_UsersList.size(); k++) 346 346 { 347 if (m_UsersList[ i].group.CompareNoCase(oldName))348 newList.push_back(m_UsersList[ i]);347 if (m_UsersList[k].group.CompareNoCase(oldName)) 348 newList.push_back(m_UsersList[k]); 349 349 } 350 350 m_UsersList = newList; 351 351 } -
Interface/misc/BrowseForFolder.cpp
114 114 if ((pidl = ::SHBrowseForFolder(&m_bi)) != NULL) 115 115 { 116 116 m_strPath.Empty(); 117 if ( SUCCEEDED(::SHGetPathFromIDList(pidl, m_szSelected)))117 if (::SHGetPathFromIDList(pidl, m_szSelected)) 118 118 { 119 119 bRet = true; 120 120 m_strPath = m_szSelected; -
Interface/misc/ExceptionReport.cpp
254 254 } 255 255 256 256 int nError=0; 257 if (m_hReportFile == INVALID_HANDLE_VALUE && INVALID_HANDLE_VALUE)257 if (m_hReportFile == INVALID_HANDLE_VALUE) 258 258 nError = GetLastError(); 259 259 else 260 260 { -
Interface/misc/HyperLink.cpp
458 458 HCURSOR hHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106)); 459 459 if (hHandCursor) 460 460 g_hLinkCursor = CopyCursor(hHandCursor); 461 FreeLibrary(hModule); 461 462 } 462 FreeLibrary(hModule);463 463 } 464 464 } 465 465 -
Interface/misc/MailMsg.cpp
203 203 message.flFlags = 0; 204 204 message.lpOriginator = m_from.size() ? pRecipients : NULL; 205 205 message.nRecipCount = nRecipients - m_from.size(); // don't count originator 206 message.lpRecips = nRecipients - m_from.size() ? &pRecipients[m_from.size()] : NULL;206 message.lpRecips = (nRecipients - m_from.size()) ? &pRecipients[m_from.size()] : NULL; 207 207 message.nFileCount = nAttachments; 208 208 message.lpFiles = nAttachments ? pAttachments : NULL; 209 209 -
Interface/misc/SAPrefsDialog.cpp
229 229 else 230 230 { 231 231 // find start page 232 for ( unsigned inti = 0; i <m_pages.size(); i++)232 for (i = 0; i <m_pages.size(); i++) 233 233 { 234 234 pageStruct *pPS = m_pages[i]; 235 235 ASSERT(pPS); -
Interface/OptionsAdminInterfacePage.cpp
249 249 250 250 void COptionsAdminInterfacePage::LoadData() 251 251 { 252 m_Port.Format(_T("%d"), m_pOptionsDlg->GetOptionVal(OPTION_ADMINPORT));252 m_Port.Format(_T("%d"), static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_ADMINPORT))); 253 253 m_IpBindings = m_pOptionsDlg->GetOption(OPTION_ADMINIPBINDINGS); 254 254 m_IpAddresses = m_pOptionsDlg->GetOption(OPTION_ADMINIPADDRESSES); 255 255 m_NewPass = m_pOptionsDlg->GetOption(OPTION_ADMINPASS); -
Interface/OptionsAutobanPage.cpp
78 78 void COptionsAutobanPage::LoadData() 79 79 { 80 80 m_enable = m_pOptionsDlg->GetOptionVal(OPTION_AUTOBAN_ENABLE) ? true : false; 81 m_attempts.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_AUTOBAN_ATTEMPTS));82 m_time.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_AUTOBAN_BANTIME));81 m_attempts.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_AUTOBAN_ATTEMPTS))); 82 m_time.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_AUTOBAN_BANTIME))); 83 83 m_type = m_pOptionsDlg->GetOptionVal(OPTION_AUTOBAN_TYPE) ? 1 : 0; 84 84 } 85 85 -
Interface/OptionsCompressionPage.cpp
111 111 112 112 void COptionsCompressionPage::LoadData() 113 113 { 114 m_LevelMin.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_MODEZ_LEVELMIN));115 m_LevelMax.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_MODEZ_LEVELMAX));114 m_LevelMin.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_MODEZ_LEVELMIN))); 115 m_LevelMax.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_MODEZ_LEVELMAX))); 116 116 m_UseModeZ = m_pOptionsDlg->GetOptionVal(OPTION_MODEZ_USE) != 0; 117 117 m_DisallowLocal = !m_pOptionsDlg->GetOptionVal(OPTION_MODEZ_ALLOWLOCAL); 118 118 m_disallowedIPs = m_pOptionsDlg->GetOption(OPTION_MODEZ_DISALLOWED_IPS); -
Interface/OptionsDlg.cpp
369 369 char* utf8 = ConvToNetwork(GetOption(i+1)); 370 370 if (utf8) 371 371 { 372 int l en= strlen(utf8);373 *p++ = (l en/ 256) / 256;374 *p++ = l en/ 256;375 *p++ = l en% 256;376 memcpy(p, utf8, l en);377 p += l en;372 int l = strlen(utf8); 373 *p++ = (l / 256) / 256; 374 *p++ = l / 256; 375 *p++ = l % 256; 376 memcpy(p, utf8, l); 377 p += l; 378 378 delete [] utf8; 379 379 } 380 380 else -
Interface/OptionsGeneralPage.cpp
144 144 145 145 void COptionsGeneralPage::LoadData() 146 146 { 147 m_Port = m_pOptionsDlg->GetOption(OPTION_SERVERPORT); 148 m_Threadnum.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_THREADNUM));149 m_MaxUsers.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_MAXUSERS));150 m_Timeout.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_TIMEOUT));151 m_NoTransferTimeout.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_NOTRANSFERTIMEOUT));152 m_LoginTimeout.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_LOGINTIMEOUT));147 m_Port = m_pOptionsDlg->GetOption(OPTION_SERVERPORT); 148 m_Threadnum.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_THREADNUM))); 149 m_MaxUsers.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_MAXUSERS))); 150 m_Timeout.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_TIMEOUT))); 151 m_NoTransferTimeout.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_NOTRANSFERTIMEOUT))); 152 m_LoginTimeout.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_LOGINTIMEOUT))); 153 153 } 154 154 155 155 void COptionsGeneralPage::SaveData() -
Interface/OptionsMiscPage.cpp
84 84 { 85 85 m_bDontShowPass = m_pOptionsDlg->GetOptionVal(OPTION_LOGSHOWPASS) == 0; 86 86 m_bStartMinimized = m_pOptionsDlg->m_pInterfaceOptions->GetOptionVal(IOPTION_STARTMINIMIZED) != 0; 87 m_TransferBufferSize.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE));88 m_TransferBufferSize2.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE2));87 m_TransferBufferSize.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE))); 88 m_TransferBufferSize2.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE2))); 89 89 m_bSharedWrite = m_pOptionsDlg->GetOptionVal(OPTION_SHAREDWRITE) != 0; 90 90 m_bActiveIgnoreLocal = m_pOptionsDlg->GetOptionVal(OPTION_ACTIVE_IGNORELOCAL) != 0; 91 91 } -
Interface/OptionsPasvPage.cpp
162 162 m_IP = m_pOptionsDlg->GetOption(OPTION_CUSTOMPASVIP); 163 163 m_URL = m_pOptionsDlg->GetOption(OPTION_CUSTOMPASVIPSERVER); 164 164 m_bUseCustomPort = m_pOptionsDlg->GetOptionVal(OPTION_USECUSTOMPASVPORT) != 0; 165 m_PortMin.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_CUSTOMPASVMINPORT));166 m_PortMax.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_CUSTOMPASVMAXPORT));165 m_PortMin.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_CUSTOMPASVMINPORT))); 166 m_PortMax.Format("%d", static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_CUSTOMPASVMAXPORT))); 167 167 m_NoExternalOnLocal = m_pOptionsDlg->GetOptionVal(OPTION_NOEXTERNALIPONLOCAL) != 0; 168 168 } 169 169 -
Interface/UsersListCtrl.cpp
300 300 CConnectionData *pConnectionData = iter->second; 301 301 302 302 m_connectionDataMap.erase(iter); 303 for (std::vector<CConnectionData*>::iterator i ter = m_connectionDataArray.begin() + pConnectionData->listIndex + 1; iter != m_connectionDataArray.end(); iter++)304 (*i ter)->listIndex--;303 for (std::vector<CConnectionData*>::iterator i = m_connectionDataArray.begin() + pConnectionData->listIndex + 1; i != m_connectionDataArray.end(); i++) 304 (*i)->listIndex--; 305 305 m_connectionDataArray.erase(m_connectionDataArray.begin() + pConnectionData->listIndex); 306 306 delete pConnectionData; 307 307 -
version.cpp
83 83 { 84 84 TCHAR ch = 'a'; 85 85 ch += static_cast<TCHAR>(fi->dwFileVersionLS >> 16) - 1; 86 version.Format(_T("%s version %d.%d%c test release %d)"), ProductName , fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF, ch, fi->dwFileVersionLS & 0xFFFF);86 version.Format(_T("%s version %d.%d%c test release %d)"), ProductName.GetString(), fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF, ch, fi->dwFileVersionLS & 0xFFFF); 87 87 } 88 88 else 89 version.Format(_T("%s version %d.%d test release %d"), ProductName , fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS & 0xFFFF);89 version.Format(_T("%s version %d.%d test release %d"), ProductName.GetString(), fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS & 0xFFFF); 90 90 } 91 91 else 92 92 { //final versions … … 94 94 { 95 95 TCHAR ch = 'a'; 96 96 ch += static_cast<TCHAR>(fi->dwFileVersionLS >> 16) - 1; 97 version.Format(_T("%s version %d.%d%c final"), ProductName, fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF, ch);97 version.Format(_T("%s version %d.%d%c final"), ProductName.GetString(), fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF, ch); 98 98 } 99 99 else 100 version.Format(_T("%s version %d.%d final"), ProductName , fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF);100 version.Format(_T("%s version %d.%d final"), ProductName.GetString(), fi->dwFileVersionMS >> 16, fi->dwFileVersionMS & 0xFFFF); 101 101 } 102 102 } 103 103 else … … 106 106 if ((fi->dwFileVersionLS & 0xFFFF) / 100) 107 107 if ((fi->dwFileVersionLS & 0xFFFF) % 100) 108 108 //test release 109 version.Format(_T("%s version 0.%d.%d%c beta test release %d"), ProductName , fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS >> 16, (fi->dwFileVersionLS & 0xFFFF) / 100 + 'a' - 1, (fi->dwFileVersionLS & 0xFFFF) % 100);109 version.Format(_T("%s version 0.%d.%d%c beta test release %d"), ProductName.GetString(), fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS >> 16, (fi->dwFileVersionLS & 0xFFFF) / 100 + 'a' - 1, (fi->dwFileVersionLS & 0xFFFF) % 100); 110 110 else 111 111 //final version 112 version.Format(_T("%s version 0.%d.%d%c beta"), ProductName, fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS>>16, (fi->dwFileVersionLS & 0xFFFF) / 100 + 'a' - 1);112 version.Format(_T("%s version 0.%d.%d%c beta"), ProductName.GetString(), fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS>>16, (fi->dwFileVersionLS & 0xFFFF) / 100 + 'a' - 1); 113 113 else 114 114 if (fi->dwFileVersionLS&0xFFFF) 115 115 //test release 116 version.Format(_T("%s version 0.%d.%d beta test release %d"), ProductName ,fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS >> 16, fi->dwFileVersionLS & 0xFFFF);116 version.Format(_T("%s version 0.%d.%d beta test release %d"), ProductName.GetString(), fi->dwFileVersionMS & 0xFFFF, fi->dwFileVersionLS >> 16, fi->dwFileVersionLS & 0xFFFF); 117 117 else 118 118 //final version 119 version.Format(_T("%s version 0.%d.%d beta"), ProductName , fi->dwFileVersionMS&0xFFFF, fi->dwFileVersionLS >> 16);119 version.Format(_T("%s version 0.%d.%d beta"), ProductName.GetString(), fi->dwFileVersionMS&0xFFFF, fi->dwFileVersionLS >> 16); 120 120 } 121 121 122 122 }