Commit 5b63264f authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Avoid temporaries

parent 341bf15c
......@@ -310,48 +310,39 @@ void CanOpenPdoConfigCache::collectMappedVars (CanOpenObjDict * obd) {
if (subEntryDest != Q_NULLPTR) {
switch (subEntryDest->getDataType ()) {
case CanOpenDataTypes::Bool: {
const bool tmp = subEntryDest->readAs<bool> ();
currentFrameData.setBitsAs<bool> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<bool> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<bool> ());
break;
}
case CanOpenDataTypes::Int8: {
const qint8 tmp = subEntryDest->readAs<qint8> ();
currentFrameData.setBitsAs<qint8> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<qint8> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<qint8> ());
break;
}
case CanOpenDataTypes::UInt8: {
const quint8 tmp = subEntryDest->readAs<quint8> ();
currentFrameData.setBitsAs<quint8> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<quint8> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<quint8> ());
break;
}
case CanOpenDataTypes::Int16: {
const qint16 tmp = subEntryDest->readAs<qint16> ();
currentFrameData.setBitsAs<qint16> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<qint16> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<qint16> ());
break;
}
case CanOpenDataTypes::UInt16: {
const quint16 tmp = subEntryDest->readAs<quint16> ();
currentFrameData.setBitsAs<quint16> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<quint16> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<quint16> ());
break;
}
case CanOpenDataTypes::Int32: {
const qint32 tmp = subEntryDest->readAs<qint32> ();
currentFrameData.setBitsAs<qint32> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<qint32> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<qint32> ());
break;
}
case CanOpenDataTypes::UInt32: {
const quint32 tmp = subEntryDest->readAs<quint32> ();
currentFrameData.setBitsAs<quint32> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<quint32> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<quint32> ());
break;
}
case CanOpenDataTypes::Int64: {
const qint64 tmp = subEntryDest->readAs<qint64> ();
currentFrameData.setBitsAs<qint64> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<qint64> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<qint64> ());
break;
}
case CanOpenDataTypes::UInt64: {
const quint64 tmp = subEntryDest->readAs<quint64> ();
currentFrameData.setBitsAs<quint64> (currentBitIdx, mappingMux.fields.bitsCount, &tmp);
currentFrameData.setBitsWith<quint64> (currentBitIdx, mappingMux.fields.bitsCount, subEntryDest->readAs<quint64> ());
break;
}
default: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment