aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-23 15:01:08 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-23 15:01:08 +0000
commit31648eb1cfe19257ec077efebb11ab251bfd25f7 (patch)
treeeba2e89da62bf7c3fcc94841624b4c9663c5b91b
parent4ee8aea2a77d2d22d56afe68699179e5a02ac4f4 (diff)
Fix warnings
Review URL: http://codereview.appspot.com/5433054/ git-svn-id: http://skia.googlecode.com/svn/trunk@2741 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--gm/aarectmodes.cpp5
-rw-r--r--gyp/common_conditions.gypi9
-rw-r--r--src/gpu/mesa/SkMesaGLContext.cpp2
-rw-r--r--tests/WritePixelsTest.cpp10
4 files changed, 18 insertions, 8 deletions
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;