Commit 2e59bc9a authored by hjk's avatar hjk
Browse files

fix a few krazy warnings

parent 243bdc8c
...@@ -3325,14 +3325,14 @@ void GdbEngine::handleRegisterListValues(const GdbResponse &response) ...@@ -3325,14 +3325,14 @@ void GdbEngine::handleRegisterListValues(const GdbResponse &response)
GdbMi val = item.findChild("value"); GdbMi val = item.findChild("value");
QByteArray ba; QByteArray ba;
bool handled = false; bool handled = false;
if (val.data().startsWith("{")) { if (val.data().startsWith('{')) {
int pos1 = val.data().indexOf("v2_int32"); int pos1 = val.data().indexOf("v2_int32");
if (pos1 == -1) if (pos1 == -1)
pos1 = val.data().indexOf("v4_int32"); pos1 = val.data().indexOf("v4_int32");
if (pos1 != -1) { if (pos1 != -1) {
// FIXME: This block wastes cycles. // FIXME: This block wastes cycles.
pos1 = val.data().indexOf("{", pos1 + 1) + 1; pos1 = val.data().indexOf('{', pos1 + 1) + 1;
int pos2 = val.data().indexOf("}", pos1); int pos2 = val.data().indexOf('}', pos1);
QByteArray ba2 = val.data().mid(pos1, pos2 - pos1); QByteArray ba2 = val.data().mid(pos1, pos2 - pos1);
foreach (QByteArray ba3, ba2.split(',')) { foreach (QByteArray ba3, ba2.split(',')) {
ba3 = ba3.trimmed(); ba3 = ba3.trimmed();
......
...@@ -214,7 +214,7 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage() ...@@ -214,7 +214,7 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage()
if (from <= pc && pc <= to) { if (from <= pc && pc <= to) {
//to = qMax(to - 4, from); //to = qMax(to - 4, from);
//to = qMax(to - 4, from); //to = qMax(to - 4, from);
showMessage("STEP IN " + hexxNumber(from) + " " + hexxNumber(to) showMessage("STEP IN " + hexxNumber(from) + ' ' + hexxNumber(to)
+ " INSTEAD OF " + hexxNumber(pc)); + " INSTEAD OF " + hexxNumber(pc));
} else { } else {
from = pc; from = pc;
...@@ -502,8 +502,9 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd) ...@@ -502,8 +502,9 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
sendGdbServerAck(); sendGdbServerAck();
bool ok = false; bool ok = false;
const uint signalNumber = cmd.mid(1).toUInt(&ok, 16); const uint signalNumber = cmd.mid(1).toUInt(&ok, 16);
logMessage(QString::fromLatin1("Not implemented 'Continue with signal' %1: ").arg(signalNumber), LogWarning); logMessage(_("Not implemented 'Continue with signal' %1: ")
sendGdbServerMessage("O" + QByteArray("Console output").toHex()); .arg(signalNumber), LogWarning);
sendGdbServerMessage('O' + QByteArray("Console output").toHex());
sendGdbServerMessage("W81"); // "Process exited with result 1 sendGdbServerMessage("W81"); // "Process exited with result 1
trkContinueAll("gdb 'C'"); trkContinueAll("gdb 'C'");
} }
...@@ -940,7 +941,7 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result) ...@@ -940,7 +941,7 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
// If we do so, TRK will complain about wrong sequencing. // If we do so, TRK will complain about wrong sequencing.
//sendTrkAck(result.token); //sendTrkAck(result.token);
logMessage(QString::fromAscii(result.data), AppOutput); logMessage(QString::fromAscii(result.data), AppOutput);
sendGdbServerMessage("O" + result.data.toHex()); sendGdbServerMessage('O' + result.data.toHex());
return; return;
} }
//logMessage("READ TRK " + result.toString()); //logMessage("READ TRK " + result.toString());
...@@ -1243,13 +1244,13 @@ static QString msgMemoryReadError(int code, uint addr, uint len = 0) ...@@ -1243,13 +1244,13 @@ static QString msgMemoryReadError(int code, uint addr, uint len = 0)
{ {
const QString lenS = len ? QString::number(len) : QLatin1String("<unknown>"); const QString lenS = len ? QString::number(len) : QLatin1String("<unknown>");
return _("Memory read error %1 at: 0x%2 %3") return _("Memory read error %1 at: 0x%2 %3")
.arg(code).arg(addr, 0 ,16).arg(lenS); .arg(code).arg(addr, 0, 16).arg(lenS);
} }
void TrkGdbAdapter::handleReadMemoryBuffered(const TrkResult &result) void TrkGdbAdapter::handleReadMemoryBuffered(const TrkResult &result)
{ {
if (extractShort(result.data.data() + 1) + 3 != result.data.size()) if (extractShort(result.data.data() + 1) + 3 != result.data.size())
logMessage("\n BAD MEMORY RESULT: " + result.data.toHex() + "\n", LogError); logMessage("\n BAD MEMORY RESULT: " + result.data.toHex() + '\n', LogError);
const MemoryRange range = result.cookie.value<MemoryRange>(); const MemoryRange range = result.cookie.value<MemoryRange>();
MEMORY_DEBUG("HANDLE READ MEMORY ***BUFFERED*** FOR " << range); MEMORY_DEBUG("HANDLE READ MEMORY ***BUFFERED*** FOR " << range);
if (const int errorCode = result.errorCode()) { if (const int errorCode = result.errorCode()) {
...@@ -1269,7 +1270,7 @@ void TrkGdbAdapter::handleReadMemoryBuffered(const TrkResult &result) ...@@ -1269,7 +1270,7 @@ void TrkGdbAdapter::handleReadMemoryBuffered(const TrkResult &result)
void TrkGdbAdapter::handleReadMemoryUnbuffered(const TrkResult &result) void TrkGdbAdapter::handleReadMemoryUnbuffered(const TrkResult &result)
{ {
if (extractShort(result.data.data() + 1) + 3 != result.data.size()) if (extractShort(result.data.data() + 1) + 3 != result.data.size())
logMessage("\n BAD MEMORY RESULT: " + result.data.toHex() + "\n", LogError); logMessage("\n BAD MEMORY RESULT: " + result.data.toHex() + '\n', LogError);
const MemoryRange range = result.cookie.value<MemoryRange>(); const MemoryRange range = result.cookie.value<MemoryRange>();
MEMORY_DEBUG("HANDLE READ MEMORY UNBUFFERED FOR " << range); MEMORY_DEBUG("HANDLE READ MEMORY UNBUFFERED FOR " << range);
if (const int errorCode = result.errorCode()) { if (const int errorCode = result.errorCode()) {
...@@ -1424,7 +1425,7 @@ void TrkGdbAdapter::handleAndReportSetBreakpoint(const TrkResult &result) ...@@ -1424,7 +1425,7 @@ void TrkGdbAdapter::handleAndReportSetBreakpoint(const TrkResult &result)
uint bpnr = extractInt(result.data.data() + 1); uint bpnr = extractInt(result.data.data() + 1);
uint addr = result.cookie.toUInt(); uint addr = result.cookie.toUInt();
m_session.addressToBP[addr] = bpnr; m_session.addressToBP[addr] = bpnr;
logMessage("SET BREAKPOINT " + hexxNumber(bpnr) + " " logMessage("SET BREAKPOINT " + hexxNumber(bpnr) + ' '
+ stringFromArray(result.data.data())); + stringFromArray(result.data.data()));
sendGdbServerMessage("OK"); sendGdbServerMessage("OK");
//sendGdbServerMessage("OK"); //sendGdbServerMessage("OK");
......
...@@ -319,7 +319,7 @@ QByteArray JsonValue::toString(bool multiline, int indent) const ...@@ -319,7 +319,7 @@ QByteArray JsonValue::toString(bool multiline, int indent) const
break; break;
case String: case String:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
result += m_name + "="; result += m_name + '=';
result += '"' + escapeCString(m_data) + '"'; result += '"' + escapeCString(m_data) + '"';
break; break;
case Number: case Number:
...@@ -333,24 +333,24 @@ QByteArray JsonValue::toString(bool multiline, int indent) const ...@@ -333,24 +333,24 @@ QByteArray JsonValue::toString(bool multiline, int indent) const
if (multiline) { if (multiline) {
result += "{\n"; result += "{\n";
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += '\n' + ind(indent) + "}"; result += '\n' + ind(indent) + '}';
} else { } else {
result += "{"; result += '{';
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += "}"; result += '}';
} }
break; break;
case Array: case Array:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
result += m_name + "="; result += m_name + '=';
if (multiline) { if (multiline) {
result += "[\n"; result += "[\n";
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += '\n' + ind(indent) + "]"; result += '\n' + ind(indent) + ']';
} else { } else {
result += "["; result += '[';
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += "]"; result += ']';
} }
break; break;
} }
......
...@@ -339,7 +339,7 @@ void TcfEngine::handleResponse(const QByteArray &response) ...@@ -339,7 +339,7 @@ void TcfEngine::handleResponse(const QByteArray &response)
int token = parts.at(1).toInt(); int token = parts.at(1).toInt();
TcfCommand tcf = m_cookieForToken[token]; TcfCommand tcf = m_cookieForToken[token];
SDEBUG("COMMAND NOT RECOGNIZED FOR TOKEN" << token << tcf.toString()); SDEBUG("COMMAND NOT RECOGNIZED FOR TOKEN" << token << tcf.toString());
showMessage(QString::number(token) + "^" showMessage(QString::number(token) + '^'
+ "NOT RECOQNIZED: " + quoteUnprintableLatin1(response), + "NOT RECOQNIZED: " + quoteUnprintableLatin1(response),
LogOutput); LogOutput);
acknowledgeResult(); acknowledgeResult();
...@@ -493,8 +493,8 @@ void TcfEngine::sendCommandNow(const TcfCommand &cmd) ...@@ -493,8 +493,8 @@ void TcfEngine::sendCommandNow(const TcfCommand &cmd)
int result = m_socket->write(cmd.command); int result = m_socket->write(cmd.command);
Q_UNUSED(result) Q_UNUSED(result)
m_socket->flush(); m_socket->flush();
showMessage(QString::number(cmd.token) + " " + cmd.toString(), LogInput); showMessage(QString::number(cmd.token) + ' ' + cmd.toString(), LogInput);
SDEBUG("SEND " << cmd.toString()); //<< " " << QString::number(result)); SDEBUG("SEND " << cmd.toString()); //<< ' ' << QString::number(result));
} }
void TcfEngine::acknowledgeResult() void TcfEngine::acknowledgeResult()
......
...@@ -1366,7 +1366,7 @@ void WatchHandler::showEditValue(const WatchData &data) ...@@ -1366,7 +1366,7 @@ void WatchHandler::showEditValue(const WatchData &data)
p->waitForStarted(); p->waitForStarted();
m_editHandlers[key] = p; m_editHandlers[key] = p;
} }
p->write(input + "\n"); p->write(input + '\n');
} else { } else {
QTC_ASSERT(false, qDebug() << "Display format: " << data.editformat); QTC_ASSERT(false, qDebug() << "Display format: " << data.editformat);
} }
......
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