summaryrefslogtreecommitdiff
path: root/src/DefaultBtAnnounce.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-25 22:43:33 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-25 22:43:33 +0900
commit4b03634f36b05c32737aeea8ca178f53f68052e8 (patch)
treec0eff13df7c53eedf96ddf546832179f8305a8fd /src/DefaultBtAnnounce.cc
parent3620d271af36a210af9c83fd6b49d13940710055 (diff)
Use PRId64 for int64_t format specifier
Diffstat (limited to 'src/DefaultBtAnnounce.cc')
-rw-r--r--src/DefaultBtAnnounce.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/DefaultBtAnnounce.cc b/src/DefaultBtAnnounce.cc
index 705ddeef..8f60285c 100644
--- a/src/DefaultBtAnnounce.cc
+++ b/src/DefaultBtAnnounce.cc
@@ -142,7 +142,7 @@ std::string DefaultBtAnnounce::getAnnounceUrl() {
numWant = 0;
}
TransferStat stat = peerStorage_->calculateStat();
- off_t left =
+ int64_t left =
pieceStorage_->getTotalLength()-pieceStorage_->getCompletedLength();
// Use last 8 bytes of peer ID as a key
const size_t keyLen = 8;
@@ -150,9 +150,9 @@ std::string DefaultBtAnnounce::getAnnounceUrl() {
uri += uriHasQuery(uri) ? "&" : "?";
uri += fmt("info_hash=%s&"
"peer_id=%s&"
- "uploaded=%lld&"
- "downloaded=%lld&"
- "left=%lld&"
+ "uploaded=%" PRId64 "&"
+ "downloaded=%" PRId64 "&"
+ "left=%" PRId64 "&"
"compact=1&"
"key=%s&"
"numwant=%d&"
@@ -162,9 +162,9 @@ std::string DefaultBtAnnounce::getAnnounceUrl() {
INFO_HASH_LENGTH).c_str(),
util::torrentPercentEncode
(bittorrent::getStaticPeerId(), PEER_ID_LENGTH).c_str(),
- static_cast<long long int>(stat.getSessionUploadLength()),
- static_cast<long long int>(stat.getSessionDownloadLength()),
- static_cast<long long int>(left),
+ stat.getSessionUploadLength(),
+ stat.getSessionDownloadLength(),
+ left,
util::torrentPercentEncode
(bittorrent::getStaticPeerId()+PEER_ID_LENGTH-keyLen,
keyLen).c_str(),