diff options
Diffstat (limited to 'src/piklab-test/checksum/checksum_check.cpp')
-rw-r--r-- | src/piklab-test/checksum/checksum_check.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/piklab-test/checksum/checksum_check.cpp b/src/piklab-test/checksum/checksum_check.cpp index 031688b..47873ab 100644 --- a/src/piklab-test/checksum/checksum_check.cpp +++ b/src/piklab-test/checksum/checksum_check.cpp @@ -36,11 +36,11 @@ void ChecksumCheck::setProtection(const Pic::Data &data, const Pic::Checksum::Da if ( !valueName.isEmpty() ) _memory->setUserIdToUnprotectedChecksum(); for (uint i=0; i<cdata.protectedMaskNames.count(); i++) { TQString pmName = cdata.protectedMaskNames[i]; - const Pic::Config::Mask *tqmask = data.config().findMask(pmName, 0); - for (int k=tqmask->values.count()-1; k>=0; k--) { - if ( tqmask->values[k].name.isEmpty() ) continue; - if ( protection.isNoneProtectedValueName(tqmask->values[k].name) ) continue; - _memory->setConfigValue(pmName, tqmask->values[k].name); + const Pic::Config::Mask *mask = data.config().findMask(pmName, 0); + for (int k=mask->values.count()-1; k>=0; k--) { + if ( mask->values[k].name.isEmpty() ) continue; + if ( protection.isNoneProtectedValueName(mask->values[k].name) ) continue; + _memory->setConfigValue(pmName, mask->values[k].name); break; } } @@ -57,8 +57,8 @@ bool ChecksumCheck::checkChecksum(BitValue checksum, const TQString &label) void ChecksumCheck::checkChecksum(const Pic::Data &pdata, const TQString &maskName, const TQString &valueName, bool &ok) { if ( !pdata.checksums().contains(valueName) ) { - const Pic::Config::Mask *tqmask = pdata.config().findMask(maskName); - TQString label = valueName + (tqmask ? "/" + tqmask->name : TQString()); + const Pic::Config::Mask *mask = pdata.config().findMask(maskName); + TQString label = valueName + (mask ? "/" + mask->name : TQString()); printf("Missing checksum for \"%s\"", label.latin1()); return; } @@ -84,10 +84,10 @@ bool ChecksumCheck::execute(const Device::Data &data) break; case Pic::Protection::BasicProtection: { TQString maskName = protection.maskName(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Code); - const Pic::Config::Mask *tqmask = pdata.config().findMask(maskName); - Q_ASSERT(tqmask); - for (uint i=0; i<tqmask->values.count(); i++) { - TQString valueName = tqmask->values[i].name; + const Pic::Config::Mask *mask = pdata.config().findMask(maskName); + Q_ASSERT(mask); + for (uint i=0; i<mask->values.count(); i++) { + TQString valueName = mask->values[i].name; if ( valueName.isEmpty() ) continue; // invalid value checkChecksum(pdata, maskName, valueName, ok); } |