Closed
Bug 1215898
Opened 10 years ago
Closed 10 years ago
Fix clang's -Wimplicit-fallthrough warnings in gfx/thebes
Categories
(Core :: Graphics: Text, defect)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla45
| Tracking | Status | |
|---|---|---|
| firefox45 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
|
5.92 KB,
patch
|
jrmuizel
:
review+
jtd
:
review+
|
Details | Diff | Splinter Review |
MOZ_FALLTHROUGH is an annotation to suppress clang's -Wimplicit-fallthrough warnings about switch cases that fall through without a break or return statement. MOZ_FALLTHROUGH is only needed on cases that have code:
switch (foo) {
case 1: // These cases have no code. No fallthrough annotations are needed.
case 2:
case 3:
foo = 4; // This case has code, so a fallthrough annotation is needed:
MOZ_FALLTHROUGH;
default:
return foo;
}
gfx/thebes/gfxContext.cpp:1415:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
gfx/thebes/gfxContext.cpp:1419:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
gfx/thebes/gfxFont.cpp:473:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
gfx/thebes/gfxFont.cpp:481:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
gfx/thebes/gfxFont.cpp:2999:13 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
gfx/thebes/gfxTextRun.cpp:1720:13 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
Attachment #8675364 -
Flags: review?(jmuizelaar)
Comment 1•10 years ago
|
||
Comment on attachment 8675364 [details] [diff] [review]
MOZ_FALLTHROUGH_gfx-thebes.patch
Review of attachment 8675364 [details] [diff] [review]:
-----------------------------------------------------------------
I'm fine with these changes. But it might be worth asking the author of the code in gfxFont.cpp/gfxTextRun.cpp how they feel about the change from using 'default' for NORMAL
Attachment #8675364 -
Flags: review?(jmuizelaar) → review+
| Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8675364 [details] [diff] [review]
MOZ_FALLTHROUGH_gfx-thebes.patch
John, do you mind that I created an explicit no-op case for NS_FONT_VARIANT_CAPS_NORMAL (instead of relying on no-op default) and added a MOZ_UNREACHABLE_ASSERT to the default case? I added the assert because the NS_FONT_VARIANT_CAPS values are macros, so the compiler can't report -Wswitch-enum warnings like it could if NS_FONT_VARIANT_CAPS was an enum.
https://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxFontConstants.h#78
Attachment #8675364 -
Flags: review?(jdaggett)
| Assignee | ||
Updated•10 years ago
|
Comment 3•10 years ago
|
||
Comment on attachment 8675364 [details] [diff] [review]
MOZ_FALLTHROUGH_gfx-thebes.patch
Review of attachment 8675364 [details] [diff] [review]:
-----------------------------------------------------------------
Sure, looks reasonable.
Attachment #8675364 -
Flags: review?(jdaggett) → review+
Comment 5•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 6•10 years ago
|
||
| bugherder uplift | ||
status-b2g-v2.5:
--- → fixed
Comment 7•10 years ago
|
||
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
status-b2g-v2.5:
fixed → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•