diff --git a/Engine/API/Abstract/abstractrhxcontroller.cpp b/Engine/API/Abstract/abstractrhxcontroller.cpp index 26611ff..09a991a 100644 --- a/Engine/API/Abstract/abstractrhxcontroller.cpp +++ b/Engine/API/Abstract/abstractrhxcontroller.cpp @@ -665,14 +665,13 @@ unsigned int AbstractRHXController::fifoCapacityInWords() // Print a command list to the console in readable form. void AbstractRHXController::printCommandList(const vector &commandList) const { - unsigned int i, cmd; int channel, reg, data, uFlag, mFlag, dFlag, hFlag; cout << '\n'; - for (i = 0; i < commandList.size(); ++i) { - cmd = commandList[i]; + for (uint i = 0; i < commandList.size(); ++i) { + auto cmd = commandList[i]; if (type != ControllerStimRecord) { - if (cmd < 0 || cmd > 0xffff) { + if ((int)cmd < 0 || cmd > 0xffff) { cout << " command[" << i << "] = INVALID COMMAND: " << cmd << '\n'; } else if ((cmd & 0xc000) == 0x0000) { channel = (cmd & 0x3f00) >> 8; diff --git a/Engine/API/Hardware/rhxregisters.cpp b/Engine/API/Hardware/rhxregisters.cpp index 2d4b882..6a9a26e 100644 --- a/Engine/API/Hardware/rhxregisters.cpp +++ b/Engine/API/Hardware/rhxregisters.cpp @@ -1122,7 +1122,7 @@ unsigned int RHXRegisters::createRHXCommand(RHXCommandType commandType, unsigned } else { switch (commandType) { case RHXCommandConvert: - if ((arg1 < 0) || (arg1 > 63)) { + if (((int)arg1 < 0) || (arg1 > 63)) { cerr << "Error in RHXRegisters::createRHXCommand: " << "Channel number out of range.\n"; return -1; @@ -1130,7 +1130,7 @@ unsigned int RHXRegisters::createRHXCommand(RHXCommandType commandType, unsigned return 0x0000 + (arg1 << 8); // 00cccccc0000000h; if the command is 'Convert', // arg1 is the channel number. case RHXCommandRegRead: - if ((arg1 < 0) || (arg1 > 63)) { + if (((int)arg1 < 0) || (arg1 > 63)) { cerr << "Error in RHXRegisters::createRHXCommand: " << "Register address out of range.\n"; return -1; @@ -1182,12 +1182,12 @@ unsigned int RHXRegisters::createRHXCommand(RHXCommandType commandType, unsigned } else { switch (commandType) { case RHXCommandRegWrite: - if ((arg1 < 0) || (arg1 > 63)) { + if (((int)arg1 < 0) || (arg1 > 63)) { cerr << "Error in RHXRegisters::createRHXCommand: " << "Register address out of range.\n"; return -1; } - if ((arg2 < 0) || (arg2 > 255)) { + if (((int)arg2 < 0) || (arg2 > 255)) { cerr << "Error in RHXRegisters::createRHXCommand: " << "Register data out of range.\n"; return -1; diff --git a/Engine/Processing/xmlinterface.cpp b/Engine/Processing/xmlinterface.cpp index 2fff4b3..cb10990 100644 --- a/Engine/Processing/xmlinterface.cpp +++ b/Engine/Processing/xmlinterface.cpp @@ -884,7 +884,7 @@ void XMLInterface::parseSignalGroupsAttributes(const QByteArray &byteArray, QStr { QXmlStreamReader stream(byteArray); while (!stream.atEnd()) { - while (stream.name() != "SignalGroup") { + while (stream.name() != QStringLiteral("SignalGroup")) { QXmlStreamReader::TokenType token = stream.readNext(); if (token == QXmlStreamReader::EndDocument) { return; @@ -894,7 +894,7 @@ void XMLInterface::parseSignalGroupsAttributes(const QByteArray &byteArray, QStr QXmlStreamAttributes attributes = stream.attributes(); QString portName(""); for (auto attribute : attributes) { - if (attribute.name().toString().toLower() == "prefix") { + if (attribute.name().toString().toLower() == QStringLiteral("prefix")) { portName = "Port " + attribute.value().toString(); break; } @@ -910,7 +910,7 @@ void XMLInterface::parseSignalGroupsAttributes(const QByteArray &byteArray, QStr QString attributeName = attribute.name().toString(); QString attributeValue = attribute.value().toString(); - if (attributeValue != "N/A") { + if (attributeValue != QStringLiteral("N/A")) { StateSingleItem *singleItem = state->locateStateSingleItem(thisSignalGroup->portItems, attributeName); // If the attribute is a StateSingleItem, set it according to XMLIncludeParameters. diff --git a/GUI/Widgets/pageview.cpp b/GUI/Widgets/pageview.cpp index 66cd247..c797995 100644 --- a/GUI/Widgets/pageview.cpp +++ b/GUI/Widgets/pageview.cpp @@ -1266,8 +1266,8 @@ QString PageView::getSiteShape(int port, int site) void PageView::overwriteColor(QColor &color, const QString& colorName) { - if (color.isValidColor(colorName)) - color.setNamedColor(colorName); + if (color.isValidColorName(colorName)) + color = QColor::fromString(colorName); } void PageView::overwriteFloat(float &original, float newValue) { diff --git a/GUI/Widgets/testcontrolpanel.cpp b/GUI/Widgets/testcontrolpanel.cpp index 9e3bdca..9628766 100644 --- a/GUI/Widgets/testcontrolpanel.cpp +++ b/GUI/Widgets/testcontrolpanel.cpp @@ -94,8 +94,8 @@ TestControlPanel::TestControlPanel(ControllerInterface *controllerInterface_, Ab helpDialogCheckInputWave(nullptr), helpDialogTestChip(nullptr), helpDialogUploadTestStimParameters(nullptr), - previousDelay(-1), portComboBox(nullptr), + previousDelay(-1), auxIn1Min(3.3), auxIn1Max(0), auxIn1Median(0), @@ -830,13 +830,11 @@ void TestControlPanel::recordDummySegment(double duration, int portIndex) void TestControlPanel::allocateDoubleArray3D(QVector > > &array3D, int xSize, int ySize, int zSize) { - int i, j; - if (xSize == 0) return; array3D.resize(xSize); - for (i = 0; i < xSize; ++i) { + for (int i = 0; i < xSize; ++i) { array3D[i].resize(ySize); - for (j = 0; j < ySize; ++j) { + for (int j = 0; j < ySize; ++j) { array3D[i][j].resize(zSize); } } @@ -846,11 +844,9 @@ void TestControlPanel::allocateDoubleArray3D(QVector > > void TestControlPanel::allocateDoubleArray2D(QVector > &array2D, int xSize, int ySize) { - int i, j; - if (xSize == 0) return; array2D.resize(xSize); - for (i = 0; i < xSize; ++i) { + for (int i = 0; i < xSize; ++i) { array2D[i].resize(ySize); } }