mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
commander: fix initialization order of _failsafe_flags
In this case it did not cause any problems.
Fixes a compiler warning:
/src/modules/commander/HealthAndArmingChecks/HealthAndArmingChecks.cpp:39:21: error: member ‘HealthAndArmingChecks::_failsafe_flags’ is used uninitialized [-Werror=uninitialized]
39 | _reporter(_failsafe_flags)
| ^~~~~~~~~~~~~~~
This commit is contained in:
parent
8e5efb0131
commit
640f9cc801
@ -35,8 +35,7 @@
|
|||||||
|
|
||||||
HealthAndArmingChecks::HealthAndArmingChecks(ModuleParams *parent, vehicle_status_s &status)
|
HealthAndArmingChecks::HealthAndArmingChecks(ModuleParams *parent, vehicle_status_s &status)
|
||||||
: ModuleParams(parent),
|
: ModuleParams(parent),
|
||||||
_context(status),
|
_context(status)
|
||||||
_reporter(_failsafe_flags)
|
|
||||||
{
|
{
|
||||||
// Initialize mode requirements to invalid
|
// Initialize mode requirements to invalid
|
||||||
_failsafe_flags.angular_velocity_invalid = true;
|
_failsafe_flags.angular_velocity_invalid = true;
|
||||||
|
|||||||
@ -103,12 +103,12 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void updateParams() override;
|
void updateParams() override;
|
||||||
private:
|
private:
|
||||||
Context _context;
|
|
||||||
Report _reporter;
|
|
||||||
orb_advert_t _mavlink_log_pub{nullptr};
|
|
||||||
|
|
||||||
failsafe_flags_s _failsafe_flags{};
|
failsafe_flags_s _failsafe_flags{};
|
||||||
|
|
||||||
|
Context _context;
|
||||||
|
Report _reporter{_failsafe_flags};
|
||||||
|
orb_advert_t _mavlink_log_pub{nullptr};
|
||||||
|
|
||||||
uORB::Publication<health_report_s> _health_report_pub{ORB_ID(health_report)};
|
uORB::Publication<health_report_s> _health_report_pub{ORB_ID(health_report)};
|
||||||
uORB::Publication<failsafe_flags_s> _failsafe_flags_pub{ORB_ID(failsafe_flags)};
|
uORB::Publication<failsafe_flags_s> _failsafe_flags_pub{ORB_ID(failsafe_flags)};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user