Closed Bug 1307155 Opened 3 years ago Closed 3 years ago

JsepSessionImpl.cpp:292:15: warning: 4 enumeration values not handled in switch: 'kAudio', 'kText', 'kApplication'... [-Wswitch]

Categories

(Core :: WebRTC, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: dholbert, Assigned: jesup, NeedInfo)

References

Details

Attachments

(1 file)

New clang build warning, when compiling mozilla-central with clang 3.8 (on Linux):
> Warning: -Wswitch in $SRC/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp: 4 enumeration values not handled in switch: 'kAudio', 'kText', 'kApplication'...
> $SRC/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp:292:15: warning: 4 enumeration values not handled in switch: 'kAudio', 'kText', 'kApplication'... [-Wswitch]
>       switch (it->mTrack->GetMediaType()) {
>               ^

This is for the following code, just added in bug 1306873:
https://hg.mozilla.org/mozilla-central/rev/1378de3d013b#l1.18
>  for (auto constraintEntry: constraints) {
>    if (constraintEntry.rid != "") {
>      switch (it->mTrack->GetMediaType()) {
>        case SdpMediaSection::kVideo: {
> [...]
>          break;
>        }
>      }
>    }

jesup, since there's only one case here, could we replace this "switch" with "if (it->mTrack->GetMediaType() == SdpMediaSection::kVideo)"?
Flags: needinfo?(rjesup)
Assignee: nobody → rjesup
Status: NEW → ASSIGNED
Comment on attachment 8797236 [details] [diff] [review]
fix some warnings from bug 1306873 landing

Review of attachment 8797236 [details] [diff] [review]:
-----------------------------------------------------------------

Nit: the commit message ("fix some warnings from bug 1306873 landing") might really want to say something like:
 "Use 'if' instead of 'switch' to fix compile warning"

...to better-match the describe-the-change ideals of Commit Message Authoring.

r=me regardless; thanks for the quick turnaround!
Attachment #8797236 - Flags: review?(dholbert) → review+
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bf3e7722fd07
Use 'if' instead of 'switch' to fix warnings from bug 1306873 landing r=dholbert
https://hg.mozilla.org/mozilla-central/rev/bf3e7722fd07
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.