diff options
Diffstat (limited to 'common/stream.cpp')
-rw-r--r-- | common/stream.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/stream.cpp b/common/stream.cpp index 0a5fa94ac3..5c9b571af4 100644 --- a/common/stream.cpp +++ b/common/stream.cpp @@ -135,7 +135,7 @@ enum { }; char *SeekableReadStream::readLine(char *buf, size_t bufSize) { - assert(buf != 0 && bufSize > 1); + assert(buf != nullptr && bufSize > 1); char *p = buf; size_t len = 0; char c = 0; @@ -143,7 +143,7 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) { // If end-of-file occurs before any characters are read, return NULL // and the buffer contents remain unchanged. if (eos() || err()) { - return 0; + return nullptr; } // Loop as long as there is still free space in the buffer, @@ -155,7 +155,7 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) { // If end-of-file occurs before any characters are read, return // NULL and the buffer contents remain unchanged. if (len == 0) - return 0; + return nullptr; break; } @@ -163,7 +163,7 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) { // If an error occurs, return NULL and the buffer contents // are indeterminate. if (err()) - return 0; + return nullptr; // Check for CR or CR/LF // * DOS and Windows use CRLF line breaks @@ -174,7 +174,7 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) { c = readByte(); if (err()) { - return 0; // error: the buffer contents are indeterminate + return nullptr; // error: the buffer contents are indeterminate } if (eos()) { // The CR was the last character in the file. @@ -382,7 +382,7 @@ uint32 BufferedReadStream::read(void *dataPtr, uint32 dataSize) { ReadStream *wrapBufferedReadStream(ReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream) { if (parentStream) return new BufferedReadStream(parentStream, bufSize, disposeParentStream); - return 0; + return nullptr; } #pragma mark - @@ -459,7 +459,7 @@ bool BufferedSeekableReadStream::seek(int32 offset, int whence) { SeekableReadStream *wrapBufferedSeekableReadStream(SeekableReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream) { if (parentStream) return new BufferedSeekableReadStream(parentStream, bufSize, disposeParentStream); - return 0; + return nullptr; } #pragma mark - @@ -543,7 +543,7 @@ public: WriteStream *wrapBufferedWriteStream(WriteStream *parentStream, uint32 bufSize) { if (parentStream) return new BufferedWriteStream(parentStream, bufSize); - return 0; + return nullptr; } } // End of namespace Common |