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.
Unified · Split
| @@ -118,7 +118,7 @@ static const char* channel_order_names[] = {"UNSPEC", "NATIVE", "CUSTOM", "AMBI · 117 unmodified lines | ||
| 118 | 118 | |
| 119 | 119 | static void describe_type(AVBPrint *bp, AVChannelLayout *layout) |
| 120 | 120 | { |
| 121 | − if (layout->order >= 0 && layout->order < FF_ARRAY_ELEMS(channel_order_names)) { | |
| 121 | + if ((unsigned)layout->order < FF_ARRAY_ELEMS(channel_order_names)) { | |
| 122 | 122 | av_bprintf(bp, "%-6s (", channel_order_names[layout->order]); |
| 123 | 123 | av_channel_layout_describe_bprint(layout, bp); |
| 124 | 124 | av_bprintf(bp, ")"); |