From c545814fe4a36e59ec3539ad17fc4b5f960569a9 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Thu, 21 Jan 2021 12:26:03 +0200 Subject: [PATCH] Fix clang warnings --- daemon/HTTPServer.cpp | 4 ++-- libi2pd/Blinding.cpp | 2 +- libi2pd/Crypto.cpp | 6 +++--- libi2pd_client/SOCKS.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index aba30fd7..9103cd46 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -123,8 +123,8 @@ namespace http { const char HTTP_COMMAND_LOGLEVEL[] = "set_loglevel"; const char HTTP_COMMAND_KILLSTREAM[] = "closestream"; const char HTTP_COMMAND_LIMITTRANSIT[] = "limittransit"; - const char HTTP_PARAM_SAM_SESSION_ID[] = "id"; - const char HTTP_PARAM_ADDRESS[] = "address"; + const char HTTP_PARAM_SAM_SESSION_ID[] __attribute__((unused)) = "id"; + const char HTTP_PARAM_ADDRESS[] __attribute__((unused)) = "address"; static std::string ConvertTime (uint64_t time); std::map HTTPConnection::m_Tokens; diff --git a/libi2pd/Blinding.cpp b/libi2pd/Blinding.cpp index 6770d223..038bdca1 100644 --- a/libi2pd/Blinding.cpp +++ b/libi2pd/Blinding.cpp @@ -135,7 +135,7 @@ namespace data //---------------------------------------------------------- const uint8_t B33_TWO_BYTES_SIGTYPE_FLAG = 0x01; - const uint8_t B33_PER_SECRET_FLAG = 0x02; // not used for now + const uint8_t B33_PER_SECRET_FLAG __attribute__((unused)) = 0x02; // not used for now const uint8_t B33_PER_CLIENT_AUTH_FLAG = 0x04; BlindedPublicKey::BlindedPublicKey (std::shared_ptr identity, bool clientAuth): diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index 68850a9d..6a8329b4 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -160,7 +160,7 @@ namespace crypto // DH/ElGamal const int ELGAMAL_SHORT_EXPONENT_NUM_BITS = 226; - const int ELGAMAL_SHORT_EXPONENT_NUM_BYTES = ELGAMAL_SHORT_EXPONENT_NUM_BITS/8+1; + const int ELGAMAL_SHORT_EXPONENT_NUM_BYTES __attribute__((unused)) = ELGAMAL_SHORT_EXPONENT_NUM_BITS/8+1; const int ELGAMAL_FULL_EXPONENT_NUM_BITS = 2048; const int ELGAMAL_FULL_EXPONENT_NUM_BYTES = ELGAMAL_FULL_EXPONENT_NUM_BITS/8; @@ -631,8 +631,8 @@ namespace crypto const uint64_t OPAD = 0x5C5C5C5C5C5C5C5C; - static const uint64_t ipads[] = { IPAD, IPAD, IPAD, IPAD }; - static const uint64_t opads[] = { OPAD, OPAD, OPAD, OPAD }; + static const uint64_t ipads[] __attribute__((unused)) = { IPAD, IPAD, IPAD, IPAD }; + static const uint64_t opads[] __attribute__((unused)) = { OPAD, OPAD, OPAD, OPAD }; void HMACMD5Digest (uint8_t * msg, size_t len, const MACKey& key, uint8_t * digest) // key is 32 bytes diff --git a/libi2pd_client/SOCKS.cpp b/libi2pd_client/SOCKS.cpp index c5428c86..facb245f 100644 --- a/libi2pd_client/SOCKS.cpp +++ b/libi2pd_client/SOCKS.cpp @@ -27,7 +27,7 @@ namespace proxy static const size_t socks_buffer_size = 8192; static const size_t max_socks_hostname_size = 255; // Limit for socks5 and bad idea to traverse - static const size_t SOCKS_FORWARDER_BUFFER_SIZE = 8192; + static const size_t SOCKS_FORWARDER_BUFFER_SIZE __attribute__((unused)) = 8192; static const size_t SOCKS_UPSTREAM_SOCKS4A_REPLY_SIZE = 8;