ardupilot/libraries/AP_AccelCal
Lucas De Marchi f3ee7a9a85 AP_AccelCal: use union instead of reference
The current approach to access the same memory location by using a
reference is giving this warning:

	../libraries/AP_AccelCal/AccelCalibrator.cpp: In constructor ‘AccelCalibrator::AccelCalibrator()’:
	../libraries/AP_AccelCal/AccelCalibrator.cpp:34:64: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
	 _param_struct(*reinterpret_cast<struct param_t *>(&_param_array))
									^
	../libraries/AP_AccelCal/AccelCalibrator.cpp: In member function ‘void AccelCalibrator::run_fit(uint8_t, float&)’:
	../libraries/AP_AccelCal/AccelCalibrator.cpp:336:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
	     struct param_t &fit_param(*reinterpret_cast<struct param_t *>(&param_array));
                                                                               ^
Using a union allows us to get rid of the warning, make sure the sizes of the
different structs match and have a more elegant solution.
2016-01-02 10:04:16 +11:00
..
AP_AccelCal.cpp AP_AccelCal: Add separate lib for accel calibration 2015-12-29 10:46:34 -08:00
AP_AccelCal.h AP_AccelCal: Add separate lib for accel calibration 2015-12-29 10:46:34 -08:00
AccelCalibrator.cpp AP_AccelCal: use union instead of reference 2016-01-02 10:04:16 +11:00
AccelCalibrator.h AP_AccelCal: use union instead of reference 2016-01-02 10:04:16 +11:00