Browse Source

Merge pull request #1893 from Vort/warning_fixes

Fix several warnings
pull/1894/head
orignal 2 years ago committed by GitHub
parent
commit
75ab385ab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      libi2pd/Gzip.cpp
  2. 4
      libi2pd/SSU2.cpp
  3. 4
      libi2pd/Streaming.cpp

2
libi2pd/Gzip.cpp

@ -139,7 +139,7 @@ namespace data
if (m_IsDirty) deflateReset (&m_Deflator); if (m_IsDirty) deflateReset (&m_Deflator);
m_IsDirty = true; m_IsDirty = true;
size_t offset = 0; size_t offset = 0;
int err; int err = 0;
for (const auto& it: bufs) for (const auto& it: bufs)
{ {
m_Deflator.next_in = const_cast<uint8_t *>(it.first); m_Deflator.next_in = const_cast<uint8_t *>(it.first);

4
libi2pd/SSU2.cpp

@ -918,7 +918,7 @@ namespace transport
} }
uint64_t token; uint64_t token;
RAND_bytes ((uint8_t *)&token, 8); RAND_bytes ((uint8_t *)&token, 8);
m_IncomingTokens.emplace (ep, std::make_pair (token, ts + SSU2_TOKEN_EXPIRATION_TIMEOUT)); m_IncomingTokens.emplace (ep, std::make_pair (token, uint32_t(ts + SSU2_TOKEN_EXPIRATION_TIMEOUT)));
return token; return token;
} }
@ -927,7 +927,7 @@ namespace transport
m_IncomingTokens.erase (ep); // drop previous m_IncomingTokens.erase (ep); // drop previous
uint64_t token; uint64_t token;
RAND_bytes ((uint8_t *)&token, 8); RAND_bytes ((uint8_t *)&token, 8);
auto ret = std::make_pair (token, i2p::util::GetSecondsSinceEpoch () + SSU2_NEXT_TOKEN_EXPIRATION_TIMEOUT); auto ret = std::make_pair (token, uint32_t(i2p::util::GetSecondsSinceEpoch () + SSU2_NEXT_TOKEN_EXPIRATION_TIMEOUT));
m_IncomingTokens.emplace (ep, ret); m_IncomingTokens.emplace (ep, ret);
return ret; return ret;
} }

4
libi2pd/Streaming.cpp

@ -51,8 +51,8 @@ namespace stream
{ {
// partially // partially
rem = len - offset; rem = len - offset;
memcpy (buf + offset, nextBuffer->GetRemaningBuffer (), len - offset); memcpy (buf + offset, nextBuffer->GetRemaningBuffer (), rem);
nextBuffer->offset += (len - offset); nextBuffer->offset += rem;
offset = len; // break offset = len; // break
} }
} }

Loading…
Cancel
Save