David Rose 23 anni fa
parent
commit
b1fdbd2747
2 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. 3 2
      panda/src/express/multifile.cxx
  2. 2 2
      panda/src/express/subStreamBuf.cxx

+ 3 - 2
panda/src/express/multifile.cxx

@@ -418,6 +418,7 @@ repack() {
   Filename orig_name = _multifile_name;
   temp.close();
   close();
+  orig_name.unlink();
   if (!temp_filename.rename_to(orig_name)) {
     express_cat.info()
       << "Unable to rename temporary file " << temp_filename << " to "
@@ -666,7 +667,7 @@ extract_subfile_to(int index, ostream &out) {
     byte = in.get();
   }
 
-  bool failed = in.fail();
+  bool failed = (in.fail() && !in.eof());
   close_subfile();
   nassertr(!failed, false);
 
@@ -716,7 +717,7 @@ open_read_subfile(int index) {
   // that references into the open Multifile istream.
   nassertr(_open_subfile->_data_start != (streampos)0, empty_stream);
   _subfile_substream.open(_read, _open_subfile->_data_start,
-                          _open_subfile->_data_start + _open_subfile->_data_length); 
+                          _open_subfile->_data_start + (streampos)_open_subfile->_data_length); 
   return _subfile_substream;
 }
 

+ 2 - 2
panda/src/express/subStreamBuf.cxx

@@ -110,7 +110,7 @@ seekoff(streamoff off, ios::seek_dir dir, int mode) {
 //               internal buffer is filled, plus one character.
 ////////////////////////////////////////////////////////////////////
 int SubStreamBuf::
-SubStreamBuf::overflow(int c) {
+overflow(int c) {
   // We don't support ostream.
 
   /*
@@ -178,7 +178,7 @@ underflow() {
     
     size_t buffer_size = egptr() - eback();
     size_t num_bytes;
-    if (_end - _cur > buffer_size) {
+    if (_end - _cur > (streampos)buffer_size) {
       // We have enough bytes in the input stream to fill our buffer.
       num_bytes = buffer_size;
     } else {