From 548a433ec356cc38f73780563501a00ed937c49c Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 11 Jul 2012 19:45:22 +0000 Subject: [PATCH] Fix linux warnings Review URL: http://codereview.appspot.com/6354093/ git-svn-id: http://skia.googlecode.com/svn/trunk@4554 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/gl/GrGLCaps.cpp | 6 +++--- src/gpu/gl/GrGLPath.cpp | 4 ++-- src/gpu/gl/GrGpuGL.cpp | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 3c6726cbd2..0afbe57319 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -175,8 +175,8 @@ bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, return true; } - int otherFormat = GR_GL_RGBA; - int otherType = GR_GL_UNSIGNED_BYTE; + GrGLint otherFormat = GR_GL_RGBA; + GrGLint otherType = GR_GL_UNSIGNED_BYTE; // The other supported format/type combo supported for ReadPixels // can change based on which render target is bound @@ -188,7 +188,7 @@ bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, &otherType); - return otherFormat == format && otherType == type; + return (GrGLenum)otherFormat == format && (GrGLenum)otherType == type; } namespace { diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp index 217cf4dd0d..64d5a55945 100644 --- a/src/gpu/gl/GrGLPath.cpp +++ b/src/gpu/gl/GrGLPath.cpp @@ -29,7 +29,7 @@ inline GrGLubyte verb_to_gl_path_cmd(const SkPath::Verb verb) { GR_STATIC_ASSERT(3 == SkPath::kCubic_Verb); GR_STATIC_ASSERT(4 == SkPath::kClose_Verb); - GrAssert(verb >= 0 && verb < GR_ARRAY_COUNT(gTable)); + GrAssert(verb >= 0 && (size_t)verb < GR_ARRAY_COUNT(gTable)); return gTable[verb]; } @@ -47,7 +47,7 @@ inline int num_pts(const SkPath::Verb verb) { GR_STATIC_ASSERT(3 == SkPath::kCubic_Verb); GR_STATIC_ASSERT(4 == SkPath::kClose_Verb); - GrAssert(verb >= 0 && verb < GR_ARRAY_COUNT(gTable)); + GrAssert(verb >= 0 && (size_t)verb < GR_ARRAY_COUNT(gTable)); return gTable[verb]; } } diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 7c1306ed6d..7ebe9d7f06 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1810,6 +1810,7 @@ void GrGpuGL::onGpuStencilPath(const GrPath* path, GrPathFill fill) { default: // Only the above two fill rules are allowed. GrCrash("Unexpected path fill."); + return; // suppress unused var warning. } GrGLint writeMask = fStencilSettings.writeMask(GrStencilSettings::kFront_Face); GL_CALL(StencilFillPath(id, fillMode, writeMask));