From 2e40381060794745562c4a26896970406114b07a Mon Sep 17 00:00:00 2001 From: caryclark Date: Mon, 25 Aug 2014 06:53:04 -0700 Subject: add const to arrays of member functions running 'size ./out/Release/libskia_core.a' revealed a couple of places where path ops chose poorly and declared arrays of member functions to be unnecessarily writable. R=reed@android.com TBR=reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/461363003 --- src/pathops/SkIntersections.cpp | 4 ++-- src/pathops/SkIntersections.h | 4 ++-- src/pathops/SkPathOpsBounds.cpp | 2 +- src/pathops/SkPathOpsBounds.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pathops/SkIntersections.cpp b/src/pathops/SkIntersections.cpp index 56eba2717b..62c1e411ad 100644 --- a/src/pathops/SkIntersections.cpp +++ b/src/pathops/SkIntersections.cpp @@ -13,14 +13,14 @@ void SkIntersections::append(const SkIntersections& i) { } } -int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkScalar, bool) = { +int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkScalar, bool) = { NULL, &SkIntersections::verticalLine, &SkIntersections::verticalQuad, &SkIntersections::verticalCubic }; -int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine&) = { +int ( SkIntersections::* const CurveRay[])(const SkPoint[], const SkDLine&) = { NULL, &SkIntersections::lineRay, &SkIntersections::quadRay, diff --git a/src/pathops/SkIntersections.h b/src/pathops/SkIntersections.h index 0186b3797d..040671093c 100644 --- a/src/pathops/SkIntersections.h +++ b/src/pathops/SkIntersections.h @@ -287,8 +287,8 @@ private: #endif }; -extern int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine& ); -extern int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar top, SkScalar bottom, +extern int (SkIntersections::* const CurveRay[])(const SkPoint[], const SkDLine& ); +extern int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar top, SkScalar bottom, SkScalar x, bool flipped); #endif diff --git a/src/pathops/SkPathOpsBounds.cpp b/src/pathops/SkPathOpsBounds.cpp index 106cd30076..e5b26eec25 100644 --- a/src/pathops/SkPathOpsBounds.cpp +++ b/src/pathops/SkPathOpsBounds.cpp @@ -32,7 +32,7 @@ void SkPathOpsBounds::setQuadBounds(const SkPoint a[3]) { SkDoubleToScalar(dRect.fRight), SkDoubleToScalar(dRect.fBottom)); } -void (SkPathOpsBounds::*SetCurveBounds[])(const SkPoint[]) = { +void (SkPathOpsBounds::* const SetCurveBounds[])(const SkPoint[]) = { NULL, &SkPathOpsBounds::setLineBounds, &SkPathOpsBounds::setQuadBounds, diff --git a/src/pathops/SkPathOpsBounds.h b/src/pathops/SkPathOpsBounds.h index 07ad5d4ba9..cabc639225 100644 --- a/src/pathops/SkPathOpsBounds.h +++ b/src/pathops/SkPathOpsBounds.h @@ -67,6 +67,6 @@ struct SkPathOpsBounds : public SkRect { typedef SkRect INHERITED; }; -extern void (SkPathOpsBounds::*SetCurveBounds[])(const SkPoint[]); +extern void (SkPathOpsBounds::* const SetCurveBounds[])(const SkPoint[]); #endif -- cgit v1.2.3