From 87a016680e3677da3993f333561e79eb0cead7d5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 29 Jun 2011 16:05:55 +0000 Subject: TQt4 port ktechlab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- microbe/optimizer.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'microbe/optimizer.cpp') diff --git a/microbe/optimizer.cpp b/microbe/optimizer.cpp index 33b0bcd..7b8d059 100644 --- a/microbe/optimizer.cpp +++ b/microbe/optimizer.cpp @@ -18,10 +18,10 @@ using namespace std; -QString binary( uchar val ) +TQString binary( uchar val ) { - QString bin = QString::number( val, 2 ); - QString pad; + TQString bin = TQString::number( val, 2 ); + TQString pad; pad.fill( '0', 8-bin.length() ); return pad + bin; } @@ -143,7 +143,7 @@ bool Optimizer::pruneInstructions() //BEGIN remove labels without any reference to them // First: build up a list of labels which are referenced - QStringList referencedLabels; + TQStringList referencedLabels; for ( it = m_pCode->begin(); it != end; ++it ) { if ( Instr_goto * ins = dynamic_cast(*it) ) @@ -155,12 +155,12 @@ bool Optimizer::pruneInstructions() // Now remove labels from instructions that aren't in the referencedLabels list for ( it = m_pCode->begin(); it != end; ++it ) { - QStringList labels = (*it)->labels(); + TQStringList labels = (*it)->labels(); - QStringList::iterator labelsEnd = labels.end(); - for ( QStringList::iterator labelsIt = labels.begin(); labelsIt != labelsEnd; ) + TQStringList::iterator labelsEnd = labels.end(); + for ( TQStringList::iterator labelsIt = labels.begin(); labelsIt != labelsEnd; ) { - if ( !referencedLabels.contains( *labelsIt ) ) + if ( !referencedLabels.tqcontains( *labelsIt ) ) { labelsIt = labels.erase( labelsIt ); removed = true; @@ -386,8 +386,8 @@ bool Optimizer::optimizeInstructions() { // If we are testing STATUS, then we assume that the bits changed // are only those that are marked as independent. - uchar bitmask = ( i == 1 ) ? behaviour.reg( Register::STATUS ).indep : 0xff; - if ( !canRemove( *it, (i == 0) ? regSet : Register::STATUS, bitmask ) ) + uchar bittqmask = ( i == 1 ) ? behaviour.reg( Register::STATUS ).indep : 0xff; + if ( !canRemove( *it, (i == 0) ? regSet : Register::STATUS, bittqmask ) ) { ok = false; break; @@ -409,7 +409,7 @@ bool Optimizer::optimizeInstructions() } -bool Optimizer::redirectGotos( Instruction * current, const QString & label ) +bool Optimizer::redirectGotos( Instruction * current, const TQString & label ) { if ( current->isUsed() ) return false; @@ -479,7 +479,7 @@ bool Optimizer::canRemove( Instruction * ins, const Register & reg, uchar bitMas // The bits that are depended upon in the future for this register uchar depends = generateRegisterDepends( ins, reg ); - // Only interested in those bits allowed by the bit mask + // Only interested in those bits allowed by the bit tqmask depends &= bitMask; RegisterState inputState = ins->inputState().reg( reg ); -- cgit v1.2.3