diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-30 20:33:12 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-30 20:33:12 +0000 |
commit | 5b33211c5edafde82af781beaa1dbc295000a62f (patch) | |
tree | 31e7c9b17a8a393b4df309ea68256bc732d02620 | |
parent | 70476652a07710c15763a1c4021443a1d56c0974 (diff) |
Start addressing the clang static analyzer issues
https://codereview.appspot.com/7249043/
git-svn-id: http://skia.googlecode.com/svn/trunk@7469 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkRRect.cpp | 4 | ||||
-rw-r--r-- | src/core/SkRegion.cpp | 2 | ||||
-rw-r--r-- | src/core/SkScan_Hairline.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkDashPathEffect.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 4 | ||||
-rw-r--r-- | src/ports/SkFontHost_linux.cpp | 1 | ||||
-rw-r--r-- | tests/FontHostTest.cpp | 2 |
7 files changed, 2 insertions, 15 deletions
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp index a1c4e32618..fc1a1cf057 100644 --- a/src/core/SkRRect.cpp +++ b/src/core/SkRRect.cpp @@ -36,9 +36,7 @@ void SkRRect::setRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad) { fType = kSimple_Type; if (xRad >= SkScalarHalf(fRect.width()) && yRad >= SkScalarHalf(fRect.height())) { fType = kOval_Type; - // TODO: try asserting they are already W/2 & H/2 already - xRad = SkScalarHalf(fRect.width()); - yRad = SkScalarHalf(fRect.height()); + // TODO: assert that all the x&y radii are already W/2 & H/2 } SkDEBUGCODE(this->validate();) diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp index e6ed68f456..dcad9eaab6 100644 --- a/src/core/SkRegion.cpp +++ b/src/core/SkRegion.cpp @@ -848,7 +848,6 @@ static int operate(const SkRegion::RunType a_runs[], RgnOper oper(SkMin32(a_top, b_top), dst, op); - bool firstInterval = true; int prevBot = SkRegion::kRunTypeSentinel; // so we fail the first test while (a_bot < SkRegion::kRunTypeSentinel || @@ -895,7 +894,6 @@ static int operate(const SkRegion::RunType a_runs[], oper.addSpan(top, gSentinel, gSentinel); } oper.addSpan(bot, run0, run1); - firstInterval = false; if (quickExit && !oper.isEmpty()) { return QUICK_EXIT_TRUE_COUNT; diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp index 9e567b6d25..ada0078e3c 100644 --- a/src/core/SkScan_Hairline.cpp +++ b/src/core/SkScan_Hairline.cpp @@ -278,7 +278,6 @@ static void hair_path(const SkPath& path, const SkRasterClip& rclip, SkBlitter* } SkAAClipBlitterWrapper wrap; - const SkIRect* clipR = NULL; const SkRegion* clip = NULL; { @@ -290,7 +289,6 @@ static void hair_path(const SkPath& path, const SkRasterClip& rclip, SkBlitter* return; } if (!rclip.quickContains(ibounds)) { - clipR = &rclip.getBounds(); if (rclip.isBW()) { clip = &rclip.bwRgn(); } else { diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp index 12836284f4..10322705e4 100644 --- a/src/effects/SkDashPathEffect.cpp +++ b/src/effects/SkDashPathEffect.cpp @@ -413,12 +413,10 @@ bool SkDashPathEffect::asPoints(PointData* results, results->fNumPoints = 0; SkScalar len2 = length; - bool partialFirst = false; if (clampedInitialDashLength > 0 || 0 == fInitialDashIndex) { SkASSERT(len2 >= clampedInitialDashLength); if (0 == fInitialDashIndex) { if (clampedInitialDashLength > 0) { - partialFirst = true; if (clampedInitialDashLength >= fIntervals[0]) { ++results->fNumPoints; // partial first dash } diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index bc7b79188b..d2bfe7be75 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -611,7 +611,6 @@ bool GrClipMaskManager::createStencilClipMask(InitialState initialState, // with the existing clip. for (ElementList::Iter iter(elements.headIter()); NULL != iter.get(); iter.next()) { const Element* element = iter.get(); - SkPath::FillType fill; bool fillInverted = false; // enabled at bottom of loop drawState->disableState(GrGpu::kModifyStencilClip_StateBit); @@ -632,16 +631,13 @@ bool GrClipMaskManager::createStencilClipMask(InitialState initialState, SkTCopyOnFirstWrite<SkPath> clipPath; if (Element::kRect_Type == element->getType()) { stencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; - fill = SkPath::kEvenOdd_FillType; fillInverted = false; } else { GrAssert(Element::kPath_Type == element->getType()); clipPath.init(element->getPath()); - fill = clipPath->getFillType(); fillInverted = clipPath->isInverseFillType(); if (fillInverted) { clipPath.writable()->toggleInverseFillType(); - fill = clipPath->getFillType(); } pr = this->getContext()->getPathRenderer(*clipPath, stroke, diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp index fb6c6d564b..07235c875f 100644 --- a/src/ports/SkFontHost_linux.cpp +++ b/src/ports/SkFontHost_linux.cpp @@ -504,7 +504,6 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) { SkFontDescriptor descriptor(stream); const char* familyName = descriptor.getFamilyName(); - const char* typefaceName = descriptor.getFontFileName(); const SkTypeface::Style style = descriptor.getStyle(); const uint32_t customFontDataLength = stream->readPackedUInt(); diff --git a/tests/FontHostTest.cpp b/tests/FontHostTest.cpp index 879fdd0720..4cd7812eeb 100644 --- a/tests/FontHostTest.cpp +++ b/tests/FontHostTest.cpp @@ -41,8 +41,8 @@ static void test_unitsPerEm(skiatest::Reporter* reporter, SkTypeface* face) { } static void test_tables(skiatest::Reporter* reporter, SkTypeface* face) { - SkFontID fontID = face->uniqueID(); if (false) { // avoid bit rot, suppress warning + SkFontID fontID = face->uniqueID(); REPORTER_ASSERT(reporter, fontID); } |