summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/can/can-decoder.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-23 23:59:27 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-23 23:59:27 +0200
commit7747851ca010a3dfe9ffee808376dd5a7af68b91 (patch)
tree901e33d39e013c992adab34e7f5af82e5811eade /CAN-binder/low-can-binding/can/can-decoder.cpp
parentf30dc1a18dbb32880bdc0c9021b756c0f846ad53 (diff)
Static code review fixes.
Several style errors and mistakes mostly on constructor and passing arguments as ref. Change-Id: I2ca921d6aa70b9074392bb7779ade35bebf7bd8d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-decoder.cpp')
-rw-r--r--CAN-binder/low-can-binding/can/can-decoder.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/CAN-binder/low-can-binding/can/can-decoder.cpp b/CAN-binder/low-can-binding/can/can-decoder.cpp
index aa1f57ed..3e21397b 100644
--- a/CAN-binder/low-can-binding/can/can-decoder.cpp
+++ b/CAN-binder/low-can-binding/can/can-decoder.cpp
@@ -54,7 +54,7 @@ float decoder_t::parseSignalBitfield(can_signal_t& signal, const can_message_t&
/// always succeeds.
///
openxc_DynamicField decoder_t::noopDecoder(can_signal_t& signal,
- const std::vector<std::shared_ptr<can_signal_t> > signals, float value, bool* send)
+ const std::vector<std::shared_ptr<can_signal_t> >& signals, float value, bool* send)
{
openxc_DynamicField decoded_value = build_DynamicField(value);
@@ -76,7 +76,7 @@ openxc_DynamicField decoder_t::noopDecoder(can_signal_t& signal,
/// decoder always succeeds.
///
openxc_DynamicField decoder_t::booleanDecoder(can_signal_t& signal,
- const std::vector<std::shared_ptr<can_signal_t> > signals, float value, bool* send)
+ const std::vector<std::shared_ptr<can_signal_t> >& signals, float value, bool* send)
{
openxc_DynamicField decoded_value = build_DynamicField(value == 0.0 ? false : true);
@@ -98,7 +98,7 @@ openxc_DynamicField decoder_t::booleanDecoder(can_signal_t& signal,
/// @return Return value is undefined.
///
openxc_DynamicField decoder_t::ignoreDecoder(can_signal_t& signal,
- const std::vector<std::shared_ptr<can_signal_t> > signals, float value, bool* send)
+ const std::vector<std::shared_ptr<can_signal_t> >& signals, float value, bool* send)
{
if(send)
*send = false;
@@ -125,7 +125,7 @@ openxc_DynamicField decoder_t::ignoreDecoder(can_signal_t& signal,
/// return value is undefined.
///
openxc_DynamicField decoder_t::stateDecoder(can_signal_t& signal,
- const std::vector<std::shared_ptr<can_signal_t> > signals, float value, bool* send)
+ const std::vector<std::shared_ptr<can_signal_t> >& signals, float value, bool* send)
{
const std::string signal_state = signal.get_states((uint8_t)value);
openxc_DynamicField decoded_value = build_DynamicField(signal_state);
@@ -154,7 +154,7 @@ openxc_DynamicField decoder_t::stateDecoder(can_signal_t& signal,
/// string or boolean.
///
openxc_DynamicField decoder_t::translateSignal(can_signal_t& signal, const can_message_t& message,
- const std::vector<std::shared_ptr<can_signal_t> > signals, bool* send)
+ const std::vector<std::shared_ptr<can_signal_t> >& signals, bool* send)
{
float value = decoder_t::parseSignalBitfield(signal, message);
DEBUG(binder_interface, "%s: Decoded message from parseSignalBitfield: %f", __FUNCTION__, value);
@@ -167,7 +167,7 @@ openxc_DynamicField decoder_t::translateSignal(can_signal_t& signal, const can_m
signal.set_received(true);
// Don't send if they is no changes
- if ((signal.get_last_value() == value && !signal.get_send_same()) || !send )
+ if ((signal.get_last_value() == value && !signal.get_send_same()) || !*send )
{
*send = false;
}
@@ -193,7 +193,7 @@ openxc_DynamicField decoder_t::translateSignal(can_signal_t& signal, const can_m
/// string or boolean. If 'send' is false, the return value is undefined.
///
openxc_DynamicField decoder_t::decodeSignal( can_signal_t& signal,
- float value, const std::vector<std::shared_ptr<can_signal_t> > signals, bool* send)
+ float value, const std::vector<std::shared_ptr<can_signal_t> >& signals, bool* send)
{
SignalDecoder decoder = signal.get_decoder() == nullptr ?
noopDecoder : signal.get_decoder();
@@ -216,7 +216,7 @@ openxc_DynamicField decoder_t::decodeSignal( can_signal_t& signal,
/// not be decoded.
///
openxc_DynamicField decoder_t::decodeSignal( can_signal_t& signal,
- const can_message_t& message, const std::vector<std::shared_ptr<can_signal_t> > signals, bool* send)
+ const can_message_t& message, const std::vector<std::shared_ptr<can_signal_t> >& signals, bool* send)
{
float value = parseSignalBitfield(signal, message);
return decodeSignal(signal, value, signals, send);