summaryrefslogtreecommitdiffstats
path: root/src/devices/pic/base/pic_protection.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 22:19:39 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 22:19:39 +0000
commitf7ceb2957839027e8027a9a4c0dfff730cb9b704 (patch)
treed1d583f11612d149bc0718c80779df4653699dbb /src/devices/pic/base/pic_protection.cpp
parentd98fea1f859d23e1b1220a65d7a8eda3b757fd08 (diff)
downloadpiklab-f7ceb2957839027e8027a9a4c0dfff730cb9b704.tar.gz
piklab-f7ceb2957839027e8027a9a4c0dfff730cb9b704.zip
rename the following methods:
tqparent parent tqmask mask git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/devices/pic/base/pic_protection.cpp')
-rw-r--r--src/devices/pic/base/pic_protection.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/devices/pic/base/pic_protection.cpp b/src/devices/pic/base/pic_protection.cpp
index 4c08c45..d91f1f7 100644
--- a/src/devices/pic/base/pic_protection.cpp
+++ b/src/devices/pic/base/pic_protection.cpp
@@ -29,9 +29,9 @@ bool Pic::Protection::isAllProtectedValueName(const TQString &name) const
Pic::Protection::Family Pic::Protection::family() const
{
if ( _config.findMask("WRTBS") ) return CodeGuard;
- TQString tqmask = maskName(ProgramProtected, MemoryRangeType::Code);
- if ( _config.findMask(TQString("%1_%2").tqarg(tqmask).tqarg(0)) ) return BlockProtection;
- if ( _config.findMask(tqmask) ) return BasicProtection;
+ TQString mask = maskName(ProgramProtected, MemoryRangeType::Code);
+ if ( _config.findMask(TQString("%1_%2").tqarg(mask).tqarg(0)) ) return BlockProtection;
+ if ( _config.findMask(mask) ) return BasicProtection;
return NoProtection;
}
@@ -165,11 +165,11 @@ AddressRangeVector Pic::Protection::extractRanges(const TQString &name, MemoryRa
return rv;
}
-bool Pic::Protection::checkRange(const TQString &tqmask, const TQString &name) const
+bool Pic::Protection::checkRange(const TQString &mask, const TQString &name) const
{
if ( family()!=CodeGuard ) {
bool ok;
- (void)extractRange(tqmask, name, ok);
+ (void)extractRange(mask, name, ok);
return ok;
}
@@ -181,7 +181,7 @@ bool Pic::Protection::checkRange(const TQString &tqmask, const TQString &name) c
block = i - 1;
for (uint k=0; k<Nb_Types; k++) {
TQString mname = (isBootBlock ? bootMaskName(Type(k)) : blockMaskName(Type(k), block));
- if ( tqmask!=mname ) continue;
+ if ( mask!=mname ) continue;
ptype = Type(k);
break;
}
@@ -195,15 +195,15 @@ bool Pic::Protection::checkRange(const TQString &tqmask, const TQString &name) c
return true;
}
-Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tqmask, const TQString &name, bool &ok) const
+Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &mask, const TQString &name, bool &ok) const
{
Q_ASSERT( family()!=CodeGuard );
- //qDebug("extract range %s %s", tqmask.latin1(), name.latin1());
+ //qDebug("extract range %s %s", mask.latin1(), name.latin1());
ProtectedRange pr;
ok = false;
TQRegExp rexp("([A-Z]+)(?:_([0-9])|)");
- if ( !rexp.exactMatch(tqmask) ) {
+ if ( !rexp.exactMatch(mask) ) {
qDebug("Malformed block range");
return pr;
}
@@ -239,24 +239,24 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq
return pr;
}
- const Config::Mask *btqmask = _config.findMask(bootMaskName(ptype));
- const Config::Mask *bstqmask = _config.findMask(bootSizeMaskName());
+ const Config::Mask *bmask = _config.findMask(bootMaskName(ptype));
+ const Config::Mask *bsmask = _config.findMask(bootSizeMaskName());
const MemoryRangeData &rdata = _data.range(rtype);
if ( isAllProtectedValueName(name) ) {
- if ( rtype==MemoryRangeType::Code && !isBootBlock && btqmask ) {
+ if ( rtype==MemoryRangeType::Code && !isBootBlock && bmask ) {
qDebug("Protected range should be explicit with boot block");
return pr;
}
if (isBootBlock) {
- if ( bstqmask==0 ) {
+ if ( bsmask==0 ) {
qDebug("Protected range should be explicit when boot size not present");
return pr;
}
Address start = _data.range(MemoryRangeType::Code).start;
pr.starts.append(start);
- for (uint k=0; k<uint(bstqmask->values.count()); k++) {
+ for (uint k=0; k<uint(bsmask->values.count()); k++) {
bool ok1;
- uint size = bstqmask->values[k].name.toUInt(&ok1);
+ uint size = bsmask->values[k].name.toUInt(&ok1);
if ( !ok1 ) {
qDebug("Could not recognize boot size value");
return pr;
@@ -277,7 +277,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq
ok = true;
return pr;
}
- if ( isBootBlock && bstqmask ) {
+ if ( isBootBlock && bsmask ) {
qDebug("Protected range should not be explicit when boot size is present");
return pr;
}
@@ -294,7 +294,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq
qDebug("End is beyond memory range");
return pr;
}
- if ( (rtype!=MemoryRangeType::Code || isBootBlock) && (pr.starts.count()>1 || !rexp.cap(2).isEmpty() || btqmask==0) ) {
+ if ( (rtype!=MemoryRangeType::Code || isBootBlock) && (pr.starts.count()>1 || !rexp.cap(2).isEmpty() || bmask==0) ) {
qDebug("Only code with blocks and boot can have multiple protected ranges");
return pr;
}
@@ -306,14 +306,14 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq
// check with boot block
if ( pr.starts.count()>1 ) {
- if ( btqmask==0 ) {
- qDebug("No boot tqmask");
+ if ( bmask==0 ) {
+ qDebug("No boot mask");
return pr;
}
- for (uint i=0; i<uint(btqmask->values.count()); i++) {
- if ( btqmask->values[i].name=="Off" ) continue;
+ for (uint i=0; i<uint(bmask->values.count()); i++) {
+ if ( bmask->values[i].name=="Off" ) continue;
bool ok1;
- ProtectedRange bpr = extractRange(btqmask->name, btqmask->values[i].name, ok1);
+ ProtectedRange bpr = extractRange(bmask->name, bmask->values[i].name, ok1);
if ( !ok1 ) return pr;
if ( bpr.ends.count()!=pr.starts.count() ) {
qDebug("Boot number of ends (%i) should be the same as code number of starts (%i)", int(bpr.ends.count()), int(pr.starts.count()));