aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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 /src
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 'src')
-rw-r--r--src/c/sk_effects.cpp8
-rw-r--r--src/core/SkBuffer.cpp2
-rw-r--r--src/core/SkBuffer.h10
-rw-r--r--src/core/SkCanvas.cpp2
-rw-r--r--src/core/SkClipStack.h4
-rw-r--r--src/core/SkColorTable.h2
-rw-r--r--src/core/SkDevice.h6
-rw-r--r--src/core/SkDraw.h12
-rw-r--r--src/core/SkMipMap.cpp2
-rw-r--r--src/core/SkOSFile.h4
-rw-r--r--src/core/SkPath.cpp4
-rw-r--r--src/core/SkTInternalLList.h50
-rw-r--r--src/core/SkTextBlob.cpp2
-rw-r--r--src/core/SkUtils.h6
-rw-r--r--src/gpu/GrAutoLocaleSetter.h4
-rw-r--r--src/gpu/GrDrawingManager.h2
-rw-r--r--src/gpu/GrGpuResourceRef.h2
-rw-r--r--src/gpu/GrResourceProvider.cpp2
-rw-r--r--src/gpu/gl/GrGLGpu.cpp2
-rw-r--r--src/gpu/vk/GrVkBuffer.cpp2
-rw-r--r--src/gpu/vk/GrVkCommandBuffer.cpp4
-rw-r--r--src/gpu/vk/GrVkGpu.cpp6
-rw-r--r--src/gpu/vk/GrVkImage.cpp2
-rw-r--r--src/gpu/vk/GrVkInterface.cpp276
-rw-r--r--src/gpu/vk/GrVkMemory.cpp4
-rw-r--r--src/ports/SkOSFile_posix.cpp4
-rw-r--r--src/ports/SkOSFile_stdio.cpp6
-rw-r--r--src/views/SkEventSink.cpp2
-rw-r--r--src/xml/SkDOM.h6
-rw-r--r--src/xml/SkXMLParser.h2
30 files changed, 220 insertions, 220 deletions
diff --git a/src/c/sk_effects.cpp b/src/c/sk_effects.cpp
index f3a31a54bb..d3bb62cb5e 100644
--- a/src/c/sk_effects.cpp
+++ b/src/c/sk_effects.cpp
@@ -54,7 +54,7 @@ sk_shader_t* sk_shader_new_linear_gradient(const sk_point_t pts[2],
const sk_matrix_t* cmatrix) {
SkShader::TileMode mode;
if (!from_c_tilemode(cmode, &mode)) {
- return NULL;
+ return nullptr;
}
SkMatrix matrix;
if (cmatrix) {
@@ -81,7 +81,7 @@ sk_shader_t* sk_shader_new_radial_gradient(const sk_point_t* ccenter,
const sk_matrix_t* cmatrix) {
SkShader::TileMode mode;
if (!from_c_tilemode(cmode, &mode)) {
- return NULL;
+ return nullptr;
}
SkMatrix matrix;
if (cmatrix) {
@@ -125,7 +125,7 @@ sk_shader_t* sk_shader_new_two_point_conical_gradient(const sk_point_t* start,
const sk_matrix_t* cmatrix) {
SkShader::TileMode mode;
if (!from_c_tilemode(cmode, &mode)) {
- return NULL;
+ return nullptr;
}
SkMatrix matrix;
if (cmatrix) {
@@ -180,7 +180,7 @@ void sk_maskfilter_unref(sk_maskfilter_t* cfilter) {
sk_maskfilter_t* sk_maskfilter_new_blur(sk_blurstyle_t cstyle, float sigma) {
SkBlurStyle style;
if (!find_blurstyle(cstyle, &style)) {
- return NULL;
+ return nullptr;
}
return ToMaskFilter(SkBlurMaskFilter::Make(style, sigma).release());
}
diff --git a/src/core/SkBuffer.cpp b/src/core/SkBuffer.cpp
index 7fd4170c8f..b7cf8b2b87 100644
--- a/src/core/SkBuffer.cpp
+++ b/src/core/SkBuffer.cpp
@@ -45,7 +45,7 @@ void* SkWBuffer::skip(size_t size) {
}
void SkWBuffer::writeNoSizeCheck(const void* buffer, size_t size) {
- SkASSERT(fData == 0 || fStop == 0 || fPos + size <= fStop);
+ SkASSERT(fData == nullptr || fStop == nullptr || fPos + size <= fStop);
if (fData && buffer)
memcpy(fPos, buffer, size);
fPos += size;
diff --git a/src/core/SkBuffer.h b/src/core/SkBuffer.h
index c9c1a8e686..dd7f95aa3c 100644
--- a/src/core/SkBuffer.h
+++ b/src/core/SkBuffer.h
@@ -21,12 +21,12 @@
*/
class SkRBuffer : SkNoncopyable {
public:
- SkRBuffer() : fData(0), fPos(0), fStop(0) {}
+ SkRBuffer() : fData(nullptr), fPos(nullptr), fStop(nullptr) {}
/** Initialize RBuffer with a data point and length.
*/
SkRBuffer(const void* data, size_t size) {
- SkASSERT(data != 0 || size == 0);
+ SkASSERT(data != nullptr || size == 0);
fData = (const char*)data;
fPos = (const char*)data;
fStop = (const char*)data + size;
@@ -77,18 +77,18 @@ private:
*/
class SkWBuffer : SkNoncopyable {
public:
- SkWBuffer() : fData(0), fPos(0), fStop(0) {}
+ SkWBuffer() : fData(nullptr), fPos(nullptr), fStop(nullptr) {}
SkWBuffer(void* data) { reset(data); }
SkWBuffer(void* data, size_t size) { reset(data, size); }
void reset(void* data) {
fData = (char*)data;
fPos = (char*)data;
- fStop = 0; // no bounds checking
+ fStop = nullptr; // no bounds checking
}
void reset(void* data, size_t size) {
- SkASSERT(data != 0 || size == 0);
+ SkASSERT(data != nullptr || size == 0);
fData = (char*)data;
fPos = (char*)data;
fStop = (char*)data + size;
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 6edaff9bc2..f1b42e6975 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1058,7 +1058,7 @@ void SkCanvas::internalSaveLayer(const SaveLayerRec& rec, SaveLayerStrategy stra
SaveLayerFlags saveLayerFlags = rec.fSaveLayerFlags;
SkLazyPaint lazyP;
- SkImageFilter* imageFilter = paint ? paint->getImageFilter() : NULL;
+ SkImageFilter* imageFilter = paint ? paint->getImageFilter() : nullptr;
SkMatrix stashedMatrix = fMCRec->fMatrix;
SkMatrix remainder;
SkSize scale;
diff --git a/src/core/SkClipStack.h b/src/core/SkClipStack.h
index 466df6cab9..84acb3c51c 100644
--- a/src/core/SkClipStack.h
+++ b/src/core/SkClipStack.h
@@ -298,7 +298,7 @@ public:
*/
void getBounds(SkRect* canvFiniteBound,
BoundsType* boundType,
- bool* isIntersectionOfRects = NULL) const;
+ bool* isIntersectionOfRects = nullptr) const;
SkRect bounds(const SkIRect& deviceBounds) const;
bool isEmpty(const SkIRect& deviceBounds) const;
@@ -464,7 +464,7 @@ public:
int maxWidth,
int maxHeight,
SkRect* devBounds,
- bool* isIntersectionOfRects = NULL) const;
+ bool* isIntersectionOfRects = nullptr) const;
private:
friend class Iter;
diff --git a/src/core/SkColorTable.h b/src/core/SkColorTable.h
index ef8712d1d8..c56e6fe917 100644
--- a/src/core/SkColorTable.h
+++ b/src/core/SkColorTable.h
@@ -37,7 +37,7 @@ public:
* the index is in range (0 <= index < count).
*/
SkPMColor operator[](int index) const {
- SkASSERT(fColors != NULL && (unsigned)index < (unsigned)fCount);
+ SkASSERT(fColors != nullptr && (unsigned)index < (unsigned)fCount);
return fColors[index];
}
diff --git a/src/core/SkDevice.h b/src/core/SkDevice.h
index c531b1e18b..3bd12ab36a 100644
--- a/src/core/SkDevice.h
+++ b/src/core/SkDevice.h
@@ -198,7 +198,7 @@ protected:
*/
virtual void drawPath(const SkPath& path,
const SkPaint& paint,
- const SkMatrix* prePathMatrix = NULL,
+ const SkMatrix* prePathMatrix = nullptr,
bool pathIsMutable = false) = 0;
virtual void drawBitmap(const SkBitmap& bitmap,
SkScalar x,
@@ -340,7 +340,7 @@ protected:
* it could not call drawDevice with it (but it could call drawSprite or drawBitmap).
*/
virtual SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) {
- return NULL;
+ return nullptr;
}
// A helper function used by derived classes to log the scale factor of a bitmap or image draw.
@@ -377,7 +377,7 @@ private:
*/
virtual void flush() {}
- virtual SkImageFilterCache* getImageFilterCache() { return NULL; }
+ virtual SkImageFilterCache* getImageFilterCache() { return nullptr; }
friend class SkNoPixelsDevice;
friend class SkBitmapDevice;
diff --git a/src/core/SkDraw.h b/src/core/SkDraw.h
index f2941948b7..ab1fda75c7 100644
--- a/src/core/SkDraw.h
+++ b/src/core/SkDraw.h
@@ -39,7 +39,7 @@ public:
void drawRect(const SkRect& prePaintRect, const SkPaint&, const SkMatrix* paintMatrix,
const SkRect* postPaintRect) const;
void drawRect(const SkRect& rect, const SkPaint& paint) const {
- this->drawRect(rect, paint, NULL, NULL);
+ this->drawRect(rect, paint, nullptr, nullptr);
}
void drawRRect(const SkRRect&, const SkPaint&) const;
/**
@@ -57,8 +57,8 @@ public:
}
void drawPath(const SkPath& path, const SkPaint& paint,
- SkBlitter* customBlitter = NULL) const {
- this->drawPath(path, paint, NULL, false, false, customBlitter);
+ SkBlitter* customBlitter = nullptr) const {
+ this->drawPath(path, paint, nullptr, false, false, customBlitter);
}
/* If dstOrNull is null, computes a dst by mapping the bitmap's bounds through the matrix. */
@@ -83,10 +83,10 @@ public:
* Only device A8 is supported right now.
*/
void drawPathCoverage(const SkPath& src, const SkPaint& paint,
- SkBlitter* customBlitter = NULL) const {
+ SkBlitter* customBlitter = nullptr) const {
bool isHairline = paint.getStyle() == SkPaint::kStroke_Style &&
paint.getStrokeWidth() > 0;
- this->drawPath(src, paint, NULL, false, !isHairline, customBlitter);
+ this->drawPath(src, paint, nullptr, false, !isHairline, customBlitter);
}
/** Helper function that creates a mask from a path and an optional maskfilter.
@@ -131,7 +131,7 @@ private:
void drawPath(const SkPath&, const SkPaint&, const SkMatrix* preMatrix,
bool pathIsMutable, bool drawCoverage,
- SkBlitter* customBlitter = NULL) const;
+ SkBlitter* customBlitter = nullptr) const;
void drawLine(const SkPoint[2], const SkPaint&) const;
void drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawCoverage,
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index b3766e5cc2..0d4aba72fb 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -791,7 +791,7 @@ int SkMipMap::countLevels() const {
}
bool SkMipMap::getLevel(int index, Level* levelPtr) const {
- if (NULL == fLevels) {
+ if (nullptr == fLevels) {
return false;
}
if (index < 0) {
diff --git a/src/core/SkOSFile.h b/src/core/SkOSFile.h
index 88ad958b1c..ddbcc2b264 100644
--- a/src/core/SkOSFile.h
+++ b/src/core/SkOSFile.h
@@ -80,10 +80,10 @@ public:
class Iter {
public:
Iter();
- Iter(const char path[], const char suffix[] = NULL);
+ Iter(const char path[], const char suffix[] = nullptr);
~Iter();
- void reset(const char path[], const char suffix[] = NULL);
+ void reset(const char path[], const char suffix[] = nullptr);
/** If getDir is true, only returns directories.
Results are undefined if true and false calls are
interleaved on a single iterator.
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 8aecf1b624..32ec2c560b 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1877,8 +1877,8 @@ const SkPoint& SkPath::Iter::cons_moveTo() {
void SkPath::Iter::consumeDegenerateSegments(bool exact) {
// We need to step over anything that will not move the current draw point
// forward before the next move is seen
- const uint8_t* lastMoveVerb = 0;
- const SkPoint* lastMovePt = 0;
+ const uint8_t* lastMoveVerb = nullptr;
+ const SkPoint* lastMovePt = nullptr;
const SkScalar* lastMoveWeight = nullptr;
SkPoint lastPt = fLastPt;
while (fVerbs != fVerbStop) {
diff --git a/src/core/SkTInternalLList.h b/src/core/SkTInternalLList.h
index 00a8743976..ef4b74f633 100644
--- a/src/core/SkTInternalLList.h
+++ b/src/core/SkTInternalLList.h
@@ -15,7 +15,7 @@
*/
template <typename T> class SkPtrWrapper {
public:
- SkPtrWrapper() : fPtr(NULL) {}
+ SkPtrWrapper() : fPtr(nullptr) {}
SkPtrWrapper& operator =(T* ptr) { fPtr = ptr; return *this; }
operator T*() const { return fPtr; }
T* operator->() { return fPtr; }
@@ -41,8 +41,8 @@ template <typename T> class SkPtrWrapper {
template <class T> class SkTInternalLList : SkNoncopyable {
public:
SkTInternalLList()
- : fHead(NULL)
- , fTail(NULL) {
+ : fHead(nullptr)
+ , fTail(nullptr) {
}
void remove(T* entry) {
@@ -63,25 +63,25 @@ public:
fTail = prev;
}
- entry->fPrev = NULL;
- entry->fNext = NULL;
+ entry->fPrev = nullptr;
+ entry->fNext = nullptr;
#ifdef SK_DEBUG
- entry->fList = NULL;
+ entry->fList = nullptr;
#endif
}
void addToHead(T* entry) {
- SkASSERT(NULL == entry->fPrev && NULL == entry->fNext);
- SkASSERT(NULL == entry->fList);
+ SkASSERT(nullptr == entry->fPrev && nullptr == entry->fNext);
+ SkASSERT(nullptr == entry->fList);
- entry->fPrev = NULL;
+ entry->fPrev = nullptr;
entry->fNext = fHead;
if (fHead) {
fHead->fPrev = entry;
}
fHead = entry;
- if (NULL == fTail) {
+ if (nullptr == fTail) {
fTail = entry;
}
@@ -91,16 +91,16 @@ public:
}
void addToTail(T* entry) {
- SkASSERT(NULL == entry->fPrev && NULL == entry->fNext);
- SkASSERT(NULL == entry->fList);
+ SkASSERT(nullptr == entry->fPrev && nullptr == entry->fNext);
+ SkASSERT(nullptr == entry->fList);
entry->fPrev = fTail;
- entry->fNext = NULL;
+ entry->fNext = nullptr;
if (fTail) {
fTail->fNext = entry;
}
fTail = entry;
- if (NULL == fHead) {
+ if (nullptr == fHead) {
fHead = entry;
}
@@ -117,7 +117,7 @@ public:
void addBefore(T* newEntry, T* existingEntry) {
SkASSERT(newEntry);
- if (NULL == existingEntry) {
+ if (nullptr == existingEntry) {
this->addToTail(newEntry);
return;
}
@@ -127,7 +127,7 @@ public:
T* prev = existingEntry->fPrev;
existingEntry->fPrev = newEntry;
newEntry->fPrev = prev;
- if (NULL == prev) {
+ if (nullptr == prev) {
SkASSERT(fHead == existingEntry);
fHead = newEntry;
} else {
@@ -146,7 +146,7 @@ public:
void addAfter(T* newEntry, T* existingEntry) {
SkASSERT(newEntry);
- if (NULL == existingEntry) {
+ if (nullptr == existingEntry) {
this->addToHead(newEntry);
return;
}
@@ -156,7 +156,7 @@ public:
T* next = existingEntry->fNext;
existingEntry->fNext = newEntry;
newEntry->fNext = next;
- if (NULL == next) {
+ if (nullptr == next) {
SkASSERT(fTail == existingEntry);
fTail = newEntry;
} else {
@@ -207,7 +207,7 @@ public:
kTail_IterStart
};
- Iter() : fCurr(NULL) {}
+ Iter() : fCurr(nullptr) {}
Iter(const Iter& iter) : fCurr(iter.fCurr) {}
Iter& operator= (const Iter& iter) { fCurr = iter.fCurr; return *this; }
@@ -228,8 +228,8 @@ public:
* Return the next/previous element in the list or NULL if at the end.
*/
T* next() {
- if (NULL == fCurr) {
- return NULL;
+ if (nullptr == fCurr) {
+ return nullptr;
}
fCurr = fCurr->fNext;
@@ -237,8 +237,8 @@ public:
}
T* prev() {
- if (NULL == fCurr) {
- return NULL;
+ if (nullptr == fCurr) {
+ return nullptr;
}
fCurr = fCurr->fPrev;
@@ -255,12 +255,12 @@ public:
Iter iter;
for (T* item = iter.init(*this, Iter::kHead_IterStart); item; item = iter.next()) {
SkASSERT(this->isInList(item));
- if (NULL == item->fPrev) {
+ if (nullptr == item->fPrev) {
SkASSERT(fHead == item);
} else {
SkASSERT(item->fPrev->fNext == item);
}
- if (NULL == item->fNext) {
+ if (nullptr == item->fNext) {
SkASSERT(fTail == item);
} else {
SkASSERT(item->fNext->fPrev == item);
diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp
index 77ec429325..c72399bed1 100644
--- a/src/core/SkTextBlob.cpp
+++ b/src/core/SkTextBlob.cpp
@@ -423,7 +423,7 @@ SkRect SkTextBlobBuilder::TightRunBounds(const SkTextBlob::RunRecord& run) {
SkAutoSTArray<16, SkRect> glyphBounds(run.glyphCount());
paint.getTextWidths(run.glyphBuffer(),
run.glyphCount() * sizeof(uint16_t),
- NULL,
+ nullptr,
glyphBounds.get());
SkASSERT(SkTextBlob::kFull_Positioning == run.positioning() ||
diff --git a/src/core/SkUtils.h b/src/core/SkUtils.h
index 832bdbd8fd..d894467ce6 100644
--- a/src/core/SkUtils.h
+++ b/src/core/SkUtils.h
@@ -75,7 +75,7 @@ SkUnichar SkUTF8_PrevUnichar(const char**);
into a utf8 sequence. Will be 1..kMaxBytesInUTF8Sequence,
or 0 if uni is illegal.
*/
-size_t SkUTF8_FromUnichar(SkUnichar uni, char utf8[] = NULL);
+size_t SkUTF8_FromUnichar(SkUnichar uni, char utf8[] = nullptr);
///////////////////////////////////////////////////////////////////////////////
@@ -88,10 +88,10 @@ int SkUTF16_CountUnichars(const uint16_t utf16[], int numberOf16BitValues);
SkUnichar SkUTF16_NextUnichar(const uint16_t**);
// this guy backs up to the previus unichar value, and returns it (*--p)
SkUnichar SkUTF16_PrevUnichar(const uint16_t**);
-size_t SkUTF16_FromUnichar(SkUnichar uni, uint16_t utf16[] = NULL);
+size_t SkUTF16_FromUnichar(SkUnichar uni, uint16_t utf16[] = nullptr);
size_t SkUTF16_ToUTF8(const uint16_t utf16[], int numberOf16BitValues,
- char utf8[] = NULL);
+ char utf8[] = nullptr);
inline bool SkUnichar_IsVariationSelector(SkUnichar uni) {
/* The 'true' ranges are:
diff --git a/src/gpu/GrAutoLocaleSetter.h b/src/gpu/GrAutoLocaleSetter.h
index 9cfa6374d4..c373b78e97 100644
--- a/src/gpu/GrAutoLocaleSetter.h
+++ b/src/gpu/GrAutoLocaleSetter.h
@@ -54,11 +54,11 @@ public:
name = nullptr;
}
#endif
- fLocale = newlocale(LC_ALL_MASK, name, 0);
+ fLocale = newlocale(LC_ALL_MASK, name, nullptr);
if (fLocale) {
fOldLocale = uselocale(fLocale);
} else {
- fOldLocale = static_cast<locale_t>(0);
+ fOldLocale = static_cast<locale_t>(nullptr);
}
#else
(void) name; // suppress unused param warning.
diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h
index 6a1ad19d93..0143783708 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -60,7 +60,7 @@ public:
GrPathRenderer* getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args,
bool allowSW,
GrPathRendererChain::DrawType drawType,
- GrPathRenderer::StencilSupport* stencilSupport = NULL);
+ GrPathRenderer::StencilSupport* stencilSupport = nullptr);
void flushIfNecessary() {
if (fContext->getResourceCache()->requestsFlush()) {
diff --git a/src/gpu/GrGpuResourceRef.h b/src/gpu/GrGpuResourceRef.h
index a56674b494..866521a912 100644
--- a/src/gpu/GrGpuResourceRef.h
+++ b/src/gpu/GrGpuResourceRef.h
@@ -173,7 +173,7 @@ private:
*/
template <typename T, GrIOType IO_TYPE> class GrPendingIOResource : SkNoncopyable {
public:
- GrPendingIOResource(T* resource = NULL) : fResource(NULL) {
+ GrPendingIOResource(T* resource = nullptr) : fResource(nullptr) {
this->reset(resource);
}
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 1979570fe0..a02280854e 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -287,7 +287,7 @@ GrTexture* GrResourceProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& k
SkASSERT(texture);
return texture;
}
- return NULL;
+ return nullptr;
}
void GrResourceProvider::assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) {
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 594312071f..36c26dceb3 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1543,7 +1543,7 @@ int GrGLGpu::getCompatibleStencilIndex(GrPixelConfig config) {
0,
externalFormat,
externalType,
- NULL));
+ nullptr));
if (GR_GL_NO_ERROR != CHECK_ALLOC_ERROR(this->glInterface())) {
GL_CALL(DeleteTextures(1, &colorID));
return -1;
diff --git a/src/gpu/vk/GrVkBuffer.cpp b/src/gpu/vk/GrVkBuffer.cpp
index b2af229de3..a93a16e3cc 100644
--- a/src/gpu/vk/GrVkBuffer.cpp
+++ b/src/gpu/vk/GrVkBuffer.cpp
@@ -88,7 +88,7 @@ void GrVkBuffer::addMemoryBarrier(const GrVkGpu* gpu,
bool byRegion) const {
VkBufferMemoryBarrier bufferMemoryBarrier = {
VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // sType
- NULL, // pNext
+ nullptr, // pNext
srcAccessMask, // srcAccessMask
dstAccesMask, // dstAccessMask
VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex
diff --git a/src/gpu/vk/GrVkCommandBuffer.cpp b/src/gpu/vk/GrVkCommandBuffer.cpp
index c44d12128e..8a17a4f033 100644
--- a/src/gpu/vk/GrVkCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkCommandBuffer.cpp
@@ -344,7 +344,7 @@ GrVkPrimaryCommandBuffer* GrVkPrimaryCommandBuffer::Create(const GrVkGpu* gpu,
VkCommandPool cmdPool) {
const VkCommandBufferAllocateInfo cmdInfo = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
cmdPool, // commandPool
VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
1 // bufferCount
@@ -751,7 +751,7 @@ GrVkSecondaryCommandBuffer* GrVkSecondaryCommandBuffer::Create(const GrVkGpu* gp
VkCommandPool cmdPool) {
const VkCommandBufferAllocateInfo cmdInfo = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
cmdPool, // commandPool
VK_COMMAND_BUFFER_LEVEL_SECONDARY, // level
1 // bufferCount
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 83d28decb6..f32a83a610 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1070,7 +1070,7 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) {
VkImageAspectFlags aspectFlags = VK_IMAGE_ASPECT_COLOR_BIT;
VkImageMemoryBarrier imageMemoryBarrier = {
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType
- NULL, // pNext
+ nullptr, // pNext
VK_ACCESS_TRANSFER_WRITE_BIT, // srcAccessMask
VK_ACCESS_TRANSFER_READ_BIT, // dstAccessMask
VK_IMAGE_LAYOUT_GENERAL, // oldLayout
@@ -1213,7 +1213,7 @@ GrBackendObject GrVkGpu::createTestingOnlyBackendTexture(void* srcData, int w, i
const VkImageCreateInfo imageCreateInfo = {
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
0, // VkImageCreateFlags
VK_IMAGE_TYPE_2D, // VkImageType
pixelFormat, // VkFormat
@@ -1295,7 +1295,7 @@ GrBackendObject GrVkGpu::createTestingOnlyBackendTexture(void* srcData, int w, i
const VkCommandBufferAllocateInfo cmdInfo = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
fCmdPool, // commandPool
VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level
1 // bufferCount
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp
index 5a9f69d455..c3a47dcfdc 100644
--- a/src/gpu/vk/GrVkImage.cpp
+++ b/src/gpu/vk/GrVkImage.cpp
@@ -90,7 +90,7 @@ bool GrVkImage::InitImageInfo(const GrVkGpu* gpu, const ImageDesc& imageDesc, Gr
const VkImageCreateInfo imageCreateInfo = {
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
createFlags, // VkImageCreateFlags
imageDesc.fImageType, // VkImageType
imageDesc.fFormat, // VkFormat
diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp
index 4188943b17..dedc264136 100644
--- a/src/gpu/vk/GrVkInterface.cpp
+++ b/src/gpu/vk/GrVkInterface.cpp
@@ -200,148 +200,148 @@ GrVkInterface::GrVkInterface(GetProc getProc,
bool GrVkInterface::validate(uint32_t extensionFlags) const {
// functions that are always required
- if (NULL == fFunctions.fCreateInstance ||
- NULL == fFunctions.fDestroyInstance ||
- NULL == fFunctions.fEnumeratePhysicalDevices ||
- NULL == fFunctions.fGetPhysicalDeviceFeatures ||
- NULL == fFunctions.fGetPhysicalDeviceFormatProperties ||
- NULL == fFunctions.fGetPhysicalDeviceImageFormatProperties ||
- NULL == fFunctions.fGetPhysicalDeviceProperties ||
- NULL == fFunctions.fGetPhysicalDeviceQueueFamilyProperties ||
- NULL == fFunctions.fGetPhysicalDeviceMemoryProperties ||
- NULL == fFunctions.fCreateDevice ||
- NULL == fFunctions.fDestroyDevice ||
- NULL == fFunctions.fEnumerateInstanceExtensionProperties ||
- NULL == fFunctions.fEnumerateDeviceExtensionProperties ||
- NULL == fFunctions.fEnumerateInstanceLayerProperties ||
- NULL == fFunctions.fEnumerateDeviceLayerProperties ||
- NULL == fFunctions.fGetDeviceQueue ||
- NULL == fFunctions.fQueueSubmit ||
- NULL == fFunctions.fQueueWaitIdle ||
- NULL == fFunctions.fDeviceWaitIdle ||
- NULL == fFunctions.fAllocateMemory ||
- NULL == fFunctions.fFreeMemory ||
- NULL == fFunctions.fMapMemory ||
- NULL == fFunctions.fUnmapMemory ||
- NULL == fFunctions.fFlushMappedMemoryRanges ||
- NULL == fFunctions.fInvalidateMappedMemoryRanges ||
- NULL == fFunctions.fGetDeviceMemoryCommitment ||
- NULL == fFunctions.fBindBufferMemory ||
- NULL == fFunctions.fBindImageMemory ||
- NULL == fFunctions.fGetBufferMemoryRequirements ||
- NULL == fFunctions.fGetImageMemoryRequirements ||
- NULL == fFunctions.fGetImageSparseMemoryRequirements ||
- NULL == fFunctions.fGetPhysicalDeviceSparseImageFormatProperties ||
- NULL == fFunctions.fQueueBindSparse ||
- NULL == fFunctions.fCreateFence ||
- NULL == fFunctions.fDestroyFence ||
- NULL == fFunctions.fResetFences ||
- NULL == fFunctions.fGetFenceStatus ||
- NULL == fFunctions.fWaitForFences ||
- NULL == fFunctions.fCreateSemaphore ||
- NULL == fFunctions.fDestroySemaphore ||
- NULL == fFunctions.fCreateEvent ||
- NULL == fFunctions.fDestroyEvent ||
- NULL == fFunctions.fGetEventStatus ||
- NULL == fFunctions.fSetEvent ||
- NULL == fFunctions.fResetEvent ||
- NULL == fFunctions.fCreateQueryPool ||
- NULL == fFunctions.fDestroyQueryPool ||
- NULL == fFunctions.fGetQueryPoolResults ||
- NULL == fFunctions.fCreateBuffer ||
- NULL == fFunctions.fDestroyBuffer ||
- NULL == fFunctions.fCreateBufferView ||
- NULL == fFunctions.fDestroyBufferView ||
- NULL == fFunctions.fCreateImage ||
- NULL == fFunctions.fDestroyImage ||
- NULL == fFunctions.fGetImageSubresourceLayout ||
- NULL == fFunctions.fCreateImageView ||
- NULL == fFunctions.fDestroyImageView ||
- NULL == fFunctions.fCreateShaderModule ||
- NULL == fFunctions.fDestroyShaderModule ||
- NULL == fFunctions.fCreatePipelineCache ||
- NULL == fFunctions.fDestroyPipelineCache ||
- NULL == fFunctions.fGetPipelineCacheData ||
- NULL == fFunctions.fMergePipelineCaches ||
- NULL == fFunctions.fCreateGraphicsPipelines ||
- NULL == fFunctions.fCreateComputePipelines ||
- NULL == fFunctions.fDestroyPipeline ||
- NULL == fFunctions.fCreatePipelineLayout ||
- NULL == fFunctions.fDestroyPipelineLayout ||
- NULL == fFunctions.fCreateSampler ||
- NULL == fFunctions.fDestroySampler ||
- NULL == fFunctions.fCreateDescriptorSetLayout ||
- NULL == fFunctions.fDestroyDescriptorSetLayout ||
- NULL == fFunctions.fCreateDescriptorPool ||
- NULL == fFunctions.fDestroyDescriptorPool ||
- NULL == fFunctions.fResetDescriptorPool ||
- NULL == fFunctions.fAllocateDescriptorSets ||
- NULL == fFunctions.fFreeDescriptorSets ||
- NULL == fFunctions.fUpdateDescriptorSets ||
- NULL == fFunctions.fCreateFramebuffer ||
- NULL == fFunctions.fDestroyFramebuffer ||
- NULL == fFunctions.fCreateRenderPass ||
- NULL == fFunctions.fDestroyRenderPass ||
- NULL == fFunctions.fGetRenderAreaGranularity ||
- NULL == fFunctions.fCreateCommandPool ||
- NULL == fFunctions.fDestroyCommandPool ||
- NULL == fFunctions.fResetCommandPool ||
- NULL == fFunctions.fAllocateCommandBuffers ||
- NULL == fFunctions.fFreeCommandBuffers ||
- NULL == fFunctions.fBeginCommandBuffer ||
- NULL == fFunctions.fEndCommandBuffer ||
- NULL == fFunctions.fResetCommandBuffer ||
- NULL == fFunctions.fCmdBindPipeline ||
- NULL == fFunctions.fCmdSetViewport ||
- NULL == fFunctions.fCmdSetScissor ||
- NULL == fFunctions.fCmdSetLineWidth ||
- NULL == fFunctions.fCmdSetDepthBias ||
- NULL == fFunctions.fCmdSetBlendConstants ||
- NULL == fFunctions.fCmdSetDepthBounds ||
- NULL == fFunctions.fCmdSetStencilCompareMask ||
- NULL == fFunctions.fCmdSetStencilWriteMask ||
- NULL == fFunctions.fCmdSetStencilReference ||
- NULL == fFunctions.fCmdBindDescriptorSets ||
- NULL == fFunctions.fCmdBindIndexBuffer ||
- NULL == fFunctions.fCmdBindVertexBuffers ||
- NULL == fFunctions.fCmdDraw ||
- NULL == fFunctions.fCmdDrawIndexed ||
- NULL == fFunctions.fCmdDrawIndirect ||
- NULL == fFunctions.fCmdDrawIndexedIndirect ||
- NULL == fFunctions.fCmdDispatch ||
- NULL == fFunctions.fCmdDispatchIndirect ||
- NULL == fFunctions.fCmdCopyBuffer ||
- NULL == fFunctions.fCmdCopyImage ||
- NULL == fFunctions.fCmdBlitImage ||
- NULL == fFunctions.fCmdCopyBufferToImage ||
- NULL == fFunctions.fCmdCopyImageToBuffer ||
- NULL == fFunctions.fCmdUpdateBuffer ||
- NULL == fFunctions.fCmdFillBuffer ||
- NULL == fFunctions.fCmdClearColorImage ||
- NULL == fFunctions.fCmdClearDepthStencilImage ||
- NULL == fFunctions.fCmdClearAttachments ||
- NULL == fFunctions.fCmdResolveImage ||
- NULL == fFunctions.fCmdSetEvent ||
- NULL == fFunctions.fCmdResetEvent ||
- NULL == fFunctions.fCmdWaitEvents ||
- NULL == fFunctions.fCmdPipelineBarrier ||
- NULL == fFunctions.fCmdBeginQuery ||
- NULL == fFunctions.fCmdEndQuery ||
- NULL == fFunctions.fCmdResetQueryPool ||
- NULL == fFunctions.fCmdWriteTimestamp ||
- NULL == fFunctions.fCmdCopyQueryPoolResults ||
- NULL == fFunctions.fCmdPushConstants ||
- NULL == fFunctions.fCmdBeginRenderPass ||
- NULL == fFunctions.fCmdNextSubpass ||
- NULL == fFunctions.fCmdEndRenderPass ||
- NULL == fFunctions.fCmdExecuteCommands) {
+ if (nullptr == fFunctions.fCreateInstance ||
+ nullptr == fFunctions.fDestroyInstance ||
+ nullptr == fFunctions.fEnumeratePhysicalDevices ||
+ nullptr == fFunctions.fGetPhysicalDeviceFeatures ||
+ nullptr == fFunctions.fGetPhysicalDeviceFormatProperties ||
+ nullptr == fFunctions.fGetPhysicalDeviceImageFormatProperties ||
+ nullptr == fFunctions.fGetPhysicalDeviceProperties ||
+ nullptr == fFunctions.fGetPhysicalDeviceQueueFamilyProperties ||
+ nullptr == fFunctions.fGetPhysicalDeviceMemoryProperties ||
+ nullptr == fFunctions.fCreateDevice ||
+ nullptr == fFunctions.fDestroyDevice ||
+ nullptr == fFunctions.fEnumerateInstanceExtensionProperties ||
+ nullptr == fFunctions.fEnumerateDeviceExtensionProperties ||
+ nullptr == fFunctions.fEnumerateInstanceLayerProperties ||
+ nullptr == fFunctions.fEnumerateDeviceLayerProperties ||
+ nullptr == fFunctions.fGetDeviceQueue ||
+ nullptr == fFunctions.fQueueSubmit ||
+ nullptr == fFunctions.fQueueWaitIdle ||
+ nullptr == fFunctions.fDeviceWaitIdle ||
+ nullptr == fFunctions.fAllocateMemory ||
+ nullptr == fFunctions.fFreeMemory ||
+ nullptr == fFunctions.fMapMemory ||
+ nullptr == fFunctions.fUnmapMemory ||
+ nullptr == fFunctions.fFlushMappedMemoryRanges ||
+ nullptr == fFunctions.fInvalidateMappedMemoryRanges ||
+ nullptr == fFunctions.fGetDeviceMemoryCommitment ||
+ nullptr == fFunctions.fBindBufferMemory ||
+ nullptr == fFunctions.fBindImageMemory ||
+ nullptr == fFunctions.fGetBufferMemoryRequirements ||
+ nullptr == fFunctions.fGetImageMemoryRequirements ||
+ nullptr == fFunctions.fGetImageSparseMemoryRequirements ||
+ nullptr == fFunctions.fGetPhysicalDeviceSparseImageFormatProperties ||
+ nullptr == fFunctions.fQueueBindSparse ||
+ nullptr == fFunctions.fCreateFence ||
+ nullptr == fFunctions.fDestroyFence ||
+ nullptr == fFunctions.fResetFences ||
+ nullptr == fFunctions.fGetFenceStatus ||
+ nullptr == fFunctions.fWaitForFences ||
+ nullptr == fFunctions.fCreateSemaphore ||
+ nullptr == fFunctions.fDestroySemaphore ||
+ nullptr == fFunctions.fCreateEvent ||
+ nullptr == fFunctions.fDestroyEvent ||
+ nullptr == fFunctions.fGetEventStatus ||
+ nullptr == fFunctions.fSetEvent ||
+ nullptr == fFunctions.fResetEvent ||
+ nullptr == fFunctions.fCreateQueryPool ||
+ nullptr == fFunctions.fDestroyQueryPool ||
+ nullptr == fFunctions.fGetQueryPoolResults ||
+ nullptr == fFunctions.fCreateBuffer ||
+ nullptr == fFunctions.fDestroyBuffer ||
+ nullptr == fFunctions.fCreateBufferView ||
+ nullptr == fFunctions.fDestroyBufferView ||
+ nullptr == fFunctions.fCreateImage ||
+ nullptr == fFunctions.fDestroyImage ||
+ nullptr == fFunctions.fGetImageSubresourceLayout ||
+ nullptr == fFunctions.fCreateImageView ||
+ nullptr == fFunctions.fDestroyImageView ||
+ nullptr == fFunctions.fCreateShaderModule ||
+ nullptr == fFunctions.fDestroyShaderModule ||
+ nullptr == fFunctions.fCreatePipelineCache ||
+ nullptr == fFunctions.fDestroyPipelineCache ||
+ nullptr == fFunctions.fGetPipelineCacheData ||
+ nullptr == fFunctions.fMergePipelineCaches ||
+ nullptr == fFunctions.fCreateGraphicsPipelines ||
+ nullptr == fFunctions.fCreateComputePipelines ||
+ nullptr == fFunctions.fDestroyPipeline ||
+ nullptr == fFunctions.fCreatePipelineLayout ||
+ nullptr == fFunctions.fDestroyPipelineLayout ||
+ nullptr == fFunctions.fCreateSampler ||
+ nullptr == fFunctions.fDestroySampler ||
+ nullptr == fFunctions.fCreateDescriptorSetLayout ||
+ nullptr == fFunctions.fDestroyDescriptorSetLayout ||
+ nullptr == fFunctions.fCreateDescriptorPool ||
+ nullptr == fFunctions.fDestroyDescriptorPool ||
+ nullptr == fFunctions.fResetDescriptorPool ||
+ nullptr == fFunctions.fAllocateDescriptorSets ||
+ nullptr == fFunctions.fFreeDescriptorSets ||
+ nullptr == fFunctions.fUpdateDescriptorSets ||
+ nullptr == fFunctions.fCreateFramebuffer ||
+ nullptr == fFunctions.fDestroyFramebuffer ||
+ nullptr == fFunctions.fCreateRenderPass ||
+ nullptr == fFunctions.fDestroyRenderPass ||
+ nullptr == fFunctions.fGetRenderAreaGranularity ||
+ nullptr == fFunctions.fCreateCommandPool ||
+ nullptr == fFunctions.fDestroyCommandPool ||
+ nullptr == fFunctions.fResetCommandPool ||
+ nullptr == fFunctions.fAllocateCommandBuffers ||
+ nullptr == fFunctions.fFreeCommandBuffers ||
+ nullptr == fFunctions.fBeginCommandBuffer ||
+ nullptr == fFunctions.fEndCommandBuffer ||
+ nullptr == fFunctions.fResetCommandBuffer ||
+ nullptr == fFunctions.fCmdBindPipeline ||
+ nullptr == fFunctions.fCmdSetViewport ||
+ nullptr == fFunctions.fCmdSetScissor ||
+ nullptr == fFunctions.fCmdSetLineWidth ||
+ nullptr == fFunctions.fCmdSetDepthBias ||
+ nullptr == fFunctions.fCmdSetBlendConstants ||
+ nullptr == fFunctions.fCmdSetDepthBounds ||
+ nullptr == fFunctions.fCmdSetStencilCompareMask ||
+ nullptr == fFunctions.fCmdSetStencilWriteMask ||
+ nullptr == fFunctions.fCmdSetStencilReference ||
+ nullptr == fFunctions.fCmdBindDescriptorSets ||
+ nullptr == fFunctions.fCmdBindIndexBuffer ||
+ nullptr == fFunctions.fCmdBindVertexBuffers ||
+ nullptr == fFunctions.fCmdDraw ||
+ nullptr == fFunctions.fCmdDrawIndexed ||
+ nullptr == fFunctions.fCmdDrawIndirect ||
+ nullptr == fFunctions.fCmdDrawIndexedIndirect ||
+ nullptr == fFunctions.fCmdDispatch ||
+ nullptr == fFunctions.fCmdDispatchIndirect ||
+ nullptr == fFunctions.fCmdCopyBuffer ||
+ nullptr == fFunctions.fCmdCopyImage ||
+ nullptr == fFunctions.fCmdBlitImage ||
+ nullptr == fFunctions.fCmdCopyBufferToImage ||
+ nullptr == fFunctions.fCmdCopyImageToBuffer ||
+ nullptr == fFunctions.fCmdUpdateBuffer ||
+ nullptr == fFunctions.fCmdFillBuffer ||
+ nullptr == fFunctions.fCmdClearColorImage ||
+ nullptr == fFunctions.fCmdClearDepthStencilImage ||
+ nullptr == fFunctions.fCmdClearAttachments ||
+ nullptr == fFunctions.fCmdResolveImage ||
+ nullptr == fFunctions.fCmdSetEvent ||
+ nullptr == fFunctions.fCmdResetEvent ||
+ nullptr == fFunctions.fCmdWaitEvents ||
+ nullptr == fFunctions.fCmdPipelineBarrier ||
+ nullptr == fFunctions.fCmdBeginQuery ||
+ nullptr == fFunctions.fCmdEndQuery ||
+ nullptr == fFunctions.fCmdResetQueryPool ||
+ nullptr == fFunctions.fCmdWriteTimestamp ||
+ nullptr == fFunctions.fCmdCopyQueryPoolResults ||
+ nullptr == fFunctions.fCmdPushConstants ||
+ nullptr == fFunctions.fCmdBeginRenderPass ||
+ nullptr == fFunctions.fCmdNextSubpass ||
+ nullptr == fFunctions.fCmdEndRenderPass ||
+ nullptr == fFunctions.fCmdExecuteCommands) {
RETURN_FALSE_INTERFACE
}
if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
- if (NULL == fFunctions.fCreateDebugReportCallbackEXT ||
- NULL == fFunctions.fDebugReportMessageEXT ||
- NULL == fFunctions.fDestroyDebugReportCallbackEXT) {
+ if (nullptr == fFunctions.fCreateDebugReportCallbackEXT ||
+ nullptr == fFunctions.fDebugReportMessageEXT ||
+ nullptr == fFunctions.fDestroyDebugReportCallbackEXT) {
RETURN_FALSE_INTERFACE
}
}
diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp
index 31dea10ac4..0496a5463c 100644
--- a/src/gpu/vk/GrVkMemory.cpp
+++ b/src/gpu/vk/GrVkMemory.cpp
@@ -472,7 +472,7 @@ GrVkSubHeap::GrVkSubHeap(const GrVkGpu* gpu, uint32_t memoryTypeIndex, uint32_t
VkMemoryAllocateInfo allocInfo = {
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
size, // allocationSize
memoryTypeIndex, // memoryTypeIndex
};
@@ -518,7 +518,7 @@ bool GrVkHeap::subAlloc(VkDeviceSize size, VkDeviceSize alignment,
if (alignedSize > fSubHeapSize) {
VkMemoryAllocateInfo allocInfo = {
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType
- NULL, // pNext
+ nullptr, // pNext
size, // allocationSize
memoryTypeIndex, // memoryTypeIndex
};
diff --git a/src/ports/SkOSFile_posix.cpp b/src/ports/SkOSFile_posix.cpp
index 48b5b95ad3..448a5c8c9f 100644
--- a/src/ports/SkOSFile_posix.cpp
+++ b/src/ports/SkOSFile_posix.cpp
@@ -110,7 +110,7 @@ size_t sk_qread(FILE* file, void* buffer, size_t count, size_t offset) {
////////////////////////////////////////////////////////////////////////////
struct SkOSFileIterData {
- SkOSFileIterData() : fDIR(0) { }
+ SkOSFileIterData() : fDIR(nullptr) { }
DIR* fDIR;
SkString fPath, fSuffix;
};
@@ -135,7 +135,7 @@ void SkOSFile::Iter::reset(const char path[], const char suffix[]) {
SkOSFileIterData& self = *static_cast<SkOSFileIterData*>(fSelf.get());
if (self.fDIR) {
::closedir(self.fDIR);
- self.fDIR = 0;
+ self.fDIR = nullptr;
}
self.fPath.set(path);
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp
index 68c2d3d4d7..77f502a96e 100644
--- a/src/ports/SkOSFile_stdio.cpp
+++ b/src/ports/SkOSFile_stdio.cpp
@@ -29,8 +29,8 @@ static FILE* ios_open_from_bundle(const char path[], const char* perm) {
CFBundleRef mainBundle = CFBundleGetMainBundle();
// Get a reference to the file's URL
- CFStringRef pathRef = CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8);
- CFURLRef imageURL = CFBundleCopyResourceURL(mainBundle, pathRef, NULL, NULL);
+ CFStringRef pathRef = CFStringCreateWithCString(nullptr, path, kCFStringEncodingUTF8);
+ CFURLRef imageURL = CFBundleCopyResourceURL(mainBundle, pathRef, nullptr, nullptr);
CFRelease(pathRef);
if (!imageURL) {
return nullptr;
@@ -81,7 +81,7 @@ FILE* sk_fopen(const char path[], SkFILE_Flags flags) {
}
#endif
if (nullptr == file && (flags & kWrite_SkFILE_Flag)) {
- SkDEBUGF(("sk_fopen: fopen(\"%s\", \"%s\") returned NULL (errno:%d): %s\n",
+ SkDEBUGF(("sk_fopen: fopen(\"%s\", \"%s\") returned nullptr (errno:%d): %s\n",
path, perm, errno, strerror(errno)));
}
return file;
diff --git a/src/views/SkEventSink.cpp b/src/views/SkEventSink.cpp
index 5732feb395..cd83111f50 100644
--- a/src/views/SkEventSink.cpp
+++ b/src/views/SkEventSink.cpp
@@ -233,7 +233,7 @@ SkEventSink::EventResult SkEventSink::DoEvent(const SkEvent& evt) {
SkEventSink* SkEventSink::FindSink(SkEventSinkID sinkID)
{
if (sinkID == 0)
- return 0;
+ return nullptr;
SkEventSink_Globals& globals = getGlobals();
SkAutoMutexAcquire ac(globals.fSinkMutex);
diff --git a/src/xml/SkDOM.h b/src/xml/SkDOM.h
index e72bcadea8..c3862a3ada 100644
--- a/src/xml/SkDOM.h
+++ b/src/xml/SkDOM.h
@@ -45,8 +45,8 @@ public:
Type getType(const Node*) const;
const char* getName(const Node*) const;
- const Node* getFirstChild(const Node*, const char elem[] = NULL) const;
- const Node* getNextSibling(const Node*, const char elem[] = NULL) const;
+ const Node* getFirstChild(const Node*, const char elem[] = nullptr) const;
+ const Node* getNextSibling(const Node*, const char elem[] = nullptr) const;
const char* findAttr(const Node*, const char attrName[]) const;
const Attr* getFirstAttr(const Node*) const;
@@ -55,7 +55,7 @@ public:
const char* getAttrValue(const Node*, const Attr*) const;
// helpers for walking children
- int countChildren(const Node* node, const char elem[] = NULL) const;
+ int countChildren(const Node* node, const char elem[] = nullptr) const;
// helpers for calling SkParse
bool findS32(const Node*, const char name[], int32_t* value) const;
diff --git a/src/xml/SkXMLParser.h b/src/xml/SkXMLParser.h
index 3f69013ce6..a20c7631e1 100644
--- a/src/xml/SkXMLParser.h
+++ b/src/xml/SkXMLParser.h
@@ -53,7 +53,7 @@ private:
class SkXMLParser {
public:
- SkXMLParser(SkXMLParserError* parserError = NULL);
+ SkXMLParser(SkXMLParserError* parserError = nullptr);
virtual ~SkXMLParser();
/** Returns true for success