aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkTemplates.h
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-08-28 10:34:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-28 17:48:57 +0000
commita93a14a99816d25b773f0b12868143702baf44bf (patch)
tree727e7cb88867bdc12cbcf8baa354ae3afc9444e2 /include/private/SkTemplates.h
parent695db408437807d049ecc02b3b852704092728f2 (diff)
Convert NULL and 0 to nullptr.
This was created by looking at warnings produced by clang's -Wzero-as-null-pointer-constant. This updates most issues in Skia code. However, there are places where GL and Vulkan want pointer values which are explicitly 0, external headers which use NULL directly, and possibly more uses in un-compiled sources (for other platforms). Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345 Reviewed-on: https://skia-review.googlesource.com/39521 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include/private/SkTemplates.h')
-rw-r--r--include/private/SkTemplates.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/private/SkTemplates.h b/include/private/SkTemplates.h
index 919d160d0d..5ebf13ac36 100644
--- a/include/private/SkTemplates.h
+++ b/include/private/SkTemplates.h
@@ -87,14 +87,14 @@ public:
template <typename T> class SkAutoTArray : SkNoncopyable {
public:
SkAutoTArray() {
- fArray = NULL;
+ fArray = nullptr;
SkDEBUGCODE(fCount = 0;)
}
/** Allocate count number of T elements
*/
explicit SkAutoTArray(int count) {
SkASSERT(count >= 0);
- fArray = NULL;
+ fArray = nullptr;
if (count) {
fArray = new T[count];
}
@@ -106,7 +106,7 @@ public:
void reset(int count) {
delete[] fArray;
SkASSERT(count >= 0);
- fArray = NULL;
+ fArray = nullptr;
if (count) {
fArray = new T[count];
}
@@ -142,14 +142,14 @@ template <int kCountRequested, typename T> class SkAutoSTArray : SkNoncopyable {
public:
/** Initialize with no objects */
SkAutoSTArray() {
- fArray = NULL;
+ fArray = nullptr;
fCount = 0;
}
/** Allocate count number of T elements
*/
SkAutoSTArray(int count) {
- fArray = NULL;
+ fArray = nullptr;
fCount = 0;
this->reset(count);
}
@@ -184,7 +184,7 @@ public:
} else if (count > 0) {
fArray = (T*) fStorage;
} else {
- fArray = NULL;
+ fArray = nullptr;
}
fCount = count;
@@ -244,7 +244,7 @@ private:
template <typename T> class SkAutoTMalloc : SkNoncopyable {
public:
/** Takes ownership of the ptr. The ptr must be a value which can be passed to sk_free. */
- explicit SkAutoTMalloc(T* ptr = NULL) {
+ explicit SkAutoTMalloc(T* ptr = nullptr) {
fPtr = ptr;
}
@@ -308,7 +308,7 @@ public:
*/
T* release() {
T* ptr = fPtr;
- fPtr = NULL;
+ fPtr = nullptr;
return ptr;
}