fix (new annoying) warning (mac only I think)



git-svn-id: http://skia.googlecode.com/svn/trunk@7583 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrCacheID.cpp b/src/gpu/GrCacheID.cpp
index c3d1d66..a75054a 100644
--- a/src/gpu/GrCacheID.cpp
+++ b/src/gpu/GrCacheID.cpp
@@ -8,10 +8,15 @@
 #include "GrTypes.h"
 #include "SkThread.h"       // for sk_atomic_inc
 
-static GrCacheID::Key kAssertKey;
-GR_STATIC_ASSERT(sizeof(kAssertKey.fData8)  == sizeof(kAssertKey.fData32));
-GR_STATIC_ASSERT(sizeof(kAssertKey.fData8) == sizeof(kAssertKey.fData64));
-GR_STATIC_ASSERT(sizeof(kAssertKey.fData8) == sizeof(kAssertKey));
+// This used to be a global scope, but we got a warning about unused variable
+// so we moved it into here. We just want it to compile, so we can test the
+// static asserts.
+static inline void dummy_function_to_avoid_unused_var_warning() {
+    GrCacheID::Key kAssertKey;
+    GR_STATIC_ASSERT(sizeof(kAssertKey.fData8) == sizeof(kAssertKey.fData32));
+    GR_STATIC_ASSERT(sizeof(kAssertKey.fData8) == sizeof(kAssertKey.fData64));
+    GR_STATIC_ASSERT(sizeof(kAssertKey.fData8) == sizeof(kAssertKey));
+}
 
 GrCacheID::Domain GrCacheID::GenerateDomain() {
     static int32_t gNextDomain = kInvalid_Domain + 1;