Closed Bug 1185422 Opened 5 years ago Closed 5 years ago

dom/system/gonk/AudioManager.cpp:766:16: error: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Categories

(Firefox OS Graveyard :: AudioChannel, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(firefox42 fixed)

RESOLVED FIXED
Tracking Status
firefox42 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch AudioManager_Wtype-limits.patch (obsolete) — Splinter Review
Fix -Wtype-limits warnings-as-errors in gonk/AudioManager.cpp and constify some static data.

dom/system/gonk/AudioManager.cpp:766:16: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
dom/system/gonk/AudioManager.cpp:950:16: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
dom/system/gonk/AudioManager.cpp:1125:47: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
Attachment #8635871 - Flags: review?(alwu)
Assignee: nobody → cpeterson
Attachment #8635871 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8635871 - Flags: review?(alwu)
Attachment #8635872 - Flags: review?(alwu)
Comment on attachment 8635872 [details] [diff] [review]
AudioManager_Wtype-limits_v2.patch

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

::: dom/system/gonk/AudioManager.cpp
@@ +1126,5 @@
>      if (mAudioProfiles[idx]->GetActive()) {
>        mPresentProfile = static_cast<AudioOutputProfiles>(idx);
>        break;
>      }
>    }

Alastor, do we need a special case here for mPresentProfile when we loop through all mAudioProfiles and none of them are active?
Comment on attachment 8635872 [details] [diff] [review]
AudioManager_Wtype-limits_v2.patch

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

LGTM, Thanks!

::: dom/system/gonk/AudioManager.cpp
@@ +1126,5 @@
>      if (mAudioProfiles[idx]->GetActive()) {
>        mPresentProfile = static_cast<AudioOutputProfiles>(idx);
>        break;
>      }
>    }

No, there is always an active profile, because we wouldn't close the primary profile :)

The line#1110 is to prevent we close the primary profile.
Attachment #8635872 - Flags: review?(alwu) → review+
https://hg.mozilla.org/mozilla-central/rev/833460e114a2
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.