From 6762f094906cfd4c53d35e1b1ab5d1fb44bb2cc2 Mon Sep 17 00:00:00 2001
From: mcsauder <mcsauder@gmail.com>
Date: Tue, 19 Feb 2019 11:17:53 -0700
Subject: [PATCH] Move variable initializations to header file that were no
 longer in the correct order in the constructor list.

---
 src/modules/mavlink/mavlink_receiver.cpp | 4 ----
 src/modules/mavlink/mavlink_receiver.h   | 9 +++++----
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp
index 2fe17e4231..5243e7b72c 100644
--- a/src/modules/mavlink/mavlink_receiver.cpp
+++ b/src/modules/mavlink/mavlink_receiver.cpp
@@ -132,10 +132,6 @@ MavlinkReceiver::MavlinkReceiver(Mavlink *parent) :
 	_debug_array_pub(nullptr),
 	_gps_inject_data_pub(nullptr),
 	_command_ack_pub(nullptr),
-	_control_mode_sub(orb_subscribe(ORB_ID(vehicle_control_mode))),
-	_actuator_armed_sub(orb_subscribe(ORB_ID(actuator_armed))),
-	_vehicle_attitude_sub(orb_subscribe(ORB_ID(vehicle_attitude))),
-	_global_ref_timestamp(0),
 	_hil_frames(0),
 	_old_timestamp(0),
 	_hil_local_proj_inited(0),
diff --git a/src/modules/mavlink/mavlink_receiver.h b/src/modules/mavlink/mavlink_receiver.h
index b94c068b6c..8aadd074c1 100644
--- a/src/modules/mavlink/mavlink_receiver.h
+++ b/src/modules/mavlink/mavlink_receiver.h
@@ -253,12 +253,13 @@ private:
 
 	static const int _gps_inject_data_queue_size = 6;
 
-	int _actuator_armed_sub;
-	int _control_mode_sub;
+	int _actuator_armed_sub{orb_subscribe(ORB_ID(actuator_armed))};
+	int _control_mode_sub{orb_subscribe(ORB_ID(vehicle_control_mode))};
+	int _vehicle_attitude_sub{orb_subscribe(ORB_ID(vehicle_attitude))};
+
 	int _hil_frames;
-	int _vehicle_attitude_sub;
 
-	uint64_t _global_ref_timestamp;
+	uint64_t _global_ref_timestamp{0};
 	uint64_t _old_timestamp;
 
 	bool _hil_local_proj_inited;
-- 
GitLab