forked from qt-creator/qt-creator
Trk: Fix source code scanning tool issues.
showing up in Qt.
This commit is contained in:
@@ -583,16 +583,18 @@ void Launcher::handleSupportMask(const TrkResult &result)
|
||||
return;
|
||||
const char *data = result.data.data() + 1;
|
||||
|
||||
QByteArray str;
|
||||
QString str = QLatin1String("SUPPORTED: ");
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
//str.append(" [" + formatByte(data[i]) + "]: ");
|
||||
for (int j = 0; j < 8; ++j)
|
||||
if (data[i] & (1 << j))
|
||||
str.append(QByteArray::number(i * 8 + j, 16) + " ");
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
if (data[i] & (1 << j)) {
|
||||
str.append(QString::number(i * 8 + j, 16));
|
||||
str.append(QLatin1Char(' '));
|
||||
}
|
||||
logMessage("SUPPORTED: " + str);
|
||||
}
|
||||
|
||||
}
|
||||
logMessage(str);
|
||||
}
|
||||
|
||||
void Launcher::cleanUp()
|
||||
{
|
||||
|
||||
@@ -133,9 +133,9 @@ QString Session::deviceDescription(unsigned verbose) const
|
||||
|
||||
|
||||
// FIXME: Use the QByteArray based version below?
|
||||
QString stringFromByte(byte c)
|
||||
static inline QString stringFromByte(byte c)
|
||||
{
|
||||
return QString("%1 ").arg(c, 2, 16, QChar('0'));
|
||||
return QString::fromLatin1("%1").arg(c, 2, 16, QChar('0'));
|
||||
}
|
||||
|
||||
QString stringFromArray(const QByteArray &ba, int maxLen)
|
||||
@@ -188,9 +188,12 @@ void TrkResult::clear()
|
||||
|
||||
QString TrkResult::toString() const
|
||||
{
|
||||
QString res = stringFromByte(code) + "[" + stringFromByte(token);
|
||||
res.chop(1);
|
||||
return res + "] " + stringFromArray(data);
|
||||
QString res = stringFromByte(code);
|
||||
res += QLatin1String(" [");
|
||||
res += stringFromByte(token);
|
||||
res += QLatin1Char(']');
|
||||
res += stringFromArray(data);
|
||||
return res;
|
||||
}
|
||||
|
||||
QByteArray frameMessage(byte command, byte token, const QByteArray &data, bool serialFrame)
|
||||
|
||||
Reference in New Issue
Block a user