Fix more clang tautological-constant-out-of-range-compare errors.
authortfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 29 Mar 2013 16:53:30 +0000 (16:53 +0000)
committertfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 29 Mar 2013 16:53:30 +0000 (16:53 +0000)
And one of unused-private-field:
samplecode/SampleStrokeText.cpp:109:10: error: private field 'fAA' is not used [-Werror,-Wunused-private-field]
    bool fAA;

R=bsalomon@google.com,reed@google.com

Review URL: https://codereview.chromium.org/12906016

git-svn-id: http://skia.googlecode.com/svn/trunk@8445 2bbb7eff-a529-9590-31e7-b0007b416f81

samplecode/SampleStrokeText.cpp
src/animator/SkDrawPaint.cpp

index 4e9fe0d..aa19017 100644 (file)
@@ -106,9 +106,8 @@ static void lettersToBitmap2(SkBitmap* dst, const char chars[],
 }
 
 class StrokeTextView : public SampleView {
-    bool fAA;
 public:
-    StrokeTextView() : fAA(false) {
+    StrokeTextView() {
         this->setBGColor(0xFFCC8844);
     }
 
index 4d1bd8b..22d99e4 100644 (file)
@@ -224,7 +224,7 @@ void SkDrawPaint::setupPaint(SkPaint* paint) const {
     //  stroke is legacy; style setting if present overrides stroke
     if (stroke != -1)
         paint->setStyle(SkToBool(stroke) ? SkPaint::kStroke_Style : SkPaint::kFill_Style);
-    if (style != (SkPaint::Style) -1)
+    if (style != -1)
         paint->setStyle((SkPaint::Style) style);
     if (linearText != -1)
         paint->setLinearText(SkToBool(linearText));
@@ -242,15 +242,15 @@ void SkDrawPaint::setupPaint(SkPaint* paint) const {
         SkSafeUnref(paint->setShader(shader->getShader()));
     if (strikeThru != -1)
         paint->setStrikeThruText(SkToBool(strikeThru));
-    if (strokeCap != (SkPaint::Cap) -1)
+    if (strokeCap != -1)
         paint->setStrokeCap((SkPaint::Cap) strokeCap);
-    if (strokeJoin != (SkPaint::Join) -1)
+    if (strokeJoin != -1)
         paint->setStrokeJoin((SkPaint::Join) strokeJoin);
     if (SkScalarIsNaN(strokeMiter) == false)
         paint->setStrokeMiter(strokeMiter);
     if (SkScalarIsNaN(strokeWidth) == false)
         paint->setStrokeWidth(strokeWidth);
-    if (textAlign != (SkPaint::Align) -1)
+    if (textAlign != -1)
         paint->setTextAlign((SkPaint::Align) textAlign);
     if (SkScalarIsNaN(textScaleX) == false)
         paint->setTextScaleX(textScaleX);
@@ -264,6 +264,6 @@ void SkDrawPaint::setupPaint(SkPaint* paint) const {
         SkSafeUnref(paint->setTypeface(typeface->getTypeface()));
     if (underline != -1)
         paint->setUnderlineText(SkToBool(underline));
-    if (xfermode != (SkXfermode::Mode) -1)
+    if (xfermode != -1)
         paint->setXfermodeMode((SkXfermode::Mode) xfermode);
 }