From 8e54daa948a0aba6f0699bb6fbe772a22c9c66b1 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Sun, 18 Nov 2018 11:27:46 +0000 Subject: [PATCH] Avoid the build warnings: 'this statement may fall through' --- .svn-revision | 2 +- src/BaseClient.cpp | 1 + src/CFile.cpp | 1 + src/ClientTCPSocket.cpp | 3 +++ src/ECSpecialCoreTags.cpp | 1 + src/ECSpecialMuleTags.cpp | 1 + src/EncryptedStreamSocket.cpp | 3 +++ src/ExternalConn.cpp | 3 +++ src/PartFile.cpp | 1 + src/SafeFile.cpp | 1 + src/ServerConnect.cpp | 1 + src/TextClient.cpp | 7 +++++++ src/kademlia/net/PacketTracking.cpp | 1 + src/libs/common/Format.cpp | 1 + src/libs/common/Path.cpp | 1 + src/libs/common/StringFunctions.h | 2 ++ src/webserver/src/php_syntree.cpp | 2 ++ 17 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.svn-revision b/.svn-revision index c7ab6d1f..27af2e6a 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -11002 +11003 diff --git a/src/BaseClient.cpp b/src/BaseClient.cpp index cf1093a3..0cfef152 100644 --- a/src/BaseClient.cpp +++ b/src/BaseClient.cpp @@ -1321,6 +1321,7 @@ bool CUpDownClient::Disconnected(const wxString& DEBUG_ONLY(strReason), bool bFr switch (m_nDownloadState) { case DS_ONQUEUE: source_type = A4AF_SOURCE; // Will be checked. + /* fall through */ case DS_TOOMANYCONNS: case DS_NONEEDEDPARTS: case DS_LOWTOLOWIP: diff --git a/src/CFile.cpp b/src/CFile.cpp index d02ef0c2..33ac5b9e 100644 --- a/src/CFile.cpp +++ b/src/CFile.cpp @@ -251,6 +251,7 @@ bool CFile::Open(const CPath& fileName, OpenMode mode, int accessMode) //else: fall through as write_append is the same as write if the // file doesn't exist + /* fall through */ case write: flags |= O_WRONLY | O_CREAT | O_TRUNC; break; diff --git a/src/ClientTCPSocket.cpp b/src/ClientTCPSocket.cpp index 73e5d21c..9cf78792 100644 --- a/src/ClientTCPSocket.cpp +++ b/src/ClientTCPSocket.cpp @@ -1037,6 +1037,7 @@ bool CClientTCPSocket::ProcessExtPacket(const byte* buffer, uint32 size, uint8 o switch(opcode) { case OP_MULTIPACKET_EXT: AddDebugLogLineN( logRemoteClient, wxT("Remote Client: OP_MULTIPACKET_EXT from ") + m_client->GetFullIP()); + /* fall through */ case OP_MULTIPACKET: { if (opcode == OP_MULTIPACKET) AddDebugLogLineN( logRemoteClient, wxT("Remote Client: OP_MULTIPACKET from ") + m_client->GetFullIP() ); @@ -1346,8 +1347,10 @@ bool CClientTCPSocket::ProcessExtPacket(const byte* buffer, uint32 size, uint8 o } case OP_SENDINGPART_I64: AddDebugLogLineN( logRemoteClient, wxT("Remote Client: OP_SENDINGPART_I64 from ") + m_client->GetFullIP() ); + /* fall through */ case OP_COMPRESSEDPART_I64: if (opcode == OP_COMPRESSEDPART_I64) AddDebugLogLineN( logRemoteClient, wxT("Remote Client: OP_COMPRESSEDPART_I64 from ") + m_client->GetFullIP() ); + /* fall through */ case OP_COMPRESSEDPART: { // 0.47a if (opcode == OP_COMPRESSEDPART) AddDebugLogLineN( logRemoteClient, wxT("Remote Client: OP_COMPRESSEDPART from ") + m_client->GetFullIP() ); diff --git a/src/ECSpecialCoreTags.cpp b/src/ECSpecialCoreTags.cpp index e7bc3d4b..7c87ad2c 100644 --- a/src/ECSpecialCoreTags.cpp +++ b/src/ECSpecialCoreTags.cpp @@ -94,6 +94,7 @@ CEC_Server_Tag::CEC_Server_Tag(const CServer *server, EC_DETAIL_LEVEL detail_lev if ((tmpInt = server->GetFiles()) != 0) { AddTag(CECTag(EC_TAG_SERVER_FILES, tmpInt)); } + /* fall through */ case EC_DETAIL_CMD: if (!(tmpStr = server->GetListName()).IsEmpty()) { AddTag(CECTag(EC_TAG_SERVER_NAME, tmpStr)); diff --git a/src/ECSpecialMuleTags.cpp b/src/ECSpecialMuleTags.cpp index d73d29dd..700f604d 100644 --- a/src/ECSpecialMuleTags.cpp +++ b/src/ECSpecialMuleTags.cpp @@ -43,6 +43,7 @@ CEC_Category_Tag::CEC_Category_Tag(uint32 cat_index, EC_DETAIL_LEVEL detail_leve AddTag(CECTag(EC_TAG_CATEGORY_COMMENT, cat->comment)); AddTag(CECTag(EC_TAG_CATEGORY_COLOR, (uint32)cat->color)); AddTag(CECTag(EC_TAG_CATEGORY_PRIO, cat->prio)); + /* fall through */ case EC_DETAIL_CMD: AddTag(CECTag(EC_TAG_CATEGORY_TITLE, cat->title)); } diff --git a/src/EncryptedStreamSocket.cpp b/src/EncryptedStreamSocket.cpp index da579ceb..408c2646 100644 --- a/src/EncryptedStreamSocket.cpp +++ b/src/EncryptedStreamSocket.cpp @@ -533,6 +533,7 @@ int CEncryptedStreamSocket::Negotiate(const uint8* pBuffer, uint32 nLen) break; } } + /* fall through */ case ONS_BASIC_CLIENTA_PADDING: { //printf("Negotiating on padding, completing\n"); // ignore the random bytes, send the response, set status complete @@ -579,6 +580,7 @@ int CEncryptedStreamSocket::Negotiate(const uint8* pBuffer, uint32 nLen) break; } } + /* fall through */ case ONS_BASIC_CLIENTB_PADDING: //printf("Negotiating on client B padding, handshake complete\n"); // ignore the random bytes, the handshake is complete @@ -637,6 +639,7 @@ int CEncryptedStreamSocket::Negotiate(const uint8* pBuffer, uint32 nLen) if (m_nReceiveBytesWanted > 0) { break; } + /* fall through */ case ONS_BASIC_SERVER_PADDING: { // ignore the random bytes (they are decrypted already), send the response, set status complete CMemFile fileResponse(26); diff --git a/src/ExternalConn.cpp b/src/ExternalConn.cpp index 67912cfd..ecf36f07 100644 --- a/src/ExternalConn.cpp +++ b/src/ExternalConn.cpp @@ -584,6 +584,7 @@ static CECPacket *Get_EC_Response_StatRequest(const CECPacket *request, CLoggerA response->AddTag(CECTag(EC_TAG_STATS_TOTAL_SENT_BYTES, theStats::GetTotalSentBytes())); response->AddTag(CECTag(EC_TAG_STATS_TOTAL_RECEIVED_BYTES, theStats::GetTotalReceivedBytes())); response->AddTag(CECTag(EC_TAG_STATS_SHARED_FILE_COUNT, theStats::GetSharedFileCount())); + /* fall through */ case EC_DETAIL_WEB: case EC_DETAIL_CMD: response->AddTag(CECTag(EC_TAG_STATS_UL_SPEED, (uint32)theStats::GetUploadRate())); @@ -1100,10 +1101,12 @@ static CECPacket *Get_EC_Response_Search(const CECPacket *request) switch (search_type) { case EC_SEARCH_GLOBAL: core_search_type = GlobalSearch; + /* fall through */ case EC_SEARCH_KAD: if (core_search_type != GlobalSearch) { // Not a global search obviously core_search_type = KadSearch; } + /* fall through */ case EC_SEARCH_LOCAL: { uint32 search_id = 0xffffffff; wxString error = theApp->searchlist->StartNewSearch(&search_id, core_search_type, params); diff --git a/src/PartFile.cpp b/src/PartFile.cpp index ad2768f2..d7394da1 100644 --- a/src/PartFile.cpp +++ b/src/PartFile.cpp @@ -1465,6 +1465,7 @@ uint32 CPartFile::Process(uint32 reducedownload/*in percent*/,uint8 m_icounter) // No break here, since the next case takes care of asking for downloads. } + /* fall through */ case DS_CONNECTING: case DS_TOOMANYCONNS: case DS_NONE: diff --git a/src/SafeFile.cpp b/src/SafeFile.cpp index 5b0cfad5..adb4b887 100644 --- a/src/SafeFile.cpp +++ b/src/SafeFile.cpp @@ -328,6 +328,7 @@ void CFileDataIO::WriteString(const wxString& str, EUtf8Str eEncode, uint8 SizeL break; } } + /* fall through */ default: { // Non UTF-8 strings are saved as Latin-1 wxCharBuffer s1 = str.mb_str(wxConvISO8859_1); diff --git a/src/ServerConnect.cpp b/src/ServerConnect.cpp index 35810490..20217e54 100644 --- a/src/ServerConnect.cpp +++ b/src/ServerConnect.cpp @@ -421,6 +421,7 @@ void CServerConnect::ConnectionFailed(CServerSocket* sender) % sender->cur_server->GetFullIP() % sender->cur_server->GetPort() ); } + /* fall through */ case CS_SERVERDEAD: case CS_SERVERFULL:{ if (!connecting) { diff --git a/src/TextClient.cpp b/src/TextClient.cpp index 0070de09..7d7cad0a 100644 --- a/src/TextClient.cpp +++ b/src/TextClient.cpp @@ -259,6 +259,7 @@ int CamulecmdApp::ProcessCommand(int CmdId) case CMD_ID_SET_IPFILTER_CLIENTS_ON: case CMD_ID_SET_IPFILTER_SERVERS_ON: tmp_int = 1; + /* fall through */ case CMD_ID_SET_IPFILTER_OFF: case CMD_ID_SET_IPFILTER_CLIENTS_OFF: case CMD_ID_SET_IPFILTER_SERVERS_OFF: @@ -282,6 +283,7 @@ int CamulecmdApp::ProcessCommand(int CmdId) request->AddTag(prefs); request_list.push_back(request); } + /* fall through */ case CMD_ID_GET_IPFILTER: case CMD_ID_GET_IPFILTER_STATE: case CMD_ID_GET_IPFILTER_STATE_CLIENTS: @@ -306,6 +308,7 @@ int CamulecmdApp::ProcessCommand(int CmdId) } } CmdId = CMD_ID_GET_IPFILTER_LEVEL; + /* fall through */ case CMD_ID_GET_IPFILTER_LEVEL: request = new CECPacket(EC_OP_GET_PREFERENCES); request->AddTag(CECTag(EC_TAG_SELECT_PREFS, (uint32)EC_PREFS_SECURITY)); @@ -467,6 +470,7 @@ int CamulecmdApp::ProcessCommand(int CmdId) case CMD_ID_SET_BWLIMIT_UP: tmp_int = EC_TAG_CONN_MAX_UL - EC_TAG_CONN_MAX_DL; + /* fall through */ case CMD_ID_SET_BWLIMIT_DOWN: tmp_int += EC_TAG_CONN_MAX_DL; { @@ -481,6 +485,7 @@ int CamulecmdApp::ProcessCommand(int CmdId) return CMD_ERR_INVALID_ARG; } } + /* fall through */ case CMD_ID_GET_BWLIMITS: request = new CECPacket(EC_OP_GET_PREFERENCES); request->AddTag(CECTag(EC_TAG_SELECT_PREFS, (uint32)EC_PREFS_CONNECTIONS)); @@ -507,10 +512,12 @@ int CamulecmdApp::ProcessCommand(int CmdId) break; case CMD_ID_SEARCH_GLOBAL: search_type = EC_SEARCH_GLOBAL; + /* fall through */ case CMD_ID_SEARCH_LOCAL: if (search_type != EC_SEARCH_GLOBAL){ search_type = EC_SEARCH_LOCAL; } + /* fall through */ case CMD_ID_SEARCH_KAD: if (search_type != EC_SEARCH_GLOBAL && search_type != EC_SEARCH_LOCAL){ search_type = EC_SEARCH_KAD; diff --git a/src/kademlia/net/PacketTracking.cpp b/src/kademlia/net/PacketTracking.cpp index 15c39b28..c6ed61cd 100644 --- a/src/kademlia/net/PacketTracking.cpp +++ b/src/kademlia/net/PacketTracking.cpp @@ -148,6 +148,7 @@ bool CPacketTracking::InTrackListIsAllowedPacket(uint32_t ip, uint8_t opcode, bo break; case KADEMLIA_FIREWALLED2_REQ: opcode = KADEMLIA_FIREWALLED_REQ; + /* fall through */ case KADEMLIA_FIREWALLED_REQ: allowedPacketsPerMinute = 2; break; diff --git a/src/libs/common/Format.cpp b/src/libs/common/Format.cpp index 433567ef..f3aa552c 100644 --- a/src/libs/common/Format.cpp +++ b/src/libs/common/Format.cpp @@ -199,6 +199,7 @@ void CFormat::Init(const wxString& str) switch (state) { case esInvalidFormat: wxFAIL_MSG(wxT("Invalid format specifier: ") + str.Mid(formatStart, pos - formatStart + 1)); + /* fall through */ case esFormatStart: formatStart = pos; break; diff --git a/src/libs/common/Path.cpp b/src/libs/common/Path.cpp index 28152a23..979f5590 100644 --- a/src/libs/common/Path.cpp +++ b/src/libs/common/Path.cpp @@ -131,6 +131,7 @@ wxString DoCleanup(const wxString& filename, bool keepSpaces, bool isFAT32) continue; } + /* fall through */ default: if ((c == wxT(' ')) && !keepSpaces) { result += wxT("%20"); diff --git a/src/libs/common/StringFunctions.h b/src/libs/common/StringFunctions.h index 3b06002a..6814860e 100644 --- a/src/libs/common/StringFunctions.h +++ b/src/libs/common/StringFunctions.h @@ -171,6 +171,7 @@ inline size_t GetRawSize(const wxString& rstr, EUtf8Str eEncode) switch (eEncode) { case utf8strOptBOM: RealLen = 3; + /* fall through */ case utf8strRaw: { Unicode2CharBuf s(unicode2UTF8(rstr)); if (s) { @@ -180,6 +181,7 @@ inline size_t GetRawSize(const wxString& rstr, EUtf8Str eEncode) RealLen = 0; } } + /* fall through */ default: { Unicode2CharBuf s(unicode2char(rstr)); if (s) { diff --git a/src/webserver/src/php_syntree.cpp b/src/webserver/src/php_syntree.cpp index e287ba48..ba866306 100644 --- a/src/webserver/src/php_syntree.cpp +++ b/src/webserver/src/php_syntree.cpp @@ -1103,6 +1103,7 @@ void php_exp_tree_free(PHP_EXP_NODE *tree) break; case PHP_OP_MUX: php_exp_tree_free(tree->exp_node); + /* fall through */ default: // all other things using left/right php_exp_tree_free(tree->tree_node.left); @@ -1695,6 +1696,7 @@ void php_eval_int_math(PHP_EXP_OP op, PHP_VALUE_NODE *op1, PHP_VALUE_NODE *op2, case PHP_OP_LOG_XOR: op1->int_val = op1->int_val ? 1 : 0; op2->int_val = op2->int_val ? 1 : 0; + /* fall through */ case PHP_OP_XOR: result->int_val = op1->int_val ^ op2->int_val; break; -- 2.11.4.GIT