diff options
author | John Stiles <johnstiles@google.com> | 2021-08-11 11:01:17 -0400 |
---|---|---|
committer | SkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com> | 2021-08-11 16:05:52 +0000 |
commit | 488654b8397a0a64e9907517fe8cda1508af2455 (patch) | |
tree | 4f7d5e0b32116fdb9c02f8f40a034fb579ca49f2 /docs | |
parent | d6c08c9be843443c812e5b0491b8ce39dc51aea6 (diff) | |
download | skia-488654b8397a0a64e9907517fe8cda1508af2455.tar.gz |
Fix cases of variable shadowing in /tools/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.
(Turtle.cpp is #included from a cpp in the tools directory.)
Change-Id: I1685086ec0ceae1d51efa7daa0f46137b535ce77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438476
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/examples/Turtle.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/examples/Turtle.cpp b/docs/examples/Turtle.cpp index 5275b7cfdb..ec3c55f87f 100644 --- a/docs/examples/Turtle.cpp +++ b/docs/examples/Turtle.cpp @@ -41,8 +41,7 @@ const char* eval(SkCanvas* canvas, const char* s, char e, float& dist, float& l, d = std::min(d, l); dist += d; l -= d; float r = t.h * 0.01745329f; - auto s = sinf(r), c = cosf(r); - Turtle nt = { t.x + s * d, t.y - c * d, t.h, t.p }; + Turtle nt = { t.x + sinf(r) * d, t.y - cosf(r) * d, t.h, t.p }; if (pt && t.p) canvas->drawLine(t.x, t.y, nt.x, nt.y, p()); t = nt; break; |