Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: src/utils/SkFrontBufferedStream.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkInterpolator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkFrontBufferedStream.cpp
diff --git a/src/utils/SkFrontBufferedStream.cpp b/src/utils/SkFrontBufferedStream.cpp
index 08364d15ebeaced04c755179c177ed221fee9a8d..0955cfaf712b7c8296ab4eecb4cb36042a5698cc 100644
--- a/src/utils/SkFrontBufferedStream.cpp
+++ b/src/utils/SkFrontBufferedStream.cpp
@@ -30,7 +30,7 @@ public:
size_t getLength() const override { return fLength; }
- SkStreamRewindable* duplicate() const override { return NULL; }
+ SkStreamRewindable* duplicate() const override { return nullptr; }
private:
SkAutoTDelete<SkStream> fStream;
@@ -44,21 +44,21 @@ private:
// Total size of the buffer.
const size_t fBufferSize;
// FIXME: SkAutoTMalloc throws on failure. Instead, Create should return a
- // NULL stream.
+ // nullptr stream.
SkAutoTMalloc<char> fBuffer;
// Read up to size bytes from already buffered data, and copy to
- // dst, if non-NULL. Updates fOffset. Assumes that fOffset is less
+ // dst, if non-nullptr. Updates fOffset. Assumes that fOffset is less
// than fBufferedSoFar.
size_t readFromBuffer(char* dst, size_t size);
// Buffer up to size bytes from the stream, and copy to dst if non-
- // NULL. Updates fOffset and fBufferedSoFar. Assumes that fOffset is
+ // nullptr. Updates fOffset and fBufferedSoFar. Assumes that fOffset is
// less than fBufferedSoFar, and size is greater than 0.
size_t bufferAndWriteTo(char* dst, size_t size);
// Read up to size bytes directly from the stream and into dst if non-
- // NULL. Updates fOffset. Assumes fOffset is at or beyond the buffered
+ // nullptr. Updates fOffset. Assumes fOffset is at or beyond the buffered
// data, and size is greater than 0.
size_t readDirectlyFromStream(char* dst, size_t size);
@@ -66,8 +66,8 @@ private:
};
SkStreamRewindable* SkFrontBufferedStream::Create(SkStream* stream, size_t bufferSize) {
- if (NULL == stream) {
- return NULL;
+ if (nullptr == stream) {
+ return nullptr;
}
return new FrontBufferedStream(stream, bufferSize);
}
@@ -106,7 +106,7 @@ size_t FrontBufferedStream::readFromBuffer(char* dst, size_t size) {
// lesser of the size requested and the remainder of the buffered
// data.
const size_t bytesToCopy = SkTMin(size, fBufferedSoFar - fOffset);
- if (dst != NULL) {
+ if (dst != nullptr) {
memcpy(dst, fBuffer + fOffset, bytesToCopy);
}
@@ -133,7 +133,7 @@ size_t FrontBufferedStream::bufferAndWriteTo(char* dst, size_t size) {
SkASSERT(fBufferedSoFar <= fBufferSize);
// Copy the buffer to the destination buffer and update the amount read.
- if (dst != NULL) {
+ if (dst != nullptr) {
memcpy(dst, buffer, buffered);
}
@@ -185,7 +185,7 @@ size_t FrontBufferedStream::read(void* voidDst, size_t size) {
// and the destination buffer.
size -= bytesCopied;
SkASSERT(size + (fOffset - start) == totalSize);
- if (dst != NULL) {
+ if (dst != nullptr) {
dst += bytesCopied;
}
}
@@ -199,7 +199,7 @@ size_t FrontBufferedStream::read(void* voidDst, size_t size) {
// and the destination buffer.
size -= buffered;
SkASSERT(size + (fOffset - start) == totalSize);
- if (dst != NULL) {
+ if (dst != nullptr) {
dst += buffered;
}
}
« no previous file with comments | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkInterpolator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698