Fix cases of variable shadowing in samplecode/.
These were reviewed last year at http://review.skia.org/312480 but never
landed. Splitting into small chunks to land individually.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.
Change-Id: I53d04e5b2ffd7e170a8b10a6bacbc239c8b5e7ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435720
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp
index d371751..b717f62 100644
--- a/samplecode/SamplePath.cpp
+++ b/samplecode/SamplePath.cpp
@@ -604,7 +604,6 @@
SkPoint storage[3 + 2 + 1];
SkPoint* tmp = storage;
const SkPoint* prev = pts;
- int n = count;
for (int n = count; n > 0; --n) {
for (int i = 0; i < n; ++i) {
canvas->drawLine(prev[i], prev[i+1], paint);
@@ -616,7 +615,7 @@
paint.setColor(SK_ColorBLUE);
paint.setStyle(SkPaint::kFill_Style);
- n = tmp - storage;
+ int n = tmp - storage;
for (int i = 0; i < n; ++i) {
Dot(canvas, storage[i], 4, SK_ColorBLUE);
}