More fixes for compile warnings

This commit is contained in:
Collin Kidder
2019-08-08 21:49:03 -04:00
parent e7e65b7216
commit 947f24f267
9 changed files with 34 additions and 30 deletions
+7 -7
View File
@@ -232,7 +232,7 @@ void CANScriptHelper::sendFrame(QJSValue bus, QJSValue id, QJSValue length, QJSV
CANFrame frame;
frame.extended = false;
frame.remote = false;
frame.ID = id.toInt();
frame.ID = static_cast<uint32_t>(id.toInt());
frame.len = length.toUInt();
if (frame.len > 8) frame.len = 8;
@@ -338,7 +338,7 @@ void ISOTPScriptHelper::newISOMessage(ISOTP_MESSAGE msg)
args << msg.bus << msg.ID << msg.len;
QJSValue dataBytes = scriptEngine->newArray(static_cast<uint>(msg.len));
for (unsigned int j = 0; j < msg.len; j++) dataBytes.setProperty(j, QJSValue(msg.data[j]));
for (int j = 0; j < msg.len; j++) dataBytes.setProperty(static_cast<quint32>(j), QJSValue(msg.data[j]));
args.append(dataBytes);
gotFrameFunction.call(args);
}
@@ -386,12 +386,12 @@ void UDSScriptHelper::sendUDS(QJSValue bus, QJSValue id, QJSValue service, QJSVa
msg.data.reserve(msg.len);
for (unsigned int i = 0; i < msg.len; i++)
for (int i = 0; i < msg.len; i++)
{
msg.data.append(static_cast<uint8_t>(data.property(i).toInt()));
msg.data.append(static_cast<uint8_t>(data.property(static_cast<quint32>(i)).toInt()));
}
msg.bus = (uint32_t)bus.toInt();
msg.bus = bus.toInt();
if (msg.ID > 0x7FF) msg.extended = true;
@@ -414,9 +414,9 @@ void UDSScriptHelper::newUDSMessage(UDS_MESSAGE msg)
QJSValueList args;
args << msg.bus << msg.ID << msg.service << msg.subFunc << msg.len;
QJSValue dataBytes = scriptEngine->newArray(msg.len);
QJSValue dataBytes = scriptEngine->newArray(static_cast<unsigned int>(msg.len));
for (unsigned int j = 0; j < msg.data.length(); j++) dataBytes.setProperty(j, QJSValue(msg.data[j]));
for (int j = 0; j < msg.data.length(); j++) dataBytes.setProperty(static_cast<quint32>(j), QJSValue(msg.data[j]));
args.append(dataBytes);
gotFrameFunction.call(args);
}