Browse Source

fix cast warning (#512)

Nicolas Schneider 5 years ago
parent
commit
05e8b22989
1 changed files with 3 additions and 3 deletions
  1. 3 3
      httplib.h

+ 3 - 3
httplib.h

@@ -1543,7 +1543,7 @@ inline void read_file(const std::string &path, std::string &out) {
   auto size = fs.tellg();
   auto size = fs.tellg();
   fs.seekg(0);
   fs.seekg(0);
   out.resize(static_cast<size_t>(size));
   out.resize(static_cast<size_t>(size));
-  fs.read(&out[0], size);
+  fs.read(&out[0], static_cast<std::streamsize>(size));
 }
 }
 
 
 inline std::string file_extension(const std::string &path) {
 inline std::string file_extension(const std::string &path) {
@@ -2929,8 +2929,8 @@ private:
 
 
   std::string buf_;
   std::string buf_;
   size_t state_ = 0;
   size_t state_ = 0;
-  size_t is_valid_ = false;
-  size_t is_done_ = false;
+  bool is_valid_ = false;
+  bool is_done_ = false;
   size_t off_ = 0;
   size_t off_ = 0;
   MultipartFormData file_;
   MultipartFormData file_;
 };
 };