summaryrefslogtreecommitdiffstats
path: root/src/coff/base/coff.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
commit0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch)
treeb95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/coff/base/coff.cpp
parentb79a2c28534cf09987eeeba3077fff9236df182a (diff)
downloadpiklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz
piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip
TQt4 port piklab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/coff/base/coff.cpp')
-rw-r--r--src/coff/base/coff.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/coff/base/coff.cpp b/src/coff/base/coff.cpp
index 5eaad84..83100a4 100644
--- a/src/coff/base/coff.cpp
+++ b/src/coff/base/coff.cpp
@@ -33,64 +33,64 @@ CoffType Coff::identify(const PURL::Url &url, Log::Base &log)
{
PURL::File file(url, log);
if ( !file.openForRead() ) return CoffType::Nb_Types;
- QByteArray data = file.readAll();
+ TQByteArray data = file.readAll();
if ( log.hasError() ) return CoffType::Nb_Types;
uint offset = 0;
Format format;
- Q_UINT32 magic;
+ TQ_UINT32 magic;
return identify(data, offset, log, format, magic);
}
-CoffType Coff::identify(const QByteArray &data, uint &offset, Log::Base &log, Format &format, Q_UINT32 &magic)
+CoffType Coff::identify(const TQByteArray &data, uint &offset, Log::Base &log, Format &format, TQ_UINT32 &magic)
{
- QString id = "!<arch>\012";
+ TQString id = "!<arch>\012";
if ( data.count()>=id.length() ) {
- QString s = QString::fromAscii(data.data(), id.length());
+ TQString s = TQString::fromAscii(data.data(), id.length());
if ( s==id ) {
offset += id.length();
return CoffType::Archive;
}
}
if ( !getULong(data, offset, 2, log, magic) ) return CoffType::Nb_Types;
- log.log(Log::DebugLevel::Extra, QString("COFF format: %1").arg(toHexLabel(magic, 4)));
+ log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").tqarg(toHexLabel(magic, 4)));
format = Format::Nb_Types;
FOR_EACH(Format, f) if ( magic==f.data().magic ) format = f;
return CoffType::Object;
}
//----------------------------------------------------------------------------
-bool Coff::getULong(const QByteArray &data, uint &offset, uint nbBytes, Log::Base &log, Q_UINT32 &v)
+bool Coff::getULong(const TQByteArray &data, uint &offset, uint nbBytes, Log::Base &log, TQ_UINT32 &v)
{
bool ok;
v = ::getULong(data, offset, nbBytes, &ok);
if ( !ok ) {
- log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbBytes).arg(data.count()));
+ log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").tqarg(offset).tqarg(nbBytes).tqarg(data.count()));
return false;
}
offset += nbBytes;
return true;
}
-bool Coff::getString(const QByteArray &data, uint &offset, uint nbChars, Log::Base &log, QString &name)
+bool Coff::getString(const TQByteArray &data, uint &offset, uint nbChars, Log::Base &log, TQString &name)
{
if ( !checkAvailable(data, offset, nbChars) ) {
- log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbChars).arg(data.count()));
+ log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").tqarg(offset).tqarg(nbChars).tqarg(data.count()));
return false;
}
- name = QString::fromAscii(data.data()+offset, nbChars);
+ name = TQString::fromAscii(data.data()+offset, nbChars);
offset += nbChars;
return true;
}
//----------------------------------------------------------------------------
-bool Coff::Base::initParse(CoffType type, QByteArray &data, uint &offset, Log::Base &log)
+bool Coff::Base::initParse(CoffType type, TQByteArray &data, uint &offset, Log::Base &log)
{
PURL::File file(_url, log);
if ( !file.openForRead() ) return false;
data = file.readAll();
if ( log.hasError() ) return false;
if ( identify(data, offset, log, _format, _magic)!=type ) {
- log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").arg(toHexLabel(_magic, 4)));
+ log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").tqarg(toHexLabel(_magic, 4)));
return false;
}
return true;