diff options
author | halcanary <halcanary@google.com> | 2015-08-27 07:41:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-27 07:41:16 -0700 |
commit | 96fcdcc219d2a0d3579719b84b28bede76efba64 (patch) | |
tree | 0ec5ea0193d8292df8bf5ed9dd8498a5eb5763dd /src/svg/parser | |
parent | 435af2f736c85c3274a0c6760a3523810750d237 (diff) |
Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002
Review URL: https://codereview.chromium.org/1316233002
Diffstat (limited to 'src/svg/parser')
-rw-r--r-- | src/svg/parser/SkSVGClipPath.cpp | 2 | ||||
-rw-r--r-- | src/svg/parser/SkSVGElements.cpp | 4 | ||||
-rw-r--r-- | src/svg/parser/SkSVGGradient.cpp | 2 | ||||
-rw-r--r-- | src/svg/parser/SkSVGGroup.cpp | 4 | ||||
-rw-r--r-- | src/svg/parser/SkSVGPaintState.cpp | 10 | ||||
-rw-r--r-- | src/svg/parser/SkSVGParser.cpp | 20 | ||||
-rw-r--r-- | src/svg/parser/SkSVGPath.cpp | 2 |
7 files changed, 22 insertions, 22 deletions
diff --git a/src/svg/parser/SkSVGClipPath.cpp b/src/svg/parser/SkSVGClipPath.cpp index fa3a79918d..86dc2df7f1 100644 --- a/src/svg/parser/SkSVGClipPath.cpp +++ b/src/svg/parser/SkSVGClipPath.cpp @@ -28,7 +28,7 @@ void SkSVGClipPath::translate(SkSVGParser& parser, bool defState) { SkSVGElement* child = *fChildren.begin(); SkASSERT(child->getType() == SkSVGType_Use); SkSVGUse* use = (SkSVGUse*) child; - SkSVGElement* ref = NULL; + SkSVGElement* ref = nullptr; const char* refStr = &use->f_xlink_href.c_str()[1]; SkASSERT(parser.getIDs().find(refStr, &ref)); SkASSERT(ref); diff --git a/src/svg/parser/SkSVGElements.cpp b/src/svg/parser/SkSVGElements.cpp index a1bd100571..dc8ec940c5 100644 --- a/src/svg/parser/SkSVGElements.cpp +++ b/src/svg/parser/SkSVGElements.cpp @@ -21,14 +21,14 @@ void SkSVGBase::addAttribute(SkSVGParser& parser, int attrIndex, } -SkSVGElement::SkSVGElement() : fParent(NULL), fIsDef(false), fIsNotDef(true) { +SkSVGElement::SkSVGElement() : fParent(nullptr), fIsDef(false), fIsNotDef(true) { } SkSVGElement::~SkSVGElement() { } SkSVGElement* SkSVGElement::getGradient() { - return NULL; + return nullptr; } bool SkSVGElement::isGroupParent() { diff --git a/src/svg/parser/SkSVGGradient.cpp b/src/svg/parser/SkSVGGradient.cpp index bbcca18f39..0f7c6bab7e 100644 --- a/src/svg/parser/SkSVGGradient.cpp +++ b/src/svg/parser/SkSVGGradient.cpp @@ -33,7 +33,7 @@ void SkSVGGradient::translate(SkSVGParser& parser, bool defState) { bool addedFirst = false; bool addedLast = false; SkString offsets("["); - SkString* lastOffset = NULL; + SkString* lastOffset = nullptr; for (SkSVGElement** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) { SkASSERT((*ptr)->getType() == SkSVGType_Stop); SkSVGStop* stop = (SkSVGStop*) *ptr; diff --git a/src/svg/parser/SkSVGGroup.cpp b/src/svg/parser/SkSVGGroup.cpp index 420179d871..cbd8c4ea71 100644 --- a/src/svg/parser/SkSVGGroup.cpp +++ b/src/svg/parser/SkSVGGroup.cpp @@ -17,10 +17,10 @@ SkSVGGroup::SkSVGGroup() { SkSVGElement* SkSVGGroup::getGradient() { for (SkSVGElement** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) { SkSVGElement* result = (*ptr)->getGradient(); - if (result != NULL) + if (result != nullptr) return result; } - return NULL; + return nullptr; } bool SkSVGGroup::isDef() { diff --git a/src/svg/parser/SkSVGPaintState.cpp b/src/svg/parser/SkSVGPaintState.cpp index 5db624d02e..df8ba2823f 100644 --- a/src/svg/parser/SkSVGPaintState.cpp +++ b/src/svg/parser/SkSVGPaintState.cpp @@ -38,7 +38,7 @@ SkSVGAttribute SkSVGPaint::gAttributes[] = { const int SkSVGPaint::kAttributesSize = SK_ARRAY_COUNT(SkSVGPaint::gAttributes); -SkSVGPaint::SkSVGPaint() : fNext(NULL) { +SkSVGPaint::SkSVGPaint() : fNext(nullptr) { } SkString* SkSVGPaint::operator[](int index) { @@ -81,7 +81,7 @@ void SkSVGPaint::addAttribute(SkSVGParser& parser, int attrIndex, const char* attrEnd = attrValue + attrLength; do { const char* end = strchr(attrValue, ';'); - if (end == NULL) + if (end == nullptr) end = attrEnd; const char* delimiter = strchr(attrValue, ':'); SkASSERT(delimiter != 0 && delimiter < end); @@ -102,7 +102,7 @@ bool SkSVGPaint::flush(SkSVGParser& parser, bool isFlushable, bool isDef) { SkSVGPaint current; SkSVGPaint* walking = parser.fHead; int index; - while (walking != NULL) { + while (walking != nullptr) { for (index = kInitial + 1; index < kTerminal; index++) { SkString* lastAttr = (*walking)[index]; if (lastAttr->size() == 0) @@ -195,7 +195,7 @@ void SkSVGPaint::setSave(SkSVGParser& parser) { int index; SkMatrix sum; sum.reset(); - while (walking != NULL) { + while (walking != nullptr) { for (index = kInitial + 1; index < kTerminal; index++) { SkString* lastAttr = (*walking)[index]; if (lastAttr->size() == 0) @@ -205,7 +205,7 @@ void SkSVGPaint::setSave(SkSVGParser& parser) { SkASSERT(strncmp(str, "matrix(", 7) == 0); str += 6; const char* strEnd = strrchr(str, ')'); - SkASSERT(strEnd != NULL); + SkASSERT(strEnd != nullptr); SkString mat(str, strEnd - str); SkSVGParser::ConvertToArray(mat); SkScalar values[6]; diff --git a/src/svg/parser/SkSVGParser.cpp b/src/svg/parser/SkSVGParser.cpp index 74ea0236e0..854716b6c5 100644 --- a/src/svg/parser/SkSVGParser.cpp +++ b/src/svg/parser/SkSVGParser.cpp @@ -38,14 +38,14 @@ static int gGeneratedMatrixID = 0; SkSVGParser::SkSVGParser(SkXMLParserError* errHandler) : SkXMLParser(errHandler), fHead(&fEmptyPaint), fIDs(256), - fXMLWriter(&fStream), fCurrElement(NULL), fInSVG(false), fSuppressPaint(false) { + fXMLWriter(&fStream), fCurrElement(nullptr), fInSVG(false), fSuppressPaint(false) { fLastTransform.reset(); fEmptyPaint.f_fill.set("black"); fEmptyPaint.f_stroke.set("none"); fEmptyPaint.f_strokeMiterlimit.set("4"); fEmptyPaint.f_fillRule.set("winding"); fEmptyPaint.f_opacity.set("1"); - fEmptyPaint.fNext = NULL; + fEmptyPaint.fNext = nullptr; for (int index = SkSVGPaint::kInitial + 1; index < SkSVGPaint::kTerminal; index++) { SkString* initial = fEmptyPaint[index]; if (initial->size() == 0) @@ -129,7 +129,7 @@ bool SkSVGParser::isStrokeAndFill( SkSVGPaint** strokeState, SkSVGPaint** fillS bool fill = false; bool strokeSet = false; bool fillSet = false; - while (walking != NULL) { + while (walking != nullptr) { if (strokeSet == false && walking->f_stroke.size() > 0) { stroke = walking->f_stroke.equals("none") == false; *strokeState = walking; @@ -150,7 +150,7 @@ bool SkSVGParser::onAddAttribute(const char name[], const char value[]) { } bool SkSVGParser::onAddAttributeLen(const char name[], const char value[], size_t len) { - if (fCurrElement == NULL) // this signals we should ignore attributes for this element + if (fCurrElement == nullptr) // this signals we should ignore attributes for this element return true; if (fCurrElement->fIsDef == false && fCurrElement->fIsNotDef == false) return false; // also an ignored element @@ -202,7 +202,7 @@ bool SkSVGParser::onStartElementLen(const char name[], size_t len) { type = SkSVGType_G; // return true; } - SkSVGElement* parent = fParents.count() > 0 ? fParents.top() : NULL; + SkSVGElement* parent = fParents.count() > 0 ? fParents.top() : nullptr; SkSVGElement* element = CreateElement(type, parent); bool result = false; if (parent) { @@ -237,7 +237,7 @@ void SkSVGParser::translate(SkSVGElement* element, bool isDef) { (element->fIsDef == false && isDef && element->fIsNotDef)) { isFlushable = false; } - SkSVGPaint* strokeState = NULL, * fillState = NULL; + SkSVGPaint* strokeState = nullptr, * fillState = nullptr; if (isFlushable) element->fPaintState.setSave(*this); if (isFlushable && isStrokeAndFill(&strokeState, &fillState)) { @@ -288,7 +288,7 @@ void SkSVGParser::translateMatrix(SkString& string, SkString* stringID) { SkASSERT(strncmp(str, "matrix(", 7) == 0); str += 6; const char* strEnd = strrchr(str, ')'); - SkASSERT(strEnd != NULL); + SkASSERT(strEnd != nullptr); SkString mat(str, strEnd - str); ConvertToArray(mat); const char* elems[6]; @@ -305,7 +305,7 @@ void SkSVGParser::translateMatrix(SkString& string, SkString* stringID) { string.reset(); for (int index = 0; index < 6; index++) { const char* end = strchr(elems[index], ','); - if (end == NULL) + if (end == nullptr) end= strchr(elems[index], ']'); string.append(elems[index], end - elems[index] + 1); } @@ -356,7 +356,7 @@ undoLastComma: #define CASE_NEW(type) case SkSVGType_##type : created = new SkSVG##type(); break SkSVGElement* SkSVGParser::CreateElement(SkSVGTypes type, SkSVGElement* parent) { - SkSVGElement* created = NULL; + SkSVGElement* created = nullptr; switch (type) { CASE_NEW(Circle); CASE_NEW(ClipPath); @@ -383,7 +383,7 @@ SkSVGElement* SkSVGParser::CreateElement(SkSVGTypes type, SkSVGElement* parent) CASE_NEW(Use); default: SkASSERT(0); - return NULL; + return nullptr; } created->fParent = parent; bool isDef = created->fIsDef = created->isDef(); diff --git a/src/svg/parser/SkSVGPath.cpp b/src/svg/parser/SkSVGPath.cpp index ab18a65a7b..c9917c7b52 100644 --- a/src/svg/parser/SkSVGPath.cpp +++ b/src/svg/parser/SkSVGPath.cpp @@ -21,7 +21,7 @@ void SkSVGPath::translate(SkSVGParser& parser, bool defState) { INHERITED::translate(parser, defState); bool hasMultiplePaths = false; const char* firstZ = strchr(f_d.c_str(), 'z'); - if (firstZ != NULL) { + if (firstZ != nullptr) { firstZ++; // skip over 'z' while (*firstZ == ' ') firstZ++; |