Browse Source

[[fallthrough]] if C++17 only

pull/1478/head
orignal 5 years ago
parent
commit
2ffe62ba41
  1. 5
      libi2pd/Garlic.cpp
  2. 5
      libi2pd/Identity.cpp
  3. 6
      libi2pd/RouterContext.cpp
  4. 5
      libi2pd/Streaming.cpp
  5. 2
      libi2pd_client/SOCKS.cpp

5
libi2pd/Garlic.cpp

@ -911,7 +911,10 @@ namespace garlic
case eGarlicDeliveryTypeDestination: case eGarlicDeliveryTypeDestination:
LogPrint (eLogDebug, "Garlic: type destination"); LogPrint (eLogDebug, "Garlic: type destination");
buf += 32; // TODO: check destination buf += 32; // TODO: check destination
[[fallthrough]]; // no break here #if (__cplusplus >= 201703L) // C++ 17 or higher
[[fallthrough]];
#endif
// no break here
case eGarlicDeliveryTypeLocal: case eGarlicDeliveryTypeLocal:
{ {
LogPrint (eLogDebug, "Garlic: type local"); LogPrint (eLogDebug, "Garlic: type local");

5
libi2pd/Identity.cpp

@ -723,7 +723,10 @@ namespace data
case SIGNING_KEY_TYPE_RSA_SHA384_3072: case SIGNING_KEY_TYPE_RSA_SHA384_3072:
case SIGNING_KEY_TYPE_RSA_SHA512_4096: case SIGNING_KEY_TYPE_RSA_SHA512_4096:
LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA"); LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA");
[[fallthrough]]; // no break here #if (__cplusplus >= 201703L) // C++ 17 or higher
[[fallthrough]];
#endif
// no break here
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519:
i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub); i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub);
break; break;

6
libi2pd/RouterContext.cpp

@ -338,7 +338,11 @@ namespace i2p
{ {
case low : /* not set */; break; case low : /* not set */; break;
case extra : caps |= i2p::data::RouterInfo::eExtraBandwidth; break; // 'P' case extra : caps |= i2p::data::RouterInfo::eExtraBandwidth; break; // 'P'
case unlim : caps |= i2p::data::RouterInfo::eExtraBandwidth; [[fallthrough]]; // no break here, extra + high means 'X' case unlim : caps |= i2p::data::RouterInfo::eExtraBandwidth;
#if (__cplusplus >= 201703L) // C++ 17 or higher
[[fallthrough]];
#endif
// no break here, extra + high means 'X'
case high : caps |= i2p::data::RouterInfo::eHighBandwidth; break; case high : caps |= i2p::data::RouterInfo::eHighBandwidth; break;
} }
m_RouterInfo.SetCaps (caps); m_RouterInfo.SetCaps (caps);

5
libi2pd/Streaming.cpp

@ -847,7 +847,10 @@ namespace stream
break; break;
case 2: case 2:
m_RTO = INITIAL_RTO; // drop RTO to initial upon tunnels pair change first time m_RTO = INITIAL_RTO; // drop RTO to initial upon tunnels pair change first time
[[fallthrough]]; // no break here #if (__cplusplus >= 201703L) // C++ 17 or higher
[[fallthrough]];
#endif
// no break here
case 4: case 4:
if (m_RoutingSession) m_RoutingSession->SetSharedRoutingPath (nullptr); if (m_RoutingSession) m_RoutingSession->SetSharedRoutingPath (nullptr);
UpdateCurrentRemoteLease (); // pick another lease UpdateCurrentRemoteLease (); // pick another lease

2
libi2pd_client/SOCKS.cpp

@ -433,7 +433,9 @@ namespace proxy
break; break;
case CMD_UDP: case CMD_UDP:
if (m_socksv == SOCKS5) break; if (m_socksv == SOCKS5) break;
#if (__cplusplus >= 201703L) // C++ 17 or higher
[[fallthrough]]; [[fallthrough]];
#endif
default: default:
LogPrint(eLogError, "SOCKS: invalid command: ", ((int)*sock_buff)); LogPrint(eLogError, "SOCKS: invalid command: ", ((int)*sock_buff));
SocksRequestFailed(SOCKS5_GEN_FAIL); SocksRequestFailed(SOCKS5_GEN_FAIL);

Loading…
Cancel
Save