aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-29 13:44:30 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-29 13:44:30 +0000
commit2c2508d2ede7e6a8eb43dba0ef2419905ccbb3d8 (patch)
tree5035faa69e52c6ea64ef95d693cf6af90f609171 /src/core
parente14490adad033991401714252458f7ed9c993ba2 (diff)
More variable initializations and curly braces to avoid Linux compiler
warnings. git-svn-id: http://skia.googlecode.com/svn/trunk@1993 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkPath.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 1b9121ee18..e0d5b69cb8 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -218,10 +218,12 @@ bool SkPath::isRect(SkRect* rect) const {
int corners = 0;
SkPoint first, last;
- int firstDirection;
- int lastDirection;
- int nextDirection;
- bool closedOrMoved;
+ first.set(0, 0);
+ last.set(0, 0);
+ int firstDirection = 0;
+ int lastDirection = 0;
+ int nextDirection = 0;
+ bool closedOrMoved = false;
bool autoClose = false;
const uint8_t* verbs = fVerbs.begin();
const uint8_t* verbStop = fVerbs.end();
@@ -269,7 +271,7 @@ bool SkPath::isRect(SkRect* rect) const {
// Possible values for corners are 2, 3, and 4.
// When corners == 3, nextDirection opposes firstDirection.
// Otherwise, nextDirection at corner 2 opposes corner 4.
- int turn = firstDirection ^ corners - 1;
+ int turn = firstDirection ^ (corners - 1);
int directionCycle = 3 == corners ? 0 : nextDirection ^ turn;
if ((directionCycle ^ turn) != nextDirection) {
return false; // direction didn't follow cycle