diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/devices/pic/xml | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/devices/pic/xml')
-rw-r--r-- | src/devices/pic/xml/pic_xml_to_data.cpp | 432 |
1 files changed, 216 insertions, 216 deletions
diff --git a/src/devices/pic/xml/pic_xml_to_data.cpp b/src/devices/pic/xml/pic_xml_to_data.cpp index f3675de..7f727ff 100644 --- a/src/devices/pic/xml/pic_xml_to_data.cpp +++ b/src/devices/pic/xml/pic_xml_to_data.cpp @@ -6,8 +6,8 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> #include "xml_to_data/device_xml_to_data.h" #include "common/common/misc.h" @@ -19,17 +19,17 @@ namespace Pic class XmlToData : public Device::XmlToData<Data> { private: - virtual QString namespaceName() const { return "Pic"; } + virtual TQString namespaceName() const { return "Pic"; } -bool getVoltages(ProgVoltageType type, QDomElement element) +bool getVoltages(ProgVoltageType type, TQDomElement element) { - QDomElement voltages = findUniqueElement(element, "voltages", "name", type.key()); + TQDomElement voltages = findUniqueElement(element, "voltages", "name", type.key()); if ( voltages.isNull() ) return false; bool ok1, ok2, ok3; data()->_voltages[type].min = voltages.attribute("min").toDouble(&ok1); data()->_voltages[type].max = voltages.attribute("max").toDouble(&ok2); data()->_voltages[type].nominal = voltages.attribute("nominal").toDouble(&ok3); - if ( !ok1 || !ok2 || !ok3 ) qFatal(QString("Cannot extract voltage value for \"%1\"").arg(type.key())); + if ( !ok1 || !ok2 || !ok3 ) qFatal(TQString("Cannot extract voltage value for \"%1\"").tqarg(type.key())); if ( data()->_voltages[type].min>data()->_voltages[type].max || data()->_voltages[type].nominal<data()->_voltages[type].min || data()->_voltages[type].nominal>data()->_voltages[type].max ) @@ -37,9 +37,9 @@ bool getVoltages(ProgVoltageType type, QDomElement element) return true; } -bool getMemoryRange(MemoryRangeType type, QDomElement element) +bool getMemoryRange(MemoryRangeType type, TQDomElement element) { - QDomElement range = findUniqueElement(element, "memory", "name", type.key()); + TQDomElement range = findUniqueElement(element, "memory", "name", type.key()); if ( range.isNull() ) return false; data()->_ranges[type].properties = Present; bool ok; @@ -50,11 +50,11 @@ bool getMemoryRange(MemoryRangeType type, QDomElement element) if ( !ok ) qFatal("Cannot extract end address"); if ( data()->_ranges[type].end<data()->_ranges[type].start ) qFatal("Memory range end is before its start"); uint nbCharsWord = data()->nbCharsWord(type); - if ( data()->nbBitsWord(type)==0 ) qFatal(QString("Architecture doesn't contain memory range %1").arg(type.key())); + if ( data()->nbBitsWord(type)==0 ) qFatal(TQString("Architecture doesn't contain memory range %1").tqarg(type.key())); if ( type==MemoryRangeType::UserId ) { - data()->_userIdRecommendedMask = fromHexLabel(range.attribute("rmask"), nbCharsWord, &ok); - if ( !ok ) qFatal("Cannot extract rmask value for user id"); - if ( !data()->_userIdRecommendedMask.isInside(data()->mask(type)) ) qFatal(QString("rmask is not inside mask %1 (%2)").arg(toHexLabel(data()->_userIdRecommendedMask, 8)).arg(toHexLabel(data()->mask(type), 8))); + data()->_userIdRecommendedMask = fromHexLabel(range.attribute("rtqmask"), nbCharsWord, &ok); + if ( !ok ) qFatal("Cannot extract rtqmask value for user id"); + if ( !data()->_userIdRecommendedMask.isInside(data()->tqmask(type)) ) qFatal(TQString("rtqmask is not inside tqmask %1 (%2)").tqarg(toHexLabel(data()->_userIdRecommendedMask, 8)).tqarg(toHexLabel(data()->tqmask(type), 8))); } if ( range.attribute("hexfile_offset")!="?" ) { data()->_ranges[type].properties |= Programmable; @@ -64,15 +64,15 @@ bool getMemoryRange(MemoryRangeType type, QDomElement element) } } if ( type==MemoryRangeType::Cal && !data()->is18Family() ) { - data()->_calibration.opcodeMask = fromHexLabel(range.attribute("cal_opmask"), nbCharsWord, &ok); - if ( !ok ) qFatal("Cannot extract calibration opcode mask"); + data()->_calibration.opcodeMask = fromHexLabel(range.attribute("cal_optqmask"), nbCharsWord, &ok); + if ( !ok ) qFatal("Cannot extract calibration opcode tqmask"); data()->_calibration.opcode = fromHexLabel(range.attribute("cal_opcode"), nbCharsWord, &ok); if ( !ok ) qFatal("Cannot extract calibration opcode"); - if ( !data()->_calibration.opcode.isInside(data()->_calibration.opcodeMask) ) qFatal("Calibration opcode should be inside opcode mask"); - if ( !data()->_calibration.opcodeMask.isInside(data()->mask(type)) ) qFatal("Calibration mask should be inside opcode mask"); + if ( !data()->_calibration.opcode.isInside(data()->_calibration.opcodeMask) ) qFatal("Calibration opcode should be inside opcode tqmask"); + if ( !data()->_calibration.opcodeMask.isInside(data()->tqmask(type)) ) qFatal("Calibration tqmask should be inside opcode tqmask"); } - QString wwa = range.attribute("word_write_align"); - QString wea = range.attribute("word_erase_align"); + TQString wwa = range.attribute("word_write_align"); + TQString wea = range.attribute("word_erase_align"); if ( type==MemoryRangeType::Code ) { if ( data()->_architecture==Architecture::P18F || data()->_architecture==Architecture::P18J ) { data()->_nbWordsCodeWrite = wwa.toUInt(&ok); @@ -88,31 +88,31 @@ bool getMemoryRange(MemoryRangeType type, QDomElement element) return true; } -bool hasValue(const Pic::Config::Mask &mask, BitValue value) +bool hasValue(const Pic::Config::Mask &tqmask, BitValue value) { - for (uint i=0; i<uint(mask.values.count()); i++) - if ( mask.values[i].value==value ) return true; + for (uint i=0; i<uint(tqmask.values.count()); i++) + if ( tqmask.values[i].value==value ) return true; return false; } -void processName(const Pic::Config::Mask &cmask, BitValue pmask, Pic::Config::Value &cvalue) +void processName(const Pic::Config::Mask &ctqmask, BitValue ptqmask, Pic::Config::Value &cvalue) { - QStringList &cnames = cvalue.configNames[Pic::ConfigNameType::Default]; + TQStringList &cnames = cvalue.configNames[Pic::ConfigNameType::Default]; if ( cvalue.name=="invalid" ) { - cvalue.name = QString::null; - if ( !cnames.isEmpty() ) qFatal(QString("No cname should be defined for invalid value in mask %1").arg(cmask.name)); + cvalue.name = TQString(); + if ( !cnames.isEmpty() ) qFatal(TQString("No cname should be defined for invalid value in tqmask %1").tqarg(ctqmask.name)); return; } - if ( cvalue.name.isEmpty() ) qFatal(QString("Empty value name in mask %1").arg(cmask.name)); - if ( cmask.value.isInside(pmask) ) { // protected bits - if ( !cnames.isEmpty() ) qFatal(QString("Config name should be null for protected config mask \"%1\"").arg(cmask.name)); + if ( cvalue.name.isEmpty() ) qFatal(TQString("Empty value name in tqmask %1").tqarg(ctqmask.name)); + if ( ctqmask.value.isInside(ptqmask) ) { // protected bits + if ( !cnames.isEmpty() ) qFatal(TQString("Config name should be null for protected config tqmask \"%1\"").tqarg(ctqmask.name)); } else { - if ( cnames.isEmpty() && cmask.name!="BSSEC" && cmask.name!="BSSIZ" && cmask.name!="SSSEC" && cmask.name!="SSSIZ" ) { + if ( cnames.isEmpty() && ctqmask.name!="BSSEC" && ctqmask.name!="BSSIZ" && ctqmask.name!="SSSEC" && ctqmask.name!="SSSIZ" ) { // ### FIXME: 18J 24H 30F1010/202X if ( data()->architecture()!=Pic::Architecture::P18J && data()->architecture()!=Pic::Architecture::P24H && data()->architecture()!=Pic::Architecture::P24F && data()->architecture()!=Pic::Architecture::P33F && data()->name()!="30F1010" && data()->name()!="30F2020" && data()->name()!="30F2023" ) - qFatal(QString("cname not defined for \"%1\" (%2)").arg(cvalue.name).arg(cmask.name)); + qFatal(TQString("cname not defined for \"%1\" (%2)").tqarg(cvalue.name).tqarg(ctqmask.name)); } if ( cnames.count()==1 && cnames[0]=="_" ) cnames.clear(); for (uint i=0; i<uint(cnames.count()); i++) { @@ -121,133 +121,133 @@ void processName(const Pic::Config::Mask &cmask, BitValue pmask, Pic::Config::Va bool ok; BitValue v = fromHexLabel(cnames[i], &ok); uint nbChars = data()->nbCharsWord(MemoryRangeType::Config); - BitValue mask = cmask.value.complementInMask(maxValue(NumberBase::Hex, nbChars)); - if ( ok && v==(mask | cvalue.value) ) continue; + BitValue tqmask = ctqmask.value.complementInMask(maxValue(NumberBase::Hex, nbChars)); + if ( ok && v==(tqmask | cvalue.value) ) continue; } else if ( XOR(cnames[i].startsWith("_"), data()->architecture()==Pic::Architecture::P30F) ) continue; - qFatal(QString("Invalid config name for \"%1\"/\"%2\"").arg(cmask.name).arg(cvalue.name)); + qFatal(TQString("Invalid config name for \"%1\"/\"%2\"").tqarg(ctqmask.name).tqarg(cvalue.name)); } - QStringList &ecnames = cvalue.configNames[Pic::ConfigNameType::Extra]; + TQStringList &ecnames = cvalue.configNames[Pic::ConfigNameType::Extra]; for (uint i=0; i<uint(ecnames.count()); i++) - if ( ecnames[i][0]!='_' ) qFatal(QString("Invalid extra config name for %1").arg(cvalue.name)); + if ( ecnames[i][0]!='_' ) qFatal(TQString("Invalid extra config name for %1").tqarg(cvalue.name)); } } -Pic::Config::Mask toConfigMask(QDomElement mask, BitValue pmask) +Pic::Config::Mask toConfigMask(TQDomElement tqmask, BitValue ptqmask) { uint nbChars = data()->nbCharsWord(MemoryRangeType::Config); bool ok; - QString defName; - QMap<Pic::ConfigNameType, QStringList> defConfigNames; - Config::Mask cmask; - cmask.name = mask.attribute("name"); - if ( !Config::hasMaskName(cmask.name) ) qFatal(QString("Unknown mask name %1").arg(cmask.name)); - cmask.value = fromHexLabel(mask.attribute("value"), nbChars, &ok); - if ( !ok || cmask.value==0 || cmask.value>data()->mask(MemoryRangeType::Config) ) - qFatal(QString("Malformed mask value in mask %1").arg(mask.attribute("name"))); - //QStringList names; - QDomNode child = mask.firstChild(); + TQString defName; + TQMap<Pic::ConfigNameType, TQStringList> defConfigNames; + Config::Mask ctqmask; + ctqmask.name = tqmask.attribute("name"); + if ( !Config::hasMaskName(ctqmask.name) ) qFatal(TQString("Unknown tqmask name %1").tqarg(ctqmask.name)); + ctqmask.value = fromHexLabel(tqmask.attribute("value"), nbChars, &ok); + if ( !ok || ctqmask.value==0 || ctqmask.value>data()->tqmask(MemoryRangeType::Config) ) + qFatal(TQString("Malformed tqmask value in tqmask %1").tqarg(tqmask.attribute("name"))); + //TQStringList names; + TQDomNode child = tqmask.firstChild(); while ( !child.isNull() ) { - QDomElement value = child.toElement(); + TQDomElement value = child.toElement(); child = child.nextSibling(); if ( value.isNull() ) continue; - if ( value.nodeName()!="value" ) qFatal(QString("Non value child in mask %1").arg(cmask.name)); + if ( value.nodeName()!="value" ) qFatal(TQString("Non value child in tqmask %1").tqarg(ctqmask.name)); if ( value.attribute("value")=="default" ) { - if ( !defName.isEmpty() ) qFatal(QString("Default value already defined for mask %1").arg(cmask.name)); + if ( !defName.isEmpty() ) qFatal(TQString("Default value already defined for tqmask %1").tqarg(ctqmask.name)); defName = value.attribute("name"); - //if ( names.contains(defName) ) qFatal(QString("Value name duplicated in mask %1").arg(cmask.name)); + //if ( names.tqcontains(defName) ) qFatal(TQString("Value name duplicated in tqmask %1").tqarg(ctqmask.name)); //names.append(defName); - FOR_EACH(Pic::ConfigNameType, type) defConfigNames[type] = QStringList::split(' ', value.attribute(type.data().key)); + FOR_EACH(Pic::ConfigNameType, type) defConfigNames[type] = TQStringList::split(' ', value.attribute(type.data().key)); continue; } Config::Value cvalue; cvalue.value = fromHexLabel(value.attribute("value"), nbChars, &ok); - if ( !ok || !cvalue.value.isInside(cmask.value) ) qFatal(QString("Malformed value in mask %1").arg(cmask.name)); + if ( !ok || !cvalue.value.isInside(ctqmask.value) ) qFatal(TQString("Malformed value in tqmask %1").tqarg(ctqmask.name)); cvalue.name = value.attribute("name"); - //if ( names.contains(cvalue.name) ) qFatal(QString("Value name duplicated in mask %1").arg(cmask.name)); + //if ( names.tqcontains(cvalue.name) ) qFatal(TQString("Value name duplicated in tqmask %1").tqarg(ctqmask.name)); //names.append(cvalue.name); - FOR_EACH(Pic::ConfigNameType, type) cvalue.configNames[type] = QStringList::split(' ', value.attribute(type.data().key)); - processName(cmask, pmask, cvalue); - cmask.values.append(cvalue); + FOR_EACH(Pic::ConfigNameType, type) cvalue.configNames[type] = TQStringList::split(' ', value.attribute(type.data().key)); + processName(ctqmask, ptqmask, cvalue); + ctqmask.values.append(cvalue); } // add default values if ( !defName.isEmpty() ) { uint nb = 0; BitValue::const_iterator it; - for (it=cmask.value.begin(); it!=cmask.value.end(); ++it) { - if ( hasValue(cmask, *it) ) continue; // already set + for (it=ctqmask.value.begin(); it!=ctqmask.value.end(); ++it) { + if ( hasValue(ctqmask, *it) ) continue; // already set nb++; Config::Value cvalue; cvalue.value = *it; cvalue.name = defName; cvalue.configNames = defConfigNames; - processName(cmask, pmask, cvalue); - cmask.values.append(cvalue); + processName(ctqmask, ptqmask, cvalue); + ctqmask.values.append(cvalue); } - if ( nb<=1 ) qFatal(QString("Default value used less than twice in mask %1").arg(cmask.name)); + if ( nb<=1 ) qFatal(TQString("Default value used less than twice in tqmask %1").tqarg(ctqmask.name)); } - qHeapSort(cmask.values); - return cmask; + qHeapSort(ctqmask.values); + return ctqmask; } -Pic::Config::Word toConfigWord(QDomElement config) +Pic::Config::Word toConfigWord(TQDomElement config) { uint nbChars = data()->nbCharsWord(MemoryRangeType::Config); Config::Word cword; cword.name = config.attribute("name"); if ( cword.name.isNull() ) qFatal("Config word name not specified."); bool ok; - cword.wmask = fromHexLabel(config.attribute("wmask"), nbChars, &ok); - BitValue gmask = data()->mask(MemoryRangeType::Config); - if ( !ok || cword.wmask>gmask ) qFatal(QString("Missing or malformed config wmask \"%1\"").arg(config.attribute("wmask"))); + cword.wtqmask = fromHexLabel(config.attribute("wtqmask"), nbChars, &ok); + BitValue gtqmask = data()->tqmask(MemoryRangeType::Config); + if ( !ok || cword.wtqmask>gtqmask ) qFatal(TQString("Missing or malformed config wtqmask \"%1\"").tqarg(config.attribute("wtqmask"))); cword.bvalue = fromHexLabel(config.attribute("bvalue"), nbChars, &ok); - if ( !ok ) qFatal(QString("Missing or malformed config bvalue \"%1\"").arg(config.attribute("bvalue"))); - if ( config.attribute("pmask").isEmpty() ) cword.pmask = 0; + if ( !ok ) qFatal(TQString("Missing or malformed config bvalue \"%1\"").tqarg(config.attribute("bvalue"))); + if ( config.attribute("ptqmask").isEmpty() ) cword.ptqmask = 0; else { bool ok; - cword.pmask = fromHexLabel(config.attribute("pmask"), nbChars, &ok); - if ( !ok || cword.pmask>gmask ) qFatal("Missing or malformed config pmask"); + cword.ptqmask = fromHexLabel(config.attribute("ptqmask"), nbChars, &ok); + if ( !ok || cword.ptqmask>gtqmask ) qFatal("Missing or malformed config ptqmask"); } - cword.ignoredCNames = QStringList::split(' ', config.attribute("icnames")); + cword.ignoredCNames = TQStringList::split(' ', config.attribute("icnames")); for (uint i=0; i<uint(cword.ignoredCNames.count()); i++) - if ( cword.ignoredCNames[i][0]!='_' ) qFatal(QString("Invalid ignored config name for %1").arg(cword.name)); - QDomNode child = config.firstChild(); + if ( cword.ignoredCNames[i][0]!='_' ) qFatal(TQString("Invalid ignored config name for %1").tqarg(cword.name)); + TQDomNode child = config.firstChild(); while ( !child.isNull() ) { - QDomElement mask = child.toElement(); + TQDomElement tqmask = child.toElement(); child = child.nextSibling(); - if ( mask.isNull() ) continue; - if ( mask.nodeName()!="mask" ) qFatal(QString("Non mask child in config %1").arg(cword.name)); - if ( mask.attribute("name").isEmpty() ) qFatal(QString("Empty mask name in config %1").arg(cword.name)); - Config::Mask cmask = toConfigMask(mask, cword.pmask); - if ( !cmask.value.isInside(gmask) ) qFatal(QString("Mask value not inside mask in config %1").arg(cword.name)); - for (uint i=0; i<uint(cword.masks.count()); i++) { - if ( cword.masks[i].name==cmask.name ) qFatal(QString("Duplicated mask name %1 in config %2").arg(cmask.name).arg(cword.name)); - if ( cmask.value.isOverlapping(cword.masks[i].value) ) qFatal(QString("Overlapping masks in config %1").arg(cword.name)); + if ( tqmask.isNull() ) continue; + if ( tqmask.nodeName()!="tqmask" ) qFatal(TQString("Non tqmask child in config %1").tqarg(cword.name)); + if ( tqmask.attribute("name").isEmpty() ) qFatal(TQString("Empty tqmask name in config %1").tqarg(cword.name)); + Config::Mask ctqmask = toConfigMask(tqmask, cword.ptqmask); + if ( !ctqmask.value.isInside(gtqmask) ) qFatal(TQString("Mask value not inside tqmask in config %1").tqarg(cword.name)); + for (uint i=0; i<uint(cword.tqmasks.count()); i++) { + if ( cword.tqmasks[i].name==ctqmask.name ) qFatal(TQString("Duplicated tqmask name %1 in config %2").tqarg(ctqmask.name).tqarg(cword.name)); + if ( ctqmask.value.isOverlapping(cword.tqmasks[i].value) ) qFatal(TQString("Overlapping tqmasks in config %1").tqarg(cword.name)); } - cword.masks.append(cmask); + cword.tqmasks.append(ctqmask); } - qHeapSort(cword.masks); - BitValue mask = (cword.usedMask() | cword.bvalue).clearMaskBits(cword.pmask); - if ( config.attribute("cmask").isEmpty() ) { - if ( data()->_architecture==Pic::Architecture::P30F ) cword.cmask = cword.wmask; - else cword.cmask = mask; + qHeapSort(cword.tqmasks); + BitValue tqmask = (cword.usedMask() | cword.bvalue).clearMaskBits(cword.ptqmask); + if ( config.attribute("ctqmask").isEmpty() ) { + if ( data()->_architecture==Pic::Architecture::P30F ) cword.ctqmask = cword.wtqmask; + else cword.ctqmask = tqmask; } else { bool ok; - cword.cmask = fromHexLabel(config.attribute("cmask"), nbChars, &ok); - if ( !ok || cword.cmask>gmask ) qFatal("Missing or malformed config cmask"); - //if ( data()->_architecture==Pic::Architecture::P30X &&cword.cmask==cword.wmask ) qFatal(QString("Redundant cmask in %1").arg(cword.name)); - if ( cword.cmask==mask ) qFatal(QString("Redundant cmask in %1").arg(cword.name)); + cword.ctqmask = fromHexLabel(config.attribute("ctqmask"), nbChars, &ok); + if ( !ok || cword.ctqmask>gtqmask ) qFatal("Missing or malformed config ctqmask"); + //if ( data()->_architecture==Pic::Architecture::P30X &&cword.ctqmask==cword.wtqmask ) qFatal(TQString("Redundant ctqmask in %1").tqarg(cword.name)); + if ( cword.ctqmask==tqmask ) qFatal(TQString("Redundant ctqmask in %1").tqarg(cword.name)); } - if ( !cword.pmask.isInside(cword.usedMask()) ) qFatal("pmask should be inside or'ed mask values."); + if ( !cword.ptqmask.isInside(cword.usedMask()) ) qFatal("ptqmask should be inside or'ed tqmask values."); return cword; } -QValueVector<Pic::Config::Word> getConfigWords(QDomElement element) +TQValueVector<Pic::Config::Word> getConfigWords(TQDomElement element) { uint nbWords = data()->nbWords(MemoryRangeType::Config); - QValueVector<Config::Word> configWords(nbWords); - QDomNode child = element.firstChild(); + TQValueVector<Config::Word> configWords(nbWords); + TQDomNode child = element.firstChild(); while ( !child.isNull() ) { - QDomElement config = child.toElement(); + TQDomElement config = child.toElement(); child = child.nextSibling(); if ( config.isNull() || config.nodeName()!="config" ) continue; bool ok; @@ -255,25 +255,25 @@ QValueVector<Pic::Config::Word> getConfigWords(QDomElement element) if ( !ok ) qFatal("Missing or malformed config offset"); if ( (offset % data()->addressIncrement(MemoryRangeType::Config))!=0 ) qFatal("Config offset not aligned"); offset /= data()->addressIncrement(MemoryRangeType::Config); - if ( offset>=nbWords ) qFatal(QString("Offset too big %1/%2").arg(offset).arg(nbWords)); - if ( !configWords[offset].name.isNull() ) qFatal(QString("Config offset %1 is duplicated").arg(offset)); + if ( offset>=nbWords ) qFatal(TQString("Offset too big %1/%2").tqarg(offset).tqarg(nbWords)); + if ( !configWords[offset].name.isNull() ) qFatal(TQString("Config offset %1 is duplicated").tqarg(offset)); for (uint i=0; i<nbWords; i++) { if ( !configWords[i].name.isNull() && configWords[i].name==config.attribute("name") ) - qFatal(QString("Duplicated config name %1").arg(configWords[i].name)); + qFatal(TQString("Duplicated config name %1").tqarg(configWords[i].name)); } configWords[offset] = toConfigWord(config); } return configWords; } -QString getChecksumData(QDomElement checksum) +TQString getChecksumData(TQDomElement checksum) { Checksum::Data cdata; cdata.blankChecksum = 0x0; cdata.checkChecksum = 0x0; const Protection &protection = data()->_config->protection(); - QString valueName; + TQString valueName; if ( protection.family()==Protection::BlockProtection ) { valueName = checksum.attribute("protected_blocks"); bool ok; @@ -281,10 +281,10 @@ QString getChecksumData(QDomElement checksum) uint max = (protection.hasBootBlock() ? 1 : 0) + protection.nbBlocks(); if ( !ok || nb>max ) qFatal("Invalid number of protected blocks for checksum"); if ( nb>0 ) cdata.protectedMaskNames += "CPB"; - for (uint i=1; i<nb; i++) cdata.protectedMaskNames += "CP_" + QString::number(i-1); + for (uint i=1; i<nb; i++) cdata.protectedMaskNames += "CP_" + TQString::number(i-1); cdata.bbsize = checksum.attribute("bbsize"); - const Config::Mask *mask = data()->_config->findMask(protection.bootSizeMaskName()); - if ( mask==0 ) { + const Config::Mask *tqmask = data()->_config->findMask(protection.bootSizeMaskName()); + if ( tqmask==0 ) { if ( !cdata.bbsize.isEmpty() ) qFatal("Device does not have a variable boot size (no \"bbsize\" allowed in checksum)"); } else if ( cdata.bbsize.isEmpty() ) { if ( nb==1 ) qFatal("\"bbsize\" should be define in checksum for \"protected_blocks\"==1"); @@ -298,9 +298,9 @@ QString getChecksumData(QDomElement checksum) if ( protection.family()==Protection::NoProtection && !valueName.isEmpty() ) qFatal("Checksum protected attribute for device with no code protection"); } - if ( data()->_checksums.contains(valueName) ) qFatal("Duplicate checksum protected range"); + if ( data()->_checksums.tqcontains(valueName) ) qFatal("Duplicate checksum protected range"); - QString s = checksum.attribute("constant"); + TQString s = checksum.attribute("constant"); if ( s.isEmpty() ) cdata.constant = 0x0000; else { bool ok; @@ -317,16 +317,16 @@ QString getChecksumData(QDomElement checksum) s = checksum.attribute("mprotected"); if ( !s.isEmpty() ) { - QStringList list = QStringList::split(" ", s); + TQStringList list = TQStringList::split(" ", s); for (uint i=0; i<uint(list.count()); i++) { - const Config::Mask *mask = data()->config().findMask(list[i]); - if ( mask==0 ) qFatal(QString("Not valid mask name for \"protected\" tag in checksum: %1").arg(list[i])); - if ( mask->values.count()==2 ) continue; - for (uint k=0; k<uint(mask->values.count()); k++) { - QString valueName = mask->values[k].name; + const Config::Mask *tqmask = data()->config().findMask(list[i]); + if ( tqmask==0 ) qFatal(TQString("Not valid tqmask name for \"protected\" tag in checksum: %1").tqarg(list[i])); + if ( tqmask->values.count()==2 ) continue; + for (uint k=0; k<uint(tqmask->values.count()); k++) { + TQString valueName = tqmask->values[k].name; if ( valueName.isEmpty() ) continue; if ( !protection.isNoneProtectedValueName(valueName) && !protection.isAllProtectedValueName(valueName) ) - qFatal(QString("Not switch protection from mask name for \"protected\" tag in checksum: %1").arg(list[i])); + qFatal(TQString("Not switch protection from tqmask name for \"protected\" tag in checksum: %1").tqarg(list[i])); } } cdata.protectedMaskNames = list; @@ -352,25 +352,25 @@ QString getChecksumData(QDomElement checksum) return valueName; } -virtual void processDevice(QDomElement device) +virtual void processDevice(TQDomElement device) { Device::XmlToDataBase::processDevice(device); - QString arch = device.attribute("architecture"); + TQString arch = device.attribute("architecture"); data()->_architecture = Architecture::fromKey(arch); - if ( data()->_architecture==Architecture::Nb_Types ) qFatal(QString("Unrecognized architecture \"%1\"").arg(arch)); - if ( (data()->_architecture==Architecture::P18F && data()->_name.contains("C")) - || (data()->_architecture==Architecture::P18F && data()->_name.contains("J")) ) qFatal("Not matching family"); + if ( data()->_architecture==Architecture::Nb_Types ) qFatal(TQString("Unrecognized architecture \"%1\"").tqarg(arch)); + if ( (data()->_architecture==Architecture::P18F && data()->_name.tqcontains("C")) + || (data()->_architecture==Architecture::P18F && data()->_name.tqcontains("J")) ) qFatal("Not matching family"); bool ok; - QString pc = device.attribute("pc"); + TQString pc = device.attribute("pc"); data()->_nbBitsPC = data()->_architecture.data().nbBitsPC; if ( data()->_nbBitsPC==0 ) { data()->_nbBitsPC = pc.toUInt(&ok); if ( !ok || data()->_nbBitsPC==0 ) qFatal("Malformed or missing PC"); } else if ( !pc.isEmpty() ) qFatal("No PC should be provided for this device architecture"); - QString sw = device.attribute("self_write"); + TQString sw = device.attribute("self_write"); data()->_selfWrite = (data()->_memoryTechnology!=Device::MemoryTechnology::Flash ? SelfWrite::No : data()->_architecture.data().selfWrite); if ( data()->_selfWrite==SelfWrite::Nb_Types ) { data()->_selfWrite = SelfWrite::fromKey(sw); @@ -379,8 +379,8 @@ virtual void processDevice(QDomElement device) // device ids FOR_EACH(Device::Special, special) { - QString key = "id" + (special==Device::Special::Normal ? QString::null : QString("_") + special.key()); - QString id = device.attribute(key); + TQString key = "id" + (special==Device::Special::Normal ? TQString() : TQString("_") + special.key()); + TQString id = device.attribute(key); if ( id.isEmpty() ) { if ( special==Device::Special::Normal ) data()->_ids[special] = 0x0000; } else { @@ -390,13 +390,13 @@ virtual void processDevice(QDomElement device) } // voltages - QStringList names; + TQStringList names; FOR_EACH(ProgVoltageType, vtype) { names += vtype.key(); if ( !getVoltages(vtype, device) ) { switch (vtype.type()) { case ProgVoltageType::Vpp: - case ProgVoltageType::VddBulkErase: qFatal(QString("Voltage \"%1\" not defined").arg(vtype.key())); + case ProgVoltageType::VddBulkErase: qFatal(TQString("Voltage \"%1\" not defined").tqarg(vtype.key())); case ProgVoltageType::VddWrite: data()->_voltages[ProgVoltageType::VddWrite] = data()->_voltages[ProgVoltageType::VddBulkErase]; break; case ProgVoltageType::Nb_Types: Q_ASSERT(false); break; } @@ -426,7 +426,7 @@ virtual void processDevice(QDomElement device) Address start2 = data()->_ranges[i].start + data()->_ranges[i].hexFileOffset; Address end2 = data()->_ranges[i].end + data()->_ranges[i].hexFileOffset; if ( end1>=start2 && start1<=end2 ) - qFatal(QString("Overlapping memory ranges (%1 and %2)").arg(k.key()).arg(i.key())); + qFatal(TQString("Overlapping memory ranges (%1 and %2)").tqarg(k.key()).tqarg(i.key())); } } checkTagNames(device, "memory", names); @@ -434,24 +434,24 @@ virtual void processDevice(QDomElement device) qFatal("Id present and device id memory range absent or the opposite"); // config words - QValueVector<Config::Word> cwords = getConfigWords(device); + TQValueVector<Config::Word> cwords = getConfigWords(device); uint nbWords = data()->nbWords(MemoryRangeType::Config); data()->_config->_words.resize(nbWords); FOR_EACH(Pic::ConfigNameType, type) { - QMap<QString, QString> cnames; // cname -> mask name + TQMap<TQString, TQString> cnames; // cname -> tqmask name for (uint i=0; i<nbWords; i++) { - if ( cwords[i].name.isNull() ) qFatal(QString("Config word #%1 not defined").arg(i)); + if ( cwords[i].name.isNull() ) qFatal(TQString("Config word #%1 not defined").tqarg(i)); data()->_config->_words[i] = cwords[i]; const Config::Word &word = data()->_config->_words[i]; - for (uint j=0; j<uint(word.masks.count()); j++) { - const Config::Mask &mask = word.masks[j]; - for (uint k=0; k<uint(mask.values.count()); k++) { - const QStringList &vcnames = mask.values[k].configNames[type]; + for (uint j=0; j<uint(word.tqmasks.count()); j++) { + const Config::Mask &tqmask = word.tqmasks[j]; + for (uint k=0; k<uint(tqmask.values.count()); k++) { + const TQStringList &vcnames = tqmask.values[k].configNames[type]; for (uint l=0; l<uint(vcnames.count()); l++) { if ( vcnames[l].startsWith("0x") ) continue; - if ( cnames.contains(vcnames[l]) && cnames[vcnames[l]]!=mask.name ) - qFatal(QString("Duplicated config name for %1/%2").arg(mask.name).arg(mask.values[k].name)); - cnames[vcnames[l]] = word.masks[j].name; + if ( cnames.tqcontains(vcnames[l]) && cnames[vcnames[l]]!=tqmask.name ) + qFatal(TQString("Duplicated config name for %1/%2").tqarg(tqmask.name).tqarg(tqmask.values[k].name)); + cnames[vcnames[l]] = word.tqmasks[j].name; } } } @@ -460,64 +460,64 @@ virtual void processDevice(QDomElement device) // check validity of value names for (uint i=0; i<nbWords; i++) { const Config::Word &word = data()->_config->_words[i]; - for (uint j=0; j<uint(word.masks.count()); j++) { - const Config::Mask &mask = word.masks[j]; - for (uint k=0; k<uint(mask.values.count()); k++) { - const Config::Value &value = mask.values[k]; + for (uint j=0; j<uint(word.tqmasks.count()); j++) { + const Config::Mask &tqmask = word.tqmasks[j]; + for (uint k=0; k<uint(tqmask.values.count()); k++) { + const Config::Value &value = tqmask.values[k]; if ( !value.isValid() ) continue; - if ( !data()->_config->checkValueName(mask.name, value.name) ) - qFatal(QString("Malformed value name \"%1\" in mask %2").arg(value.name).arg(mask.name)); + if ( !data()->_config->checkValueName(tqmask.name, value.name) ) + qFatal(TQString("Malformed value name \"%1\" in tqmask %2").tqarg(value.name).tqarg(tqmask.name)); } } } // check if all values are explicit for (uint i=0; i<nbWords; i++) { const Config::Word &word = data()->_config->_words[i]; - for (uint j=0; j<uint(word.masks.count()); j++) { - const Config::Mask &mask = word.masks[j]; + for (uint j=0; j<uint(word.tqmasks.count()); j++) { + const Config::Mask &tqmask = word.tqmasks[j]; BitValue::const_iterator it; - for (it=mask.value.begin(); it!=mask.value.end(); ++it) - if ( !hasValue(mask, *it) ) qFatal(QString("Value %1 not defined in mask %2").arg(toHexLabel(*it, data()->nbCharsWord(MemoryRangeType::Config))).arg(mask.name)); + for (it=tqmask.value.begin(); it!=tqmask.value.end(); ++it) + if ( !hasValue(tqmask, *it) ) qFatal(TQString("Value %1 not defined in tqmask %2").tqarg(toHexLabel(*it, data()->nbCharsWord(MemoryRangeType::Config))).tqarg(tqmask.name)); } } // checksums (after config bits!) - QDomElement checksums = findUniqueElement(device, "checksums", QString::null, QString::null); + TQDomElement checksums = findUniqueElement(device, "checksums", TQString(), TQString()); if ( checksums.isNull() ) { // qFatal("No checksum defined"); // #### FIXME } else { - QMap<QString, bool> valueNames; + TQMap<TQString, bool> valueNames; const Pic::Protection &protection = data()->_config->protection(); if ( protection.family()==Protection::BasicProtection ) { - QString maskName = protection.maskName(Protection::ProgramProtected, MemoryRangeType::Code); - const Pic::Config::Mask *mask = data()->_config->findMask(maskName); - Q_ASSERT(mask); - for (uint i=0; i<uint(mask->values.count()); i++) valueNames[mask->values[i].name] = false; + TQString tqmaskName = protection.tqmaskName(Protection::ProgramProtected, MemoryRangeType::Code); + const Pic::Config::Mask *tqmask = data()->_config->findMask(tqmaskName); + Q_ASSERT(tqmask); + for (uint i=0; i<uint(tqmask->values.count()); i++) valueNames[tqmask->values[i].name] = false; } - QDomNode child = checksums.firstChild(); + TQDomNode child = checksums.firstChild(); while ( !child.isNull() ) { if ( !child.isElement() ) continue; if ( child.nodeName()!="checksum" ) qFatal("Childs of \"checksums\" should \"checksum\""); - QString valueName = getChecksumData(child.toElement()); + TQString valueName = getChecksumData(child.toElement()); if ( protection.family()==Protection::BasicProtection ) { - if ( !valueNames.contains(valueName) ) qFatal("Unknown protected attribute"); + if ( !valueNames.tqcontains(valueName) ) qFatal("Unknown protected attribute"); valueNames[valueName] = true; } child = child.nextSibling(); } - QMap<QString, bool>::const_iterator it; + TQMap<TQString, bool>::const_iterator it; for (it=valueNames.begin(); it!=valueNames.end(); ++it) - if ( !it.key().isEmpty() && !it.data() ) qFatal(QString("Missing checksum \"%1\"").arg(it.key())); + if ( !it.key().isEmpty() && !it.data() ) qFatal(TQString("Missing checksum \"%1\"").tqarg(it.key())); } } -void processMirrored(QDomElement element) +void processMirrored(TQDomElement element) { - QValueVector<RangeData> mirrored; - QDomNode child = element.firstChild(); + TQValueVector<RangeData> mirrored; + TQDomNode child = element.firstChild(); while ( !child.isNull() ) { if ( !child.isElement() ) qFatal("\"mirror\" child should be an element"); - QDomElement e = child.toElement(); + TQDomElement e = child.toElement(); if ( e.nodeName()!="range" ) qFatal("\"mirror\" child should be \"range\""); RangeData rd; bool ok; @@ -532,7 +532,7 @@ void processMirrored(QDomElement element) if ( !mirrored.isEmpty() ) static_cast<RegistersData *>(data()->_registersData)->mirrored.append(mirrored); } -void processUnused(QDomElement e) +void processUnused(TQDomElement e) { RangeData rd; bool ok; @@ -544,64 +544,64 @@ void processUnused(QDomElement e) static_cast<RegistersData *>(data()->_registersData)->unused.append(rd); } -void processSfr(QDomElement e) +void processSfr(TQDomElement e) { - QString name = e.attribute("name"); + TQString name = e.attribute("name"); if ( name.isEmpty() ) qFatal("SFR cannot have empty name"); - if ( data()->registersData().sfrs.contains(name) || data()->registersData().combined.contains(name) ) + if ( data()->registersData().sfrs.tqcontains(name) || data()->registersData().combined.tqcontains(name) ) qFatal("SFR name is duplicated"); bool ok; uint address = fromHexLabel(e.attribute("address"), &ok); - if ( !ok ) qFatal(QString("SFR %1 address %2 is malformed").arg(name).arg(e.attribute("address"))); + if ( !ok ) qFatal(TQString("SFR %1 address %2 is malformed").tqarg(name).tqarg(e.attribute("address"))); uint rlength = data()->registersData().nbBanks * data()->architecture().data().registerBankLength; - if ( address>=rlength ) qFatal(QString("Address %1 outside register range").arg(toHexLabel(address, 3))); + if ( address>=rlength ) qFatal(TQString("Address %1 outside register range").tqarg(toHexLabel(address, 3))); RegisterData rdata; rdata.address = address; uint nb = data()->registersData().nbBits(); - if ( nb>Device::MAX_NB_PORT_BITS ) qFatal(QString("Need higher MAX_NB_PORT_BITS: %1").arg(nb)); - QString access = e.attribute("access"); + if ( nb>Device::MAX_NB_PORT_BITS ) qFatal(TQString("Need higher MAX_NB_PORT_BITS: %1").tqarg(nb)); + TQString access = e.attribute("access"); if ( uint(access.length())!=nb ) qFatal("access is missing or malformed"); - QString mclr = e.attribute("mclr"); + TQString mclr = e.attribute("mclr"); if ( uint(mclr.length())!=nb ) qFatal("mclr is missing or malformed"); - QString por = e.attribute("por"); + TQString por = e.attribute("por"); if ( uint(por.length())!=nb ) qFatal("por is missing or malformed"); for (uint i=0; i<nb; i++) { uint k = nb - i - 1; bool ok; rdata.bits[k].properties = RegisterBitProperties(fromHex(access[i].latin1(), &ok)); - if ( !ok || rdata.bits[k].properties>MaxRegisterBitProperty ) qFatal(QString("Malformed access bit %1").arg(k)); + if ( !ok || rdata.bits[k].properties>MaxRegisterBitProperty ) qFatal(TQString("Malformed access bit %1").tqarg(k)); rdata.bits[k].mclr = RegisterBitState(fromHex(mclr[i].latin1(), &ok)); - if ( !ok || rdata.bits[k].mclr>Nb_RegisterBitStates ) qFatal(QString("Malformed mclr bit %1").arg(k)); + if ( !ok || rdata.bits[k].mclr>Nb_RegisterBitStates ) qFatal(TQString("Malformed mclr bit %1").tqarg(k)); rdata.bits[k].por = RegisterBitState(fromHex(por[i].latin1(), &ok)); - if ( !ok || rdata.bits[k].por>Nb_RegisterBitStates ) qFatal(QString("Malformed por bit %1").arg(k)); + if ( !ok || rdata.bits[k].por>Nb_RegisterBitStates ) qFatal(TQString("Malformed por bit %1").tqarg(k)); } static_cast<RegistersData *>(data()->_registersData)->sfrs[name] = rdata; } -void processCombined(QDomElement e) +void processCombined(TQDomElement e) { - QString name = e.attribute("name"); + TQString name = e.attribute("name"); if ( name.isEmpty() ) qFatal("Combined register cannot have empty name"); - if ( data()->registersData().sfrs.contains(name) || data()->registersData().combined.contains(name) ) + if ( data()->registersData().sfrs.tqcontains(name) || data()->registersData().combined.tqcontains(name) ) qFatal("Combined register name is duplicated"); bool ok; CombinedData rdata; rdata.address = fromHexLabel(e.attribute("address"), &ok); - if ( !ok ) qFatal(QString("Combined %1 address %2 is malformed").arg(name).arg(e.attribute("address"))); + if ( !ok ) qFatal(TQString("Combined %1 address %2 is malformed").tqarg(name).tqarg(e.attribute("address"))); uint rlength = data()->registersData().nbBanks * data()->architecture().data().registerBankLength; - if ( rdata.address>=rlength ) qFatal(QString("Address %1 outside register range").arg(toHexLabel(rdata.address, 3))); + if ( rdata.address>=rlength ) qFatal(TQString("Address %1 outside register range").tqarg(toHexLabel(rdata.address, 3))); rdata.nbChars = 2*e.attribute("size").toUInt(&ok); - if ( !ok || rdata.nbChars<2 ) qFatal(QString("Combined %1 size %2 is malformed").arg(name).arg(e.attribute("size"))); + if ( !ok || rdata.nbChars<2 ) qFatal(TQString("Combined %1 size %2 is malformed").tqarg(name).tqarg(e.attribute("size"))); Address end = rdata.address + rdata.nbChars/2 - 1; - if ( end>=rlength ) qFatal(QString("Address %1 outside register range").arg(toHexLabel(end, 3))); + if ( end>=rlength ) qFatal(TQString("Address %1 outside register range").tqarg(toHexLabel(end, 3))); static_cast<RegistersData *>(data()->_registersData)->combined[name] = rdata; } -void processDeviceRegisters(QDomElement element) +void processDeviceRegisters(TQDomElement element) { - QString s = element.attribute("same_as"); + TQString s = element.attribute("same_as"); if ( !s.isEmpty() ) { - if ( !_map.contains(s) ) qFatal(QString("Registers same as unknown device %1").arg(s)); + if ( !_map.tqcontains(s) ) qFatal(TQString("Registers same as unknown device %1").tqarg(s)); const Pic::Data *d = static_cast<const Pic::Data *>(_map[s]); data()->_registersData = d->_registersData; return; @@ -614,54 +614,54 @@ void processDeviceRegisters(QDomElement element) if ( data()->is18Family() ) { rdata.accessBankSplit = fromHexLabel(element.attribute("access_bank_split_offset"), &ok); if ( !ok || rdata.accessBankSplit==0 || rdata.accessBankSplit>=0xFF ) qFatal("Malformed access bank split offset"); - rdata.unusedBankMask = fromHexLabel(element.attribute("unused_bank_mask"), &ok); - if ( !ok || rdata.unusedBankMask>=maxValue(NumberBase::Hex, rdata.nbBanks) ) qFatal("Malformed access unused bank mask"); + rdata.unusedBankMask = fromHexLabel(element.attribute("unused_bank_tqmask"), &ok); + if ( !ok || rdata.unusedBankMask>=maxValue(NumberBase::Hex, rdata.nbBanks) ) qFatal("Malformed access unused bank tqmask"); } else { rdata.accessBankSplit = 0; rdata.unusedBankMask = 0; } - QDomNode child = element.firstChild(); + TQDomNode child = element.firstChild(); while ( !child.isNull() ) { if ( !child.isElement() ) qFatal("\"device\" child should be an element"); - QDomElement e = child.toElement(); + TQDomElement e = child.toElement(); if ( e.nodeName()=="mirror" ) processMirrored(e); else if ( e.nodeName()=="unused" ) processUnused(e); else if ( e.nodeName()=="combined" ) processCombined(e); else if ( e.nodeName()=="sfr" ) processSfr(e); - else qFatal(QString("Node name \"%1\" is not recognized").arg(e.nodeName())); + else qFatal(TQString("Node name \"%1\" is not recognized").tqarg(e.nodeName())); child = child.nextSibling(); } for (uint i=0; i<Device::MAX_NB_PORTS; i++) { - QString portname = rdata.portName(i); + TQString portname = rdata.portName(i); if ( portname.isEmpty() ) break; - bool hasPort = rdata.sfrs.contains(portname); - QString trisname = rdata.trisName(i); + bool hasPort = rdata.sfrs.tqcontains(portname); + TQString trisname = rdata.trisName(i); if ( trisname.isEmpty() ) continue; - bool hasTris = rdata.sfrs.contains(trisname); - if ( !hasPort && hasTris ) qFatal(QString("%1 needs %2 to be present").arg(trisname).arg(portname)); - QString latchname = rdata.latchName(i); + bool hasTris = rdata.sfrs.tqcontains(trisname); + if ( !hasPort && hasTris ) qFatal(TQString("%1 needs %2 to be present").tqarg(trisname).tqarg(portname)); + TQString latchname = rdata.latchName(i); if ( latchname.isEmpty() ) continue; - bool hasLatch = rdata.sfrs.contains(latchname); - if ( !hasPort && hasLatch ) qFatal(QString("%1 needs %2 to be present").arg(latchname).arg(portname)); + bool hasLatch = rdata.sfrs.tqcontains(latchname); + if ( !hasPort && hasLatch ) qFatal(TQString("%1 needs %2 to be present").tqarg(latchname).tqarg(portname)); } } -void processRegistersFile(const QString &filename, QStringList &devices) +void processRegistersFile(const TQString &filename, TQStringList &devices) { - QDomDocument doc = parseFile(filename); - QDomElement root = doc.documentElement(); + TQDomDocument doc = parseFile(filename); + TQDomElement root = doc.documentElement(); if ( root.nodeName()!="registers" ) qFatal("root node should be \"registers\""); - for (QDomNode child=root.firstChild(); !child.isNull(); child = child.nextSibling()) { + for (TQDomNode child=root.firstChild(); !child.isNull(); child = child.nextSibling()) { if ( child.isComment() ) qDebug("comment: %s", child.toComment().data().latin1()); else { if ( !child.isElement() ) qFatal("\"registers\" child should be an element"); if ( child.nodeName()!="device" ) qFatal("Device node should be named \"device\""); - QDomElement device = child.toElement(); - QString name = device.attribute("name"); - if ( devices.contains(name) ) qFatal(QString("Registers already defined for %1").arg(name)); - if ( _map.contains(name) ) { + TQDomElement device = child.toElement(); + TQString name = device.attribute("name"); + if ( devices.tqcontains(name) ) qFatal(TQString("Registers already defined for %1").tqarg(name)); + if ( _map.tqcontains(name) ) { _data = _map[name]; processDeviceRegisters(device); devices.append(name); @@ -672,34 +672,34 @@ void processRegistersFile(const QString &filename, QStringList &devices) void processRegisters() { - QStringList devices; + TQStringList devices; processRegistersFile("registers/registers.xml", devices); processRegistersFile("registers/registers_missing.xml", devices); // check if we miss any register description - QMap<QString, Device::Data *>::const_iterator it = _map.begin(); + TQMap<TQString, Device::Data *>::const_iterator it = _map.begin(); for (; it!=_map.end(); ++it) { _data = it.data(); - if ( !devices.contains(it.key()) ) qWarning("Register description not found for %s", it.key().latin1()); + if ( !devices.tqcontains(it.key()) ) qWarning("Register description not found for %s", it.key().latin1()); } } -virtual void checkPins(const QMap<QString, uint> &pinLabels) const +virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const { - if ( !pinLabels.contains("VDD") ) qFatal("No VDD pin specified"); - if ( !pinLabels.contains("VSS") ) qFatal("No VSS pin specified"); - QMap<QString, uint>::const_iterator it; + if ( !pinLabels.tqcontains("VDD") ) qFatal("No VDD pin specified"); + if ( !pinLabels.tqcontains("VSS") ) qFatal("No VSS pin specified"); + TQMap<TQString, uint>::const_iterator it; for (it=pinLabels.begin(); it!=pinLabels.end(); ++it) { if ( it.key()=="VDD" || it.key()=="VSS" || it.key().startsWith("CCP") ) continue; - if ( it.data()!=1 ) qFatal(QString("Duplicated pin \"%1\"").arg(it.key())); + if ( it.data()!=1 ) qFatal(TQString("Duplicated pin \"%1\"").tqarg(it.key())); } const Pic::RegistersData &rdata = static_cast<const Pic::RegistersData &>(*_data->registersData()); for (uint i=0; i<Device::MAX_NB_PORTS; i++) { if ( !rdata.hasPort(i) ) continue; for (uint k=0; k<Device::MAX_NB_PORT_BITS; k++) { if ( !rdata.hasPortBit(i, k) ) continue; - QString name = rdata.portBitName(i, k); - if ( !pinLabels.contains(name) ) qFatal(QString("Pin \"%1\" not present").arg(name)); + TQString name = rdata.portBitName(i, k); + if ( !pinLabels.tqcontains(name) ) qFatal(TQString("Pin \"%1\" not present").tqarg(name)); } } } |