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

Unified Diff: src/core/SkData.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/core/SkConvolver.cpp ('k') | src/core/SkDataTable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkData.cpp
diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp
index 4590e3bafe1c75318d529dfe64e3d115e5041f2f..9e65d2a32e28506b34282e1b8872619bff8e1c5d 100644
--- a/src/core/SkData.cpp
+++ b/src/core/SkData.cpp
@@ -26,8 +26,8 @@ SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) {
SkData::SkData(size_t size) {
fPtr = (char*)(this + 1); // contents are immediately after this
fSize = size;
- fReleaseProc = NULL;
- fReleaseProcContext = NULL;
+ fReleaseProc = nullptr;
+ fReleaseProcContext = nullptr;
}
SkData::~SkData() {
@@ -37,7 +37,7 @@ SkData::~SkData() {
}
bool SkData::equals(const SkData* other) const {
- if (NULL == other) {
+ if (nullptr == other) {
return false;
}
@@ -81,7 +81,7 @@ SkData* SkData::PrivateNewWithCopy(const void* srcOrNull, size_t length) {
///////////////////////////////////////////////////////////////////////////////
// As a template argument these must have external linkage.
-SkData* sk_new_empty_data() { return new SkData(NULL, 0, NULL, NULL); }
+SkData* sk_new_empty_data() { return new SkData(nullptr, 0, nullptr, nullptr); }
namespace { void sk_unref_data(SkData* ptr) { return SkSafeUnref(ptr); } }
SK_DECLARE_STATIC_LAZY_PTR(SkData, empty, sk_new_empty_data, sk_unref_data);
@@ -96,7 +96,7 @@ static void sk_free_releaseproc(const void* ptr, void*) {
}
SkData* SkData::NewFromMalloc(const void* data, size_t length) {
- return new SkData(data, length, sk_free_releaseproc, NULL);
+ return new SkData(data, length, sk_free_releaseproc, nullptr);
}
SkData* SkData::NewWithCopy(const void* src, size_t length) {
@@ -105,7 +105,7 @@ SkData* SkData::NewWithCopy(const void* src, size_t length) {
}
SkData* SkData::NewUninitialized(size_t length) {
- return PrivateNewWithCopy(NULL, length);
+ return PrivateNewWithCopy(nullptr, length);
}
SkData* SkData::NewWithProc(const void* ptr, size_t length, ReleaseProc proc, void* context) {
@@ -121,17 +121,17 @@ static void sk_mmap_releaseproc(const void* addr, void* ctx) {
SkData* SkData::NewFromFILE(SkFILE* f) {
size_t size;
void* addr = sk_fmmap(f, &size);
- if (NULL == addr) {
- return NULL;
+ if (nullptr == addr) {
+ return nullptr;
}
return SkData::NewWithProc(addr, size, sk_mmap_releaseproc, reinterpret_cast<void*>(size));
}
SkData* SkData::NewFromFileName(const char path[]) {
- SkFILE* f = path ? sk_fopen(path, kRead_SkFILE_Flag) : NULL;
- if (NULL == f) {
- return NULL;
+ SkFILE* f = path ? sk_fopen(path, kRead_SkFILE_Flag) : nullptr;
+ if (nullptr == f) {
+ return nullptr;
}
SkData* data = NewFromFILE(f);
sk_fclose(f);
@@ -141,11 +141,11 @@ SkData* SkData::NewFromFileName(const char path[]) {
SkData* SkData::NewFromFD(int fd) {
size_t size;
void* addr = sk_fdmmap(fd, &size);
- if (NULL == addr) {
- return NULL;
+ if (nullptr == addr) {
+ return nullptr;
}
- return SkData::NewWithProc(addr, size, sk_mmap_releaseproc, NULL);
+ return SkData::NewWithProc(addr, size, sk_mmap_releaseproc, nullptr);
}
// assumes context is a SkData
@@ -178,7 +178,7 @@ SkData* SkData::NewSubset(const SkData* src, size_t offset, size_t length) {
SkData* SkData::NewWithCString(const char cstr[]) {
size_t size;
- if (NULL == cstr) {
+ if (nullptr == cstr) {
cstr = "";
size = 1;
} else {
@@ -192,7 +192,7 @@ SkData* SkData::NewWithCString(const char cstr[]) {
SkData* SkData::NewFromStream(SkStream* stream, size_t size) {
SkAutoDataUnref data(SkData::NewUninitialized(size));
if (stream->read(data->writable_data(), size) != size) {
- return NULL;
+ return nullptr;
}
return data.detach();
}
« no previous file with comments | « src/core/SkConvolver.cpp ('k') | src/core/SkDataTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698