| Index: src/utils/SkParseColor.cpp
|
| diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp
|
| index 989a6091ef8197bbcd5866a2be5cad38797c0d23..329b304ac469ee7c3178f46e075df9e7c39fabf6 100644
|
| --- a/src/utils/SkParseColor.cpp
|
| +++ b/src/utils/SkParseColor.cpp
|
| @@ -423,11 +423,11 @@ const char* SkParse::FindNamedColor(const char* name, size_t len, SkColor* color
|
| while ((int) gColorNames[lo] >= 0)
|
| ++lo;
|
| } else if (hi == mid)
|
| - return NULL;
|
| + return nullptr;
|
| else
|
| hi = mid;
|
| }
|
| - return NULL;
|
| + return nullptr;
|
| }
|
|
|
| // !!! move to char utilities
|
| @@ -435,12 +435,12 @@ const char* SkParse::FindNamedColor(const char* name, size_t len, SkColor* color
|
| // char c;
|
| // int separators = 0;
|
| // while ((c = *str++) != '\0') {
|
| -// if (strchr(sep, c) == NULL)
|
| +// if (strchr(sep, c) == nullptr)
|
| // continue;
|
| // do {
|
| // if ((c = *str++) == '\0')
|
| // goto goHome;
|
| -// } while (strchr(sep, c) != NULL);
|
| +// } while (strchr(sep, c) != nullptr);
|
| // separators++;
|
| // }
|
| //goHome:
|
| @@ -459,7 +459,7 @@ const char* SkParse::FindColor(const char* value, SkColor* colorPtr) {
|
| uint32_t hex;
|
| const char* end = SkParse::FindHex(value + 1, &hex);
|
| // SkASSERT(end);
|
| - if (end == NULL)
|
| + if (end == nullptr)
|
| return end;
|
| size_t len = end - value - 1;
|
| if (len == 3 || len == 4) {
|
| @@ -476,7 +476,7 @@ const char* SkParse::FindColor(const char* value, SkColor* colorPtr) {
|
| return end;
|
| } else {
|
| // SkASSERT(0);
|
| - return NULL;
|
| + return nullptr;
|
| }
|
| // } else if (strchr(value, ',')) {
|
| // SkScalar array[4];
|
| @@ -484,8 +484,8 @@ const char* SkParse::FindColor(const char* value, SkColor* colorPtr) {
|
| // SkASSERT(count == 3 || count == 4);
|
| // array[0] = SK_Scalar1 * 255;
|
| // const char* end = SkParse::FindScalars(value, &array[4 - count], count);
|
| -// if (end == NULL)
|
| -// return NULL;
|
| +// if (end == nullptr)
|
| +// return nullptr;
|
| // !!! range check for errors?
|
| // *colorPtr = SkColorSetARGB(SkScalarRoundToInt(array[0]), SkScalarRoundToInt(array[1]),
|
| // SkScalarRoundToInt(array[2]), SkScalarRoundToInt(array[3]));
|
| @@ -503,7 +503,7 @@ void SkParse::TestColor() {
|
| for (index = 0; index < colorNamesSize; index++) {
|
| result = SK_ColorBLACK;
|
| SkNameRGB nameRGB = colorNames[index];
|
| - SkASSERT(FindColor(nameRGB.name, &result) != NULL);
|
| + SkASSERT(FindColor(nameRGB.name, &result) != nullptr);
|
| SkASSERT(result == (SkColor) (nameRGB.rgb | 0xFF000000));
|
| }
|
| for (index = 0; index < colorNamesSize; index++) {
|
| @@ -513,9 +513,9 @@ void SkParse::TestColor() {
|
| size_t len = strlen(nameRGB.name);
|
| memcpy(bad, nameRGB.name, len);
|
| bad[len - 1] -= 1;
|
| - SkASSERT(FindColor(bad, &result) == NULL);
|
| + SkASSERT(FindColor(bad, &result) == nullptr);
|
| bad[len - 1] += 2;
|
| - SkASSERT(FindColor(bad, &result) == NULL);
|
| + SkASSERT(FindColor(bad, &result) == nullptr);
|
| }
|
| result = SK_ColorBLACK;
|
| SkASSERT(FindColor("lightGrey", &result));
|
|
|