From e05894553004a47b1e2f276bedcf5963b57a3932 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: rename the following methods: tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- microbe/expression.cpp | 16 ++++++++-------- microbe/instruction.cpp | 14 +++++++------- microbe/instruction.h | 2 +- microbe/microbe.cpp | 6 +++--- microbe/optimizer.cpp | 2 +- microbe/parser.cpp | 26 +++++++++++++------------- microbe/pic14.cpp | 2 +- 7 files changed, 34 insertions(+), 34 deletions(-) (limited to 'microbe') diff --git a/microbe/expression.cpp b/microbe/expression.cpp index 33a70f2..cfa2d95 100644 --- a/microbe/expression.cpp +++ b/microbe/expression.cpp @@ -493,12 +493,12 @@ void Expression::compileExpression( const TQString & expression ) void Expression::compileConditional( const TQString & expression, Code * ifCode, Code * elseCode ) { - if( expression.tqcontains(TQRegExp("=>|=<|=!")) ) + if( expression.contains(TQRegExp("=>|=<|=!")) ) { mistake( Microbe::InvalidComparison, expression ); return; } - if( expression.tqcontains(TQRegExp("[^=>isVariableKnown(expr) && !m_pic->isValidPort( expr ) && !m_pic->isValidTris( expr ) ) @@ -750,11 +750,11 @@ void Expression::expressionValue( TQString expr, BTreeBase */*tree*/, BTreeNode if( t == extpin ) { bool NOT; - int i = expr.tqfind("is"); + int i = expr.find("is"); if(i > 0) { - NOT = expr.tqcontains("low"); - if(!expr.tqcontains("high") && !expr.tqcontains("low")) + NOT = expr.contains("low"); + if(!expr.contains("high") && !expr.contains("low")) mistake( Microbe::HighLowExpected, expr ); expr = expr.left(i-1); } @@ -796,7 +796,7 @@ ExprType Expression::expressionType( const TQString & expression ) if ( value != -1 ) return number; - if( expression.tqcontains('.') ) + if( expression.contains('.') ) return extpin; if ( mb->variable( expression ).type() == Variable::keypadType ) diff --git a/microbe/instruction.cpp b/microbe/instruction.cpp index b05423c..5e41fc8 100644 --- a/microbe/instruction.cpp +++ b/microbe/instruction.cpp @@ -780,7 +780,7 @@ uchar & RegisterDepends::reg( const Register & reg ) return status; // If we don't already have the register, we need to reset it first - if ( !m_registers.tqcontains( reg.name() ) ) + if ( !m_registers.contains( reg.name() ) ) m_registers[ reg ] = 0xff; return m_registers[ reg ]; @@ -905,7 +905,7 @@ Instruction * Code::instruction( const TQString & label ) const InstructionList::const_iterator end = m_instructionLists[i].end(); for ( InstructionList::const_iterator it = m_instructionLists[i].begin(); it != end; ++it ) { - if ( (*it)->labels().tqcontains( label ) ) + if ( (*it)->labels().contains( label ) ) return *it; } } @@ -913,7 +913,7 @@ Instruction * Code::instruction( const TQString & label ) const } -Code::iterator Code::tqfind( Instruction * instruction ) +Code::iterator Code::find( Instruction * instruction ) { iterator e = end(); iterator i = begin(); @@ -1020,7 +1020,7 @@ TQStringList Code::findVariables() const continue; TQString alias = (*i)->file().name(); - if ( !variables.tqcontains( alias ) ) + if ( !variables.contains( alias ) ) variables << alias; } @@ -1304,7 +1304,7 @@ void Instruction::makeLabelOutputLink( const TQString & label ) void Instruction::addInputLink( Instruction * instruction ) { // Don't forget that a link to ourself is valid! - if ( !instruction || m_inputLinks.tqcontains( instruction ) ) + if ( !instruction || m_inputLinks.contains( instruction ) ) return; m_inputLinks << instruction; @@ -1315,7 +1315,7 @@ void Instruction::addInputLink( Instruction * instruction ) void Instruction::addOutputLink( Instruction * instruction ) { // Don't forget that a link to ourself is valid! - if ( !instruction || m_outputLinks.tqcontains( instruction ) ) + if ( !instruction || m_outputLinks.contains( instruction ) ) return; m_outputLinks << instruction; @@ -2035,7 +2035,7 @@ void Instr_call::linkReturns( Instruction * current, Instruction * returnPoint ) { // Jump over the call instruction to its return point, // which will be the instruction after current. - current = *(++m_pCode->tqfind( current )); + current = *(++m_pCode->find( current )); continue; } diff --git a/microbe/instruction.h b/microbe/instruction.h index 595dd16..ce5a6f3 100644 --- a/microbe/instruction.h +++ b/microbe/instruction.h @@ -512,7 +512,7 @@ class Code * @return an iterator to the current instruction, or end if it wasn't * found. */ - iterator tqfind( Instruction * instruction ); + iterator find( Instruction * instruction ); /** * Removes the Instruction (regardless of position). * @warning You should always use only this function to remove an diff --git a/microbe/microbe.cpp b/microbe/microbe.cpp index 847dc88..3c7dbef 100644 --- a/microbe/microbe.cpp +++ b/microbe/microbe.cpp @@ -394,7 +394,7 @@ TQString Microbe::alias( const TQString & alias ) const { // If the string is an alias, return the real string, // otherwise just return the alias as that is the real string. - AliasMap::const_iterator it = m_aliasList.tqfind(alias); + AliasMap::const_iterator it = m_aliasList.find(alias); if ( it != m_aliasList.constEnd() ) return it.data(); return alias; @@ -404,7 +404,7 @@ TQString Microbe::alias( const TQString & alias ) const void Microbe::setInterruptUsed(const TQString &interruptName) { // Don't add it again if it is already in the list - if ( m_usedInterrupts.tqcontains( interruptName ) ) + if ( m_usedInterrupts.contains( interruptName ) ) return; m_usedInterrupts.append(interruptName); } @@ -412,7 +412,7 @@ void Microbe::setInterruptUsed(const TQString &interruptName) bool Microbe::isInterruptUsed( const TQString & interruptName ) { - return m_usedInterrupts.tqcontains( interruptName ); + return m_usedInterrupts.contains( interruptName ); } diff --git a/microbe/optimizer.cpp b/microbe/optimizer.cpp index 7b8d059..03e3110 100644 --- a/microbe/optimizer.cpp +++ b/microbe/optimizer.cpp @@ -160,7 +160,7 @@ bool Optimizer::pruneInstructions() TQStringList::iterator labelsEnd = labels.end(); for ( TQStringList::iterator labelsIt = labels.begin(); labelsIt != labelsEnd; ) { - if ( !referencedLabels.tqcontains( *labelsIt ) ) + if ( !referencedLabels.contains( *labelsIt ) ) { labelsIt = labels.erase( labelsIt ); removed = true; diff --git a/microbe/parser.cpp b/microbe/parser.cpp index 0bf3fea..0e5545d 100644 --- a/microbe/parser.cpp +++ b/microbe/parser.cpp @@ -203,7 +203,7 @@ Code * Parser::parse( const SourceLineList & lines ) TQString command; // e.g. "delay", "for", "subroutine", "increment", etc { - int spacepos = line.tqfind(' '); + int spacepos = line.find(' '); if ( spacepos >= 0 ) command = line.left( spacepos ); else @@ -218,7 +218,7 @@ Code * Parser::parse( const SourceLineList & lines ) m_code->append(new Instr_sourceCode("{")); // Use the first token in the line to look up the statement type - DefinitionMap::Iterator dmit = m_definitionMap.tqfind(command); + DefinitionMap::Iterator dmit = m_definitionMap.find(command); if(dmit == m_definitionMap.end()) { if( !processAssignment( (*sit).text() ) ) @@ -269,7 +269,7 @@ Code * Parser::parse( const SourceLineList & lines ) case (Field::Variable): case (Field::Name): { - newPosition = line.tqfind( ' ', position ); + newPosition = line.find( ' ', position ); if(position == newPosition) { newPosition = -1; @@ -303,12 +303,12 @@ Code * Parser::parse( const SourceLineList & lines ) { nextField = (*it); if(nextField.type() == Field::FixedString) - newPosition = line.tqfind(TQRegExp("\\b" + nextField.string() + "\\b")); + newPosition = line.find(TQRegExp("\\b" + nextField.string() + "\\b")); // Although code is not neccessarily braced, after an expression it is the only // sensilbe way to have it. else if(nextField.type() == Field::Code) { - newPosition = line.tqfind("{"); + newPosition = line.find("{"); if(newPosition == -1) newPosition = line.length() + 1; } else if(nextField.type() == Field::Newline) @@ -367,7 +367,7 @@ Code * Parser::parse( const SourceLineList & lines ) case (Field::FixedString): { // Is the string found, and is it starting in the right place? - int stringPosition = line.tqfind(TQRegExp("\\b"+field.string()+"\\b")); + int stringPosition = line.find(TQRegExp("\\b"+field.string()+"\\b")); if( stringPosition != position || stringPosition == -1 ) { if( !field.compulsory() ) @@ -402,7 +402,7 @@ Code * Parser::parse( const SourceLineList & lines ) if( nextField.type() == Field::FixedString ) { nextStatement = *(++StatementList::Iterator(sit)); - newPosition = nextStatement.text().tqfind(TQRegExp("\\b" + nextField.string() + "\\b")); + newPosition = nextStatement.text().find(TQRegExp("\\b" + nextField.string() + "\\b")); if(newPosition != 0) { // If the next field is optional just carry on as nothing happened, @@ -476,7 +476,7 @@ bool Parser::processAssignment(const TQString &line) // Look for port variables first. - if ( firstToken.tqcontains(".") ) + if ( firstToken.contains(".") ) { PortPin portPin = m_pPic->toPortPin( firstToken ); @@ -502,14 +502,14 @@ bool Parser::processAssignment(const TQString &line) if ( tokens[1] != "=" ) mistake( Microbe::UnassignedPort, tokens[1] ); - Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.tqfind("=")+1)); + Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.find("=")+1)); m_pPic->saveResultToVar( firstToken ); } else if ( m_pPic->isValidTris( firstToken ) ) { if( tokens[1] == "=" ) { - Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.tqfind("=")+1)); + Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.find("=")+1)); m_pPic->Stristate(firstToken); } } @@ -529,7 +529,7 @@ bool Parser::processAssignment(const TQString &line) // hasn't been defined yet. mb->addVariable( Variable( Variable::charType, firstToken ) ); - Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.tqfind("=")+1)); + Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.find("=")+1)); Variable v = mb->variable( firstToken ); switch ( v.type() ) @@ -676,7 +676,7 @@ void Parser::processStatement( const TQString & name, const OutputFieldMap & fie stepPositive = true; } - TQString variable = fieldMap["initExpression"].string().mid(0,fieldMap["initExpression"].string().tqfind("=")).stripWhiteSpace(); + TQString variable = fieldMap["initExpression"].string().mid(0,fieldMap["initExpression"].string().find("=")).stripWhiteSpace(); TQString endExpr = variable+ " <= " + fieldMap["toExpression"].string().stripWhiteSpace(); if( fieldMap["stepExpression"].found() ) @@ -1027,7 +1027,7 @@ OutputField::OutputField( const TQString & string/*, int lineNumber*/ ) { // only cope with 'sane' strings a.t.m. // e.g. include "filename.extenstion" - TQString filename = (*sit).content.mid( (*sit).content.tqfind("\"") ).stripWhiteSpace(); + TQString filename = (*sit).content.mid( (*sit).content.find("\"") ).stripWhiteSpace(); // don't strip whitespace from within quotes as you // can have filenames composed entirely of spaces (kind of weird)... // remove quotes. diff --git a/microbe/pic14.cpp b/microbe/pic14.cpp index 548d4de..c9dcf24 100644 --- a/microbe/pic14.cpp +++ b/microbe/pic14.cpp @@ -75,7 +75,7 @@ PortPin PIC14::toPortPin( const TQString & portPinString ) } else { - int dotpos = portPinString.tqfind("."); + int dotpos = portPinString.find("."); if ( dotpos == -1 ) return PortPin(); -- cgit v1.2.1