From 91a420433a3e0d9e6f32989b1b8f56703f9fb103 Mon Sep 17 00:00:00 2001 From: Anatolii Cherednichenko Date: Tue, 30 Aug 2022 03:29:03 +0300 Subject: [PATCH] small fixes --- Makefile.homebrew | 2 +- libi2pd/Config.cpp | 2 +- libi2pd/Ed25519.h | 4 ++-- libi2pd/HTTP.cpp | 2 -- libi2pd/Identity.cpp | 4 ++-- libi2pd/SSU.cpp | 2 +- libi2pd/SSU2Session.cpp | 4 ++-- libi2pd/Streaming.cpp | 4 ++-- libi2pd/TunnelConfig.cpp | 2 +- libi2pd/TunnelEndpoint.cpp | 2 +- 10 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Makefile.homebrew b/Makefile.homebrew index c3f0c36a..d1cf87c3 100644 --- a/Makefile.homebrew +++ b/Makefile.homebrew @@ -11,7 +11,7 @@ endif BOOSTROOT = ${BREWROOT}/opt/boost SSLROOT = ${BREWROOT}/opt/openssl@1.1 UPNPROOT = ${BREWROOT}/opt/miniupnpc -CXXFLAGS = ${CXX_DEBUG} -Wall -std=c++11 -DMAC_OSX -Wno-overloaded-virtual +CXXFLAGS = ${CXX_DEBUG} -Wall -Wextra -Wpedantic -std=c++20 -DMAC_OSX -Wno-overloaded-virtual INCFLAGS = -I${SSLROOT}/include -I${BOOSTROOT}/include LDFLAGS = ${LD_DEBUG} diff --git a/libi2pd/Config.cpp b/libi2pd/Config.cpp index e95d8824..f32df5dc 100644 --- a/libi2pd/Config.cpp +++ b/libi2pd/Config.cpp @@ -463,7 +463,7 @@ namespace i2p { ThrowFatal("Error while parsing config file: ", e.what()); std::cerr << e.what() << std::endl; exit(EXIT_FAILURE); - }; + } } void Finalize() { diff --git a/libi2pd/Ed25519.h b/libi2pd/Ed25519.h index 51ebcb78..fbc0743b 100644 --- a/libi2pd/Ed25519.h +++ b/libi2pd/Ed25519.h @@ -74,13 +74,13 @@ namespace i2p { if (x) { x1 = BN_dup(x); BN_set_negative(x1, !BN_is_negative(x)); - }; + } if (y) y1 = BN_dup(y); if (z) z1 = BN_dup(z); if (t) { t1 = BN_dup(t); BN_set_negative(t1, !BN_is_negative(t)); - }; + } return EDDSAPoint{x1, y1, z1, t1}; } }; diff --git a/libi2pd/HTTP.cpp b/libi2pd/HTTP.cpp index 6a0ba210..ee6f2ead 100644 --- a/libi2pd/HTTP.cpp +++ b/libi2pd/HTTP.cpp @@ -7,9 +7,7 @@ */ #include -#include #include -#include #include "util.h" #include "Base.h" #include "HTTP.h" diff --git a/libi2pd/Identity.cpp b/libi2pd/Identity.cpp index bda6695c..4cd7840b 100644 --- a/libi2pd/Identity.cpp +++ b/libi2pd/Identity.cpp @@ -382,7 +382,7 @@ namespace i2p { break; default: LogPrint(eLogError, "Identity: Unknown crypto key type ", (int) keyType); - }; + } return nullptr; } @@ -626,7 +626,7 @@ namespace i2p { break; default: LogPrint(eLogError, "Identity: Unknown crypto key type ", (int) cryptoType); - }; + } return nullptr; } diff --git a/libi2pd/SSU.cpp b/libi2pd/SSU.cpp index f5233f6b..5be0c5e5 100644 --- a/libi2pd/SSU.cpp +++ b/libi2pd/SSU.cpp @@ -318,7 +318,7 @@ namespace i2p { if (ec) break; } else { LogPrint(eLogError, "SSU: v6 receive_from error: code ", ec.value(), ": ", ec.message()); - m_PacketsPool.ReleaseMt(packet);; + m_PacketsPool.ReleaseMt(packet); break; } } diff --git a/libi2pd/SSU2Session.cpp b/libi2pd/SSU2Session.cpp index f1f7b943..d8e8b033 100644 --- a/libi2pd/SSU2Session.cpp +++ b/libi2pd/SSU2Session.cpp @@ -319,7 +319,7 @@ namespace i2p { m_SentPackets.emplace(packetNum, packet); packet = newPacket; // just ack block } - }; + } if (packet->payloadSize > ackBlockSize) { ackBlockSent = true; if (packet->payloadSize + 16 < m_MaxPayloadSize) @@ -1392,7 +1392,7 @@ namespace i2p { } break; default:; - }; + } } void SSU2Session::HandleAck(const uint8_t *buf, size_t len) { diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index bbd83b40..f0d0caef 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -472,7 +472,7 @@ namespace i2p { m_Status = eStreamStatusOpen; if (!m_RemoteLeaseSet) m_RemoteLeaseSet = m_LocalDestination.GetOwner()->FindLeaseSet( - m_RemoteIdentity->GetIdentHash());; + m_RemoteIdentity->GetIdentHash()); if (m_RemoteLeaseSet) { m_RoutingSession = m_LocalDestination.GetOwner()->GetRoutingSession(m_RemoteLeaseSet, true); m_MTU = m_RoutingSession->IsRatchets() ? STREAMING_MTU_RATCHETS : STREAMING_MTU; @@ -661,7 +661,7 @@ namespace i2p { default: LogPrint(eLogWarning, "Streaming: Unexpected stream status=", (int) m_Status, " for sSID=", m_SendStreamID); - }; + } } void Stream::SendClose() { diff --git a/libi2pd/TunnelConfig.cpp b/libi2pd/TunnelConfig.cpp index b8e38e59..b18dffcd 100644 --- a/libi2pd/TunnelConfig.cpp +++ b/libi2pd/TunnelConfig.cpp @@ -195,7 +195,7 @@ namespace i2p { uint8_t *record = records + index * SHORT_TUNNEL_BUILD_RECORD_SIZE; uint8_t nonce[12]; memset(nonce, 0, 12); - nonce[4] = index; // nonce is index + nonce[4] = index; // nonce is indexed i2p::crypto::ChaCha20(record, SHORT_TUNNEL_BUILD_RECORD_SIZE, replyKey, nonce, record); } diff --git a/libi2pd/TunnelEndpoint.cpp b/libi2pd/TunnelEndpoint.cpp index 3edaa4de..223bce01 100644 --- a/libi2pd/TunnelEndpoint.cpp +++ b/libi2pd/TunnelEndpoint.cpp @@ -306,7 +306,7 @@ namespace i2p { break; default: LogPrint(eLogError, "TunnelMessage: Unknown delivery type ", (int) msg.deliveryType); - }; + } } void TunnelEndpoint::Cleanup() {