diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-06-07 12:36:27 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-06-07 12:36:27 +0000 |
| commit | 8adb77dc29f16b881b7b4faa6cbce85b5c808b0b (patch) | |
| tree | f9a08b429e0786a75b2bba5b71260437c727d6a1 | |
| parent | 23d04f0cc37971006c2db6ffe863ee6e58353c14 (diff) | |
2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compiler warnings on netbsd
* src/DHTConnectionImpl.cc
* src/PeerListenCommand.cc
* src/PeerSessionResource.cc
* src/SegmentMan.cc
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | src/DHTConnectionImpl.cc | 2 | ||||
| -rw-r--r-- | src/PeerListenCommand.cc | 2 | ||||
| -rw-r--r-- | src/PeerSessionResource.cc | 2 | ||||
| -rw-r--r-- | src/SegmentMan.cc | 3 |
5 files changed, 13 insertions, 4 deletions
@@ -1,5 +1,13 @@ 2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> + Fixed compiler warnings on netbsd + * src/DHTConnectionImpl.cc + * src/PeerListenCommand.cc + * src/PeerSessionResource.cc + * src/SegmentMan.cc + +2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> + Updated Ukrainian translation. Thanks to all translators. * po/uk.po diff --git a/src/DHTConnectionImpl.cc b/src/DHTConnectionImpl.cc index e84b7c5d..96088ab3 100644 --- a/src/DHTConnectionImpl.cc +++ b/src/DHTConnectionImpl.cc @@ -60,7 +60,7 @@ bool DHTConnectionImpl::bind(uint16_t& port, IntSequence& ports) for(std::deque<int32_t>::const_iterator portItr = randPorts.begin(); portItr != randPorts.end(); ++portItr) { - if(!(0 < (*portItr) && (*portItr) <= UINT16_MAX)) { + if(!(0 < (*portItr) && (*portItr) <= 65535)) { continue; } port = (*portItr); diff --git a/src/PeerListenCommand.cc b/src/PeerListenCommand.cc index fa9306f4..ae9be4b4 100644 --- a/src/PeerListenCommand.cc +++ b/src/PeerListenCommand.cc @@ -77,7 +77,7 @@ bool PeerListenCommand::bindPort(uint16_t& port, IntSequence& seq) for(std::deque<int32_t>::const_iterator portItr = randPorts.begin(); portItr != randPorts.end(); ++portItr) { - if(!(0 < (*portItr) && (*portItr) <= UINT16_MAX)) { + if(!(0 < (*portItr) && (*portItr) <= 65535)) { continue; } port = (*portItr); diff --git a/src/PeerSessionResource.cc b/src/PeerSessionResource.cc index 8c8849e8..44780e26 100644 --- a/src/PeerSessionResource.cc +++ b/src/PeerSessionResource.cc @@ -237,7 +237,7 @@ void PeerSessionResource::dhtEnabled(bool b) void PeerSessionResource::updateLatency(unsigned int latency) { - _latency = _latency*0.2+latency*0.8; + _latency = static_cast<unsigned int>(_latency*0.2+latency*0.8); } uint64_t PeerSessionResource::uploadLength() const diff --git a/src/SegmentMan.cc b/src/SegmentMan.cc index bb82fe98..33ed1709 100644 --- a/src/SegmentMan.cc +++ b/src/SegmentMan.cc @@ -132,7 +132,8 @@ SegmentHandle SegmentMan::checkoutSegment(cuid_t cuid, SegmentEntryHandle SegmentMan::findSlowerSegmentEntry (const PeerStatHandle& peerStat) { - unsigned int speed = peerStat->getAvgDownloadSpeed()*0.8; + unsigned int speed = + static_cast<unsigned int>(peerStat->getAvgDownloadSpeed()*0.8); SegmentEntryHandle slowSegmentEntry; int startupIdleTime = _option->getAsInt(PREF_STARTUP_IDLE_TIME); for(std::deque<SharedHandle<SegmentEntry> >::const_iterator itr = |
