Opened 8 years ago

Closed 8 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:
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 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by mt, 8 years ago

patch: 01

comment:2 by Barrett, 8 years ago

Owner: changed from korli to Barrett
Status: newassigned

comment:3 by Barrett, 8 years ago

Resolution: fixed
Status: assignedclosed

Applied in hrev50375.

Note: See TracTickets for help on using tickets.