Skip to content

Commit

Permalink
Expanded to qsizetype indexes on VM_devices and refactor loops
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanAizek committed Aug 25, 2024
1 parent 764e727 commit 41147f8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/VM_Devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ bool Emulator::Load(const QString& path)
return false;
}

for (QDomNode node = childElement.firstChild(); node.isNull() == false;
node = node.nextSibling()) {
for (QDomNode node = childElement.firstChild(); !node.isNull(); node = node.nextSibling()) {
QDomElement elem = node.toElement();
if (!elem.isNull())
Binary_Files[elem.tagName()] = elem.text();
Expand Down Expand Up @@ -320,8 +319,7 @@ bool Emulator::Load(const QString& path)

QDomNode node = thirdElement.firstChild();
Device_Map tmpDevMap;
for (int ix = 1; node.isNull() == false;
node = node.nextSibling(), ix++) {
for (qsizetype ix = 1; !node.isNull(); node = node.nextSibling(), ix++) {
QDomElement elem = node.toElement();
if (!elem.isNull()) {
if (ix % 2 != 0)
Expand Down Expand Up @@ -351,8 +349,7 @@ bool Emulator::Load(const QString& path)
}

node = thirdElement.firstChild();
for (int ix = 1; node.isNull() == false;
node = node.nextSibling(), ix++) {
for (qsizetype ix = 1; !node.isNull(); node = node.nextSibling(), ix++) {
QDomElement elem = node.toElement();
if (!elem.isNull()) {
if (ix % 2 != 0)
Expand Down Expand Up @@ -383,8 +380,7 @@ bool Emulator::Load(const QString& path)
}

node = thirdElement.firstChild();
for (int ix = 1; node.isNull() == false;
node = node.nextSibling(), ix++) {
for (qsizetype ix = 1; !node.isNull(); node = node.nextSibling(), ix++) {
QDomElement elem = node.toElement();
if (!elem.isNull()) {
if (ix % 2 != 0)
Expand Down Expand Up @@ -441,8 +437,7 @@ bool Emulator::Load(const QString& path)
}

node = thirdElement.firstChild();
for (int ix = 1; node.isNull() == false;
node = node.nextSibling(), ix++) {
for (qsizetype ix = 1; !node.isNull(); node = node.nextSibling(), ix++) {
QDomElement elem = node.toElement();
if (!elem.isNull()) {
if (ix % 2 != 0)
Expand Down

0 comments on commit 41147f8

Please sign in to comment.