fixes for VC

This commit is contained in:
David Rose 2002-08-02 23:23:45 +00:00
parent e202ad39ad
commit b1fdbd2747
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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 {