changeset 4360:4301722b3225

fix for msvc2015
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Dec 2020 18:07:12 +0100
parents 074f37013186
children 98f55e7df5ab
files OrthancFramework/Sources/Compression/ZipReader.cpp OrthancFramework/Sources/HttpServer/MultipartStreamReader.cpp
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Compression/ZipReader.cpp	Tue Dec 08 16:48:58 2020 +0100
+++ b/OrthancFramework/Sources/Compression/ZipReader.cpp	Tue Dec 08 18:07:12 2020 +0100
@@ -36,7 +36,8 @@
 #endif
 
 #if defined(_MSC_VER)
-#  include <BaseTsd.h>   // Definition of ssize_t
+#  include <BaseTsd.h>   // Definition of SSIZE_T
+typedef SSIZE_T ssize_t;
 #endif
 
 #include <string.h>
@@ -91,7 +92,7 @@
         }
       
         pos_ += s;
-        return s;
+        return static_cast<uLong>(s);
       }             
     }
 
@@ -318,7 +319,8 @@
 
       filename.resize(info.size_filename);
       if (!filename.empty() &&
-          unzGetCurrentFileInfo64(pimpl_->unzip_, &info, &filename[0], filename.size(), NULL, 0, NULL, 0) != 0)
+          unzGetCurrentFileInfo64(pimpl_->unzip_, &info, &filename[0],
+                                  static_cast<uLong>(filename.size()), NULL, 0, NULL, 0) != 0)
       {
         throw OrthancException(ErrorCode_BadFileFormat);
       }
@@ -329,7 +331,8 @@
       {
         if (unzOpenCurrentFile(pimpl_->unzip_) == 0)
         {
-          bool success = (unzReadCurrentFile(pimpl_->unzip_, &content[0], content.size()) != 0);
+          bool success = (unzReadCurrentFile(pimpl_->unzip_, &content[0],
+                                             static_cast<uLong>(content.size())) != 0);
                           
           if (unzCloseCurrentFile(pimpl_->unzip_) != 0 ||
               !success)
--- a/OrthancFramework/Sources/HttpServer/MultipartStreamReader.cpp	Tue Dec 08 16:48:58 2020 +0100
+++ b/OrthancFramework/Sources/HttpServer/MultipartStreamReader.cpp	Tue Dec 08 18:07:12 2020 +0100
@@ -29,9 +29,6 @@
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/lexical_cast.hpp>
 
-#if defined(_MSC_VER)
-#  include <BaseTsd.h>   // Definition of ssize_t
-#endif
 
 namespace Orthanc
 {