Changeset 11434
- Timestamp:
- 07/18/11 09:57:05 (13 years ago)
- Location:
- trunk/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mbase/MZlib.cc
r11424 r11434 80 80 // -------------------------------------------------------------------------- 81 81 // 82 // Fill the buffer starting at the current file position and reset buffer83 // pointers by calling setg84 //85 int MZlib::fill_buffer(int iputback)86 {87 const int num = gzread(fFile, fBuffer+4, fgBufferSize-4);88 if (num <= 0) // ERROR or EOF89 return EOF;90 91 // reset buffer pointers92 setg(fBuffer+(4-iputback), fBuffer+4, fBuffer+4+num);93 94 return num;95 }96 97 // --------------------------------------------------------------------------98 //99 82 // Handle a buffer underflow (buffer went empty) 100 83 // … … 113 96 memcpy(fBuffer+(4-iputback), gptr()-iputback, iputback); 114 97 115 if (fill_buffer(iputback)==EOF) 98 // Fill the buffer starting at the current file position and reset buffer 99 // pointers by calling setg 100 const int num = gzread(fFile, fBuffer+4, fgBufferSize-4); 101 if (num <= 0) // ERROR or EOF 116 102 return EOF; 103 104 // reset buffer pointers 105 setg(fBuffer+(4-iputback), fBuffer+4, fBuffer+4+num); 117 106 118 107 // return next character … … 187 176 return EOF; 188 177 189 // Fill buffer 190 if (fill_buffer()==EOF) 191 return EOF; 178 // Buffer is empty 179 setg(fBuffer+4, fBuffer+4, fBuffer+4); 192 180 193 181 return pos; -
trunk/Mars/mbase/MZlib.h
r11433 r11434 23 23 24 24 int underflow(); 25 int fill_buffer(int putback=0);26 25 27 26 public:
Note:
See TracChangeset
for help on using the changeset viewer.