diff --git a/bus_protocols/isotp_message.h b/bus_protocols/isotp_message.h index 5de2c21..66ed9df 100644 --- a/bus_protocols/isotp_message.h +++ b/bus_protocols/isotp_message.h @@ -9,8 +9,8 @@ public: int bus; bool extended; bool isReceived; - uint32_t len; //# of bytes this message should have (as reported) - uint32_t actualSize; //# we actually got + int len; //# of bytes this message should have (as reported) + int actualSize; //# we actually got QVector data; uint64_t timestamp; }; diff --git a/bus_protocols/uds_handler.cpp b/bus_protocols/uds_handler.cpp index e9e0ed0..4387d34 100644 --- a/bus_protocols/uds_handler.cpp +++ b/bus_protocols/uds_handler.cpp @@ -4,14 +4,14 @@ #include "isotp_handler.h" #include -QVector UDS_DIAG_CTRL_SUB = { +static QVector UDS_DIAG_CTRL_SUB = { {1,"DFLT_SESS", "Default session"}, {2,"PROG_SESS", "Programming Session"}, {3,"EXT_SESS", "Extended Diagnostics Session"}, {4,"SAFETY_SESS", "Safety System Diagnostics Session"}, }; -QVector UDS_ECU_RESET_SUB = { +static QVector UDS_ECU_RESET_SUB = { {1,"HARD_RESET", "Hard reset of ECU"}, {2,"KEYOFFON_RESET", "Simulated key off then on reset"}, {3,"SOFT_RESET", "Soft reset - leaving RAM intact"}, @@ -19,7 +19,7 @@ QVector UDS_ECU_RESET_SUB = { {5,"DIS_POWERDOWN_RESET", "Disable sleep mode"}, }; -QVector UDS_COMM_CTRL_SUB = { +static QVector UDS_COMM_CTRL_SUB = { {0,"COMM_NORMAL", "Enable both Rx and Tx of normal messages"}, {1,"COMM_DIS_TX", "Enable reception of normal messages but don't Tx them"}, {3,"COMM_DIS_ALL", "Disable both Rx and Tx of non-diagnostics messages"}, @@ -27,13 +27,13 @@ QVector UDS_COMM_CTRL_SUB = { {5,"COMM_ENHANC", "Addressed bus master should set related sub-bus to app scheduling mode"}, }; -QVector UDS_ROUTINE_SUB = { +static QVector UDS_ROUTINE_SUB = { {1,"START_ROUTINE", "Start routine by given ID"}, {2,"STOP_ROUTINE", "Stop routine by given ID"}, {3,"GET_ROUTINE_RESULTS", "Get results from routine specified by ID"}, }; -QVector UDS_SERVICE_DESC = { +static QVector UDS_SERVICE_DESC = { {1, "OBDII_SHOW_CURRENT", "OBDII - Show current data"}, {2, "OBDII_SHOW_FREEZE", "OBDII - Show freeze data"}, {3, "OBDII_SHOW_STORED_DTC", "OBDII - Show stored DTC codes"}, @@ -84,7 +84,7 @@ QVector UDS_SERVICE_DESC = { {0xFF, "UNKNOWN_CODE", "Unknown, likely proprietary UDS function code"} }; -QVector UDS_NEG_RESPONSE = +static QVector UDS_NEG_RESPONSE = { {0x10, "GENERAL_REJECT", "General rejection (no other codes matched)"}, {0x11, "SERVICE_NOTSUPP", "ECU does not support this service code"}, diff --git a/bus_protocols/uds_handler.h b/bus_protocols/uds_handler.h index b17af69..5c5ea4f 100644 --- a/bus_protocols/uds_handler.h +++ b/bus_protocols/uds_handler.h @@ -65,7 +65,7 @@ namespace UDS_SERVICES struct CODE_STRUCT { - unsigned int code; + int code; QString shortDesc; QString longDesc; }; @@ -73,9 +73,9 @@ struct CODE_STRUCT class UDS_MESSAGE: public ISOTP_MESSAGE { public: - unsigned int service; - unsigned int subFunc; - unsigned int subFuncLen; + int service; + int subFunc; + int subFuncLen; bool isErrorReply; UDS_MESSAGE(); diff --git a/connections/canconmanager.cpp b/connections/canconmanager.cpp index 46a31c3..0154c03 100644 --- a/connections/canconmanager.cpp +++ b/connections/canconmanager.cpp @@ -253,13 +253,13 @@ bool CANConManager::sendFrames(const QList& pFrames) //the bus numbers if bus wasn't -1 so that they're local to the device bool CANConManager::addTargettedFrame(int pBusId, uint32_t ID, uint32_t mask, QObject *receiver) { - int tempBusVal; + //int tempBusVal; int busBase = 0; foreach (CANConnection* conn, mConns) { if (pBusId == -1) conn->addTargettedFrame(pBusId, ID, mask, receiver); - else if (pBusId < (uint32_t)(busBase + conn->getNumBuses())) + else if (pBusId < (busBase + conn->getNumBuses())) { qDebug() << "Forwarding targetted frame setting to a connection object"; conn->addTargettedFrame(pBusId - busBase, ID, mask, receiver); @@ -272,13 +272,13 @@ bool CANConManager::addTargettedFrame(int pBusId, uint32_t ID, uint32_t mask, QO bool CANConManager::removeTargettedFrame(int pBusId, uint32_t ID, uint32_t mask, QObject *receiver) { - int tempBusVal; + //int tempBusVal; int busBase = 0; foreach (CANConnection* conn, mConns) { if (pBusId == -1) conn->removeTargettedFrame(pBusId, ID, mask, receiver); - else if (pBusId < (uint32_t)(busBase + conn->getNumBuses())) + else if (pBusId < (busBase + conn->getNumBuses())) { qDebug() << "Forwarding targetted frame setting to a connection object"; conn->removeTargettedFrame(pBusId - busBase, ID, mask, receiver); diff --git a/connections/serialbusconnection.cpp b/connections/serialbusconnection.cpp index 03891ff..6fa35f2 100644 --- a/connections/serialbusconnection.cpp +++ b/connections/serialbusconnection.cpp @@ -77,7 +77,7 @@ bool SerialBusConnection::piGetBusSettings(int pBusIdx, CANBus& pBus) void SerialBusConnection::piSetBusSettings(int pBusIdx, CANBus bus) { - CANConStatus stats; + //CANConStatus stats; /* sanity checks */ if(0 != pBusIdx) return; diff --git a/framefileio.cpp b/framefileio.cpp index c8939ca..0f3eb35 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -1258,7 +1258,7 @@ bool FrameFileIO::loadCanalyzerASC(QString filename, QVector* frames) tokens = line.simplified().split(' '); if (tokens.length() > 5) { - thisFrame.timestamp = (uint64_t)(tokens[0].toDouble() * (double)1000000.0); + thisFrame.timestamp = static_cast(tokens[0].toDouble() * 1000000.0); thisFrame.ID = tokens[2].toUInt(nullptr, 16); thisFrame.len = tokens[5].toUInt(); if (thisFrame.len > 8) return false; @@ -1266,11 +1266,11 @@ bool FrameFileIO::loadCanalyzerASC(QString filename, QVector* frames) thisFrame.bus = tokens[1].toUInt(); thisFrame.extended = (thisFrame.ID > 0x7FF); thisFrame.remote = false; - for (unsigned int d = 6; d < (6 + thisFrame.len); d++) + for (int d = 6; d < (6 + static_cast(thisFrame.len)); d++) { if (tokens.count() > d) { - thisFrame.data[d - 6] = tokens[d].toInt(nullptr, 16); + thisFrame.data[d - 6] = static_cast(tokens[d].toInt(nullptr, 16)); } else //expected byte wasn't there to read. Set it zero and set error flag { @@ -2907,7 +2907,7 @@ bool FrameFileIO::isCanDumpFile(QString filename) ret = timeExp.exactMatch(tokens[0]); if(!ret) isMatch = false; - uint64_t timestamp = (uint64_t)(timeExp.cap(1).toDouble(&ret) * (double)1000000.0); + /*uint64_t timestamp = (uint64_t)*/(timeExp.cap(1).toDouble(&ret) /** (double)1000000.0*/); if(!ret) isMatch = false; if (line.contains('[')) //the expanded format @@ -2941,7 +2941,7 @@ bool FrameFileIO::isCanDumpFile(QString filename) } /* ID */ - int ID = IdValExp.cap(1).toInt(&ret, 16); + /*int ID = */IdValExp.cap(1).toInt(&ret, 16); QString val= IdValExp.cap(2); @@ -2965,7 +2965,7 @@ bool FrameFileIO::isCanDumpFile(QString filename) isMatch = false; break; } - int data = valExp.cap(1).toInt(&ret, 16); + /*int data = */valExp.cap(1).toInt(&ret, 16); if(!ret) { isMatch = false; diff --git a/frameplaybackwindow.cpp b/frameplaybackwindow.cpp index 1afd231..09f2bbb 100644 --- a/frameplaybackwindow.cpp +++ b/frameplaybackwindow.cpp @@ -604,6 +604,7 @@ void FramePlaybackWindow::changeLooping(bool check) void FramePlaybackWindow::changeSendingBus(int newIdx) { + Q_UNUSED(newIdx); calculateWhichBus(); } diff --git a/re/temporalgraphwindow.cpp b/re/temporalgraphwindow.cpp index f61803e..afd4d42 100644 --- a/re/temporalgraphwindow.cpp +++ b/re/temporalgraphwindow.cpp @@ -5,6 +5,9 @@ QString HexTicker::getTickLabel (double tick, const QLocale& locale, QChar formatChar, int precision) { + Q_UNUSED(formatChar); + Q_UNUSED(precision); + Q_UNUSED(locale); int valu = static_cast(tick); //qDebug() << valu; return "0x" + QString::number(valu, 16).toUpper().rightJustified(3,'0'); diff --git a/scriptcontainer.cpp b/scriptcontainer.cpp index 9298d45..7e0a53e 100644 --- a/scriptcontainer.cpp +++ b/scriptcontainer.cpp @@ -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(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(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(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(data.property(i).toInt())); + msg.data.append(static_cast(data.property(static_cast(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(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(j), QJSValue(msg.data[j])); args.append(dataBytes); gotFrameFunction.call(args); }