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

Unified Diff: src/core/SkSmallAllocator.h

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/SkShader.cpp ('k') | src/core/SkSpriteBlitter_ARGB32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSmallAllocator.h
diff --git a/src/core/SkSmallAllocator.h b/src/core/SkSmallAllocator.h
index a2c132a50fdd613bcbb0949dc72ae0710d066802..c7977d36a533d4470210decba6498c7056b43096 100644
--- a/src/core/SkSmallAllocator.h
+++ b/src/core/SkSmallAllocator.h
@@ -21,7 +21,7 @@ template<typename T> void destroyT(void* ptr) {
* Template class for allocating small objects without additional heap memory
* allocations. kMaxObjects is a hard limit on the number of objects that can
* be allocated using this class. After that, attempts to create more objects
- * with this class will assert and return NULL.
+ * with this class will assert and return nullptr.
* kTotalBytes is the total number of bytes provided for storage for all
* objects created by this allocator. If an object to be created is larger
* than the storage (minus storage already used), it will be allocated on the
@@ -44,7 +44,7 @@ public:
Rec* rec = &fRecs[fNumObjects];
rec->fKillProc(rec->fObj);
// Safe to do if fObj is in fStorage, since fHeapStorage will
- // point to NULL.
+ // point to nullptr.
sk_free(rec->fHeapStorage);
}
}
@@ -54,14 +54,14 @@ public:
* SkSmallAllocator.
* Each version behaves the same but takes a different number of
* arguments.
- * Note: If kMaxObjects have been created by this SkSmallAllocator, NULL
+ * Note: If kMaxObjects have been created by this SkSmallAllocator, nullptr
* will be returned.
*/
template<typename T>
T* createT() {
void* buf = this->reserveT<T>();
- if (NULL == buf) {
- return NULL;
+ if (nullptr == buf) {
+ return nullptr;
}
new (buf) T;
return static_cast<T*>(buf);
@@ -69,8 +69,8 @@ public:
template<typename T, typename A1> T* createT(const A1& a1) {
void* buf = this->reserveT<T>();
- if (NULL == buf) {
- return NULL;
+ if (nullptr == buf) {
+ return nullptr;
}
new (buf) T(a1);
return static_cast<T*>(buf);
@@ -79,8 +79,8 @@ public:
template<typename T, typename A1, typename A2>
T* createT(const A1& a1, const A2& a2) {
void* buf = this->reserveT<T>();
- if (NULL == buf) {
- return NULL;
+ if (nullptr == buf) {
+ return nullptr;
}
new (buf) T(a1, a2);
return static_cast<T*>(buf);
@@ -89,8 +89,8 @@ public:
template<typename T, typename A1, typename A2, typename A3>
T* createT(const A1& a1, const A2& a2, const A3& a3) {
void* buf = this->reserveT<T>();
- if (NULL == buf) {
- return NULL;
+ if (nullptr == buf) {
+ return nullptr;
}
new (buf) T(a1, a2, a3);
return static_cast<T*>(buf);
@@ -99,8 +99,8 @@ public:
template<typename T, typename A1, typename A2, typename A3, typename A4>
T* createT(const A1& a1, const A2& a2, const A3& a3, const A4& a4) {
void* buf = this->reserveT<T>();
- if (NULL == buf) {
- return NULL;
+ if (nullptr == buf) {
+ return nullptr;
}
new (buf) T(a1, a2, a3, a4);
return static_cast<T*>(buf);
@@ -117,7 +117,7 @@ public:
SkASSERT(fNumObjects < kMaxObjects);
SkASSERT(storageRequired >= sizeof(T));
if (kMaxObjects == fNumObjects) {
- return NULL;
+ return nullptr;
}
const size_t storageRemaining = SkAlign4(kTotalBytes) - fStorageUsed;
storageRequired = SkAlign4(storageRequired);
@@ -133,7 +133,7 @@ public:
} else {
// There is space in fStorage.
rec->fStorageSize = storageRequired;
- rec->fHeapStorage = NULL;
+ rec->fHeapStorage = nullptr;
SkASSERT(SkIsAlign4(fStorageUsed));
rec->fObj = static_cast<void*>(fStorage + (fStorageUsed / 4));
fStorageUsed += storageRequired;
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/core/SkSpriteBlitter_ARGB32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698