Opened 4 years ago

Closed 4 years ago

#12826 closed bug (fixed)

[Patch] echo/multi.cpp: Fix clang warnings

Reported by: mt Owned by: Barrett
Priority: normal Milestone: Unscheduled
Component: Drivers/Audio/Echo3g Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

Clang warns 'id < 0' conditons. Since multi_mix_value_info->values[i].id is int32 [1], so I think we may change variable 'id' from uint32 to int32. And I think other audio drivers also need to change.

[1] http://cgit.haiku-os.org/haiku/tree/headers/private/media/hmulti_audio.h#n427

/home/haiku/haiku/haiku/src/add-ons/kernel/drivers/audio/echo/multi.cpp:258:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (id < 0 || id >= card->multi.control_count) {
                    ~~ ^ ~
/home/haiku/haiku/haiku/src/add-ons/kernel/drivers/audio/echo/multi.cpp:300:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (id < 0 || id >= card->multi.control_count) {
                    ~~ ^ ~
/home/haiku/haiku/haiku/src/add-ons/kernel/drivers/audio/echo/multi.cpp:311:12: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                if (id < 0 || id >= card->multi.control_count) {
                                    ~~ ^ ~

Attachments (1)

0013-multi.cpp-Fix-clang-warnings.patch (1.1 KB ) - added by mt 4 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by mt, 4 years ago

Has a Patch: set

comment:2 by Barrett, 4 years ago

Owner: changed from korli to Barrett
Status: newassigned

comment:3 by Barrett, 4 years ago

Resolution: fixed
Status: assignedclosed

Applied in hrev50375.

Note: See TracTickets for help on using tickets.