Feature (contd.): Variable Fields - fixed errors and warnings reported by gcc4 in the code added for this feature
This commit is contained in:
parent
a8069bbb39
commit
384fd6e172
@ -177,19 +177,14 @@ void VariableFieldsWidget::on_variableFieldList_currentItemChanged(
|
|||||||
QListWidgetItem *current,
|
QListWidgetItem *current,
|
||||||
QListWidgetItem *previous)
|
QListWidgetItem *previous)
|
||||||
{
|
{
|
||||||
AbstractProtocol *proto;
|
|
||||||
OstProto::VariableField vf;
|
OstProto::VariableField vf;
|
||||||
QListWidgetItem *protoItem = protocolList->currentItem();
|
|
||||||
|
|
||||||
qDebug("%s: curr = %p, prev = %p, proto = %p",
|
qDebug("%s: curr = %p, prev = %p",
|
||||||
__FUNCTION__, current, previous, protoItem);
|
__FUNCTION__, current, previous);
|
||||||
|
|
||||||
if (current == NULL)
|
if (current == NULL)
|
||||||
goto _exit;
|
goto _exit;
|
||||||
|
|
||||||
Q_ASSERT(protoItem);
|
|
||||||
proto = protoItem->data(Qt::UserRole).value<AbstractProtocol*>();
|
|
||||||
|
|
||||||
vf = current->data(Qt::UserRole).value<OstProto::VariableField>();
|
vf = current->data(Qt::UserRole).value<OstProto::VariableField>();
|
||||||
|
|
||||||
isProgLoad_ = true;
|
isProgLoad_ = true;
|
||||||
|
@ -373,16 +373,16 @@ int AbstractProtocol::fieldFrameBitOffset(int index, int streamIndex) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < index; i++) {
|
for (int i = 0; i < index; i++) {
|
||||||
if (_cacheFlags.testFlag(FieldFrameBitOffsetCache)
|
if ((_cacheFlags & FieldFrameBitOffsetCache)
|
||||||
&& !_fieldFrameBitOffset.contains(i))
|
&& !_fieldFrameBitOffset.contains(i))
|
||||||
_fieldFrameBitOffset.insert(i, ofs);
|
_fieldFrameBitOffset.insert(i, ofs);
|
||||||
ofs += fieldData(i, FieldBitSize, streamIndex).toInt();
|
ofs += fieldData(i, FieldBitSize, streamIndex).toInt();
|
||||||
}
|
}
|
||||||
if (_cacheFlags.testFlag(FieldFrameBitOffsetCache))
|
if ((_cacheFlags & FieldFrameBitOffsetCache))
|
||||||
_fieldFrameBitOffset.insert(index, ofs);
|
_fieldFrameBitOffset.insert(index, ofs);
|
||||||
|
|
||||||
_exit:
|
|
||||||
qDebug("======> ffbo index: %d, ofs: %d", index, ofs);
|
qDebug("======> ffbo index: %d, ofs: %d", index, ofs);
|
||||||
|
_exit:
|
||||||
return ofs;
|
return ofs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1100,6 +1100,7 @@ bool varyCounter(QString protocolName, QByteArray &buf, int frameIndex,
|
|||||||
default:
|
default:
|
||||||
qWarning("%s Unsupported varField mode %d",
|
qWarning("%s Unsupported varField mode %d",
|
||||||
qPrintable(protocolName), varField.mode());
|
qPrintable(protocolName), varField.mode());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeof(T) == sizeof(quint8))
|
if (sizeof(T) == sizeof(quint8))
|
||||||
@ -1132,3 +1133,4 @@ void AbstractProtocol::varyProtocolFrameValue(QByteArray &buf, int frameIndex,
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,8 +67,7 @@ protected:
|
|||||||
enum CacheFlag {
|
enum CacheFlag {
|
||||||
FieldFrameBitOffsetCache = 0x1
|
FieldFrameBitOffsetCache = 0x1
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(CacheFlags, CacheFlag);
|
quint32 _cacheFlags;
|
||||||
CacheFlags _cacheFlags;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//! Properties of a field, can be OR'd
|
//! Properties of a field, can be OR'd
|
||||||
@ -179,7 +178,5 @@ private:
|
|||||||
void varyProtocolFrameValue(QByteArray &buf, int frameIndex,
|
void varyProtocolFrameValue(QByteArray &buf, int frameIndex,
|
||||||
const OstProto::VariableField &varField) const;
|
const OstProto::VariableField &varField) const;
|
||||||
};
|
};
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractProtocol::CacheFlags);
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractProtocol::FieldFlags);
|
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractProtocol::FieldFlags);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user