aboutsummaryrefslogtreecommitdiff
path: root/common/stream.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2018-04-05 20:25:28 +0200
committerBastien Bouclet2018-05-10 08:35:46 +0200
commit955e18c64874203b6f7156835d7d8458b6fb54de (patch)
tree8a165d5aabdb7acbfabd0ca7286485f3980d4014 /common/stream.cpp
parent82296866b4f79798d1fd5085bfd91fa2fb829d6a (diff)
downloadscummvm-rg350-955e18c64874203b6f7156835d7d8458b6fb54de.tar.gz
scummvm-rg350-955e18c64874203b6f7156835d7d8458b6fb54de.tar.bz2
scummvm-rg350-955e18c64874203b6f7156835d7d8458b6fb54de.zip
COMMON: Use nullptr instead of NULL or 0 where appropriate
Diffstat (limited to 'common/stream.cpp')
-rw-r--r--common/stream.cpp16
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