Sfoglia il codice sorgente

2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Fixed compile error on Mac OS X
	* src/HttpServer.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodImpl.cc
Tatsuhiro Tsujikawa 16 anni fa
parent
commit
c3129fd4a4
4 ha cambiato i file con 17 aggiunte e 4 eliminazioni
  1. 7 0
      ChangeLog
  2. 3 1
      src/HttpServer.cc
  3. 2 0
      src/XmlRpcMethod.h
  4. 5 3
      src/XmlRpcMethodImpl.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2009-05-10  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Fixed compile error on Mac OS X
+	* src/HttpServer.cc
+	* src/XmlRpcMethod.h
+	* src/XmlRpcMethodImpl.cc
+
 2009-05-10  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Use std::binary_search instead of std::find

+ 3 - 1
src/HttpServer.cc

@@ -99,7 +99,9 @@ bool HttpServer::receiveBody()
   }
   const size_t BUFLEN = 4096;
   char buf[BUFLEN];
-  size_t length = std::min(BUFLEN, _lastContentLength-_lastBody.tellg());
+  size_t length = std::min(BUFLEN,
+			   static_cast<size_t>
+			   (_lastContentLength-_lastBody.tellg()));
   _socket->readData(buf, length);
   if(length == 0 && !(_socket->wantRead() || _socket->wantWrite())) {
     throw DlAbortEx(EX_EOF_FROM_PEER);

+ 2 - 0
src/XmlRpcMethod.h

@@ -66,6 +66,8 @@ protected:
 public:
   XmlRpcMethod();
 
+  virtual ~XmlRpcMethod() {}
+
   std::string execute(const XmlRpcRequest& req, DownloadEngine* e);
 };
 

+ 5 - 3
src/XmlRpcMethodImpl.cc

@@ -168,7 +168,9 @@ static void gatherProgressCommon
 (BDE& entryDict, const SharedHandle<RequestGroup>& group)
 {
   entryDict["gid"] = Util::itos(group->getGID());
+  // This is "filtered" total length if --select-file is used.
   entryDict["totalLength"] = Util::uitos(group->getTotalLength());
+  // This is "filtered" total length if --select-file is used.
   entryDict["completedLength"] = Util::uitos(group->getCompletedLength());
   TransferStat stat = group->calculateStat();
   entryDict["downloadSpeed"] = Util::uitos(stat.getDownloadSpeed());
@@ -280,12 +282,12 @@ BDE GetFilesXmlRpcMethod::process
       btctx->getFileEntries();
 
     bool selectAll = fileIndexes.empty() || fileEntries.size() == 1;
-
-    size_t index = 1;
+    
+    int32_t index = 1;
     for(std::deque<SharedHandle<FileEntry> >::const_iterator i =
 	  fileEntries.begin(); i != fileEntries.end(); ++i, ++index) {
       BDE entry = BDE::dict();
-      entry["index"] = Util::uitos(index);
+      entry["index"] = Util::itos(index);
       entry["path"] = (*i)->getPath();
       if(selectAll ||
 	 std::binary_search(fileIndexes.begin(), fileIndexes.end(), index)) {