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