From d068b1b24ab0283fc9d1774b030ebdb5d40f9873 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 5 Aug 2002 15:06:04 +0000 Subject: [PATCH] vc++ sillyisms --- panda/src/express/subStreamBuf.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/panda/src/express/subStreamBuf.cxx b/panda/src/express/subStreamBuf.cxx index 8dcfc29835..289ad69bf2 100644 --- a/panda/src/express/subStreamBuf.cxx +++ b/panda/src/express/subStreamBuf.cxx @@ -111,8 +111,8 @@ seekoff(streamoff off, ios::seek_dir dir, int mode) { // egptr(). // Use this to determine the actual file position right now. - streamsize n = egptr() - gptr(); - streampos cur_pos = _cur - n; + size_t n = egptr() - gptr(); + streampos cur_pos = _cur - (streampos)n; streampos new_pos = cur_pos; // Now adjust the data pointer appropriately. @@ -126,7 +126,7 @@ seekoff(streamoff off, ios::seek_dir dir, int mode) { break; case ios::end: - if (_end == 0) { + if (_end == (streampos)0) { // If the end of the file is unspecified, we have to seek to // find it. _source->seekg(off, ios::end); @@ -175,7 +175,7 @@ overflow(int c) { //////////////////////////////////////////////////////////////////// int SubStreamBuf:: sync() { - streamsize n = egptr() - gptr(); + size_t n = egptr() - gptr(); gbump(n); return 0; @@ -200,14 +200,14 @@ underflow() { // Sometimes underflow() is called even if the buffer is not empty. if (gptr() >= egptr()) { - if (_end != 0 && _cur >= _end) { + if (_end != (streampos)0 && _cur >= _end) { // We're done. return EOF; } size_t buffer_size = egptr() - eback(); size_t num_bytes; - if (_end == 0 || _end - _cur > (streampos)buffer_size) { + if (_end == (streampos)0 || _end - _cur > (streampos)buffer_size) { // We have enough bytes in the input stream to fill our buffer. num_bytes = buffer_size; } else { @@ -226,7 +226,7 @@ underflow() { // Oops, we didn't read what we thought we would. if (read_count == 0) { _unused = buffer_size; - if (_end != 0) { + if (_end != (streampos)0) { _end = _cur; } return EOF;