GCS_MAVLink: Remove pragma to disable compiler warning and instead cast enum to int to fix the code.

This commit is contained in:
Eric Katzfey 2024-12-11 20:20:07 -08:00 committed by Peter Barker
parent 93ba994eb1
commit 7c1cc26509
1 changed files with 1 additions and 4 deletions

View File

@ -55,10 +55,7 @@ extern mavlink_system_t mavlink_system;
/// @param chan Channel to send to
static inline bool valid_channel(mavlink_channel_t chan)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
return chan < MAVLINK_COMM_NUM_BUFFERS;
#pragma clang diagnostic pop
return static_cast<int>(chan) < MAVLINK_COMM_NUM_BUFFERS;
}
mavlink_message_t* mavlink_get_channel_buffer(uint8_t chan);