Closed
Bug 1273363
Opened 8 years ago
Closed 8 years ago
Fix -Wshadow warnings in layout/svg/
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file, 1 obsolete file)
7.58 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
And stop suppressing -Wshadow warnings-as-errors. I plan to enable -Wshadow warnings soon in bug 1272513.
layout/svg/SVGTextFrame.cpp:4198:28 [-Wshadow] declaration shadows a local variable
layout/svg/nsSVGClipPathFrame.cpp:388:18 [-Wshadow] declaration shadows a local variable
layout/svg/nsSVGIntegrationUtils.cpp:562:15 [-Wshadow] declaration shadows a local variable
layout/svg/nsSVGIntegrationUtils.cpp:586:26 [-Wshadow] declaration shadows a local variable
layout/svg/nsSVGIntegrationUtils.cpp:620:15 [-Wshadow] declaration shadows a local variable
Attachment #8753175 -
Flags: review?(dholbert)
Assignee | ||
Comment 1•8 years ago
|
||
I forget to include one more fix, renaming `target` to `maskTarget`:
layout/svg/nsSVGIntegrationUtils.cpp:586:26 [-Wshadow] declaration shadows a local variable
Attachment #8753175 -
Attachment is obsolete: true
Attachment #8753175 -
Flags: review?(dholbert)
Attachment #8753225 -
Flags: review?(dholbert)
Comment 2•8 years ago
|
||
Comment on attachment 8753225 [details] [diff] [review]
Wshadow_layout-svg_v2.patch
Review of attachment 8753225 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, 2 nits:
::: layout/svg/SVGTextFrame.cpp
@@ +4176,5 @@
> // Find each rendered run that intersects with the range defined
> // by charnum/nchars.
> nscoord textLength = 0;
> + TextRenderedRunIterator runIt(this, TextRenderedRunIterator::eAllFrames);
> + TextRenderedRun run = runIt.Current();
Nit: "runIt" is too easy misread as "Run it!" (since both "run" and "it" are words with completely different meaning from their usage here).
Please rename to something like "runIter" (or perhaps "textRunIt"/"textRunIter").
::: layout/svg/nsSVGIntegrationUtils.cpp
@@ +582,5 @@
> aContext.Restore();
> return;
> }
>
> + RefPtr<gfxContext> maskTarget = gfxContext::ForDrawTarget(targetDT);
Please rename the local variable "targetDT" to "maskTargetDT", for consistency here. (The variables "target" and "targetDT" are strongly intertwined here, & they seem to intentionally have pretty-much-the-same-name to reflect that relationship.)
As a bonus, this will make this "targetDT" variable easier to distinguish from a different targetDT that's declared further down in a different scope. (Not in a shadowing way, but still in an easy-to-confuse way.)
Attachment #8753225 -
Flags: review?(dholbert) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Thanks. I'll update the iterator and targetDT names.
Comment 5•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•