diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-03-01 13:22:13 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-03-01 13:22:13 -0600 |
commit | 9abf98be4f3111c54f13dcb44902a275bd2d7169 (patch) | |
tree | d6771816657222c79deae56c23c2d6339cba27e3 | |
parent | 2b18f76290022900fe896ebac6b2b6da30a9f136 (diff) | |
download | piklab-9abf98be4f3111c54f13dcb44902a275bd2d7169.tar.gz piklab-9abf98be4f3111c54f13dcb44902a275bd2d7169.zip |
Rename additional global TQt functions
45 files changed, 339 insertions, 339 deletions
diff --git a/src/coff/base/coff_object.cpp b/src/coff/base/coff_object.cpp index ee49a95..98f8f3b 100644 --- a/src/coff/base/coff_object.cpp +++ b/src/coff/base/coff_object.cpp @@ -205,7 +205,7 @@ Coff::Symbol::Symbol(const Object &object, const TQByteArray &data, uint start, if ( v==sclass.data().id ) { _sclass = sclass; break; } if ( !getULong(data, offset, 1, log, v) ) return; uint nbAux = v; - //qDebug("symbol: %s value=%s type=%i dtype=%i class=%i nbAux=%i section=%i", _name.latin1(), toHexLabel(_value, 4).latin1(), _type, _dtype, _class, nbAux, _section); + //tqDebug("symbol: %s value=%s type=%i dtype=%i class=%i nbAux=%i section=%i", _name.latin1(), toHexLabel(_value, 4).latin1(), _type, _dtype, _class, nbAux, _section); AuxSymbolType auxType = AuxSymbolType::Nb_Types; if ( _name==".direct" ) auxType = AuxSymbolType::Direct; @@ -262,7 +262,7 @@ Coff::Relocation::Relocation(const Object &object, const Section §ion, } if ( !getULong(data, offset, 2, log, v) ) return; _type = v; - //qDebug("reloc %s: address=%s offset=%i type=%i", _symbol->_name.latin1(), toHexLabel(_address, 4).latin1(), _offset, _type); + //tqDebug("reloc %s: address=%s offset=%i type=%i", _symbol->_name.latin1(), toHexLabel(_address, 4).latin1(), _offset, _type); } //---------------------------------------------------------------------------- @@ -280,7 +280,7 @@ Coff::CodeLine::CodeLine(const Object &object, const Section §ion, if ( _line!=0 ) { _address = tmp; _filename = lastFilename; - //qDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1()); + //tqDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1()); } else { if ( tmp>=object.nbSymbols() ) { log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp)); @@ -292,7 +292,7 @@ Coff::CodeLine::CodeLine(const Object &object, const Section §ion, } _symbol = static_cast<const Symbol *>(object.symbol(tmp)); _filename = _symbol->filename(); - //qDebug("code line %i: %s", _line, _symbol->_name.latin1()); + //tqDebug("code line %i: %s", _line, _symbol->_name.latin1()); } } else { if ( tmp>=object.nbSymbols() ) { @@ -314,7 +314,7 @@ Coff::CodeLine::CodeLine(const Object &object, const Section §ion, // flags if ( !getULong(data, offset, 4, log, v) ) return; // function index - //qDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1()); + //tqDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1()); } // if ( _symbol && _symbol->_class!=Symbol::CFile ) // log.log(Log::LineType::Warning, i18n("Line without file symbol associated (%1:%2 %3).") @@ -362,7 +362,7 @@ Coff::Section::Section(const Device::Data &device, const Object &object, // read data Q_ASSERT ( device.group().name()=="pic" ); const Pic::Data &pdata = static_cast<const Pic::Data &>(device); - //qDebug("section %s: address=%s size=%i flags=%i", _name.data(), toHexLabel(_address, 4).latin1(), _size, int(_flags)); + //tqDebug("section %s: address=%s size=%i flags=%i", _name.data(), toHexLabel(_address, 4).latin1(), _size, int(_flags)); if ( _size!=0 && dataOffset!=0 ) { uint inc = 1; uint nbWords = _size; @@ -392,7 +392,7 @@ Coff::Section::Section(const Device::Data &device, const Object &object, _instructions[address+inc].opcode = toHex(op2, pdata.nbCharsWord(Pic::MemoryRangeType::Code)); i++; } - //qDebug(" %s: %s (%s %s)", toHex(address, 4).data(), _data[address].disasm.data(), _data[address].opcode.data(), (nbop==2 ? _data[address+inc].opcode.data() : "")); + //tqDebug(" %s: %s (%s %s)", toHex(address, 4).data(), _data[address].disasm.data(), _data[address].opcode.data(), (nbop==2 ? _data[address+inc].opcode.data() : "")); } else if ( _flags & FDataRom ) _instructions[address].opcode = toHex(op, 4); else if ( _flags & FData ) _instructions[address].opcode = toHex(op.maskWith(0xFF), 2); } diff --git a/src/coff/base/text_coff.cpp b/src/coff/base/text_coff.cpp index 1ddeb30..d8eba7b 100644 --- a/src/coff/base/text_coff.cpp +++ b/src/coff/base/text_coff.cpp @@ -100,7 +100,7 @@ void Coff::TextObject::init() const const Section *sec = section(*lines[k]); if (sec) { ldata.codes[k].opcode = "0x" + sec->instructions()[address].opcode.upper(); - //qDebug("%s: %s", ldata.codes[k].address.latin1(), ldata.codes[k].opcode.latin1()); + //tqDebug("%s: %s", ldata.codes[k].address.latin1(), ldata.codes[k].opcode.latin1()); opcodeWidth = qMax(opcodeWidth, uint(ldata.codes[k].opcode.length())); TQString s = sec->instructions()[address].disasm; int j = s.find('\t'); diff --git a/src/coff/xml/xml_coff_parser.cpp b/src/coff/xml/xml_coff_parser.cpp index 556cdb0..9b915bf 100644 --- a/src/coff/xml/xml_coff_parser.cpp +++ b/src/coff/xml/xml_coff_parser.cpp @@ -35,14 +35,14 @@ private: void Coff::XmlToData::parseData(TQDomElement element, Data &data) { TQStringList list = TQStringList::split(' ', element.attribute("id")); - if ( list.isEmpty() ) qFatal("Missing id"); - if ( list.count()>MAX_NB_IDS ) qFatal("Please raise MAX_NB_IDS"); + if ( list.isEmpty() ) tqFatal("Missing id"); + if ( list.count()>MAX_NB_IDS ) tqFatal("Please raise MAX_NB_IDS"); for (uint i=0; i<MAX_NB_IDS; i++) { if ( i<uint(list.count()) ) { bool ok; data.ids[i] = fromHexLabel(list[i], 4, &ok); - if ( !ok ) qFatal("Invalid id"); - //if ( _ids.contains(data.ids[i]) ) qFatal("Duplicated id"); + if ( !ok ) tqFatal("Invalid id"); + //if ( _ids.contains(data.ids[i]) ) tqFatal("Duplicated id"); //_ids[data.ids[i]] = true; } else data.ids[i] = 0; } @@ -93,19 +93,19 @@ void Coff::XmlToData::parse() case Pic::Architecture::P33F: continue; case Pic::Architecture::Nb_Types: Q_ASSERT(false); continue; } - if ( !hasDevice(data->name()) ) qWarning("No id for device %s", data->name().latin1()); + if ( !hasDevice(data->name()) ) tqWarning("No id for device %s", data->name().latin1()); } // extract COFF id from gputils for (uint i=0; pics[i].tag!=no_processor; i++) { _current = TQString(pics[i].names[2]).upper(); if ( !Device::lister().isSupported(_current) ) continue; - if ( !hasDevice(_current) ) qDebug(">> add new id %s: %s", _current.latin1(), toHexLabel(pics[i].coff_type, 4).latin1()); + if ( !hasDevice(_current) ) tqDebug(">> add new id %s: %s", _current.latin1(), toHexLabel(pics[i].coff_type, 4).latin1()); else { bool ok = false; for (uint k=0; k<MAX_NB_IDS; k++) if ( _map[_current].data.ids[k]==pics[i].coff_type ) ok = true; - if ( !ok ) qFatal(TQString("Different ids")); + if ( !ok ) tqFatal(TQString("Different ids")); } } } diff --git a/src/common/common/bitvalue.cpp b/src/common/common/bitvalue.cpp index 16d5ef0..b0a7a30 100644 --- a/src/common/common/bitvalue.cpp +++ b/src/common/common/bitvalue.cpp @@ -17,7 +17,7 @@ BitValue BitValue::XORn(uint n) const uint res = 0x0; for (uint i=0; i<nb; i +=n) { res ^= (_value >> i) & mask; - //qDebug("%i %s %s", i, toHexLabel((value>>i) & mask, 4).latin1(), toHexLabel(res, 4).latin1()); + //tqDebug("%i %s %s", i, toHexLabel((value>>i) & mask, 4).latin1(), toHexLabel(res, 4).latin1()); } return res; } diff --git a/src/common/common/misc.cpp b/src/common/common/misc.cpp index 1c22b4e..0e8b86a 100644 --- a/src/common/common/misc.cpp +++ b/src/common/common/misc.cpp @@ -48,7 +48,7 @@ TQString htmlTableRow(const TQString &title, const TQString &value) void crash(const char *assert, const char *file, int line) { - qDebug("CRASH_ASSERT: \"%s\" in %s (%d)", assert, file, line); + tqDebug("CRASH_ASSERT: \"%s\" in %s (%d)", assert, file, line); int * ptr = 0; (*ptr)++; } diff --git a/src/common/common/number.cpp b/src/common/common/number.cpp index 01fa4eb..e0b5b0a 100644 --- a/src/common/common/number.cpp +++ b/src/common/common/number.cpp @@ -26,7 +26,7 @@ const NumberBase::Data NumberBase::DATA[Nb_Types] = { char toChar(NumberBase base, uint value) { Q_ASSERT( value<base.data().base ); - if ( value>=base.data().base ) qDebug("toChar %u (%u)", value, base.data().base); + if ( value>=base.data().base ) tqDebug("toChar %u (%u)", value, base.data().base); if ( base==NumberBase::String ) { if ( !isprint(value) ) return '.'; return value; @@ -45,7 +45,7 @@ TQString toString(NumberBase base, ulong value, uint nbChars) value /= base.data().base; } Q_ASSERT( value==0 ); - if ( value!=0 ) qDebug("toString %s nbChars=%u", toLabel(base, tmp, ::nbChars(base, tmp)).latin1(), nbChars); + if ( value!=0 ) tqDebug("toString %s nbChars=%u", toLabel(base, tmp, ::nbChars(base, tmp)).latin1(), nbChars); return s; } diff --git a/src/common/global/generic_config.cpp b/src/common/global/generic_config.cpp index 6ddf44c..6b50ff0 100644 --- a/src/common/global/generic_config.cpp +++ b/src/common/global/generic_config.cpp @@ -51,7 +51,7 @@ GenericConfig::~GenericConfig() void GenericConfig::rollback() { #if defined(NO_KDE) - qWarning("Config rollback not supported"); + tqWarning("Config rollback not supported"); #else _d->config().rollback(); #endif diff --git a/src/common/global/progress_monitor.cpp b/src/common/global/progress_monitor.cpp index 0b3044d..bcb75a1 100644 --- a/src/common/global/progress_monitor.cpp +++ b/src/common/global/progress_monitor.cpp @@ -78,7 +78,7 @@ void ProgressMonitor::addTaskProgress(uint nbSteps) if ( _current==_tasks.end() ) return; uint nb = (*_current).nbDoneSteps + nbSteps; Q_ASSERT( nb<=(*_current).nbSteps ); - if ( nb>(*_current).nbSteps ) qDebug("%s %i+%i > %i", (*_current).label.latin1(), (*_current).nbDoneSteps, nbSteps, (*_current).nbSteps); + if ( nb>(*_current).nbSteps ) tqDebug("%s %i+%i > %i", (*_current).label.latin1(), (*_current).nbDoneSteps, nbSteps, (*_current).nbSteps); (*_current).nbDoneSteps = TQMIN(nb, (*_current).nbSteps); update(); } diff --git a/src/common/global/purl.cpp b/src/common/global/purl.cpp index d0b5498..c9ff16d 100644 --- a/src/common/global/purl.cpp +++ b/src/common/global/purl.cpp @@ -62,7 +62,7 @@ TQString PURL::Private::getWindowsDrivePath(char drive) ::Process::StringOutput process; process.setup("winepath", args, false); ::Process::State state = ::Process::runSynchronously(process, ::Process::Start, 3000); - if ( state!=::Process::Exited ) qWarning("Error running \"winepath\" with \"%s\" (%i)", args.join(" ").latin1(), state); + if ( state!=::Process::Exited ) tqWarning("Error running \"winepath\" with \"%s\" (%i)", args.join(" ").latin1(), state); s = process.sout() + process.serr(); TQDir dir(s.stripWhiteSpace()); _winDrives[drive] = dir.canonicalPath(); @@ -250,7 +250,7 @@ bool PURL::Base::isInto(const Directory &dir) const bool PURL::Base::httpUrlExists(bool *ok) const { - qInitNetworkProtocols(); + tqInitNetworkProtocols(); if (ok) *ok = false; Http http(_url.host()); Synchronous sync(500); diff --git a/src/common/gui/list_view.cpp b/src/common/gui/list_view.cpp index 1e0cb66..9bce72c 100644 --- a/src/common/gui/list_view.cpp +++ b/src/common/gui/list_view.cpp @@ -46,7 +46,7 @@ bool ListView::eventFilter(TQObject *o, TQEvent *e) for (it=_editItems.begin(); it!=_editItems.end(); ++it) { for (uint i=0; i<(*it)->_editWidgets.count(); i++) { if ( TQT_BASE_OBJECT((*it)->_editWidgets[i])==TQT_BASE_OBJECT(o) ) { - //qDebug("event %i", e->type()); + //tqDebug("event %i", e->type()); switch (e->type()) { case TQEvent::KeyPress: { TQKeyEvent *ke = TQT_TQKEYEVENT(e); @@ -62,9 +62,9 @@ bool ListView::eventFilter(TQObject *o, TQEvent *e) break; } case TQEvent::FocusOut: { - //qDebug("focus out %i %i=%i", tqApp->focusWidget(), focusWidget(), (*it)->_editWidgets[i]); + //tqDebug("focus out %i %i=%i", tqApp->focusWidget(), focusWidget(), (*it)->_editWidgets[i]); if ( tqApp->focusWidget() && focusWidget()==(*it)->_editWidgets[i] ) break; - //qDebug("ext"); + //tqDebug("ext"); TQCustomEvent *e = new TQCustomEvent(9999); TQApplication::postEvent(o, e); return true; @@ -73,7 +73,7 @@ bool ListView::eventFilter(TQObject *o, TQEvent *e) (*it)->renameDone(false); return true; default: - //qDebug(" ignored"); + //tqDebug(" ignored"); break; } } diff --git a/src/common/nokde/nokde_kaboutdata.cpp b/src/common/nokde/nokde_kaboutdata.cpp index 85edf3c..e0c4963 100644 --- a/src/common/nokde/nokde_kaboutdata.cpp +++ b/src/common/nokde/nokde_kaboutdata.cpp @@ -165,7 +165,7 @@ KAboutData::setLicenseText( const char *licenseText ) void KAboutData::setLicenseTextFile( const TQString &file ) { - mLicenseText = qstrdup(TQFile::encodeName(file)); + mLicenseText = tqstrdup(TQFile::encodeName(file)); mLicenseKey = License_File; } diff --git a/src/common/nokde/nokde_kcmdlineargs.cpp b/src/common/nokde/nokde_kcmdlineargs.cpp index 42dc5c1..6c34b0b 100644 --- a/src/common/nokde/nokde_kcmdlineargs.cpp +++ b/src/common/nokde/nokde_kcmdlineargs.cpp @@ -618,7 +618,7 @@ KCmdLineArgs::parseAllArgs() else if ( (::qstrcmp(option, "version") == 0) || (::qstrcmp(option, "v") == 0)) { - printQ( TQString("TQt: %1\n").arg(qVersion())); + printQ( TQString("TQt: %1\n").arg(tqVersion())); // printQ( TQString("KDE: %1\n").arg(TDE_VERSION_STRING)); printQ( TQString("%1: %2\n"). arg(about->programName()).arg(about->version())); @@ -742,11 +742,11 @@ KCmdLineArgs::qt_argv() } qt_argv = new char*[ args->count() + 2 ]; - qt_argv[ 0 ] = qstrdup( appName()); + qt_argv[ 0 ] = tqstrdup( appName()); int i = 0; for(; i < args->count(); i++) { - qt_argv[i+1] = qstrdup((char *) args->arg(i)); + qt_argv[i+1] = tqstrdup((char *) args->arg(i)); } qt_argv[i+1] = 0; diff --git a/src/common/port/port_base.cpp b/src/common/port/port_base.cpp index 63e820e..249db1a 100644 --- a/src/common/port/port_base.cpp +++ b/src/common/port/port_base.cpp @@ -58,32 +58,32 @@ bool Port::Base::receiveChar(char &c, uint timeout) bool Port::Base::setPinOn(uint, bool, LogicType) { - qFatal("setPinOn not implemented"); + tqFatal("setPinOn not implemented"); return false; } bool Port::Base::readPin(uint, LogicType, bool &) { - qFatal("readPin not implemented"); + tqFatal("readPin not implemented"); return 0; } TQValueVector<Port::PinData> Port::Base::pinData(IODir) const { - qFatal("pinData not implemented"); + tqFatal("pinData not implemented"); return TQValueVector<PinData>(); } bool Port::Base::isGroundPin(uint) const { - qFatal("isGroundPin not implemented"); + tqFatal("isGroundPin not implemented"); return false; } uint Port::Base::groundPin() const { - qFatal("groundPin not implemented"); + tqFatal("groundPin not implemented"); return 0; } Port::IODir Port::Base::ioDir(uint) const { - qFatal("ioType not implemented"); + tqFatal("ioType not implemented"); return NoIO; } @@ -121,7 +121,7 @@ void Port::Base::logData(const TQString &) } } } - qDebug("%s", vs.latin1()); + tqDebug("%s", vs.latin1()); */ //log(Log::Debug, vs); } diff --git a/src/common/port/port_base.h b/src/common/port/port_base.h index c48fed6..5e3ff27 100644 --- a/src/common/port/port_base.h +++ b/src/common/port/port_base.h @@ -46,8 +46,8 @@ public: protected: virtual bool internalOpen() = 0; virtual void internalClose() = 0; - virtual bool internalSend(const char *, uint, uint) { qFatal("Not implemented"); return false; } - virtual bool internalReceive(uint, char *, uint) { qFatal("Not implemented"); return false; } + virtual bool internalSend(const char *, uint, uint) { tqFatal("Not implemented"); return false; } + virtual bool internalReceive(uint, char *, uint) { tqFatal("Not implemented"); return false; } virtual void setSystemError(const TQString &message) = 0; private: diff --git a/src/common/port/usb_port.cpp b/src/common/port/usb_port.cpp index 76fa5b0..8ef4168 100644 --- a/src/common/port/usb_port.cpp +++ b/src/common/port/usb_port.cpp @@ -39,7 +39,7 @@ void Port::USB::initialize() usb_init(); VersionData vd = VersionData::fromString(LIBUSB_VERSION); TQString s = TQString("libusb %1").arg(vd.pretty()); - if ( vd<VersionData(0, 1, 8) ) qWarning("%s: may be too old (you need at least version 0.1.8)", s.latin1()); + if ( vd<VersionData(0, 1, 8) ) tqWarning("%s: may be too old (you need at least version 0.1.8)", s.latin1()); #endif } @@ -71,13 +71,13 @@ bool Port::USB::findBulk(const struct usb_device *dev) #ifdef HAVE_USB int configuration = -1, interface = -1, altsetting = -1, bulk_endpoint = -1; // walk through the possible configs, etc. - qDebug("This device has %d possible configuration(s).", dev->descriptor.bNumConfigurations); + tqDebug("This device has %d possible configuration(s).", dev->descriptor.bNumConfigurations); for (int c=0; c<dev->descriptor.bNumConfigurations; c++) { - qDebug("Looking at configuration %d...This configuration has %d interfaces.", c, dev->config[c].bNumInterfaces); + tqDebug("Looking at configuration %d...This configuration has %d interfaces.", c, dev->config[c].bNumInterfaces); for(int i=0; i<dev->config[c].bNumInterfaces; i++) { - qDebug(" Looking at interface %d...This interface has %d altsettings.", i, dev->config[c].interface[i].num_altsetting); + tqDebug(" Looking at interface %d...This interface has %d altsettings.", i, dev->config[c].interface[i].num_altsetting); for (int a=0; a < dev->config[c].interface[i].num_altsetting; a++) { - qDebug(" Looking at altsetting %d...This altsetting has %d endpoints.", a, dev->config[c].interface[i].altsetting[a].bNumEndpoints); + tqDebug(" Looking at altsetting %d...This altsetting has %d endpoints.", a, dev->config[c].interface[i].altsetting[a].bNumEndpoints); for (int e=0; e < dev->config[c].interface[i].altsetting[a].bNumEndpoints; e++) { TQString s; s.sprintf(" Endpoint %d: Address %02xh, attributes %02xh ", e, dev->config[c].interface[i].altsetting[a].endpoint[e].bEndpointAddress, dev->config[c].interface[i].altsetting[a].endpoint[e].bmAttributes); @@ -109,13 +109,13 @@ bool Port::USB::findBulk(const struct usb_device *dev) default: s += "ERROR! Got an illegal value in endpoint bEndpointAddress"; } } - qDebug("%s", s.latin1()); + tqDebug("%s", s.latin1()); } } } } if (bulk_endpoint<0) { - qDebug("No valid interface found!"); + tqDebug("No valid interface found!"); return false; } #endif @@ -151,7 +151,7 @@ struct usb_device *Port::USB::findDevice(uint vendorId, uint productId) } #else Q_UNUSED(vendorId); Q_UNUSED(productId); - qDebug("USB support disabled"); + tqDebug("USB support disabled"); #endif return 0; } @@ -350,10 +350,10 @@ bool Port::USB::write(uint ep, const char *data, uint size) int todo = size; for (;;) { int res = 0; - //qDebug("write ep=%i todo=%i/%i", ep, todo, size); + //tqDebug("write ep=%i todo=%i/%i", ep, todo, size); if ( mode==Interrupt ) res = usb_interrupt_write(_handle, ep, (char *)data + size - todo, todo, timeout(todo)); else res = usb_bulk_write(_handle, ep, (char *)data + size - todo, todo, timeout(todo)); - //qDebug("res: %i", res); + //tqDebug("res: %i", res); if ( res==todo ) break; if ( uint(time.elapsed())>3000 ) { // 3 s if ( res<0 ) setSystemError(i18n("Error sending data (ep=%1 res=%2)").arg(toHexLabel(ep, 2)).arg(res)); @@ -384,10 +384,10 @@ bool Port::USB::read(uint ep, char *data, uint size, bool *poll) int todo = size; for (;;) { int res = 0; - //qDebug("read ep=%i size=%i", ep, todo); + //tqDebug("read ep=%i size=%i", ep, todo); if ( mode==Interrupt ) res = usb_interrupt_read(_handle, ep, data + size - todo, todo, timeout(todo)); else res = usb_bulk_read(_handle, ep, data + size - todo, todo, timeout(todo)); - //qDebug("res: %i", res); + //tqDebug("res: %i", res); if ( res==todo ) break; if ( uint(time.elapsed())>3000 ) { // 3 s: seems to help icd2 in some case (?) if ( res<0 ) setSystemError(i18n("Error receiving data (ep=%1 res=%2)").arg(toHexLabel(ep, 2)).arg(res)); diff --git a/src/data/syntax_xml_generator.cpp b/src/data/syntax_xml_generator.cpp index d1d44b5..3bf5e2a 100644 --- a/src/data/syntax_xml_generator.cpp +++ b/src/data/syntax_xml_generator.cpp @@ -60,7 +60,7 @@ const char * const INSTRUCTIONS[] = { TQTextStream *initFile(TQFile &file) { - if ( !file.open(IO_WriteOnly) ) qFatal("Cannot create \"%s\".", file.name().latin1()); + if ( !file.open(IO_WriteOnly) ) tqFatal("Cannot create \"%s\".", file.name().latin1()); TQTextStream *s = new TQTextStream(&file); (*s) << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; (*s) << "<!DOCTYPE language SYSTEM \"language.dtd\">" << endl; diff --git a/src/devices/base/device_group.cpp b/src/devices/base/device_group.cpp index db70264..169a103 100644 --- a/src/devices/base/device_group.cpp +++ b/src/devices/base/device_group.cpp @@ -69,7 +69,7 @@ TQPixmap drawGraph(const TQValueVector<Device::RangeBox> &boxes) xTicks.add(0.0, 0.0); yTicks.add(0.0, 0.0); for (uint i=0; i<boxes.count(); i++) { -// qDebug("box #%i: %f=[%f %f] %f=[%f %f]", i, boxes[i].start.x, boxes[i].start.yMin, +// tqDebug("box #%i: %f=[%f %f] %f=[%f %f]", i, boxes[i].start.x, boxes[i].start.yMin, // boxes[i].start.yMax, boxes[i].end.x, boxes[i].end.yMin, boxes[i].end.yMax); xTicks.add(boxes[i].start.x, boxes[i].start.yMin); xTicks.add(boxes[i].start.x, boxes[i].start.yMax); diff --git a/src/devices/base/hex_buffer.cpp b/src/devices/base/hex_buffer.cpp index 3307f79..d4b61a9 100644 --- a/src/devices/base/hex_buffer.cpp +++ b/src/devices/base/hex_buffer.cpp @@ -217,7 +217,7 @@ void HexBuffer::load(TQTextStream &stream, Format &format, TQValueList<ErrorData uint data; if ( sscanf(p, "%02X", &data)!=1 ) errors += ErrorData(line, UnexpectedEOL); else if ( ((cksum+data) & 0xFF)!=0 ) errors += ErrorData(line, WrongCRC); - //qDebug("new address high: %s", toHex(addrH<<16, 8).data()); + //tqDebug("new address high: %s", toHex(addrH<<16, 8).data()); continue; // goto next record } @@ -236,7 +236,7 @@ void HexBuffer::load(TQTextStream &stream, Format &format, TQValueList<ErrorData /* modified by A.G, because low and hi bytes was swapped in Tobias's code , 8 may 2005 */ uint addrbase = ((addrH << 16) | addr); - //qDebug("line %i: address %s", line, toHex(addrbase, 8).data()); + //tqDebug("line %i: address %s", line, toHex(addrbase, 8).data()); for (uint x = 0; x<count; x++) { uint data; if ( sscanf(p, "%02X", &data)!=1 ) { @@ -252,7 +252,7 @@ void HexBuffer::load(TQTextStream &stream, Format &format, TQValueList<ErrorData BitValue value = (*this)[a]; if ( addrbase+x & 1 ) insert(a, value.maskWith(0x00FF) | data << 8); // Odd addr => Hi byte else insert(a, value.maskWith(0xFF00) | data); // Low byte - //if ( x==0 ) qDebug("fb@%s: %s", toHex(addrbase+x >> 1, 8).data(), toHex(fb[addrbase+x >> 1], 8).data()); + //if ( x==0 ) tqDebug("fb@%s: %s", toHex(addrbase+x >> 1, 8).data(), toHex(fb[addrbase+x >> 1], 8).data()); cksum += data; } } else if ( bytecount==count*2 ) { @@ -269,7 +269,7 @@ void HexBuffer::load(TQTextStream &stream, Format &format, TQValueList<ErrorData break; } p += 4; - //qDebug("%s: %s", toHexLabel(addr+x, 4).latin1(), toHexLabel(datal | (datah << 8), 4).latin1()); + //tqDebug("%s: %s", toHexLabel(addr+x, 4).latin1(), toHexLabel(datal | (datah << 8), 4).latin1()); insert(addr+x, datal | (datah << 8)); cksum += datah; cksum += datal; diff --git a/src/devices/mem24/xml/mem24_xml_to_data.cpp b/src/devices/mem24/xml/mem24_xml_to_data.cpp index 6e41c7b..d2a4da5 100644 --- a/src/devices/mem24/xml/mem24_xml_to_data.cpp +++ b/src/devices/mem24/xml/mem24_xml_to_data.cpp @@ -30,14 +30,14 @@ virtual void processDevice(TQDomElement device) TQDomElement e = findUniqueElement(device, "memory", "name", TQString()); bool ok; data()->_nbBytes = fromHexLabel(e.attribute("size"), &ok); - if ( !ok ) qFatal("Missing or invalid size"); + if ( !ok ) tqFatal("Missing or invalid size"); data()->_nbBlocks = e.attribute("nb_blocks").toUInt(&ok); - if ( !ok || data()->_nbBlocks==0 ) qFatal("Missing, zero, or invalid nb_blocks"); - if ( (data()->_nbBytes % data()->_nbBlocks)!=0 ) qFatal("nb_blocks should divide size"); - if ( data()->_nbBlocks>8 ) qFatal("nb_blocks is too large (>8)"); + if ( !ok || data()->_nbBlocks==0 ) tqFatal("Missing, zero, or invalid nb_blocks"); + if ( (data()->_nbBytes % data()->_nbBlocks)!=0 ) tqFatal("nb_blocks should divide size"); + if ( data()->_nbBlocks>8 ) tqFatal("nb_blocks is too large (>8)"); data()->_nbBytesPage = e.attribute("page_size").toUInt(&ok); - if ( !ok || data()->_nbBytesPage==0 ) qFatal("Missing, zero, or invalid page_size"); - if ( ((data()->_nbBytes/data()->_nbBlocks) % data()->_nbBytesPage)!=0 ) qFatal("page_size should divide size/nb_blocks"); + if ( !ok || data()->_nbBytesPage==0 ) tqFatal("Missing, zero, or invalid page_size"); + if ( ((data()->_nbBytes/data()->_nbBlocks) % data()->_nbBytesPage)!=0 ) tqFatal("page_size should divide size/nb_blocks"); TQStringList names; names.append(TQString()); checkTagNames(device, "memory", names); @@ -45,11 +45,11 @@ virtual void processDevice(TQDomElement device) virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const { - if ( !pinLabels.contains("VCC") ) qFatal("No VDD pin specified"); - if ( !pinLabels.contains("VSS") ) qFatal("No VSS pin specified"); + if ( !pinLabels.contains("VCC") ) tqFatal("No VDD pin specified"); + if ( !pinLabels.contains("VSS") ) tqFatal("No VSS pin specified"); TQMap<TQString, uint>::const_iterator it; for (it=pinLabels.begin(); it!=pinLabels.end(); ++it) - if ( it.data()!=1 ) qFatal(TQString("Duplicated pin %1").arg(it.key())); + if ( it.data()!=1 ) tqFatal(TQString("Duplicated pin %1").arg(it.key())); } }; // class diff --git a/src/devices/pic/base/pic_protection.cpp b/src/devices/pic/base/pic_protection.cpp index 8fac920..3e8f4c9 100644 --- a/src/devices/pic/base/pic_protection.cpp +++ b/src/devices/pic/base/pic_protection.cpp @@ -123,7 +123,7 @@ bool Pic::Protection::extractRanges(const TQString &name, TQValueVector<Address> bool ok1; end = fromHex(regexp.cap(regexp.numCaptures()), &ok1); if ( !ok1 ) { - qDebug("Malformed end address"); + tqDebug("Malformed end address"); return true; } starts.clear(); @@ -133,11 +133,11 @@ bool Pic::Protection::extractRanges(const TQString &name, TQValueVector<Address> TQString s = (i==1 ? regexp.cap(i) : regexp.cap(i).mid(1)); Address start = fromHex(s, &ok1); if ( !ok1 ) { - qDebug("Malformed start address %s", s.latin1()); + tqDebug("Malformed start address %s", s.latin1()); return true; } if ( start>=end && (starts.count()==0 || starts[starts.count()-1]<start) ) { - qDebug("Start addresses should be ordered"); + tqDebug("Start addresses should be ordered"); return true; } starts.append(start); @@ -188,7 +188,7 @@ bool Pic::Protection::checkRange(const TQString &mask, const TQString &name) con if ( ptype!=Nb_Types ) break; } if ( ptype==Nb_Types ) { - qDebug("Unknown protected memory range"); + tqDebug("Unknown protected memory range"); return false; } // #### TODO @@ -198,13 +198,13 @@ bool Pic::Protection::checkRange(const TQString &mask, const TQString &name) con Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &mask, const TQString &name, bool &ok) const { Q_ASSERT( family()!=CodeGuard ); - //qDebug("extract range %s %s", mask.latin1(), name.latin1()); + //tqDebug("extract range %s %s", mask.latin1(), name.latin1()); ProtectedRange pr; ok = false; TQRegExp rexp("([A-Z]+)(?:_([0-9])|)"); if ( !rexp.exactMatch(mask) ) { - qDebug("Malformed block range"); + tqDebug("Malformed block range"); return pr; } @@ -221,7 +221,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma ptype = Type(k); if ( !rexp.cap(2).isEmpty() ) { if ( isBootBlock || (rtype!=MemoryRangeType::Code && rtype!=MemoryRangeType::Eeprom) ) { - qDebug("Multiple blocks only for code and eeprom"); + tqDebug("Multiple blocks only for code and eeprom"); return pr; } } @@ -230,7 +230,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma if ( rtype!=MemoryRangeType::Nb_Types ) break; } if ( rtype==MemoryRangeType::Nb_Types ) { - qDebug("Unknown protected memory range"); + tqDebug("Unknown protected memory range"); return pr; } @@ -244,12 +244,12 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma const MemoryRangeData &rdata = _data.range(rtype); if ( isAllProtectedValueName(name) ) { if ( rtype==MemoryRangeType::Code && !isBootBlock && bmask ) { - qDebug("Protected range should be explicit with boot block"); + tqDebug("Protected range should be explicit with boot block"); return pr; } if (isBootBlock) { if ( bsmask==0 ) { - qDebug("Protected range should be explicit when boot size not present"); + tqDebug("Protected range should be explicit when boot size not present"); return pr; } Address start = _data.range(MemoryRangeType::Code).start; @@ -258,11 +258,11 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma bool ok1; uint size = bsmask->values[k].name.toUInt(&ok1); if ( !ok1 ) { - qDebug("Could not recognize boot size value"); + tqDebug("Could not recognize boot size value"); return pr; } if ( size==0 ) { - qDebug("Boot size cannot be zero"); + tqDebug("Boot size cannot be zero"); return pr; } Address end = 2 * size - 1; // instruction words @@ -278,7 +278,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma return pr; } if ( isBootBlock && bsmask ) { - qDebug("Protected range should not be explicit when boot size is present"); + tqDebug("Protected range should not be explicit when boot size is present"); return pr; } @@ -286,20 +286,20 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma Address end; bool ok1; if ( !extractRanges(name, pr.starts, end, ok1) ) { - qDebug("Could not recognized explicit range"); + tqDebug("Could not recognized explicit range"); return pr; } if ( !ok1 ) return pr; if ( end>rdata.end ) { - qDebug("End is beyond memory range"); + tqDebug("End is beyond memory range"); return pr; } 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"); + tqDebug("Only code with blocks and boot can have multiple protected ranges"); return pr; } if ( isBootBlock && pr.starts[0]!=0 ) { - qDebug("Boot block start should be zero"); + tqDebug("Boot block start should be zero"); return pr; } pr.ends.append(end); @@ -307,7 +307,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma // check with boot block if ( pr.starts.count()>1 ) { if ( bmask==0 ) { - qDebug("No boot mask"); + tqDebug("No boot mask"); return pr; } for (uint i=0; i<uint(bmask->values.count()); i++) { @@ -316,12 +316,12 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &ma 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())); + tqDebug("Boot number of ends (%i) should be the same as code number of starts (%i)", int(bpr.ends.count()), int(pr.starts.count())); return pr; } for (uint k=0; k<uint(bpr.ends.count()); k++) { if ( bpr.ends[k]+1!=pr.starts[k] ) { - qDebug("%i: End of boot block (%s) doesn't match start of code block (%s)", k, toHexLabelAbs(bpr.ends[k]).latin1(), toHexLabelAbs(pr.starts[k]).latin1()); + tqDebug("%i: End of boot block (%s) doesn't match start of code block (%s)", k, toHexLabelAbs(bpr.ends[k]).latin1(), toHexLabelAbs(pr.starts[k]).latin1()); return pr; } } diff --git a/src/devices/pic/gui/pic_config_editor.cpp b/src/devices/pic/gui/pic_config_editor.cpp index 4b70c3d..230d65f 100644 --- a/src/devices/pic/gui/pic_config_editor.cpp +++ b/src/devices/pic/gui/pic_config_editor.cpp @@ -32,9 +32,9 @@ Pic::MemoryConfigEditorWidget::MemoryConfigEditorWidget(Memory &memory, bool wit } for(uint i=0; i<nbWords; ++i) { - //qDebug("BinWordsEditor for config word #%i", i); + //tqDebug("BinWordsEditor for config word #%i", i); //uint address = device().range(Device::MemoryConfig).start + device().addressIncrement(Device::MemoryConfig) * i; - //qDebug("address: %s %s nb: %i", toHex(address, 8).data(), device().configWord(i).name.latin1(), device().configWord(i).masks.count()); + //tqDebug("address: %s %s nb: %i", toHex(address, 8).data(), device().configWord(i).name.latin1(), device().configWord(i).masks.count()); if ( device().config()._words[i].masks.count()==0 ) continue; TQWidget *page = 0; if ( nbWords>1 ) { diff --git a/src/devices/pic/gui/pic_config_word_editor.cpp b/src/devices/pic/gui/pic_config_word_editor.cpp index 39430ca..0931076 100644 --- a/src/devices/pic/gui/pic_config_word_editor.cpp +++ b/src/devices/pic/gui/pic_config_word_editor.cpp @@ -156,14 +156,14 @@ void Pic::ConfigWordEditor::setReadOnly(bool readOnly) void Pic::ConfigWordEditor::slotModified() { BitValue v = memory().word(MemoryRangeType::Config, _configIndex); - //qDebug("BinWordEditor::slotModified %i: %s", _configIndex, toHex(v, 4).data()); + //tqDebug("BinWordEditor::slotModified %i: %s", _configIndex, toHex(v, 4).data()); for (uint k=0; k<_combos.count(); k++) { const Config::Mask &cmask = device().config()._words[_configIndex].masks[k]; v = v.clearMaskBits(cmask.value); v |= cmask.values[_combos[k]->index()].value; // set value } memory().setWord(MemoryRangeType::Config, _configIndex, v); - //qDebug(" now: %s", toHex(v, 4).data()); + //tqDebug(" now: %s", toHex(v, 4).data()); if (_mdb) _mdb->updateDisplay(); emit modified(); } @@ -172,7 +172,7 @@ void Pic::ConfigWordEditor::updateDisplay() { BitValue v = memory().word(MemoryRangeType::Config, _configIndex); uint nbChars = device().nbCharsWord(MemoryRangeType::Config); - //qDebug("BinWordEditor::updateDisplay %i: %s", _configIndex, toHex(v, 4).data()); + //tqDebug("BinWordEditor::updateDisplay %i: %s", _configIndex, toHex(v, 4).data()); for (uint k=0; k<_combos.count(); k++) { const Config::Mask &cmask = device().config()._words[_configIndex].masks[k]; for (int i=cmask.values.count()-1; i>=0; i--) { diff --git a/src/devices/pic/pic/pic_memory.cpp b/src/devices/pic/pic/pic_memory.cpp index 5ffb663..c7071be 100644 --- a/src/devices/pic/pic/pic_memory.cpp +++ b/src/devices/pic/pic/pic_memory.cpp @@ -85,7 +85,7 @@ BitValue Pic::Memory::normalizedWord(MemoryRangeType type, uint offset) const void Pic::Memory::setWord(MemoryRangeType type, uint offset, BitValue value) { - if ( offset>=_ranges[type].size() ) qDebug("Memory::setWord: type=%s offset=%s size=%s value=%s", type.key(), toHexLabelAbs(offset).latin1(), toHexLabelAbs(_ranges[type].size()).latin1(), toHexLabelAbs(value).latin1()); + if ( offset>=_ranges[type].size() ) tqDebug("Memory::setWord: type=%s offset=%s size=%s value=%s", type.key(), toHexLabelAbs(offset).latin1(), toHexLabelAbs(_ranges[type].size()).latin1(), toHexLabelAbs(value).latin1()); CRASH_ASSERT( offset<_ranges[type].size() ); _ranges[type][offset] = value; } @@ -204,7 +204,7 @@ AddressRangeVector Pic::Memory::protectedRanges(Protection::Type ptype, MemoryRa if ( protection.family()!=Protection::CodeGuard ) { TQString maskName = protection.maskName(ptype, type); TQString value = findValue(maskName); - //qDebug("%s %s", maskName.latin1(), value.latin1()); + //tqDebug("%s %s", maskName.latin1(), value.latin1()); if ( !value.isEmpty() ) { AddressRangeVector tmp = protection.extractRanges(value, type); Q_ASSERT( tmp.count()==1 ); @@ -336,9 +336,9 @@ BitValue Pic::Memory::checksum() const bool isProtected = !rv.isEmpty(); uint inc = device().addressIncrement(MemoryRangeType::Code); //uint nbChars = device().nbCharsWord(MemoryRangeType::Code); - //qDebug("protected: %i nb: %s (%s)", isProtected, toHexLabelAbs(inc*device().nbWords(MemoryRangeType::Code)).latin1(), toHexLabel(mask, nbChars).latin1()); + //tqDebug("protected: %i nb: %s (%s)", isProtected, toHexLabelAbs(inc*device().nbWords(MemoryRangeType::Code)).latin1(), toHexLabel(mask, nbChars).latin1()); //for (uint i=0; i<rv.count(); i++) - // qDebug("protected: %s:%s", toHex(rv[i].start, nbChars).latin1(), toHex(rv[i].end, nbChars).latin1()); + // tqDebug("protected: %s:%s", toHex(rv[i].start, nbChars).latin1(), toHex(rv[i].end, nbChars).latin1()); if ( isProtected && (device().architecture()==Pic::Architecture::P18J || device().architecture()==Pic::Architecture::P24F) ) return 0x0000; Checksum::Algorithm algorithm = Checksum::Algorithm::Normal; @@ -353,12 +353,12 @@ BitValue Pic::Memory::checksum() const cs = checksums[valueName].constant; } } - //qDebug("constant: %s", toHexLabelAbs(cs).data()); - //qDebug("algo: %s", Checksum::ALGORITHM_DATA[algorithm].name); + //tqDebug("constant: %s", toHexLabelAbs(cs).data()); + //tqDebug("algo: %s", Checksum::ALGORITHM_DATA[algorithm].name); for (uint i=0; i<device().nbWords(MemoryRangeType::Code); i++) { if ( algorithm==Checksum::Algorithm::Normal && rv.contains(inc*i) ) continue; BitValue v = word(MemoryRangeType::Code, i).maskWith(mask); - //if ( i==0 || i==device().nbWords(MemoryRangeType::Code)-1 ) qDebug("%s %s", toHexLabel(i, 4).latin1(), toHexLabel(v, 4).latin1()); + //if ( i==0 || i==device().nbWords(MemoryRangeType::Code)-1 ) tqDebug("%s %s", toHexLabel(i, 4).latin1(), toHexLabel(v, 4).latin1()); switch (device().architecture().type()) { case Architecture::P10X: case Architecture::P16X: @@ -387,19 +387,19 @@ BitValue Pic::Memory::checksum() const case Architecture::Nb_Types: Q_ASSERT(false); break; } } - //qDebug("after code: %s", toHexLabelAbs(cs).latin1()); + //tqDebug("after code: %s", toHexLabelAbs(cs).latin1()); // config const Config &config = device().config(); for (uint i=0; i<uint(config._words.count()); i++) { const Config::Word &cword = config._words[i]; BitValue v = word(MemoryRangeType::Config, i).maskWith(cword.cmask); //uint nbChars = device().nbCharsWord(MemoryRangeType::Config); - // qDebug("%i: %s %s", i, toHex(word(MemoryRangeType::Config, i), nbChars).latin1(), toHex(cword.cmask, nbChars).latin1()); + // tqDebug("%i: %s %s", i, toHex(word(MemoryRangeType::Config, i), nbChars).latin1(), toHex(cword.cmask, nbChars).latin1()); if ( ( device().name()=="16C61" || device().name()=="16C71" ) && isProtected ) cs += v | 0x0060; else if ( device().is16bitFamily() ) cs += v.byte(0) + v.byte(1); else cs += v; } - //qDebug("after config: %s", toHexLabelAbs(cs).latin1()); + //tqDebug("after config: %s", toHexLabelAbs(cs).latin1()); // user ids if ( isProtected && device().isPresent(MemoryRangeType::UserId) && !device().is16bitFamily() && algorithm==Checksum::Algorithm::Normal ) { BitValue id = 0x0; @@ -408,14 +408,14 @@ BitValue Pic::Memory::checksum() const BitValue v = word(MemoryRangeType::UserId, nb-i-1).maskWith(0xF); if ( device().is18Family() ) id += v; else { - // qDebug("id %i (%i): %s %s", i, nbb, toHex(v, 4).latin1(), toHex(v << (nbb*i), 9).latin1()); + // tqDebug("id %i (%i): %s %s", i, nbb, toHex(v, 4).latin1(), toHex(v << (nbb*i), 9).latin1()); id += v << (4*i); } } - //qDebug("id %s", toHexLabelAbs(id).latin1()); + //tqDebug("id %s", toHexLabelAbs(id).latin1()); cs += id; } - //qDebug("checksum: %s %s", toHexLabelAbs(cs).latin1(), toHex(cs & 0xFFFF, 4).latin1()); + //tqDebug("checksum: %s %s", toHexLabelAbs(cs).latin1(), toHex(cs & 0xFFFF, 4).latin1()); return cs.maskWith(0xFFFF); } @@ -471,11 +471,11 @@ void Pic::Memory::toHexBuffer(MemoryRangeType type, HexBuffer &hb) const uint byte = 0; uint wOffset = 0; uint wByte = 0; - //qDebug("%s wnb=%i snb=%i div=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, sNbBytes, div); + //tqDebug("%s wnb=%i snb=%i div=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, sNbBytes, div); for (uint k=0; k<wNbBytes*device().nbWords(type); k++) { // set byte BitValue s = _ranges[type][wOffset].maskWith(mask); - //if ( k<4 ) qDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(sOffset, 8).data(), sByte, wOffset, wByte); + //if ( k<4 ) tqDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(sOffset, 8).data(), sByte, wOffset, wByte); s = s.byte(wByte); if ( (byte%2)==0 ) hb.insert(offset, s); else hb.insert(offset, hb[offset] | (s << ((byte%2)*8))); @@ -517,11 +517,11 @@ void Pic::Memory::fromHexBuffer(MemoryRangeType type, const HexBuffer &hb, Warni uint byte = 0; uint wOffset = 0; uint wByte = 0; - //qDebug("%s wnb=%i snb=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, nbBytes); + //tqDebug("%s wnb=%i snb=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, nbBytes); for (uint k=0; k<wNbBytes*device().nbWords(type); k++) { // set byte BitValue s = hb[offset]; - //if ( k<4 ) qDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(offset, 8).data(), byte, wOffset, wByte); + //if ( k<4 ) tqDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(offset, 8).data(), byte, wOffset, wByte); if ( !s.isInitialized() ) { if ( type==MemoryRangeType::Config ) _ranges[type][wOffset] = mask; else _ranges[type][wOffset] = BitValue(); diff --git a/src/devices/pic/xml/pic_xml_to_data.cpp b/src/devices/pic/xml/pic_xml_to_data.cpp index 9c14879..7cb573e 100644 --- a/src/devices/pic/xml/pic_xml_to_data.cpp +++ b/src/devices/pic/xml/pic_xml_to_data.cpp @@ -29,11 +29,11 @@ bool getVoltages(ProgVoltageType type, TQDomElement element) 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(TQString("Cannot extract voltage value for \"%1\"").arg(type.key())); + if ( !ok1 || !ok2 || !ok3 ) tqFatal(TQString("Cannot extract voltage value for \"%1\"").arg(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 ) - qFatal("Inconsistent voltages order"); + tqFatal("Inconsistent voltages order"); return true; } @@ -45,46 +45,46 @@ bool getMemoryRange(MemoryRangeType type, TQDomElement element) bool ok; uint nbCharsAddress = data()->nbCharsAddress(); data()->_ranges[type].start = fromHexLabel(range.attribute("start"), nbCharsAddress, &ok); - if ( !ok ) qFatal("Cannot extract start address"); + if ( !ok ) tqFatal("Cannot extract start address"); data()->_ranges[type].end = fromHexLabel(range.attribute("end"), nbCharsAddress, &ok); - if ( !ok ) qFatal("Cannot extract end address"); - if ( data()->_ranges[type].end<data()->_ranges[type].start ) qFatal("Memory range end is before its start"); + if ( !ok ) tqFatal("Cannot extract end address"); + if ( data()->_ranges[type].end<data()->_ranges[type].start ) tqFatal("Memory range end is before its start"); uint nbCharsWord = data()->nbCharsWord(type); - if ( data()->nbBitsWord(type)==0 ) qFatal(TQString("Architecture doesn't contain memory range %1").arg(type.key())); + if ( data()->nbBitsWord(type)==0 ) tqFatal(TQString("Architecture doesn't contain memory range %1").arg(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(TQString("rmask is not inside mask %1 (%2)").arg(toHexLabel(data()->_userIdRecommendedMask, 8)).arg(toHexLabel(data()->mask(type), 8))); + if ( !ok ) tqFatal("Cannot extract rmask value for user id"); + if ( !data()->_userIdRecommendedMask.isInside(data()->mask(type)) ) tqFatal(TQString("rmask is not inside mask %1 (%2)").arg(toHexLabel(data()->_userIdRecommendedMask, 8)).arg(toHexLabel(data()->mask(type), 8))); } if ( range.attribute("hexfile_offset")!="?" ) { data()->_ranges[type].properties |= Programmable; if ( !range.attribute("hexfile_offset").isEmpty() ) { data()->_ranges[type].hexFileOffset = fromHexLabel(range.attribute("hexfile_offset"), nbCharsAddress, &ok); - if ( !ok ) qFatal("Cannot extract hexfile_offset"); + if ( !ok ) tqFatal("Cannot extract hexfile_offset"); } } if ( type==MemoryRangeType::Cal && !data()->is18Family() ) { data()->_calibration.opcodeMask = fromHexLabel(range.attribute("cal_opmask"), nbCharsWord, &ok); - if ( !ok ) qFatal("Cannot extract calibration opcode mask"); + if ( !ok ) tqFatal("Cannot extract calibration opcode mask"); 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 ( !ok ) tqFatal("Cannot extract calibration opcode"); + if ( !data()->_calibration.opcode.isInside(data()->_calibration.opcodeMask) ) tqFatal("Calibration opcode should be inside opcode mask"); + if ( !data()->_calibration.opcodeMask.isInside(data()->mask(type)) ) tqFatal("Calibration mask should be inside opcode mask"); } 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); - if ( !ok || data()->_nbWordsCodeWrite==0 || (data()->_nbWordsCodeWrite%4)!=0 ) qFatal("Missing or malformed word write align"); + if ( !ok || data()->_nbWordsCodeWrite==0 || (data()->_nbWordsCodeWrite%4)!=0 ) tqFatal("Missing or malformed word write align"); data()->_nbWordsCodeRowErase = wea.toUInt(&ok); - if ( !ok || (data()->_nbWordsCodeRowErase%4)!=0 ) qFatal("Missing or malformed word erase align"); + if ( !ok || (data()->_nbWordsCodeRowErase%4)!=0 ) tqFatal("Missing or malformed word erase align"); } else { - if ( !wwa.isEmpty() || !wea.isEmpty() ) qFatal("word align should not be defined for this device family/subfamily"); + if ( !wwa.isEmpty() || !wea.isEmpty() ) tqFatal("word align should not be defined for this device family/subfamily"); data()->_nbWordsCodeWrite = 0; // #### TODO data()->_nbWordsCodeRowErase = 0; // #### TODO } - } else if ( !wwa.isEmpty() || !wea.isEmpty() ) qFatal("word align should not be defined for this memory range"); + } else if ( !wwa.isEmpty() || !wea.isEmpty() ) tqFatal("word align should not be defined for this memory range"); return true; } @@ -100,35 +100,35 @@ void processName(const Pic::Config::Mask &cmask, BitValue pmask, Pic::Config::Va TQStringList &cnames = cvalue.configNames[Pic::ConfigNameType::Default]; if ( cvalue.name=="invalid" ) { cvalue.name = TQString(); - if ( !cnames.isEmpty() ) qFatal(TQString("No cname should be defined for invalid value in mask %1").arg(cmask.name)); + if ( !cnames.isEmpty() ) tqFatal(TQString("No cname should be defined for invalid value in mask %1").arg(cmask.name)); return; } - if ( cvalue.name.isEmpty() ) qFatal(TQString("Empty value name in mask %1").arg(cmask.name)); + if ( cvalue.name.isEmpty() ) tqFatal(TQString("Empty value name in mask %1").arg(cmask.name)); if ( cmask.value.isInside(pmask) ) { // protected bits - if ( !cnames.isEmpty() ) qFatal(TQString("Config name should be null for protected config mask \"%1\"").arg(cmask.name)); + if ( !cnames.isEmpty() ) tqFatal(TQString("Config name should be null for protected config mask \"%1\"").arg(cmask.name)); } else { if ( cnames.isEmpty() && cmask.name!="BSSEC" && cmask.name!="BSSIZ" && cmask.name!="SSSEC" && cmask.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(TQString("cname not defined for \"%1\" (%2)").arg(cvalue.name).arg(cmask.name)); + tqFatal(TQString("cname not defined for \"%1\" (%2)").arg(cvalue.name).arg(cmask.name)); } if ( cnames.count()==1 && cnames[0]=="_" ) cnames.clear(); for (uint i=0; i<uint(cnames.count()); i++) { if ( cnames[i].startsWith("0x") ) { - if ( cnames.count()!=1 ) qFatal("Hex cname cannot be combined"); + if ( cnames.count()!=1 ) tqFatal("Hex cname cannot be combined"); 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; } else if ( XOR(cnames[i].startsWith("_"), data()->architecture()==Pic::Architecture::P30F) ) continue; - qFatal(TQString("Invalid config name for \"%1\"/\"%2\"").arg(cmask.name).arg(cvalue.name)); + tqFatal(TQString("Invalid config name for \"%1\"/\"%2\"").arg(cmask.name).arg(cvalue.name)); } TQStringList &ecnames = cvalue.configNames[Pic::ConfigNameType::Extra]; for (uint i=0; i<uint(ecnames.count()); i++) - if ( ecnames[i][0]!='_' ) qFatal(TQString("Invalid extra config name for %1").arg(cvalue.name)); + if ( ecnames[i][0]!='_' ) tqFatal(TQString("Invalid extra config name for %1").arg(cvalue.name)); } } @@ -140,30 +140,30 @@ Pic::Config::Mask toConfigMask(TQDomElement mask, BitValue pmask) TQMap<Pic::ConfigNameType, TQStringList> defConfigNames; Config::Mask cmask; cmask.name = mask.attribute("name"); - if ( !Config::hasMaskName(cmask.name) ) qFatal(TQString("Unknown mask name %1").arg(cmask.name)); + if ( !Config::hasMaskName(cmask.name) ) tqFatal(TQString("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(TQString("Malformed mask value in mask %1").arg(mask.attribute("name"))); + tqFatal(TQString("Malformed mask value in mask %1").arg(mask.attribute("name"))); //TQStringList names; TQDomNode child = mask.firstChild(); while ( !child.isNull() ) { TQDomElement value = child.toElement(); child = child.nextSibling(); if ( value.isNull() ) continue; - if ( value.nodeName()!="value" ) qFatal(TQString("Non value child in mask %1").arg(cmask.name)); + if ( value.nodeName()!="value" ) tqFatal(TQString("Non value child in mask %1").arg(cmask.name)); if ( value.attribute("value")=="default" ) { - if ( !defName.isEmpty() ) qFatal(TQString("Default value already defined for mask %1").arg(cmask.name)); + if ( !defName.isEmpty() ) tqFatal(TQString("Default value already defined for mask %1").arg(cmask.name)); defName = value.attribute("name"); - //if ( names.contains(defName) ) qFatal(TQString("Value name duplicated in mask %1").arg(cmask.name)); + //if ( names.contains(defName) ) tqFatal(TQString("Value name duplicated in mask %1").arg(cmask.name)); //names.append(defName); 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(TQString("Malformed value in mask %1").arg(cmask.name)); + if ( !ok || !cvalue.value.isInside(cmask.value) ) tqFatal(TQString("Malformed value in mask %1").arg(cmask.name)); cvalue.name = value.attribute("name"); - //if ( names.contains(cvalue.name) ) qFatal(TQString("Value name duplicated in mask %1").arg(cmask.name)); + //if ( names.contains(cvalue.name) ) tqFatal(TQString("Value name duplicated in mask %1").arg(cmask.name)); //names.append(cvalue.name); FOR_EACH(Pic::ConfigNameType, type) cvalue.configNames[type] = TQStringList::split(' ', value.attribute(type.data().key)); processName(cmask, pmask, cvalue); @@ -183,7 +183,7 @@ Pic::Config::Mask toConfigMask(TQDomElement mask, BitValue pmask) processName(cmask, pmask, cvalue); cmask.values.append(cvalue); } - if ( nb<=1 ) qFatal(TQString("Default value used less than twice in mask %1").arg(cmask.name)); + if ( nb<=1 ) tqFatal(TQString("Default value used less than twice in mask %1").arg(cmask.name)); } qHeapSort(cmask.values); return cmask; @@ -194,34 +194,34 @@ 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."); + if ( cword.name.isNull() ) tqFatal("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(TQString("Missing or malformed config wmask \"%1\"").arg(config.attribute("wmask"))); + if ( !ok || cword.wmask>gmask ) tqFatal(TQString("Missing or malformed config wmask \"%1\"").arg(config.attribute("wmask"))); cword.bvalue = fromHexLabel(config.attribute("bvalue"), nbChars, &ok); - if ( !ok ) qFatal(TQString("Missing or malformed config bvalue \"%1\"").arg(config.attribute("bvalue"))); + if ( !ok ) tqFatal(TQString("Missing or malformed config bvalue \"%1\"").arg(config.attribute("bvalue"))); if ( config.attribute("pmask").isEmpty() ) cword.pmask = 0; else { bool ok; cword.pmask = fromHexLabel(config.attribute("pmask"), nbChars, &ok); - if ( !ok || cword.pmask>gmask ) qFatal("Missing or malformed config pmask"); + if ( !ok || cword.pmask>gmask ) tqFatal("Missing or malformed config pmask"); } cword.ignoredCNames = TQStringList::split(' ', config.attribute("icnames")); for (uint i=0; i<uint(cword.ignoredCNames.count()); i++) - if ( cword.ignoredCNames[i][0]!='_' ) qFatal(TQString("Invalid ignored config name for %1").arg(cword.name)); + if ( cword.ignoredCNames[i][0]!='_' ) tqFatal(TQString("Invalid ignored config name for %1").arg(cword.name)); TQDomNode child = config.firstChild(); while ( !child.isNull() ) { TQDomElement mask = child.toElement(); child = child.nextSibling(); if ( mask.isNull() ) continue; - if ( mask.nodeName()!="mask" ) qFatal(TQString("Non mask child in config %1").arg(cword.name)); - if ( mask.attribute("name").isEmpty() ) qFatal(TQString("Empty mask name in config %1").arg(cword.name)); + if ( mask.nodeName()!="mask" ) tqFatal(TQString("Non mask child in config %1").arg(cword.name)); + if ( mask.attribute("name").isEmpty() ) tqFatal(TQString("Empty mask name in config %1").arg(cword.name)); Config::Mask cmask = toConfigMask(mask, cword.pmask); - if ( !cmask.value.isInside(gmask) ) qFatal(TQString("Mask value not inside mask in config %1").arg(cword.name)); + if ( !cmask.value.isInside(gmask) ) tqFatal(TQString("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(TQString("Duplicated mask name %1 in config %2").arg(cmask.name).arg(cword.name)); - if ( cmask.value.isOverlapping(cword.masks[i].value) ) qFatal(TQString("Overlapping masks in config %1").arg(cword.name)); + if ( cword.masks[i].name==cmask.name ) tqFatal(TQString("Duplicated mask name %1 in config %2").arg(cmask.name).arg(cword.name)); + if ( cmask.value.isOverlapping(cword.masks[i].value) ) tqFatal(TQString("Overlapping masks in config %1").arg(cword.name)); } cword.masks.append(cmask); } @@ -233,11 +233,11 @@ Pic::Config::Word toConfigWord(TQDomElement config) } 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(TQString("Redundant cmask in %1").arg(cword.name)); - if ( cword.cmask==mask ) qFatal(TQString("Redundant cmask in %1").arg(cword.name)); + if ( !ok || cword.cmask>gmask ) tqFatal("Missing or malformed config cmask"); + //if ( data()->_architecture==Pic::Architecture::P30X &&cword.cmask==cword.wmask ) tqFatal(TQString("Redundant cmask in %1").arg(cword.name)); + if ( cword.cmask==mask ) tqFatal(TQString("Redundant cmask in %1").arg(cword.name)); } - if ( !cword.pmask.isInside(cword.usedMask()) ) qFatal("pmask should be inside or'ed mask values."); + if ( !cword.pmask.isInside(cword.usedMask()) ) tqFatal("pmask should be inside or'ed mask values."); return cword; } @@ -252,14 +252,14 @@ TQValueVector<Pic::Config::Word> getConfigWords(TQDomElement element) if ( config.isNull() || config.nodeName()!="config" ) continue; bool ok; uint offset = fromHexLabel(config.attribute("offset"), 1, &ok); - if ( !ok ) qFatal("Missing or malformed config offset"); - if ( (offset % data()->addressIncrement(MemoryRangeType::Config))!=0 ) qFatal("Config offset not aligned"); + if ( !ok ) tqFatal("Missing or malformed config offset"); + if ( (offset % data()->addressIncrement(MemoryRangeType::Config))!=0 ) tqFatal("Config offset not aligned"); offset /= data()->addressIncrement(MemoryRangeType::Config); - if ( offset>=nbWords ) qFatal(TQString("Offset too big %1/%2").arg(offset).arg(nbWords)); - if ( !configWords[offset].name.isNull() ) qFatal(TQString("Config offset %1 is duplicated").arg(offset)); + if ( offset>=nbWords ) tqFatal(TQString("Offset too big %1/%2").arg(offset).arg(nbWords)); + if ( !configWords[offset].name.isNull() ) tqFatal(TQString("Config offset %1 is duplicated").arg(offset)); for (uint i=0; i<nbWords; i++) { if ( !configWords[i].name.isNull() && configWords[i].name==config.attribute("name") ) - qFatal(TQString("Duplicated config name %1").arg(configWords[i].name)); + tqFatal(TQString("Duplicated config name %1").arg(configWords[i].name)); } configWords[offset] = toConfigWord(config); } @@ -279,40 +279,40 @@ TQString getChecksumData(TQDomElement checksum) bool ok; uint nb = valueName.toUInt(&ok); uint max = (protection.hasBootBlock() ? 1 : 0) + protection.nbBlocks(); - if ( !ok || nb>max ) qFatal("Invalid number of protected blocks for checksum"); + if ( !ok || nb>max ) tqFatal("Invalid number of protected blocks for checksum"); if ( nb>0 ) cdata.protectedMaskNames += "CPB"; 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 ) { - if ( !cdata.bbsize.isEmpty() ) qFatal("Device does not have a variable boot size (no \"bbsize\" allowed in checksum)"); + if ( !cdata.bbsize.isEmpty() ) tqFatal("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"); + if ( nb==1 ) tqFatal("\"bbsize\" should be define in checksum for \"protected_blocks\"==1"); } else { const Config::Value *value = data()->_config->findValue(protection.bootSizeMaskName(), cdata.bbsize); - if ( value==0 ) qFatal("Invalid \"bbsize\" in checksum"); + if ( value==0 ) tqFatal("Invalid \"bbsize\" in checksum"); valueName += "_" + cdata.bbsize; } } else { valueName = checksum.attribute("protected"); if ( protection.family()==Protection::NoProtection && !valueName.isEmpty() ) - qFatal("Checksum protected attribute for device with no code protection"); + tqFatal("Checksum protected attribute for device with no code protection"); } - if ( data()->_checksums.contains(valueName) ) qFatal("Duplicate checksum protected range"); + if ( data()->_checksums.contains(valueName) ) tqFatal("Duplicate checksum protected range"); TQString s = checksum.attribute("constant"); if ( s.isEmpty() ) cdata.constant = 0x0000; else { bool ok; cdata.constant = fromHexLabel(s, 4, &ok); - if ( !ok ) qFatal("Malformed checksum constant"); + if ( !ok ) tqFatal("Malformed checksum constant"); } s = checksum.attribute("type"); if ( s.isEmpty() ) cdata.algorithm = Checksum::Algorithm::Normal; else { cdata.algorithm = Checksum::Algorithm::fromKey(s); - if ( cdata.algorithm==Checksum::Algorithm::Nb_Types ) qFatal("Unrecognized checksum algorithm"); + if ( cdata.algorithm==Checksum::Algorithm::Nb_Types ) tqFatal("Unrecognized checksum algorithm"); } s = checksum.attribute("mprotected"); @@ -320,32 +320,32 @@ TQString getChecksumData(TQDomElement checksum) 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(TQString("Not valid mask name for \"protected\" tag in checksum: %1").arg(list[i])); + if ( mask==0 ) tqFatal(TQString("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++) { TQString valueName = mask->values[k].name; if ( valueName.isEmpty() ) continue; if ( !protection.isNoneProtectedValueName(valueName) && !protection.isAllProtectedValueName(valueName) ) - qFatal(TQString("Not switch protection from mask name for \"protected\" tag in checksum: %1").arg(list[i])); + tqFatal(TQString("Not switch protection from mask name for \"protected\" tag in checksum: %1").arg(list[i])); } } cdata.protectedMaskNames = list; } s = checksum.attribute("bchecksum"); - if ( s.isEmpty() ) qFatal("No blank checksum"); + if ( s.isEmpty() ) tqFatal("No blank checksum"); else { bool ok; cdata.blankChecksum = fromHexLabel(s, 4, &ok); - if ( !ok ) qFatal("Malformed blank checksum"); + if ( !ok ) tqFatal("Malformed blank checksum"); } s = checksum.attribute("cchecksum"); - if ( s.isEmpty() ) qFatal("No check checksum"); + if ( s.isEmpty() ) tqFatal("No check checksum"); else { bool ok; cdata.checkChecksum = fromHexLabel(s, 4, &ok); - if ( !ok ) qFatal("Malformed check checksum"); + if ( !ok ) tqFatal("Malformed check checksum"); } data()->_checksums[valueName] = cdata; @@ -358,24 +358,24 @@ virtual void processDevice(TQDomElement device) TQString arch = device.attribute("architecture"); data()->_architecture = Architecture::fromKey(arch); - if ( data()->_architecture==Architecture::Nb_Types ) qFatal(TQString("Unrecognized architecture \"%1\"").arg(arch)); + if ( data()->_architecture==Architecture::Nb_Types ) tqFatal(TQString("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"); + || (data()->_architecture==Architecture::P18F && data()->_name.contains("J")) ) tqFatal("Not matching family"); bool ok; 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"); + if ( !ok || data()->_nbBitsPC==0 ) tqFatal("Malformed or missing PC"); + } else if ( !pc.isEmpty() ) tqFatal("No PC should be provided for this device architecture"); 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); - if ( data()->_selfWrite==SelfWrite::Nb_Types ) qFatal("Malformed or missing self-write field"); - } else if ( !sw.isEmpty() ) qFatal("Self-write is set for the whole family or non-flash device"); + if ( data()->_selfWrite==SelfWrite::Nb_Types ) tqFatal("Malformed or missing self-write field"); + } else if ( !sw.isEmpty() ) tqFatal("Self-write is set for the whole family or non-flash device"); // device ids FOR_EACH(Device::Special, special) { @@ -385,7 +385,7 @@ virtual void processDevice(TQDomElement device) if ( special==Device::Special::Normal ) data()->_ids[special] = 0x0000; } else { data()->_ids[special] = fromHexLabel(id, 4, &ok); - if ( !ok ) qFatal("Malformed id"); + if ( !ok ) tqFatal("Malformed id"); } } @@ -396,16 +396,16 @@ virtual void processDevice(TQDomElement device) if ( !getVoltages(vtype, device) ) { switch (vtype.type()) { case ProgVoltageType::Vpp: - case ProgVoltageType::VddBulkErase: qFatal(TQString("Voltage \"%1\" not defined").arg(vtype.key())); + case ProgVoltageType::VddBulkErase: tqFatal(TQString("Voltage \"%1\" not defined").arg(vtype.key())); case ProgVoltageType::VddWrite: data()->_voltages[ProgVoltageType::VddWrite] = data()->_voltages[ProgVoltageType::VddBulkErase]; break; case ProgVoltageType::Nb_Types: Q_ASSERT(false); break; } } } - //if ( data()->vddMin()>data()->_voltages[ProgVoltageType::VddWrite].min ) qFatal("Vdd min higher than VddWrite min"); - //if ( data()->vddMax()<data()->_voltages[ProgVoltageType::VddWrite].max ) qFatal("Vdd max lower than VddWrite max"); - if ( data()->_voltages[ProgVoltageType::VddWrite].min>data()->_voltages[ProgVoltageType::VddBulkErase].min ) qFatal("VddWrite min higher than VddBulkErase min"); - if ( data()->_voltages[ProgVoltageType::VddWrite].max<data()->_voltages[ProgVoltageType::VddBulkErase].max ) qFatal("VddWrite max lower than VddBulkErase max"); + //if ( data()->vddMin()>data()->_voltages[ProgVoltageType::VddWrite].min ) tqFatal("Vdd min higher than VddWrite min"); + //if ( data()->vddMax()<data()->_voltages[ProgVoltageType::VddWrite].max ) tqFatal("Vdd max lower than VddWrite max"); + if ( data()->_voltages[ProgVoltageType::VddWrite].min>data()->_voltages[ProgVoltageType::VddBulkErase].min ) tqFatal("VddWrite min higher than VddBulkErase min"); + if ( data()->_voltages[ProgVoltageType::VddWrite].max<data()->_voltages[ProgVoltageType::VddBulkErase].max ) tqFatal("VddWrite max lower than VddBulkErase max"); checkTagNames(device, "voltages", names); // memory ranges @@ -426,12 +426,12 @@ virtual void processDevice(TQDomElement 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(TQString("Overlapping memory ranges (%1 and %2)").arg(k.key()).arg(i.key())); + tqFatal(TQString("Overlapping memory ranges (%1 and %2)").arg(k.key()).arg(i.key())); } } checkTagNames(device, "memory", names); if ( XOR(data()->_ids[Device::Special::Normal]!=0x0000, (data()->_ranges[MemoryRangeType::DeviceId].properties & Present)) ) - qFatal("Id present and device id memory range absent or the opposite"); + tqFatal("Id present and device id memory range absent or the opposite"); // config words TQValueVector<Config::Word> cwords = getConfigWords(device); @@ -440,7 +440,7 @@ virtual void processDevice(TQDomElement device) FOR_EACH(Pic::ConfigNameType, type) { TQMap<TQString, TQString> cnames; // cname -> mask name for (uint i=0; i<nbWords; i++) { - if ( cwords[i].name.isNull() ) qFatal(TQString("Config word #%1 not defined").arg(i)); + if ( cwords[i].name.isNull() ) tqFatal(TQString("Config word #%1 not defined").arg(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++) { @@ -450,7 +450,7 @@ virtual void processDevice(TQDomElement device) 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(TQString("Duplicated config name for %1/%2").arg(mask.name).arg(mask.values[k].name)); + tqFatal(TQString("Duplicated config name for %1/%2").arg(mask.name).arg(mask.values[k].name)); cnames[vcnames[l]] = word.masks[j].name; } } @@ -466,7 +466,7 @@ virtual void processDevice(TQDomElement device) const Config::Value &value = mask.values[k]; if ( !value.isValid() ) continue; if ( !data()->_config->checkValueName(mask.name, value.name) ) - qFatal(TQString("Malformed value name \"%1\" in mask %2").arg(value.name).arg(mask.name)); + tqFatal(TQString("Malformed value name \"%1\" in mask %2").arg(value.name).arg(mask.name)); } } } @@ -477,14 +477,14 @@ virtual void processDevice(TQDomElement device) const Config::Mask &mask = word.masks[j]; BitValue::const_iterator it; for (it=mask.value.begin(); it!=mask.value.end(); ++it) - if ( !hasValue(mask, *it) ) qFatal(TQString("Value %1 not defined in mask %2").arg(toHexLabel(*it, data()->nbCharsWord(MemoryRangeType::Config))).arg(mask.name)); + if ( !hasValue(mask, *it) ) tqFatal(TQString("Value %1 not defined in mask %2").arg(toHexLabel(*it, data()->nbCharsWord(MemoryRangeType::Config))).arg(mask.name)); } } // checksums (after config bits!) TQDomElement checksums = findUniqueElement(device, "checksums", TQString(), TQString()); if ( checksums.isNull() ) { - // qFatal("No checksum defined"); // #### FIXME + // tqFatal("No checksum defined"); // #### FIXME } else { TQMap<TQString, bool> valueNames; const Pic::Protection &protection = data()->_config->protection(); @@ -497,17 +497,17 @@ virtual void processDevice(TQDomElement device) TQDomNode child = checksums.firstChild(); while ( !child.isNull() ) { if ( !child.isElement() ) continue; - if ( child.nodeName()!="checksum" ) qFatal("Childs of \"checksums\" should \"checksum\""); + if ( child.nodeName()!="checksum" ) tqFatal("Childs of \"checksums\" should \"checksum\""); TQString valueName = getChecksumData(child.toElement()); if ( protection.family()==Protection::BasicProtection ) { - if ( !valueNames.contains(valueName) ) qFatal("Unknown protected attribute"); + if ( !valueNames.contains(valueName) ) tqFatal("Unknown protected attribute"); valueNames[valueName] = true; } child = child.nextSibling(); } TQMap<TQString, bool>::const_iterator it; for (it=valueNames.begin(); it!=valueNames.end(); ++it) - if ( !it.key().isEmpty() && !it.data() ) qFatal(TQString("Missing checksum \"%1\"").arg(it.key())); + if ( !it.key().isEmpty() && !it.data() ) tqFatal(TQString("Missing checksum \"%1\"").arg(it.key())); } } @@ -516,16 +516,16 @@ void processMirrored(TQDomElement element) TQValueVector<RangeData> mirrored; TQDomNode child = element.firstChild(); while ( !child.isNull() ) { - if ( !child.isElement() ) qFatal("\"mirror\" child should be an element"); + if ( !child.isElement() ) tqFatal("\"mirror\" child should be an element"); TQDomElement e = child.toElement(); - if ( e.nodeName()!="range" ) qFatal("\"mirror\" child should be \"range\""); + if ( e.nodeName()!="range" ) tqFatal("\"mirror\" child should be \"range\""); RangeData rd; bool ok; rd.start = fromHexLabel(e.attribute("start"), &ok); Address end = fromHexLabel(e.attribute("end"), &ok); rd.length = end-rd.start+1; if ( !mirrored.isEmpty() && rd.length!=mirrored[0].length ) - qFatal("Mirrored are not of the same length"); + tqFatal("Mirrored are not of the same length"); mirrored.append(rd); child = child.nextSibling(); } @@ -537,43 +537,43 @@ void processUnused(TQDomElement e) RangeData rd; bool ok; rd.start = fromHexLabel(e.attribute("start"), &ok); - if (!ok) qFatal("Malformed start for unused register"); + if (!ok) tqFatal("Malformed start for unused register"); Address end = fromHexLabel(e.attribute("end"), &ok); rd.length = end-rd.start+1; - if (!ok) qFatal("Malformed end for unused register"); + if (!ok) tqFatal("Malformed end for unused register"); static_cast<RegistersData *>(data()->_registersData)->unused.append(rd); } void processSfr(TQDomElement e) { TQString name = e.attribute("name"); - if ( name.isEmpty() ) qFatal("SFR cannot have empty name"); + if ( name.isEmpty() ) tqFatal("SFR cannot have empty name"); if ( data()->registersData().sfrs.contains(name) || data()->registersData().combined.contains(name) ) - qFatal("SFR name is duplicated"); + tqFatal("SFR name is duplicated"); bool ok; uint address = fromHexLabel(e.attribute("address"), &ok); - if ( !ok ) qFatal(TQString("SFR %1 address %2 is malformed").arg(name).arg(e.attribute("address"))); + if ( !ok ) tqFatal(TQString("SFR %1 address %2 is malformed").arg(name).arg(e.attribute("address"))); uint rlength = data()->registersData().nbBanks * data()->architecture().data().registerBankLength; - if ( address>=rlength ) qFatal(TQString("Address %1 outside register range").arg(toHexLabel(address, 3))); + if ( address>=rlength ) tqFatal(TQString("Address %1 outside register range").arg(toHexLabel(address, 3))); RegisterData rdata; rdata.address = address; uint nb = data()->registersData().nbBits(); - if ( nb>Device::MAX_NB_PORT_BITS ) qFatal(TQString("Need higher MAX_NB_PORT_BITS: %1").arg(nb)); + if ( nb>Device::MAX_NB_PORT_BITS ) tqFatal(TQString("Need higher MAX_NB_PORT_BITS: %1").arg(nb)); TQString access = e.attribute("access"); - if ( uint(access.length())!=nb ) qFatal("access is missing or malformed"); + if ( uint(access.length())!=nb ) tqFatal("access is missing or malformed"); TQString mclr = e.attribute("mclr"); - if ( uint(mclr.length())!=nb ) qFatal("mclr is missing or malformed"); + if ( uint(mclr.length())!=nb ) tqFatal("mclr is missing or malformed"); TQString por = e.attribute("por"); - if ( uint(por.length())!=nb ) qFatal("por is missing or malformed"); + if ( uint(por.length())!=nb ) tqFatal("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(TQString("Malformed access bit %1").arg(k)); + if ( !ok || rdata.bits[k].properties>MaxRegisterBitProperty ) tqFatal(TQString("Malformed access bit %1").arg(k)); rdata.bits[k].mclr = RegisterBitState(fromHex(mclr[i].latin1(), &ok)); - if ( !ok || rdata.bits[k].mclr>Nb_RegisterBitStates ) qFatal(TQString("Malformed mclr bit %1").arg(k)); + if ( !ok || rdata.bits[k].mclr>Nb_RegisterBitStates ) tqFatal(TQString("Malformed mclr bit %1").arg(k)); rdata.bits[k].por = RegisterBitState(fromHex(por[i].latin1(), &ok)); - if ( !ok || rdata.bits[k].por>Nb_RegisterBitStates ) qFatal(TQString("Malformed por bit %1").arg(k)); + if ( !ok || rdata.bits[k].por>Nb_RegisterBitStates ) tqFatal(TQString("Malformed por bit %1").arg(k)); } static_cast<RegistersData *>(data()->_registersData)->sfrs[name] = rdata; } @@ -581,19 +581,19 @@ void processSfr(TQDomElement e) void processCombined(TQDomElement e) { TQString name = e.attribute("name"); - if ( name.isEmpty() ) qFatal("Combined register cannot have empty name"); + if ( name.isEmpty() ) tqFatal("Combined register cannot have empty name"); if ( data()->registersData().sfrs.contains(name) || data()->registersData().combined.contains(name) ) - qFatal("Combined register name is duplicated"); + tqFatal("Combined register name is duplicated"); bool ok; CombinedData rdata; rdata.address = fromHexLabel(e.attribute("address"), &ok); - if ( !ok ) qFatal(TQString("Combined %1 address %2 is malformed").arg(name).arg(e.attribute("address"))); + if ( !ok ) tqFatal(TQString("Combined %1 address %2 is malformed").arg(name).arg(e.attribute("address"))); uint rlength = data()->registersData().nbBanks * data()->architecture().data().registerBankLength; - if ( rdata.address>=rlength ) qFatal(TQString("Address %1 outside register range").arg(toHexLabel(rdata.address, 3))); + if ( rdata.address>=rlength ) tqFatal(TQString("Address %1 outside register range").arg(toHexLabel(rdata.address, 3))); rdata.nbChars = 2*e.attribute("size").toUInt(&ok); - if ( !ok || rdata.nbChars<2 ) qFatal(TQString("Combined %1 size %2 is malformed").arg(name).arg(e.attribute("size"))); + if ( !ok || rdata.nbChars<2 ) tqFatal(TQString("Combined %1 size %2 is malformed").arg(name).arg(e.attribute("size"))); Address end = rdata.address + rdata.nbChars/2 - 1; - if ( end>=rlength ) qFatal(TQString("Address %1 outside register range").arg(toHexLabel(end, 3))); + if ( end>=rlength ) tqFatal(TQString("Address %1 outside register range").arg(toHexLabel(end, 3))); static_cast<RegistersData *>(data()->_registersData)->combined[name] = rdata; } @@ -601,7 +601,7 @@ void processDeviceRegisters(TQDomElement element) { TQString s = element.attribute("same_as"); if ( !s.isEmpty() ) { - if ( !_map.contains(s) ) qFatal(TQString("Registers same as unknown device %1").arg(s)); + if ( !_map.contains(s) ) tqFatal(TQString("Registers same as unknown device %1").arg(s)); const Pic::Data *d = static_cast<const Pic::Data *>(_map[s]); data()->_registersData = d->_registersData; return; @@ -610,12 +610,12 @@ void processDeviceRegisters(TQDomElement element) RegistersData &rdata = *static_cast<RegistersData *>(data()->_registersData); bool ok; rdata.nbBanks = element.attribute("nb_banks").toUInt(&ok); - if ( !ok || data()->registersData().nbBanks==0 ) qFatal("Malformed number of banks"); + if ( !ok || data()->registersData().nbBanks==0 ) tqFatal("Malformed number of banks"); 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"); + if ( !ok || rdata.accessBankSplit==0 || rdata.accessBankSplit>=0xFF ) tqFatal("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"); + if ( !ok || rdata.unusedBankMask>=maxValue(NumberBase::Hex, rdata.nbBanks) ) tqFatal("Malformed access unused bank mask"); } else { rdata.accessBankSplit = 0; rdata.unusedBankMask = 0; @@ -623,13 +623,13 @@ void processDeviceRegisters(TQDomElement element) TQDomNode child = element.firstChild(); while ( !child.isNull() ) { - if ( !child.isElement() ) qFatal("\"device\" child should be an element"); + if ( !child.isElement() ) tqFatal("\"device\" child should be an element"); 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(TQString("Node name \"%1\" is not recognized").arg(e.nodeName())); + else tqFatal(TQString("Node name \"%1\" is not recognized").arg(e.nodeName())); child = child.nextSibling(); } @@ -640,11 +640,11 @@ void processDeviceRegisters(TQDomElement element) TQString trisname = rdata.trisName(i); if ( trisname.isEmpty() ) continue; bool hasTris = rdata.sfrs.contains(trisname); - if ( !hasPort && hasTris ) qFatal(TQString("%1 needs %2 to be present").arg(trisname).arg(portname)); + if ( !hasPort && hasTris ) tqFatal(TQString("%1 needs %2 to be present").arg(trisname).arg(portname)); TQString latchname = rdata.latchName(i); if ( latchname.isEmpty() ) continue; bool hasLatch = rdata.sfrs.contains(latchname); - if ( !hasPort && hasLatch ) qFatal(TQString("%1 needs %2 to be present").arg(latchname).arg(portname)); + if ( !hasPort && hasLatch ) tqFatal(TQString("%1 needs %2 to be present").arg(latchname).arg(portname)); } } @@ -652,15 +652,15 @@ void processRegistersFile(const TQString &filename, TQStringList &devices) { TQDomDocument doc = parseFile(filename); TQDomElement root = doc.documentElement(); - if ( root.nodeName()!="registers" ) qFatal("root node should be \"registers\""); + if ( root.nodeName()!="registers" ) tqFatal("root node should be \"registers\""); for (TQDomNode child=root.firstChild(); !child.isNull(); child = child.nextSibling()) { - if ( child.isComment() ) qDebug("comment: %s", child.toComment().data().latin1()); + if ( child.isComment() ) tqDebug("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\""); + if ( !child.isElement() ) tqFatal("\"registers\" child should be an element"); + if ( child.nodeName()!="device" ) tqFatal("Device node should be named \"device\""); TQDomElement device = child.toElement(); TQString name = device.attribute("name"); - if ( devices.contains(name) ) qFatal(TQString("Registers already defined for %1").arg(name)); + if ( devices.contains(name) ) tqFatal(TQString("Registers already defined for %1").arg(name)); if ( _map.contains(name) ) { _data = _map[name]; processDeviceRegisters(device); @@ -680,18 +680,18 @@ void processRegisters() 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.contains(it.key()) ) tqWarning("Register description not found for %s", it.key().latin1()); } } 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"); + if ( !pinLabels.contains("VDD") ) tqFatal("No VDD pin specified"); + if ( !pinLabels.contains("VSS") ) tqFatal("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(TQString("Duplicated pin \"%1\"").arg(it.key())); + if ( it.data()!=1 ) tqFatal(TQString("Duplicated pin \"%1\"").arg(it.key())); } const Pic::RegistersData &rdata = static_cast<const Pic::RegistersData &>(*_data->registersData()); for (uint i=0; i<Device::MAX_NB_PORTS; i++) { @@ -699,7 +699,7 @@ virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const for (uint k=0; k<Device::MAX_NB_PORT_BITS; k++) { if ( !rdata.hasPortBit(i, k) ) continue; TQString name = rdata.portBitName(i, k); - if ( !pinLabels.contains(name) ) qFatal(TQString("Pin \"%1\" not present").arg(name)); + if ( !pinLabels.contains(name) ) tqFatal(TQString("Pin \"%1\" not present").arg(name)); } } } diff --git a/src/libgui/likeback.cpp b/src/libgui/likeback.cpp index 3065a8d..a012ec2 100644 --- a/src/libgui/likeback.cpp +++ b/src/libgui/likeback.cpp @@ -287,7 +287,7 @@ void LikeBack::autoMove() move(window->mapToGlobal(TQPoint(0, 0)).x() + window->width() - width(), window->mapToGlobal(TQPoint(0, 0)).y() + 1); if (window != lastWindow && s_windowListing != NoListing) -// if (qstricmp(window->name(), "") == 0 || qstricmp(window->name(), "unnamed") == 0) ; +// if (tqstricmp(window->name(), "") == 0 || tqstricmp(window->name(), "unnamed") == 0) ; // std::cout << "===== LikeBack ===== UNNAMED ACTIVE WINDOW OF TYPE " << window->className() << " ======" << activeWindowPath() << std::endl; // else if (s_windowListing == AllWindows) ; // std::cout << "LikeBack: Active Window: " << activeWindowPath() << std::endl; diff --git a/src/libgui/text_editor.cpp b/src/libgui/text_editor.cpp index f78ebb8..dca5827 100644 --- a/src/libgui/text_editor.cpp +++ b/src/libgui/text_editor.cpp @@ -46,7 +46,7 @@ TextEditor::TextEditor(bool withDebugger, TQWidget *parent, const char *name) : Editor(parent, name), _view(0) { KLibFactory *factory = KLibLoader::self()->factory("libkatepart"); - if ( factory==0 ) qFatal("Could not find katepart"); + if ( factory==0 ) tqFatal("Could not find katepart"); _document = static_cast<Kate::Document *>(factory->create(TQT_TQOBJECT(this), "kate", "KTextEditor::Document")); _oldModified = _document->isModified(); _oldReadOnly = !_document->isReadWrite(); diff --git a/src/libgui/toplevel.cpp b/src/libgui/toplevel.cpp index 0be3a13..bcc9f3a 100644 --- a/src/libgui/toplevel.cpp +++ b/src/libgui/toplevel.cpp @@ -980,7 +980,7 @@ void MainWindow::setTotalProgress(uint nb) //int id = Observer::self()->newJob(job, true); //Observer::self()->slotTotalSize(job, total); //Observer::self()->slotInfoMessage(job, "test"); - //qDebug("set total steps: %i", total); + //tqDebug("set total steps: %i", total); _actionProgress->setTotalSteps(nb); _actionProgress->setProgress(0); TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput); // #### DANGER !!!! diff --git a/src/piklab-test/base/device_test.cpp b/src/piklab-test/base/device_test.cpp index 07a5fdd..ef5cef6 100644 --- a/src/piklab-test/base/device_test.cpp +++ b/src/piklab-test/base/device_test.cpp @@ -15,7 +15,7 @@ void DeviceTest::checkArguments() { if ( _args->count()==1 ) { _device = TQString(_args->arg(0)).upper(); - if ( !Device::lister().isSupported(_device) ) qFatal("Specified device \"%s\" not supported.", _device.latin1()); + if ( !Device::lister().isSupported(_device) ) tqFatal("Specified device \"%s\" not supported.", _device.latin1()); printf("Testing only %s\n", _device.latin1()); } } diff --git a/src/progs/direct/base/direct_18F.cpp b/src/progs/direct/base/direct_18F.cpp index 8c2c371..f10916d 100644 --- a/src/progs/direct/base/direct_18F.cpp +++ b/src/progs/direct/base/direct_18F.cpp @@ -83,7 +83,7 @@ bool Direct::P18F::doRead(Pic::MemoryRangeType type, Device::Array &data, const } } BitValue mask = device().mask(type); - //qDebug("read %s %i", Pic::MEMORY_RANGE_TYPE_DATA[type].label, device().nbWords(type)); + //tqDebug("read %s %i", Pic::MEMORY_RANGE_TYPE_DATA[type].label, device().nbWords(type)); //pulseEngine("w300000"); // what for ? directAccess(type); switch (type.type()) { @@ -125,7 +125,7 @@ bool Direct::P18F::doRead(Pic::MemoryRangeType type, Device::Array &data, const bool Direct::P18F::doWrite(Pic::MemoryRangeType type, const Device::Array &data, bool force) { uint inc = device().addressIncrement(type); - //qDebug("write %s %i/%i %i", Pic::MEMORY_RANGE_TYPE_DATA[type].label, nbWords, data.count(), inc); + //tqDebug("write %s %i/%i %i", Pic::MEMORY_RANGE_TYPE_DATA[type].label, nbWords, data.count(), inc); //pulseEngine("w300000"); ?? configureSinglePanel(); directAccess(type); diff --git a/src/progs/direct/base/direct_pic.cpp b/src/progs/direct/base/direct_pic.cpp index 19c74b5..2d2b6de 100644 --- a/src/progs/direct/base/direct_pic.cpp +++ b/src/progs/direct/base/direct_pic.cpp @@ -23,7 +23,7 @@ BitValue Direct::PulseEngine::pulseEngine(const TQString &cmd, BitValue value) TQByteArray a = toAscii(cmd); BitValue res = 0; for (const char *ptr=a.data(); (ptr-a.data())<int(a.count()); ++ptr) - if ( !pulse(ptr, value, res) ) qFatal("pulse engine: invalid command '%c'", *ptr); + if ( !pulse(ptr, value, res) ) tqFatal("pulse engine: invalid command '%c'", *ptr); return res; } diff --git a/src/progs/direct/xml/xml_direct_parser.cpp b/src/progs/direct/xml/xml_direct_parser.cpp index bc77853..2625f9e 100644 --- a/src/progs/direct/xml/xml_direct_parser.cpp +++ b/src/progs/direct/xml/xml_direct_parser.cpp @@ -27,7 +27,7 @@ void Direct::XmlToData::parseData(TQDomElement element, Data &) { TQString s = element.attribute("pwidth"); const Device::Data *d = Device::lister().data(currentDevice()); - if ( d==0 ) qFatal("Invalid device name"); + if ( d==0 ) tqFatal("Invalid device name"); } void Direct::XmlToData::includes(TQTextStream &s) const diff --git a/src/progs/icd1/xml/xml_icd1_parser.cpp b/src/progs/icd1/xml/xml_icd1_parser.cpp index 3296134..90d9495 100644 --- a/src/progs/icd1/xml/xml_icd1_parser.cpp +++ b/src/progs/icd1/xml/xml_icd1_parser.cpp @@ -27,7 +27,7 @@ void Icd1::XmlToData::parseData(TQDomElement element, Data &data) { bool ok; data.part = fromHexLabel(element.attribute("family"), 2, &ok); - if ( !ok ) qFatal("Missing or malformed family attribute"); + if ( !ok ) tqFatal("Missing or malformed family attribute"); } void Icd1::XmlToData::outputData(const Data &data, TQTextStream &s) const diff --git a/src/progs/icd2/base/icd2.cpp b/src/progs/icd2/base/icd2.cpp index 073dd26..5ae7415 100644 --- a/src/progs/icd2/base/icd2.cpp +++ b/src/progs/icd2/base/icd2.cpp @@ -311,7 +311,7 @@ bool Icd2::Hardware::selfTest(TestData &test) bool Icd2::Hardware::readBlock(uint nbBytesWord, uint nbWords, Device::Array &data) { - //qDebug("readBlock %i %s", nbBytesWord, toHex(nbWords, 8).data()); + //tqDebug("readBlock %i %s", nbBytesWord, toHex(nbWords, 8).data()); // receive data uint length = 2*nbBytesWord*nbWords+4; TQString s; @@ -337,7 +337,7 @@ bool Icd2::Hardware::readBlock(uint nbBytesWord, uint nbWords, Device::Array &da TQ_UINT8 chk = 0; for (uint i=0; i<nbWords; i++) { TQString ts = s.mid(1+2*nbBytesWord*i, 2*nbBytesWord); - //if ( i<10 ) qDebug("%i: %s", i, ts.data()); + //if ( i<10 ) tqDebug("%i: %s", i, ts.data()); data[i] = 0; for (int k=nbBytesWord-1; k>=0; k--) { data[i] = data[i] << 8; @@ -366,12 +366,12 @@ bool Icd2::Hardware::readMemory(Pic::MemoryRangeType type, uint wordOffset, Address start = device().range(type).start; // address uint todo = inc * data.count(); // address uint offset = inc * wordOffset; // address - //qDebug("read size=%s div=%i nbBytes=%i", toHex(size, 8).data(), div, nbBytesWord); + //tqDebug("read size=%s div=%i nbBytes=%i", toHex(size, 8).data(), div, nbBytesWord); data.resize(0); do { uint size = TQMIN(todo, uint(0x1000)); // addresses uint nb = size / inc; // word - //qDebug("read %s start=%s size=%s", Pic::MEMORY_RANGE_TYPE_DATA[type].label, toHex(start+offset, 8).data(), toHex(nb, 8).data()); + //tqDebug("read %s start=%s size=%s", Pic::MEMORY_RANGE_TYPE_DATA[type].label, toHex(start+offset, 8).data(), toHex(nb, 8).data()); TQString cmd = r + toHex(start+offset, 8) + toHex(nb/div, 8); if ( !command(cmd, 0) ) return false; Device::Array pdata; @@ -400,7 +400,7 @@ bool Icd2::Hardware::writeBlock(uint nbBytesWord, const Device::Array &data, uin for (uint i=0; i<nbWords; i++) { TQString ts = toHex(data[wordIndex+i], 2*nbBytesWord); for (int k=nbBytesWord-1; k>=0; k--) { - //if ( i<10 || i>=nbWords-10 ) qDebug("send: %i-%i %s", i, k, ts.mid(2*k, 2).data()); + //if ( i<10 || i>=nbWords-10 ) tqDebug("send: %i-%i %s", i, k, ts.mid(2*k, 2).data()); s += ts.mid(2*k, 2); chk += ts[2*k].latin1() + ts[2*k+1].latin1(); } @@ -422,13 +422,13 @@ bool Icd2::Hardware::writeBlock(uint nbBytesWord, const Device::Array &data, uin i += size; } - //qDebug("done sending %i words (chk=%s)", nbWords, toHex(chk, 2).data()); + //tqDebug("done sending %i words (chk=%s)", nbWords, toHex(chk, 2).data()); return true; } bool Icd2::Hardware::writeMemory(Pic::MemoryRangeType type, uint wordOffset, const Device::Array &data) { - //qDebug("write memory: offset:%s nbWords:%s (size: %s)", toHex(wordOffset, 4).data(), toHex(nbWords, 4).data(), toHex(data.size(), 4).data()); + //tqDebug("write memory: offset:%s nbWords:%s (size: %s)", toHex(wordOffset, 4).data(), toHex(nbWords, 4).data(), toHex(data.size(), 4).data()); const char *w = writeCommand(type); if ( w==0 ) return true; uint nbBytesWord = device().nbBytesWord(type); @@ -439,11 +439,11 @@ bool Icd2::Hardware::writeMemory(Pic::MemoryRangeType type, uint wordOffset, con uint todo = inc * data.count(); // address uint offset = inc * wordOffset; // address uint index = 0; - //qDebug("write todo=%s div=%i nbBytes=%i dataSize=%i", toHex(todo, 8).data(), div, nbBytesWord, data.size()); + //tqDebug("write todo=%s div=%i nbBytes=%i dataSize=%i", toHex(todo, 8).data(), div, nbBytesWord, data.size()); do { uint size = TQMIN(todo, uint(0x1000)); // address uint nb = size / inc; // word - //qDebug("write %s start=%s nbWords=%s", Pic::MEMORY_RANGE_TYPE_DATA[type].label, toHex(start+offset, 8).data(), toHex(nb, 8).data()); + //tqDebug("write %s start=%s nbWords=%s", Pic::MEMORY_RANGE_TYPE_DATA[type].label, toHex(start+offset, 8).data(), toHex(nb, 8).data()); TQString cmd = w + toHex(start+offset+index, 8) + toHex(nb/div, 8); if ( !command(cmd, 0) ) return false; if ( !writeBlock(nbBytesWord, data, index/inc, nb) ) return false; diff --git a/src/progs/icd2/xml/xml_icd2_parser.cpp b/src/progs/icd2/xml/xml_icd2_parser.cpp index 5cb1196..c2af113 100644 --- a/src/progs/icd2/xml/xml_icd2_parser.cpp +++ b/src/progs/icd2/xml/xml_icd2_parser.cpp @@ -29,7 +29,7 @@ uint Icd2::XmlToData::familyIndex(const TQString &family) const uint i = 0; for (; Icd2::FAMILY_DATA[i].efid!=0; i++) if ( family==Icd2::FAMILY_DATA[i].name ) break; - if ( Icd2::FAMILY_DATA[i].efid==0 ) qFatal(TQString("Family \"%1\" is unknown").arg(family)); + if ( Icd2::FAMILY_DATA[i].efid==0 ) tqFatal(TQString("Family \"%1\" is unknown").arg(family)); return i; } @@ -37,7 +37,7 @@ void Icd2::XmlToData::parseData(TQDomElement element, Data &data) { bool ok; data.famid = fromHexLabel(element.attribute("famid"), 2, &ok); - if ( !ok ) qFatal("Missing or malformed famid attribute"); + if ( !ok ) tqFatal("Missing or malformed famid attribute"); data.debugSupport = extractSupport(element.attribute("debug_support_type")); } diff --git a/src/progs/picdem_bootloader/xml/xml_picdem_bootloader_parser.cpp b/src/progs/picdem_bootloader/xml/xml_picdem_bootloader_parser.cpp index 04c6e17..2562f1d 100644 --- a/src/progs/picdem_bootloader/xml/xml_picdem_bootloader_parser.cpp +++ b/src/progs/picdem_bootloader/xml/xml_picdem_bootloader_parser.cpp @@ -28,9 +28,9 @@ private: void PicdemBootloader::XmlToData::parseData(TQDomElement, Data &) { const Device::Data *ddata = Device::lister().data(currentDevice()); - if ( ddata->group().name()!="pic" ) qFatal("non-pic device not supported"); + if ( ddata->group().name()!="pic" ) tqFatal("non-pic device not supported"); const Pic::Data *pdata = static_cast<const Pic::Data *>(ddata); - if ( !pdata->hasFeature(Pic::Feature::USB) ) qFatal("device does not have USB"); + if ( !pdata->hasFeature(Pic::Feature::USB) ) tqFatal("device does not have USB"); } } // namespace diff --git a/src/progs/pickit1/xml/xml_pickit1_parser.cpp b/src/progs/pickit1/xml/xml_pickit1_parser.cpp index 9fbfafc..1fd09cf 100644 --- a/src/progs/pickit1/xml/xml_pickit1_parser.cpp +++ b/src/progs/pickit1/xml/xml_pickit1_parser.cpp @@ -26,12 +26,12 @@ private: void Pickit1::XmlToData::parseData(TQDomElement element, Data &data) { TQString s = element.attribute("entry"); - if ( s.length()!=1 || (s[0]!='O' && s[0]!='P') ) qFatal("Invalid or missing entry mode"); + if ( s.length()!=1 || (s[0]!='O' && s[0]!='P') ) tqFatal("Invalid or missing entry mode"); data.entryMode = s[0].latin1(); s = element.attribute("regen"); if ( s.isEmpty() || s=="false" ) data.regenerateOsccal = false; else if ( s=="true" ) data.regenerateOsccal = true; - else qFatal("Invalid regen value"); + else tqFatal("Invalid regen value"); } void Pickit1::XmlToData::outputData(const Data &data, TQTextStream &s) const diff --git a/src/progs/pickit2/xml/xml_pickit2_parser.cpp b/src/progs/pickit2/xml/xml_pickit2_parser.cpp index 686e4b2e..fb0543a 100644 --- a/src/progs/pickit2/xml/xml_pickit2_parser.cpp +++ b/src/progs/pickit2/xml/xml_pickit2_parser.cpp @@ -26,25 +26,25 @@ private: void Pickit2::XmlToData::parseData(TQDomElement element, Data &data) { TQString s = element.attribute("entry"); - if ( s.length()!=1 || (s[0]!='O' && s[0]!='P') ) qFatal("Invalid or missing entry mode"); + if ( s.length()!=1 || (s[0]!='O' && s[0]!='P') ) tqFatal("Invalid or missing entry mode"); data.entryMode = s[0].latin1(); s = element.attribute("pmode"); if ( s.length()!=1 || (s[0]!='0' && s[0]!='1' && s[0]!='4' && s[0]!='n') ) - qFatal("Invalid or missing program mode"); + tqFatal("Invalid or missing program mode"); data.progMode = s[0].latin1(); s = element.attribute("pwidth"); if ( data.progMode!='n' ) { - if ( s.length()!=0 ) qFatal("Program width should not be defined"); + if ( s.length()!=0 ) tqFatal("Program width should not be defined"); data.progWidth = 0; } else { bool ok; data.progWidth = s.toUInt(&ok); - if ( !ok ) qFatal("Invalid or missing program width"); + if ( !ok ) tqFatal("Invalid or missing program width"); } s = element.attribute("regen"); if ( s.isEmpty() || s=="false" ) data.regenerateOsccal = false; else if ( s=="true" ) data.regenerateOsccal = true; - else qFatal("Invalid regen value"); + else tqFatal("Invalid regen value"); } void Pickit2::XmlToData::outputData(const Data &data, TQTextStream &s) const diff --git a/src/progs/pickit2_bootloader/xml/xml_pickit2_bootloader_parser.cpp b/src/progs/pickit2_bootloader/xml/xml_pickit2_bootloader_parser.cpp index f718c03..00c33ed 100644 --- a/src/progs/pickit2_bootloader/xml/xml_pickit2_bootloader_parser.cpp +++ b/src/progs/pickit2_bootloader/xml/xml_pickit2_bootloader_parser.cpp @@ -28,9 +28,9 @@ private: void Pickit2Bootloader::XmlToData::parseData(TQDomElement, Data &) { const Device::Data *ddata = Device::lister().data(currentDevice()); - if ( ddata->group().name()!="pic" ) qFatal("non-pic device not supported"); + if ( ddata->group().name()!="pic" ) tqFatal("non-pic device not supported"); const Pic::Data *pdata = static_cast<const Pic::Data *>(ddata); - if ( !pdata->hasFeature(Pic::Feature::USB) ) qFatal("device does not have USB"); + if ( !pdata->hasFeature(Pic::Feature::USB) ) tqFatal("device does not have USB"); } } // namespace diff --git a/src/progs/psp/xml/xml_psp_parser.cpp b/src/progs/psp/xml/xml_psp_parser.cpp index 8b8875b..d2d4aff 100644 --- a/src/progs/psp/xml/xml_psp_parser.cpp +++ b/src/progs/psp/xml/xml_psp_parser.cpp @@ -27,11 +27,11 @@ void Psp::XmlToData::parseData(TQDomElement element, Data &data) { bool ok; data.algorithm = element.attribute("algorithm").toUInt(&ok); - if ( !ok ) qFatal("Missing or invalid algorithm"); + if ( !ok ) tqFatal("Missing or invalid algorithm"); data.overprogram = element.attribute("overprogram").toUInt(&ok); - if ( !ok ) qFatal("Missing or invalid overprogram"); + if ( !ok ) tqFatal("Missing or invalid overprogram"); data.tries = element.attribute("tries").toUInt(&ok); - if ( !ok ) qFatal("Missing or invalid tries"); + if ( !ok ) tqFatal("Missing or invalid tries"); } void Psp::XmlToData::outputData(const Data &data, TQTextStream &s) const diff --git a/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp b/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp index 0960cd1..eb3087d 100644 --- a/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp +++ b/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp @@ -29,12 +29,12 @@ private: void TinyBootloader::XmlToData::parseData(TQDomElement element, Data &data) { const Device::Data *ddata = Device::lister().data(currentDevice()); - if ( ddata->group().name()!="pic" ) qFatal("non-pic device not supported"); + if ( ddata->group().name()!="pic" ) tqFatal("non-pic device not supported"); const Pic::Data *pdata = static_cast<const Pic::Data *>(ddata); - if ( !pdata->hasFeature(Pic::Feature::USART) ) qFatal("device does not have USART"); + if ( !pdata->hasFeature(Pic::Feature::USART) ) tqFatal("device does not have USART"); bool ok; data.id = fromHexLabel(element.attribute("id"), 2, &ok); - if ( !ok ) qFatal("Invalid \"id\" tag"); + if ( !ok ) tqFatal("Invalid \"id\" tag"); } void TinyBootloader::XmlToData::outputData(const Data &data, TQTextStream &s) const diff --git a/src/tools/list/compile_process.cpp b/src/tools/list/compile_process.cpp index 7ec09d8..7ba74a2 100644 --- a/src/tools/list/compile_process.cpp +++ b/src/tools/list/compile_process.cpp @@ -210,7 +210,7 @@ Compile::FileData::List Compile::Process::files(bool *ok) const PURL::FileType type = PURL::FileType::fromKey(rexp.cap(1)); if ( type==PURL::Nb_FileTypes ) { if (ok) *ok = false; - qWarning("Unknown PURL::FileType in file list for %s", _manager->label().latin1()); + tqWarning("Unknown PURL::FileType in file list for %s", _manager->label().latin1()); continue; } if ( type.data().group==PURL::LinkerScript ) { @@ -231,7 +231,7 @@ Compile::FileData::List Compile::Process::files(bool *ok) const bool Compile::Process::checkIs(const TQString &s, const TQString &key) { if ( !s.contains(key) ) return false; - if ( s!=key ) qWarning("Argument should be only %s, the rest will be ignored...", key.latin1()); + if ( s!=key ) tqWarning("Argument should be only %s, the rest will be ignored...", key.latin1()); return true; } diff --git a/src/xml_to_data/device_xml_to_data.cpp b/src/xml_to_data/device_xml_to_data.cpp index 3f0dcc0..5ad40a5 100644 --- a/src/xml_to_data/device_xml_to_data.cpp +++ b/src/xml_to_data/device_xml_to_data.cpp @@ -18,12 +18,12 @@ bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special spe TQDomElement range; for (TQDomNode child=element.firstChild(); !child.isNull(); child=child.nextSibling()) { if ( child.nodeName()!="frequency_range" ) continue; - if ( !child.isElement() ) qFatal("\"frequency_range\" should be an element"); + if ( !child.isElement() ) tqFatal("\"frequency_range\" should be an element"); if ( child.toElement().attribute("name")!=oc.key() ) continue; Special s = Special::fromKey(child.toElement().attribute("special")); - if ( s==Special::Nb_Types ) qFatal("Unrecognized special"); + if ( s==Special::Nb_Types ) tqFatal("Unrecognized special"); if ( special!=s ) continue; - if ( !range.isNull() ) qFatal("Duplicated \"frequency_range\""); + if ( !range.isNull() ) tqFatal("Duplicated \"frequency_range\""); range = child.toElement(); } if ( range.isNull() ) return false; @@ -32,7 +32,7 @@ bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special spe frange.special = special; for (TQDomNode child=range.firstChild(); !child.isNull(); child=child.nextSibling()) { if ( child.nodeName()=="frequency" ) { - if ( !child.isElement() ) qFatal("Frequency is not an element"); + if ( !child.isElement() ) tqFatal("Frequency is not an element"); TQDomElement frequency = child.toElement(); bool ok1, ok2, ok3, ok4; RangeBox box; @@ -44,11 +44,11 @@ bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special spe if ( !ok1 || !ok2 || !ok3 || !ok4 || box.start.x<0.0 || box.start.x>box.end.x || box.start.yMin<0.0 || box.start.yMin>box.start.yMax ) - qFatal("Malformed frequency element"); + tqFatal("Malformed frequency element"); if ( frequency.attribute("vdd_min_end").isEmpty() ) box.end.yMin = box.start.yMin; else { box.end.yMin = frequency.attribute("vdd_min_end").toDouble(&ok1); - if ( !ok1 || box.end.yMin>box.end.yMax ) qFatal("Malformed frequency element"); + if ( !ok1 || box.end.yMin>box.end.yMax ) tqFatal("Malformed frequency element"); } box.mode = frequency.attribute("mode"); box.osc = frequency.attribute("osc"); @@ -56,17 +56,17 @@ bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special spe for (uint i=0; i<uint(frange.vdds.count()); i++) if ( box.start.x<frange.vdds[i].end.x && box.end.x>frange.vdds[i].start.x ) { if ( box.mode.isEmpty() && box.osc.isEmpty() && box.special.isEmpty() ) - qFatal("Overlapping frequency ranges"); + tqFatal("Overlapping frequency ranges"); continue; // #### FIXME: ignore additionnal mode } -// qDebug("add Freq Range: %s %s %f=[%f %f] %f=[%f %f]", +// tqDebug("add Freq Range: %s %s %f=[%f %f] %f=[%f %f]", // Device::FrequencyRange::TYPE_LABELS[type], Device::FrequencyRange::SPECIAL_LABELS[type], // box.start.x, box.start.yMin, box.start.yMax, // box.end.x, box.end.yMin, box.end.yMax); frange.vdds.append(box); } } - if ( frange.vdds.count()==0 ) qFatal("Empty frequency range"); + if ( frange.vdds.count()==0 ) tqFatal("Empty frequency range"); _data->_frequencyRanges.append(frange); return true; } @@ -76,15 +76,15 @@ bool Device::XmlToDataBase::getMemoryTechnology(TQDomElement element) TQString s = element.attribute("memory_technology"); _data->_memoryTechnology = MemoryTechnology::fromKey(s); if ( _data->_memoryTechnology!=MemoryTechnology::Nb_Types ) return true; - if ( !s.isNull() ) qFatal("Unrecognized memory technology"); + if ( !s.isNull() ) tqFatal("Unrecognized memory technology"); return false; } void Device::XmlToDataBase::processDevice(TQDomElement device) { TQString name = device.attribute("name").upper(); - if ( name.isEmpty() ) qFatal("Device has no name"); - if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").arg(name)); + if ( name.isEmpty() ) tqFatal("Device has no name"); + if ( _map.contains(name) ) tqFatal(TQString("Device \"%1\" already defined").arg(name)); _data = createData(); _map[name] = _data; _data->_name = name; @@ -93,10 +93,10 @@ void Device::XmlToDataBase::processDevice(TQDomElement device) _data->_status = Status::fromKey(device.attribute("status")); switch (_data->_status.type()) { case Status::Nb_Types: - qFatal("Unrecognized or absent device status"); + tqFatal("Unrecognized or absent device status"); break; case Status::Future: - if ( _data->_alternatives.count() ) qFatal("Future device has alternative"); + if ( _data->_alternatives.count() ) tqFatal("Future device has alternative"); break; case Status::NotRecommended: case Status::Mature: @@ -111,34 +111,34 @@ void Device::XmlToDataBase::processDevice(TQDomElement device) _data->_documents.webpage = device.attribute("document"); // ### REMOVE ME TQDomElement documents = findUniqueElement(device, "documents", TQString(), TQString()); if ( documents.isNull() ) { - if ( _data->_documents.webpage.isEmpty() ) qFatal("Missing \"documents\" element"); + if ( _data->_documents.webpage.isEmpty() ) tqFatal("Missing \"documents\" element"); } else { - if ( !_data->_documents.webpage.isEmpty() ) qFatal("document should be removed from root element"); + if ( !_data->_documents.webpage.isEmpty() ) tqFatal("document should be removed from root element"); _data->_documents.webpage = documents.attribute("webpage"); - if ( _data->_documents.webpage.isEmpty() ) qFatal("Missing webpage"); + if ( _data->_documents.webpage.isEmpty() ) tqFatal("Missing webpage"); _data->_documents.datasheet = documents.attribute("datasheet"); TQRegExp rexp("\\d{5}"); if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified"); - if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").arg(_data->_documents.datasheet)); + if ( !rexp.exactMatch(_data->_documents.datasheet) ) tqFatal(TQString("Malformed datasheet \"%1\" (5 digits)").arg(_data->_documents.datasheet)); _data->_documents.progsheet = documents.attribute("progsheet"); if ( _data->_documents.progsheet=="?" ) warning("No progsheet specified"); - if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").arg(_data->_documents.progsheet)); + if ( !rexp.exactMatch(_data->_documents.datasheet) ) tqFatal(TQString("Malformed progsheet \"%1\" (5 digits)").arg(_data->_documents.progsheet)); _data->_documents.erratas = TQStringList::split(" ", documents.attribute("erratas")); for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) { TQString errata = _data->_documents.erratas[i]; if ( !rexp.exactMatch(errata) ) { TQRegExp rexp2("\\d{5}e\\d"); if ( !rexp2.exactMatch(errata) && !errata.startsWith("er") && errata.mid(2)!=_data->_name.lower() ) - qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").arg(errata)); + tqFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").arg(errata)); } } } if ( _data->_documents.webpage=="?" ) warning("No webpage specified"); else { TQRegExp rexp("\\d{6}"); - if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").arg(_data->_documents.webpage)); + if ( !rexp.exactMatch(_data->_documents.webpage) ) tqFatal(TQString("Malformed webpage \"%1\" (6 digits)").arg(_data->_documents.webpage)); if ( _documents.contains(_data->_documents.webpage) ) - qFatal(TQString("webpage duplicated (already used for %1)").arg(_documents[_data->_documents.webpage])); + tqFatal(TQString("webpage duplicated (already used for %1)").arg(_documents[_data->_documents.webpage])); _documents[_data->_documents.webpage] = name; } @@ -150,11 +150,11 @@ void Device::XmlToDataBase::processDevice(TQDomElement device) FOR_EACH(Special, special) if ( getFrequencyRange(oc, special, device) && special==Special::Normal ) ok = true; } - if ( !ok ) qWarning("No normal frequency range defined"); + if ( !ok ) tqWarning("No normal frequency range defined"); checkTagNames(device, "frequency_range", names); // memory technology - if ( !getMemoryTechnology(device) ) qFatal("Memory technology not defined"); + if ( !getMemoryTechnology(device) ) tqFatal("Memory technology not defined"); // packages for (TQDomNode child=device.firstChild(); !child.isNull(); child=child.nextSibling()) { @@ -172,7 +172,7 @@ void Device::XmlToDataBase::processDevice(TQDomElement device) for (uint k=0; k<uint(_data->_packages.count()); k++) for (uint l=0; l<uint(p.types.count()); l++) for (uint j=0; j<uint(_data->_packages[k].types.count()); j++) - if ( _data->_packages[k].types[j]==p.types[l] && _data->_packages[k].pins.count()==p.pins.count() ) qFatal("Duplicated package type"); + if ( _data->_packages[k].types[j]==p.types[l] && _data->_packages[k].pins.count()==p.pins.count() ) tqFatal("Duplicated package type"); if ( !pinLabels.isEmpty() ) checkPins(pinLabels); _data->_packages.append(p); } @@ -184,49 +184,49 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element) // nb pins bool ok; uint nb = element.attribute("nb_pins").toUInt(&ok); - if ( !ok || nb==0 ) qFatal("Malformed \"nb_pins\""); + if ( !ok || nb==0 ) tqFatal("Malformed \"nb_pins\""); package.pins.resize(nb); // types TQStringList types = TQStringList::split(" ", element.attribute("types")); - if ( types.isEmpty() ) qFatal("No package types specified"); + if ( types.isEmpty() ) tqFatal("No package types specified"); for (uint k=0; k<uint(types.count()); k++) { uint i = 0; for (; Package::TYPE_DATA[i].name; i++) { if ( types[k]!=Package::TYPE_DATA[i].name ) continue; for (uint j=0; j<uint(package.types.count()); j++) - if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").arg(types[k])); + if ( package.types[j]==i ) tqFatal(TQString("Duplicated package type %1").arg(types[k])); uint j = 0; for (; j<Package::MAX_NB; j++) if ( nb==Package::TYPE_DATA[i].nbPins[j] ) break; - if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").arg(types[k]).arg(nb).arg(Package::TYPE_DATA[i].nbPins[0])); + if ( j==Package::MAX_NB ) tqFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").arg(types[k]).arg(nb).arg(Package::TYPE_DATA[i].nbPins[0])); package.types.append(i); break; } - if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").arg(types[k])); + if ( Package::TYPE_DATA[i].name==0 ) tqFatal(TQString("Unknown package type \"%1\"").arg(types[k])); } // pins TQString name = Package::TYPE_DATA[package.types[0]].name; if ( name=="sot23" ) { - if ( package.types.count()!=1 ) qFatal("SOT23 should be a specific package"); - } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").arg(name)); + if ( package.types.count()!=1 ) tqFatal("SOT23 should be a specific package"); + } else if ( (nb%2)!=0 ) tqFatal(TQString("\"nb_pins\" should be even for package \"%1\"").arg(name)); uint have_pins = false; TQMemArray<bool> found(nb); found.fill(false); TQDomNode child = element.firstChild(); while ( !child.isNull() ) { if ( child.nodeName()=="pin" ) { - if ( !child.isElement() ) qFatal("\"pin\" is not an element"); + if ( !child.isElement() ) tqFatal("\"pin\" is not an element"); TQDomElement pin = child.toElement(); bool ok; uint i = pin.attribute("index").toUInt(&ok); - if ( !ok || i==0 || i>nb ) qFatal("Malformed pin index"); - if (found[i-1]) qFatal("Duplicated pin index"); + if ( !ok || i==0 || i>nb ) tqFatal("Malformed pin index"); + if (found[i-1]) tqFatal("Duplicated pin index"); found[i-1] = true; TQString name = pin.attribute("name"); if ( !name.isEmpty() && name!="N/C" ) { TQStringList labels = TQStringList::split("/", name); - if ( name.contains(" ") || labels.count()==0 ) qFatal("Malformed pin name"); - if ( name!=name.upper() ) qFatal("Pin name should be uppercase"); + if ( name.contains(" ") || labels.count()==0 ) tqFatal("Malformed pin name"); + if ( name!=name.upper() ) tqFatal("Pin name should be uppercase"); } package.pins[i-1] = name; have_pins = true; @@ -234,7 +234,7 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element) child = child.nextSibling(); } if ( !have_pins ) ;//warning("Pins not specified"); // #### REMOVE ME !! - else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").arg(i+1)); + else for (uint i=0; i<nb; i++) if ( !found[i] ) tqFatal(TQString("Pin #%1 not specified").arg(i+1)); return package; } @@ -246,7 +246,7 @@ void Device::XmlToDataBase::parse() _data = 0; TQDomDocument doc = parseFile(files[i]); TQDomElement root = doc.documentElement(); - if ( root.nodeName()!="device" ) qFatal("root node should be \"device\""); + if ( root.nodeName()!="device" ) tqFatal("root node should be \"device\""); processDevice(root); } @@ -255,6 +255,6 @@ void Device::XmlToDataBase::parse() for (; ait!=_alternatives.end(); ++ait) { TQStringList::const_iterator lit = ait.data().begin(); for (; lit!=ait.data().end(); ++lit) - if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key())); + if ( !_map.contains(*lit) ) tqFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key())); } } diff --git a/src/xml_to_data/prog_xml_to_data.h b/src/xml_to_data/prog_xml_to_data.h index 4995e1e..bcca9da 100644 --- a/src/xml_to_data/prog_xml_to_data.h +++ b/src/xml_to_data/prog_xml_to_data.h @@ -58,22 +58,22 @@ Group::Support ExtXmlToData<Data>::extractSupport(const TQString &s) const { if ( s.isEmpty() ) return Group::Support::Untested; Group::Support support = Group::Support::fromKey(s); - if ( support==Group::Support::None ) qFatal("Cannot be \"not supported\""); - if ( support==Group::Support::Nb_Types ) qFatal("Unknown support type"); + if ( support==Group::Support::None ) tqFatal("Cannot be \"not supported\""); + if ( support==Group::Support::Nb_Types ) tqFatal("Unknown support type"); return support; } template <class Data> void ExtXmlToData<Data>::parseDevice(TQDomElement element) { - if ( element.nodeName()!="device" ) qFatal("Root node child should be named \"device\""); + if ( element.nodeName()!="device" ) tqFatal("Root node child should be named \"device\""); _current = element.attribute("name").upper(); - if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").arg(_current)); - if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").arg(_current)); + if ( Device::lister().data(_current)==0 ) tqFatal(TQString("Device name \"%1\" unknown").arg(_current)); + if ( _map.contains(_current) ) tqFatal(TQString("Device \"%1\" already parsed").arg(_current)); PData data; if ( hasFamilies() ) { TQString family = element.attribute("family"); - if ( family.isEmpty() ) qFatal(TQString("Family is empty").arg(family)); + if ( family.isEmpty() ) tqFatal(TQString("Family is empty").arg(family)); if ( _families.find(family)==_families.end() ) _families.append(family); data.family = familyIndex(family); } @@ -87,13 +87,13 @@ void ExtXmlToData<Data>::parse() { TQDomDocument doc = parseFile(_basename + ".xml"); TQDomElement root = doc.documentElement(); - if ( root.nodeName()!="type" ) qFatal("Root node should be \"type\""); - if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").arg(_basename)); + if ( root.nodeName()!="type" ) tqFatal("Root node should be \"type\""); + if ( root.attribute("name")!=_basename ) tqFatal(TQString("Root node name is not \"%1\"").arg(_basename)); TQDomNode child = root.firstChild(); while ( !child.isNull() ) { - if ( child.isComment() ) qDebug("comment: %s", child.toComment().data().latin1()); + if ( child.isComment() ) tqDebug("comment: %s", child.toComment().data().latin1()); else { - if ( !child.isElement() ) qFatal("Root node child should be an element"); + if ( !child.isElement() ) tqFatal("Root node child should be an element"); parseDevice(child.toElement()); } child = child.nextSibling(); @@ -105,7 +105,7 @@ void ExtXmlToData<Data>::output() { // write .cpp file TQFile file(_basename + "_data.cpp"); - if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").arg(file.name())); + if ( !file.open(IO_WriteOnly) ) tqFatal(TQString("Cannot open output file \"%1\"").arg(file.name())); TQTextStream s(&file); s << "// #### Do not edit: this file is autogenerated !!!" << endl << endl; s << "#include \"devices/list/device_list.h\"" << endl; diff --git a/src/xml_to_data/xml_to_data.cpp b/src/xml_to_data/xml_to_data.cpp index 8176be1..ef41a8d 100644 --- a/src/xml_to_data/xml_to_data.cpp +++ b/src/xml_to_data/xml_to_data.cpp @@ -19,7 +19,7 @@ TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &t while ( !child.isNull() ) { if ( child.nodeName()==tag && child.isElement() && (attribute.isEmpty() || child.toElement().attribute(attribute)==value) ) { - if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").arg(tag).arg(value)); + if ( !element.isNull() ) tqFatal(TQString("Duplicated element \"%1/%2\"").arg(tag).arg(value)); element = child.toElement(); } child = child.nextSibling(); @@ -34,38 +34,38 @@ void XmlToData::checkTagNames(TQDomElement element, const TQString &tag, for (uint i=0; i<uint(list.count()); i++) { if ( !list.item(i).isElement() ) continue; TQString name = list.item(i).toElement().attribute("name"); - if ( names.find(name)==names.end() ) qFatal(TQString("Illegal name %1 for %2 element").arg(name).arg(tag)); + if ( names.find(name)==names.end() ) tqFatal(TQString("Illegal name %1 for %2 element").arg(name).arg(tag)); } } TQDomDocument XmlToData::parseFile(const TQString &filename) const { - qDebug("Parsing XML file \"%s\"...", filename.latin1()); + tqDebug("Parsing XML file \"%s\"...", filename.latin1()); TQFile file(filename); - if ( !file.open(IO_ReadOnly) ) qFatal("Cannot open file!"); + if ( !file.open(IO_ReadOnly) ) tqFatal("Cannot open file!"); TQDomDocument doc; TQString error; int errorLine, errorColumn; if ( !doc.setContent(&file, false, &error, &errorLine, &errorColumn) ) - qFatal(TQString("Error parsing XML file (%1 at line %2, column %3)").arg(error).arg(errorLine).arg(errorColumn)); + tqFatal(TQString("Error parsing XML file (%1 at line %2, column %3)").arg(error).arg(errorLine).arg(errorColumn)); return doc; } void XmlToData::warning(const TQString &message) const { - if ( currentDevice().isEmpty() ) ::qWarning("Warning: %s", message.latin1()); - else ::qWarning("Warning [%s]: %s", currentDevice().latin1(), message.latin1()); + if ( currentDevice().isEmpty() ) ::tqWarning("Warning: %s", message.latin1()); + else ::tqWarning("Warning [%s]: %s", currentDevice().latin1(), message.latin1()); } -void XmlToData::qFatal(const TQString &message) const +void XmlToData::tqFatal(const TQString &message) const { - if ( currentDevice().isEmpty() ) ::qFatal("Fatal: %s", message.latin1()); - else ::qFatal("Fatal [%s]: %s", currentDevice().latin1(), message.latin1()); + if ( currentDevice().isEmpty() ) ::tqFatal("Fatal: %s", message.latin1()); + else ::tqFatal("Fatal [%s]: %s", currentDevice().latin1(), message.latin1()); } void XmlToData::process() { parse(); - qDebug("Parsing XML successful."); + tqDebug("Parsing XML successful."); output(); - qDebug("Output written."); + tqDebug("Output written."); } diff --git a/src/xml_to_data/xml_to_data.h b/src/xml_to_data/xml_to_data.h index 5630f1b..1b45ea6 100644 --- a/src/xml_to_data/xml_to_data.h +++ b/src/xml_to_data/xml_to_data.h @@ -25,7 +25,7 @@ protected: virtual void output() = 0; virtual TQString currentDevice() const = 0; virtual void warning(const TQString &message) const; - virtual void qFatal(const TQString &message) const; + virtual void tqFatal(const TQString &message) const; TQDomElement findUniqueElement(TQDomElement parent, const TQString &nodeName, const TQString &attribute, const TQString &value) const; void checkTagNames(TQDomElement element, const TQString &tag, const TQStringList &names) const; |