Closed Bug 1091979 Opened 10 years ago Closed 10 years ago

Fix -Wswitch warning in widget/cocoa/nsChildView.mm

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug 879374 added a switch statement to identify MouseEvents that have pressure values. clang's -Wswitch warning complains that this switch statement on an enum type doesn't handle every enum value or at least have a catch-all default case. The current code works correctly because there is an implicit default case, but adding an explicit default case will silence this compiler warning:

widget/cocoa/nsChildView.mm:5535:11: error: 22 enumeration values not handled in switch: 'NSMouseMoved', 'NSMouseEntered', 'NSMouseExited'... [-Wswitch]            

This patch also changes global variable gChildViewMethodsSwizzled to static and removes a couple extra blank lines.
Attachment #8514734 - Flags: review?(joshmoz)
Attachment #8514734 - Flags: review?(joshmoz) → review?(smichaud)
Comment on attachment 8514734 [details] [diff] [review]
fix-Wswitch-warning.patch

Looks fine to me.
Attachment #8514734 - Flags: review?(smichaud) → review+
https://hg.mozilla.org/mozilla-central/rev/d10109f1b0c2
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: