Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27b5c0d7 authored by Yi Kong's avatar Yi Kong
Browse files

Cast enum to uint32_t before comparing with AUDIO_MODE_CNT

AUDIO_MODE_CNT falls outside of the enum range, the comparison emits
tautological-constant-out-of-range-compare warning.

Test: presubmit
Change-Id: Iacab29a79219048868d390dbe08e70aba22e9cc5
parent 3e9dd76e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ status_t EngineBase::setPhoneState(audio_mode_t state)
{
    ALOGV("setPhoneState() state %d", state);

    if (state < 0 || state >= AUDIO_MODE_CNT) {
    if (state < 0 || uint32_t(state) >= AUDIO_MODE_CNT) {
        ALOGW("setPhoneState() invalid state %d", state);
        return BAD_VALUE;
    }