Browse Source

* fix compilation warnings

pull/509/merge
hagen 9 years ago
parent
commit
1b2ac38a50
  1. 2
      AddressBook.cpp
  2. 4
      Daemon.cpp
  3. 2
      Daemon.h
  4. 2
      DaemonLinux.cpp
  5. 2
      DaemonWin32.cpp
  6. 3
      HTTP.cpp
  7. 2
      HTTPServer.cpp
  8. 3
      NetDb.cpp
  9. 2
      RouterInfo.cpp
  10. 2
      Transports.cpp
  11. 2
      Tunnel.cpp
  12. 2
      Tunnel.h

2
AddressBook.cpp

@ -159,7 +159,7 @@ namespace client @@ -159,7 +159,7 @@ namespace client
int AddressBookFilesystemStorage::Save (const std::map<std::string, i2p::data::IdentHash>& addresses)
{
if (addresses.size() == 0) {
if (addresses.empty()) {
LogPrint(eLogWarning, "Addressbook: not saving empty addressbook");
return 0;
}

4
Daemon.cpp

@ -45,10 +45,10 @@ namespace i2p @@ -45,10 +45,10 @@ namespace i2p
#endif
};
Daemon_Singleton::Daemon_Singleton() : running(1), d(*new Daemon_Singleton_Private()) {};
Daemon_Singleton::Daemon_Singleton() : isDaemon(false), running(true), d(*new Daemon_Singleton_Private()) {}
Daemon_Singleton::~Daemon_Singleton() {
delete &d;
};
}
bool Daemon_Singleton::IsService () const
{

2
Daemon.h

@ -22,9 +22,7 @@ namespace i2p @@ -22,9 +22,7 @@ namespace i2p
virtual bool stop();
virtual void run () {};
bool isLogging;
bool isDaemon;
bool running;
protected:

2
DaemonLinux.cpp

@ -45,7 +45,7 @@ namespace i2p @@ -45,7 +45,7 @@ namespace i2p
{
bool DaemonLinux::start()
{
if (isDaemon == 1)
if (isDaemon)
{
pid_t pid;
pid = fork();

2
DaemonWin32.cpp

@ -45,7 +45,7 @@ namespace i2p @@ -45,7 +45,7 @@ namespace i2p
return false;
}
if (isDaemon == 1)
if (isDaemon)
{
LogPrint(eLogDebug, "Daemon: running as service");
I2PService service(SERVICE_NAME);

3
HTTP.cpp

@ -406,11 +406,10 @@ namespace http { @@ -406,11 +406,10 @@ namespace http {
bool MergeChunkedResponse (std::istream& in, std::ostream& out) {
std::string hexLen;
long int len;
while (!in.eof ()) {
std::getline (in, hexLen);
errno = 0;
len = strtoul(hexLen.c_str(), (char **) NULL, 16);
long int len = strtoul(hexLen.c_str(), (char **) NULL, 16);
if (errno != 0)
return false; /* conversion error */
if (len == 0)

2
HTTPServer.cpp

@ -667,7 +667,7 @@ namespace http { @@ -667,7 +667,7 @@ namespace http {
i2p::config::GetOption("http.auth", needAuth);
i2p::config::GetOption("http.user", user);
i2p::config::GetOption("http.pass", pass);
};
}
void HTTPConnection::Receive ()
{

3
NetDb.cpp

@ -849,7 +849,8 @@ namespace data @@ -849,7 +849,8 @@ namespace data
template<typename Filter>
std::shared_ptr<const RouterInfo> NetDb::GetRandomRouter (Filter filter) const
{
if (!m_RouterInfos.size ()) return 0;
if (m_RouterInfos.empty())
return 0;
uint32_t ind = rand () % m_RouterInfos.size ();
for (int j = 0; j < 2; j++)
{

2
RouterInfo.cpp

@ -353,7 +353,7 @@ namespace data @@ -353,7 +353,7 @@ namespace data
if (m_Caps & eReachable) caps += CAPS_FLAG_REACHABLE; // reachable
if (m_Caps & eUnreachable) caps += CAPS_FLAG_UNREACHABLE; // unreachable
SetProperty ("caps", caps.c_str ());
SetProperty ("caps", caps);
}
void RouterInfo::WriteToStream (std::ostream& s)

2
Transports.cpp

@ -606,7 +606,7 @@ namespace transport @@ -606,7 +606,7 @@ namespace transport
std::shared_ptr<const i2p::data::RouterInfo> Transports::GetRandomPeer () const
{
if (!m_Peers.size ()) return nullptr;
if (m_Peers.empty ()) return nullptr;
std::unique_lock<std::mutex> l(m_PeersMutex);
auto it = m_Peers.begin ();
std::advance (it, rand () % m_Peers.size ());

2
Tunnel.cpp

@ -358,7 +358,7 @@ namespace tunnel @@ -358,7 +358,7 @@ namespace tunnel
std::shared_ptr<OutboundTunnel> Tunnels::GetNextOutboundTunnel ()
{
if (!m_OutboundTunnels.size ()) return nullptr;
if (m_OutboundTunnels.empty ()) return nullptr;
uint32_t ind = rand () % m_OutboundTunnels.size (), i = 0;
std::shared_ptr<OutboundTunnel> tunnel;
for (auto it: m_OutboundTunnels)

2
Tunnel.h

@ -73,7 +73,7 @@ namespace tunnel @@ -73,7 +73,7 @@ namespace tunnel
bool HandleTunnelBuildResponse (uint8_t * msg, size_t len);
virtual void Print (std::stringstream& s) const {};
virtual void Print (std::stringstream&) const {};
// implements TunnelBase
void SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg);

Loading…
Cancel
Save