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

RESOLVED FIXED in mozilla36

Status

()

Core
Widget: Cocoa
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

(Blocks: 1 bug)

unspecified
mozilla36
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 8514734 [details] [diff] [review]
fix-Wswitch-warning.patch

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)

Updated

4 years ago
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.