From a93a14a99816d25b773f0b12868143702baf44bf Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 28 Aug 2017 10:34:05 -0400 Subject: 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 Commit-Queue: Ben Wagner --- include/views/SkEvent.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'include/views') diff --git a/include/views/SkEvent.h b/include/views/SkEvent.h index b78fd6fc1d..091b7080a2 100644 --- a/include/views/SkEvent.h +++ b/include/views/SkEvent.h @@ -80,7 +80,7 @@ public: * called (if not NULL). */ SkEvent* setTargetID(SkEventSinkID targetID) { - fTargetProc = NULL; + fTargetProc = nullptr; fTargetID = targetID; return this; } @@ -122,17 +122,23 @@ public: in value (if value is non-null). If there is no matching named field, return false and ignore the value parameter. */ - bool findS32(const char name[], int32_t* value = NULL) const { return fMeta.findS32(name, value); } + bool findS32(const char name[], int32_t* value = nullptr) const { + return fMeta.findS32(name, value); + } /** Return true if the event contains the named SkScalar field, and return the field in value (if value is non-null). If there is no matching named field, return false and ignore the value parameter. */ - bool findScalar(const char name[], SkScalar* value = NULL) const { return fMeta.findScalar(name, value); } + bool findScalar(const char name[], SkScalar* value = nullptr) const { + return fMeta.findScalar(name, value); + } /** Return true if the event contains the named SkScalar field, and return the fields in value[] (if value is non-null), and return the number of SkScalars in count (if count is non-null). If there is no matching named field, return false and ignore the value and count parameters. */ - const SkScalar* findScalars(const char name[], int* count, SkScalar values[] = NULL) const { return fMeta.findScalars(name, count, values); } + const SkScalar* findScalars(const char name[], int* count, SkScalar values[] = nullptr) const { + return fMeta.findScalars(name, count, values); + } /** Return the value of the named string field, or if no matching named field exists, return null. */ const char* findString(const char name[]) const { return fMeta.findString(name); } @@ -142,7 +148,7 @@ public: */ bool findPtr(const char name[], void** value) const { return fMeta.findPtr(name, value); } bool findBool(const char name[], bool* value) const { return fMeta.findBool(name, value); } - const void* findData(const char name[], size_t* byteCount = NULL) const { + const void* findData(const char name[], size_t* byteCount = nullptr) const { return fMeta.findData(name, byteCount); } @@ -164,7 +170,9 @@ public: /** Add/replace the named SkScalar field to the event. In XML use the subelement */ void setScalar(const char name[], SkScalar value) { fMeta.setScalar(name, value); } /** Add/replace the named SkScalar[] field to the event. */ - SkScalar* setScalars(const char name[], int count, const SkScalar values[] = NULL) { return fMeta.setScalars(name, count, values); } + SkScalar* setScalars(const char name[], int count, const SkScalar values[] = nullptr) { + return fMeta.setScalars(name, count, values); + } /** Add/replace the named string field to the event. In XML use the subelement