use gcc attributes to align and pack

This commit is contained in:
Daniel Agar
2016-05-14 11:27:07 +02:00
committed by Lorenz Meier
parent 76387b1693
commit eb29b33620
14 changed files with 47 additions and 25 deletions
+4 -4
View File
@@ -60,7 +60,7 @@ Integrator::~Integrator()
}
bool
Integrator::put(uint64_t timestamp, math::Vector<3> &val, math::Vector<3> &integral, uint64_t &integral_dt)
Integrator::put(uint64_t timestamp, math::Vector<3> &val, math::Vector<3> &integral, uint64_t *integral_dt)
{
if (_last_integration_time == 0) {
/* this is the first item in the integrator */
@@ -132,7 +132,7 @@ Integrator::put_with_interval(unsigned interval_us, math::Vector<3> &val, math::
}
math::Vector<3>
Integrator::get(bool reset, uint64_t &integral_dt)
Integrator::get(bool reset, uint64_t *integral_dt)
{
math::Vector<3> val = _integral;
@@ -158,12 +158,12 @@ Integrator::get_and_filtered(bool reset, uint64_t &integral_dt, math::Vector<3>
}
void
Integrator::_reset(uint64_t &integral_dt)
Integrator::_reset(uint64_t *integral_dt)
{
_integral(0) = 0.0f;
_integral(1) = 0.0f;
_integral(2) = 0.0f;
integral_dt = (_last_integration_time - _last_reset_time);
*integral_dt = (_last_integration_time - _last_reset_time);
_last_reset_time = _last_integration_time;
}
+3 -3
View File
@@ -60,7 +60,7 @@ public:
* @return true if putting the item triggered an integral reset and the integral should be
* published.
*/
bool put(uint64_t timestamp, math::Vector<3> &val, math::Vector<3> &integral, uint64_t &integral_dt);
bool put(uint64_t timestamp, math::Vector<3> &val, math::Vector<3> &integral, uint64_t *integral_dt);
/**
* Put an item into the integral but provide an interval instead of a timestamp.
@@ -84,7 +84,7 @@ public:
* @param integral_dt Get the dt in us of the current integration (only if reset).
* @return the integral since the last read-reset
*/
math::Vector<3> get(bool reset, uint64_t &integral_dt);
math::Vector<3> get(bool reset, uint64_t *integral_dt);
/**
* Get the current integral and reset the integrator if needed. Additionally give the
@@ -115,5 +115,5 @@ private:
*
* @param integral_dt Get the dt in us of the current integration.
*/
void _reset(uint64_t &integral_dt);
void _reset(uint64_t *integral_dt);
};