@@ -255,7 +255,7 @@ class CDataStream
255255 void SetVersion (int n) { nVersion = n; }
256256 int GetVersion () { return nVersion; }
257257
258- CDataStream& read (char * pch, size_t nSize)
258+ void read (char * pch, size_t nSize)
259259 {
260260 // Read from the beginning of the buffer
261261 unsigned int nReadPosNext = nReadPos + nSize;
@@ -268,14 +268,13 @@ class CDataStream
268268 memcpy (pch, &vch[nReadPos], nSize);
269269 nReadPos = 0 ;
270270 vch.clear ();
271- return (* this ) ;
271+ return ;
272272 }
273273 memcpy (pch, &vch[nReadPos], nSize);
274274 nReadPos = nReadPosNext;
275- return (*this );
276275 }
277276
278- CDataStream& ignore (int nSize)
277+ void ignore (int nSize)
279278 {
280279 // Ignore from the beginning of the buffer
281280 if (nSize < 0 ) {
@@ -288,17 +287,15 @@ class CDataStream
288287 throw std::ios_base::failure (" CDataStream::ignore(): end of data" );
289288 nReadPos = 0 ;
290289 vch.clear ();
291- return (* this ) ;
290+ return ;
292291 }
293292 nReadPos = nReadPosNext;
294- return (*this );
295293 }
296294
297- CDataStream& write (const char * pch, size_t nSize)
295+ void write (const char * pch, size_t nSize)
298296 {
299297 // Write to the end of the buffer
300298 vch.insert (vch.end (), pch, pch + nSize);
301- return (*this );
302299 }
303300
304301 template <typename Stream>
@@ -433,16 +430,15 @@ class CAutoFile
433430 void SetVersion (int n) { nVersion = n; }
434431 int GetVersion () { return nVersion; }
435432
436- CAutoFile& read (char * pch, size_t nSize)
433+ void read (char * pch, size_t nSize)
437434 {
438435 if (!file)
439436 throw std::ios_base::failure (" CAutoFile::read: file handle is NULL" );
440437 if (fread (pch, 1 , nSize, file) != nSize)
441438 throw std::ios_base::failure (feof (file) ? " CAutoFile::read: end of file" : " CAutoFile::read: fread failed" );
442- return (*this );
443439 }
444440
445- CAutoFile& ignore (size_t nSize)
441+ void ignore (size_t nSize)
446442 {
447443 if (!file)
448444 throw std::ios_base::failure (" CAutoFile::ignore: file handle is NULL" );
@@ -453,16 +449,14 @@ class CAutoFile
453449 throw std::ios_base::failure (feof (file) ? " CAutoFile::ignore: end of file" : " CAutoFile::read: fread failed" );
454450 nSize -= nNow;
455451 }
456- return (*this );
457452 }
458453
459- CAutoFile& write (const char * pch, size_t nSize)
454+ void write (const char * pch, size_t nSize)
460455 {
461456 if (!file)
462457 throw std::ios_base::failure (" CAutoFile::write: file handle is NULL" );
463458 if (fwrite (pch, 1 , nSize, file) != nSize)
464459 throw std::ios_base::failure (" CAutoFile::write: write failed" );
465- return (*this );
466460 }
467461
468462 template <typename T>
@@ -563,7 +557,7 @@ class CBufferedFile
563557 }
564558
565559 // read a number of bytes
566- CBufferedFile& read (char *pch, size_t nSize) {
560+ void read (char *pch, size_t nSize) {
567561 if (nSize + nReadPos > nReadLimit)
568562 throw std::ios_base::failure (" Read attempted past buffer limit" );
569563 if (nSize + nRewind > vchBuf.size ())
@@ -582,7 +576,6 @@ class CBufferedFile
582576 pch += nNow;
583577 nSize -= nNow;
584578 }
585- return (*this );
586579 }
587580
588581 // return the current reading position
0 commit comments