Fix warnings

Review URL: http://codereview.appspot.com/5433054/


git-svn-id: http://skia.googlecode.com/svn/trunk@2741 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/aarectmodes.cpp b/gm/aarectmodes.cpp
index 058d824..f518cae 100644
--- a/gm/aarectmodes.cpp
+++ b/gm/aarectmodes.cpp
@@ -34,7 +34,7 @@
     };
     SkPath path;
     SkPoint* ptPtr = pts;
-    for (int i = 0; i < sizeof(verbs); ++i) {
+    for (size_t i = 0; i < sizeof(verbs); ++i) {
         switch ((SkPath::Verb) verbs[i]) {
             case SkPath::kMove_Verb:
                 path.moveTo(ptPtr->fX, ptPtr->fY);
@@ -47,6 +47,9 @@
             case SkPath::kClose_Verb:
                 path.close();
                 break;
+            default:
+                SkASSERT(false);
+                break;
         }
     }
     SkRect clip = {0, 130, 772, 531};
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 014046f..91d051f 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -87,7 +87,14 @@
             'cflags': ['-O2']
           },
         },
-        'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ],
+        'cflags': [ 
+          '-Wall',
+          '-Wextra',
+          '-Wno-unused',
+          # suppressions below here were added for clang
+          '-Wno-unused-parameter',
+          '-Wno-c++11-extensions'
+        ],
         'include_dirs' : [
           '/usr/include/freetype2',
         ],
diff --git a/src/gpu/mesa/SkMesaGLContext.cpp b/src/gpu/mesa/SkMesaGLContext.cpp
index 5440a90..b817fa7 100644
--- a/src/gpu/mesa/SkMesaGLContext.cpp
+++ b/src/gpu/mesa/SkMesaGLContext.cpp
@@ -20,7 +20,7 @@
 }
 
 SkMesaGLContext::AutoContextRestore::~AutoContextRestore() {
-    if (NULL != fOldContext) {
+    if (NULL != (OSMesaContext)fOldContext) {
         OSMesaMakeCurrent((OSMesaContext)fOldContext, fOldImage, 
                           fOldFormat, fOldWidth, fOldHeight);
     }
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 0515c59..403ab84 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -26,7 +26,7 @@
     U8CPU g = y;
     U8CPU b = 0xc;
 
-    U8CPU a = 0xff;
+    U8CPU a = 0x0;
     switch ((x+y) % 5) {
         case 0:
             a = 0xff;
@@ -37,12 +37,12 @@
         case 2:
             a = 0xCC;
             break;
-        case 4:
-            a = 0x01;
-            break;
         case 3:
             a = 0x00;
             break;
+        case 4:
+            a = 0x01;
+            break;
     }
     return SkPremultiplyARGBInline(a, r, g, b);
 }
@@ -99,7 +99,7 @@
     U8CPU b = n & 0xff;
     U8CPU g = (n >> 8) & 0xff;
     U8CPU r = (n >> 16) & 0xff;
-    U8CPU a;
+    U8CPU a = 0;
     switch ((x+y) % 5) {
         case 4:
             a = 0xff;