Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: src/utils/SkParseColor.cpp

Issue 27229004: Guard colorNames variable under SK_SUPPORT_UNITTEST. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkParseColor.cpp
diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp
index becad2cab7c8d3390d79362447b2c4e8078ca1a7..37f1308bb1980379bc02d36ec0321259c9e5d879 100644
--- a/src/utils/SkParseColor.cpp
+++ b/src/utils/SkParseColor.cpp
@@ -12,6 +12,7 @@
#ifdef SK_DEBUG
#include "SkString.h"
+#ifdef SK_SUPPORT_UNITTEST
// compress names 6 chars per long (packed 5 bits/char )
// note: little advantage to splitting chars across longs, since 3 longs at 2 unused bits each
// allow for one additional split char (vs. the 18 unsplit chars in the three longs)
@@ -175,9 +176,8 @@ static const struct SkNameRGB {
{ "yellowgreen", 0x9ACD32 }
};
-int colorNamesSize = sizeof(colorNames) / sizeof(colorNames[0]);
+int colorNamesSize = SK_ARRAY_COUNT(colorNames);
-#ifdef SK_SUPPORT_UNITTEST
static void CreateTable() {
SkString comment;
size_t originalSize = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698