diff --git a/gm/aarectmodes.cpp b/gm/aarectmodes.cpp index 058d824041..f518caebc3 100644 --- a/gm/aarectmodes.cpp +++ b/gm/aarectmodes.cpp @@ -34,7 +34,7 @@ static void test4(SkCanvas* canvas) { }; 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 @@ static void test4(SkCanvas* canvas) { 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 014046f043..91d051fd18 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 5440a90569..b817fa7c3b 100644 --- a/src/gpu/mesa/SkMesaGLContext.cpp +++ b/src/gpu/mesa/SkMesaGLContext.cpp @@ -20,7 +20,7 @@ SkMesaGLContext::AutoContextRestore::AutoContextRestore() { } 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 0515c59383..403ab84a07 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -26,7 +26,7 @@ SkPMColor getCanvasColor(int x, int y) { U8CPU g = y; U8CPU b = 0xc; - U8CPU a = 0xff; + U8CPU a = 0x0; switch ((x+y) % 5) { case 0: a = 0xff; @@ -37,12 +37,12 @@ SkPMColor getCanvasColor(int x, int y) { 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 @@ uint32_t getBitmapColor(int x, int y, int w, int h, SkCanvas::Config8888 config8 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;