mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 22:53:33 +08:00
Merge pull request #1145 from DonLakeFlyer/MoreWarnings
Fix compiler warnings
This commit is contained in:
@@ -86,4 +86,14 @@ static const struct orb_metadata *telemetry_status_orb_id[TELEMETRY_STATUS_ORB_I
|
||||
ORB_ID(telemetry_status_3),
|
||||
};
|
||||
|
||||
// This is a hack to quiet an unused-variable warning for when telemetry_status.h is
|
||||
// included but telemetry_status_orb_id is not referenced. The inline works if you
|
||||
// choose to use it, but you can continue to just directly index into the array as well.
|
||||
// If you don't use the inline this ends up being a no-op with no additional code emitted.
|
||||
extern inline const struct orb_metadata *telemetry_status_orb_id_lookup(size_t index);
|
||||
extern inline const struct orb_metadata *telemetry_status_orb_id_lookup(size_t index)
|
||||
{
|
||||
return telemetry_status_orb_id[index];
|
||||
}
|
||||
|
||||
#endif /* TOPIC_TELEMETRY_STATUS_H */
|
||||
|
||||
Reference in New Issue
Block a user