diff options
Diffstat (limited to 'src/devices/base/hex_buffer.cpp')
-rw-r--r-- | src/devices/base/hex_buffer.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/devices/base/hex_buffer.cpp b/src/devices/base/hex_buffer.cpp index a63554d..09bf847 100644 --- a/src/devices/base/hex_buffer.cpp +++ b/src/devices/base/hex_buffer.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "hex_buffer.h" -#include <qtextstream.h> +#include <tqtextstream.h> #include "devices/base/generic_device.h" @@ -18,7 +18,7 @@ const char * const HexBuffer::FORMATS[Nb_Formats] = { "inhx8m", /*"inhx8s", */"inhx16", "inhx32" }; -void HexBuffer::savePartial(QTextStream &stream, Format format) const +void HexBuffer::savePartial(TQTextStream &stream, Format format) const { BitValue oldseg; const_iterator block = begin(); @@ -37,7 +37,7 @@ void HexBuffer::savePartial(QTextStream &stream, Format format) const } } -void HexBuffer::saveEnd(QTextStream &stream) const +void HexBuffer::saveEnd(TQTextStream &stream) const { stream << ":00000001FF\n"; } @@ -46,7 +46,7 @@ void HexBuffer::saveEnd(QTextStream &stream) const * Original code source from Timo Rossi, * modified by Alain Gibaud to support large blocks write */ -void HexBuffer::writeHexBlock(QTextStream &stream, int reclen, // length (in words) +void HexBuffer::writeHexBlock(TQTextStream &stream, int reclen, // length (in words) const_iterator& data, // pointer to 1st data word (incremented by function) Format format) { @@ -133,33 +133,33 @@ bool HexBuffer::fetchNextBlock(const_iterator& it, const const_iterator &end, in return *len != 0 ; } -QString HexBuffer::ErrorData::message() const +TQString HexBuffer::ErrorData::message() const { switch (type) { - case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").arg(line); + case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").tqarg(line); case UnexpectedEOF: return i18n("Unexpected end-of-file."); - case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").arg(line); - case WrongCRC: return i18n("CRC mismatch (line %1).").arg(line); + case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").tqarg(line); + case WrongCRC: return i18n("CRC mismatch (line %1).").tqarg(line); } Q_ASSERT(false); - return QString::null; + return TQString(); } -bool HexBuffer::load(QTextStream &stream, QStringList &errors) +bool HexBuffer::load(TQTextStream &stream, TQStringList &errors) { Format format; - QValueList<ErrorData> list = load(stream, format); + TQValueList<ErrorData> list = load(stream, format); if ( list.isEmpty() ) return true; errors.clear(); for (uint i=0; i<uint(list.count()); i++) errors += list[i].message(); return false; } -QValueList<HexBuffer::ErrorData> HexBuffer::load(QTextStream &stream, Format &format) +TQValueList<HexBuffer::ErrorData> HexBuffer::load(TQTextStream &stream, Format &format) { clear(); format = Nb_Formats; - QValueList<HexBuffer::ErrorData> errors; + TQValueList<HexBuffer::ErrorData> errors; load(stream, format, errors); if ( format==Nb_Formats ) format = IHX8M; // default return errors; @@ -170,13 +170,13 @@ QValueList<HexBuffer::ErrorData> HexBuffer::load(QTextStream &stream, Format &fo the format automagicly by the wordcount and length of the line Tested in 8 and 16 bits modes ------------------------------------------------------------------------ */ -void HexBuffer::load(QTextStream &stream, Format &format, QValueList<ErrorData> &errors) +void HexBuffer::load(TQTextStream &stream, Format &format, TQValueList<ErrorData> &errors) { uint addrH = 0; // upper 16 bits of 32 bits address (inhx32 format) uint line = 1; for (; !stream.atEnd(); line++) { // read each line - QString s = stream.readLine(); + TQString s = stream.readLine(); if ( !s.startsWith(":") ) continue; // skip invalid intel hex line s = s.stripWhiteSpace(); // clean-up white spaces at end-of-line if ( s==":" ) continue; // skip empty line @@ -250,8 +250,8 @@ void HexBuffer::load(QTextStream &stream, Format &format, QValueList<ErrorData> // however, I don't know if such a situation can occurs uint a = addrbase+x >> 1; 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 ( addrbase+x & 1 ) insert(a, value.tqmaskWith(0x00FF) | data << 8); // Odd addr => Hi byte + else insert(a, value.tqmaskWith(0xFF00) | data); // Low byte //if ( x==0 ) qDebug("fb@%s: %s", toHex(addrbase+x >> 1, 8).data(), toHex(fb[addrbase+x >> 1], 8).data()); cksum += data; } |