Skip to content

Commit

Permalink
Fix compilation with Clang 3.8
Browse files Browse the repository at this point in the history
Verified compilation with Clang 3.8 on Ubuntu 16.04;
however, no linking due to binary incompatibility of libstdc++.
The compilation needs further testing on Mac or FreeBSD.
  • Loading branch information
rakhimov committed Jul 15, 2016
1 parent 96ad43e commit 8230e46
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/client/I2PControl/I2PControl.cpp
Expand Up @@ -317,7 +317,7 @@ I2PControlSession::Response I2PControlSession::HandleRequest(
}
// Call the appropriate handler
(this->*(it->second))(params, response);
} catch (const boost::property_tree::ptree_error& error) {
} catch (const boost::property_tree::ptree_error&) {
response.SetError(ErrorCode::e_ParseError);
} catch (...) {
response.SetError(ErrorCode::e_InternalError);
Expand All @@ -340,7 +340,7 @@ bool I2PControlSession::Authenticate(
response.SetError(ErrorCode::e_ExpiredToken);
return false;
}
} catch (const boost::property_tree::ptree_error& error) {
} catch (const boost::property_tree::ptree_error&) {
response.SetError(ErrorCode::e_NoToken);
return false;
}
Expand Down
1 change: 1 addition & 0 deletions src/client/I2PControl/I2PControl.h
Expand Up @@ -321,6 +321,7 @@ class I2PControlSession
m_RouterManagerHandlers,
m_NetworkSettingHandlers;

/// @todo Unused private field. Why?
boost::asio::io_service& m_Service;
boost::asio::deadline_timer m_ShutdownTimer,
m_ExpireTokensTimer;
Expand Down
6 changes: 2 additions & 4 deletions src/client/I2PService.h
Expand Up @@ -95,7 +95,7 @@ class I2PService {
virtual void Stop() = 0;

// everyone must override this
virtual std::string GetName() = 0;
virtual std::string GetName() const = 0;

private:
std::shared_ptr<ClientDestination> m_LocalDestination;
Expand Down Expand Up @@ -199,9 +199,7 @@ class TCPIPAcceptor : public I2PService {
virtual std::shared_ptr<I2PServiceHandler> CreateHandler(
std::shared_ptr<boost::asio::ip::tcp::socket> socket) = 0;

virtual std::string GetName() {
return "generic TCP/IP accepting daemon";
}
std::string GetName() const { return "generic TCP/IP accepting daemon"; }

protected:
std::string m_Address;
Expand Down
8 changes: 2 additions & 6 deletions src/client/I2PTunnel/I2PTunnel.cpp
Expand Up @@ -384,9 +384,7 @@ std::unique_ptr<const i2p::data::IdentHash> I2PClientTunnel::GetIdentHash() {
return std::move(m_DestinationIdentHash);
}

std::string I2PClientTunnel::GetName() {
return m_TunnelName;
}
std::string I2PClientTunnel::GetName() const { return m_TunnelName; }

std::shared_ptr<I2PServiceHandler> I2PClientTunnel::CreateHandler(
std::shared_ptr<boost::asio::ip::tcp::socket> socket) {
Expand Down Expand Up @@ -582,9 +580,7 @@ void I2PServerTunnel::CreateI2PConnection(
conn->Connect();
}

std::string I2PServerTunnel::GetName() {
return m_TunnelName;
}
std::string I2PServerTunnel::GetName() const { return m_TunnelName; }

I2PServerTunnelHTTP::I2PServerTunnelHTTP(
const std::string& name,
Expand Down
4 changes: 2 additions & 2 deletions src/client/I2PTunnel/I2PTunnel.h
Expand Up @@ -162,7 +162,7 @@ class I2PClientTunnel : public TCPIPAcceptor {

void Start();
void Stop();
std::string GetName();
std::string GetName() const;

private:
std::unique_ptr<const i2p::data::IdentHash> GetIdentHash();
Expand Down Expand Up @@ -216,7 +216,7 @@ class I2PServerTunnel : public I2PService {
return m_Endpoint;
}

std::string GetName();
std::string GetName() const;

private:
void HandleResolve(
Expand Down
4 changes: 1 addition & 3 deletions src/client/I2PTunnel/SOCKS.h
Expand Up @@ -58,9 +58,7 @@ class SOCKSServer : public i2p::client::TCPIPAcceptor {
std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(
std::shared_ptr<boost::asio::ip::tcp::socket> socket);

std::string GetName() const {
return "SOCKS";
}
std::string GetName() const { return "SOCKS"; }
};

typedef SOCKSServer SOCKSProxy;
Expand Down
4 changes: 2 additions & 2 deletions src/core/Profiling.cpp
Expand Up @@ -153,7 +153,7 @@ void RouterProfile::Load() {
m_NumTunnelsNonReplied = participations.get(
PEER_PROFILE_PARTICIPATION_NON_REPLIED,
0);
} catch (boost::property_tree::ptree_bad_path& ex) {
} catch (boost::property_tree::ptree_bad_path&) {
LogPrint(eLogWarn,
"RouterProfile: Missing section ",
PEER_PROFILE_SECTION_PARTICIPATION);
Expand All @@ -163,7 +163,7 @@ void RouterProfile::Load() {
auto usage = pt.get_child(PEER_PROFILE_SECTION_USAGE);
m_NumTimesTaken = usage.get(PEER_PROFILE_USAGE_TAKEN, 0);
m_NumTimesRejected = usage.get(PEER_PROFILE_USAGE_REJECTED, 0);
} catch (boost::property_tree::ptree_bad_path& ex) {
} catch (boost::property_tree::ptree_bad_path&) {
LogPrint(eLogWarn,
"RouterProfile: missing section ", PEER_PROFILE_SECTION_USAGE);
}
Expand Down
10 changes: 5 additions & 5 deletions src/core/util/Filesystem.h
Expand Up @@ -57,26 +57,26 @@ class StringStream {
m_Stream.read(
reinterpret_cast<char *>(&buf),
static_cast<SizeCast>(std::forward<Size>(size)));
};
}

template<typename SizeCast = std::size_t, typename Offset, typename Position>
void Seekg(Offset&& off, Position& pos) {
m_Stream.seekg(
static_cast<SizeCast>(std::forward<Offset>(off)),
pos);
};
}

std::size_t Tellg() {
return m_Stream.tellg();
};
}

bool EndOfFile() {
return m_Stream.eof() ? true : false;
};
}

std::string Str() {
return m_Stream.str();
};
}

private:
std::stringstream m_Stream;
Expand Down
2 changes: 1 addition & 1 deletion src/core/util/HTTP.cpp
Expand Up @@ -104,7 +104,7 @@ void URI::Parse(
m_Host.assign(m_Host.begin(), port_i);
try {
m_Port = boost::lexical_cast<decltype(m_Port)>(m_PortString);
} catch (const std::exception& e) {
} catch (const std::exception&) {
// Keep the default port
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/util/ZIP.h
Expand Up @@ -63,7 +63,8 @@ class ZIP {
ZIP(const std::string& zip,
std::size_t len,
std::size_t pos = 0)
: m_Stream(zip),
: Descriptor(),
m_Stream(zip),
m_Data(std::make_unique<Data>()) {
m_Data->content_length = len;
m_Data->content_position = pos;
Expand Down

0 comments on commit 8230e46

Please sign in to comment.