Skip to content

Commit

Permalink
Plane: reorder initialisation of member variables to make -Werror=reo…
Browse files Browse the repository at this point in the history
…rder work
  • Loading branch information
peterbarker committed Nov 12, 2024
1 parent 6ee1d94 commit b7ccee5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ArduPlane/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ class ParametersG2 {
// var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[];

// just to make compilation easier when all things are compiled out...
uint8_t unused_integer;

// button reporting library
#if HAL_BUTTON_ENABLED
AP_Button *button_ptr;
Expand Down Expand Up @@ -579,9 +582,6 @@ class ParametersG2 {

AP_Int8 axis_bitmask; // axes to be autotuned

// just to make compilation easier when all things are compiled out...
uint8_t unused_integer;

#if AP_RANGEFINDER_ENABLED
// orientation of rangefinder to use for landing
AP_Int8 rangefinder_land_orient;
Expand Down
7 changes: 4 additions & 3 deletions ArduPlane/mode.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#include "Plane.h"

Mode::Mode() :
ahrs(plane.ahrs)
unused_integer{17},
#if HAL_QUADPLANE_ENABLED
, quadplane(plane.quadplane),
pos_control(plane.quadplane.pos_control),
attitude_control(plane.quadplane.attitude_control),
loiter_nav(plane.quadplane.loiter_nav),
poscontrol(plane.quadplane.poscontrol)
quadplane(plane.quadplane),
poscontrol(plane.quadplane.poscontrol),
#endif
ahrs(plane.ahrs)
{
}

Expand Down
3 changes: 3 additions & 0 deletions ArduPlane/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ class Mode
// Output pilot throttle, this is used in stabilized modes without auto throttle control
void output_pilot_throttle();

// makes the initialiser list in the constructor manageable
uint8_t unused_integer;

#if HAL_QUADPLANE_ENABLED
// References for convenience, used by QModes
AC_PosControl*& pos_control;
Expand Down

0 comments on commit b7ccee5

Please sign in to comment.