فهرست منبع

build on msvs2010

David Rose 14 سال پیش
والد
کامیت
255b1ffffa

+ 1 - 1
direct/src/plugin/p3dHost.cxx

@@ -798,7 +798,7 @@ copy_file(const string &from_filename, const string &to_filename) {
   char buffer[buffer_size];
   
   in.read(buffer, buffer_size);
-  size_t count = in.gcount();
+  streamsize count = in.gcount();
   while (count != 0) {
     out.write(buffer, count);
     if (out.fail()) {

+ 4 - 4
direct/src/plugin/p3dMainObject.cxx

@@ -149,7 +149,7 @@ set_property(const string &property, bool needs_response, P3D_object *value) {
   // First, we set the property locally.
   if (value != NULL) {
     Properties::iterator pi;
-    pi = _properties.insert(Properties::value_type(property, NULL)).first;
+    pi = _properties.insert(Properties::value_type(property, (P3D_object *)NULL)).first;
     assert(pi != _properties.end());
     P3D_object *orig_value = (*pi).second;
     if (orig_value != value) {
@@ -673,7 +673,7 @@ read_log_file(const string &log_pathname,
   if (full_bytes > 0) {
     log.seekg(0, ios::beg);
     log.read(buffer, full_bytes);
-    size_t read_bytes = log.gcount();
+    streamsize read_bytes = log.gcount();
     assert(read_bytes < buffer_bytes);
     buffer[read_bytes] = '\0';
     log_data << "== PandaLog-" << "Full Start";
@@ -687,7 +687,7 @@ read_log_file(const string &log_pathname,
   if (head_bytes > 0) {
     log.seekg(0, ios::beg);
     log.read(buffer, head_bytes);
-    size_t read_bytes = log.gcount();
+    streamsize read_bytes = log.gcount();
     assert(read_bytes < buffer_bytes);
     buffer[read_bytes] = '\0';
     log_data << "== PandaLog-" << "Head Start";
@@ -707,7 +707,7 @@ read_log_file(const string &log_pathname,
   if (tail_bytes > 0) {
     log.seekg(file_size - tail_bytes, ios::beg);
     log.read(buffer, tail_bytes);
-    size_t read_bytes = log.gcount();
+    streamsize read_bytes = log.gcount();
     assert(read_bytes < buffer_bytes);
     buffer[read_bytes] = '\0';
     log_data << "== PandaLog-" << "Tail Start";

+ 6 - 6
direct/src/plugin/p3dMultifileReader.cxx

@@ -375,12 +375,12 @@ bool P3DMultifileReader::
 extract_subfile(ostream &out, const Subfile &s) {
   _in.seekg(s._data_start + _read_offset);
 
-  static const size_t buffer_size = 4096;
+  static const streamsize buffer_size = 4096;
   char buffer[buffer_size];
   
-  size_t remaining_data = s._data_length;
+  streamsize remaining_data = s._data_length;
   _in.read(buffer, min(buffer_size, remaining_data));
-  size_t count = _in.gcount();
+  streamsize count = _in.gcount();
   while (count != 0) {
     remaining_data -= count;
     out.write(buffer, count);
@@ -485,13 +485,13 @@ check_signatures() {
       // _last_data_byte.
       _in.seekg(_read_offset);
       streampos bytes_remaining = (streampos)_last_data_byte;
-      static const size_t buffer_size = 4096;
+      static const streamsize buffer_size = 4096;
       char buffer[buffer_size];
       _in.read(buffer, min((streampos)buffer_size, bytes_remaining));
-      size_t count = _in.gcount();
+      streamsize count = _in.gcount();
       while (count != 0) {
         assert(count <= buffer_size);
-        EVP_VerifyUpdate(md_ctx, buffer, count);
+        EVP_VerifyUpdate(md_ctx, buffer, (size_t)count);
         bytes_remaining -= count;
         _in.read(buffer, min((streampos)buffer_size, bytes_remaining));
         count = _in.gcount();

+ 4 - 4
direct/src/plugin/p3dPackage.cxx

@@ -1903,11 +1903,11 @@ thread_step() {
   int flush = 0;
 
   source.read(decompress_buffer, decompress_buffer_size);
-  size_t read_count = source.gcount();
+  streamsize read_count = source.gcount();
   eof = (read_count == 0 || source.eof() || source.fail());
   
   z.next_in = (Bytef *)decompress_buffer;
-  z.avail_in = read_count;
+  z.avail_in = (size_t)read_count;
 
   int result = inflateInit(&z);
   if (result < 0) {
@@ -1918,11 +1918,11 @@ thread_step() {
   while (true) {
     if (z.avail_in == 0 && !eof) {
       source.read(decompress_buffer, decompress_buffer_size);
-      size_t read_count = source.gcount();
+      streamsize read_count = source.gcount();
       eof = (read_count == 0 || source.eof() || source.fail());
         
       z.next_in = (Bytef *)decompress_buffer;
-      z.avail_in = read_count;
+      z.avail_in = (size_t)read_count;
     }
 
     z.next_out = (Bytef *)write_buffer;

+ 4 - 4
direct/src/plugin/p3dPatchfileReader.cxx

@@ -271,12 +271,12 @@ copy_bytes(istream &in, size_t copy_byte_count) {
   static const size_t buffer_size = 8192;
   char buffer[buffer_size];
 
-  size_t read_size = min(copy_byte_count, buffer_size);
+  streamsize read_size = min(copy_byte_count, buffer_size);
   in.read(buffer, read_size);
-  size_t count = in.gcount();
+  streamsize count = in.gcount();
   while (count != 0) {
     _target_out.write(buffer, count);
-    _bytes_written += count;
+    _bytes_written += (size_t)count;
     if (_bytes_written > _target_length) {
       nout << "Runaway patchfile.\n";
       return false;
@@ -284,7 +284,7 @@ copy_bytes(istream &in, size_t copy_byte_count) {
     if (count != read_size) {
       return false;
     }
-    copy_byte_count -= count;
+    copy_byte_count -= (size_t)count;
     count = 0;
     if (copy_byte_count != 0) {
       read_size = min(copy_byte_count, buffer_size);