avutil/tests/channel_layout: Improve enum range check
Both GCC and Clang use unsigned as underlying type of an enum with no negative enumeration constants, making checks like "layout->order >= 0" here tautologically true. Clang warns about this. Combine both range checks by casting to unsigned to suppress this warning. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
02eda84bf2
commit
830fab6891
1 changed files with 1 additions and 1 deletions
|
|
@ -118,7 +118,7 @@ static const char* channel_order_names[] = {"UNSPEC", "NATIVE", "CUSTOM", "AMBI
|
|||
|
||||
static void describe_type(AVBPrint *bp, AVChannelLayout *layout)
|
||||
{
|
||||
if (layout->order >= 0 && layout->order < FF_ARRAY_ELEMS(channel_order_names)) {
|
||||
if ((unsigned)layout->order < FF_ARRAY_ELEMS(channel_order_names)) {
|
||||
av_bprintf(bp, "%-6s (", channel_order_names[layout->order]);
|
||||
av_channel_layout_describe_bprint(layout, bp);
|
||||
av_bprintf(bp, ")");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue