diff options
author | 2013-10-15 23:01:08 +0000 | |
---|---|---|
committer | 2013-10-15 23:01:08 +0000 | |
commit | 607b3a93e00a52c99e3cf33b2a5e7d0379348426 (patch) | |
tree | a10dd8fba1fed7ae7ffeb41aa72a58749a49a246 /src/utils | |
parent | 1a01bc492e88d36b5c9f9ff25050537885a51b4a (diff) |
Guard colorNames variable under SK_SUPPORT_UNITTEST.
That way clang does not complain with unneeded-internal-declaration warning,
because otherwise to clang this variable is unused and thus it won't
emit code for it.
The warning is:
../../src/utils/SkParseColor.cpp:35:3: error: variable 'colorNames' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
} colorNames[] = {
R=bsalomon@google.com, robertphillips@google.com
Author: tfarina@chromium.org
Review URL: https://codereview.chromium.org/27229004
git-svn-id: http://skia.googlecode.com/svn/trunk@11798 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkParseColor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp index becad2cab7..37f1308bb1 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; |