diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-30 14:27:29 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-25 16:43:08 +0900 |
| commit | 35ced32e331ee29fda1642616c803637952f5b22 (patch) | |
| tree | da44726777f814e19c7ef1e43854f6a1693dd6fb /tools/designer/editor/yyindent.cpp | |
| parent | 7dd4848d61e4c52091d6c644356c84c67536bde2 (diff) | |
| download | tqt-35ced32e.tar.gz tqt-35ced32e.zip | |
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24)
Diffstat (limited to 'tools/designer/editor/yyindent.cpp')
| -rw-r--r-- | tools/designer/editor/yyindent.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/tools/designer/editor/yyindent.cpp b/tools/designer/editor/yyindent.cpp index d8498dc3a..d7228c0b6 100644 --- a/tools/designer/editor/yyindent.cpp +++ b/tools/designer/editor/yyindent.cpp @@ -137,8 +137,8 @@ static TQChar firstNonWhiteSpace( const TQString& t ) } /* - Returns TRUE if string t is made only of white space; otherwise - returns FALSE. + Returns true if string t is made only of white space; otherwise + returns false. */ static bool isOnlyWhiteSpace( const TQString& t ) { @@ -272,8 +272,8 @@ static inline TQChar lastParen( const TQString& t ) } /* - Returns TRUE if typedIn the same as okayCh or is null; otherwise - returns FALSE. + Returns true if typedIn the same as okayCh or is null; otherwise + returns false. */ static inline bool okay( TQChar typedIn, TQChar okayCh ) { @@ -331,7 +331,7 @@ static bool readLine() do { if ( yyLinizerState->iter == yyProgram->begin() ) { yyLinizerState->line = TQString::null; - return FALSE; + return false; } --yyLinizerState->iter; @@ -345,7 +345,7 @@ static bool readLine() of that and eventually yyLine will contain a slash-aster. Notice that both if's can be executed, since - yyLinizerState->inCComment is potentially set to FALSE in + yyLinizerState->inCComment is potentially set to false in the first if. The order of the if's is also important. */ @@ -357,7 +357,7 @@ static bool readLine() yyLinizerState->line = TQString::null; } else { yyLinizerState->line.truncate( k ); - yyLinizerState->inCComment = FALSE; + yyLinizerState->inCComment = false; } } @@ -368,7 +368,7 @@ static bool readLine() if ( k != -1 ) { for ( int i = 0; i < k + 2; i++ ) eraseChar( yyLinizerState->line, i, ' ' ); - yyLinizerState->inCComment = TRUE; + yyLinizerState->inCComment = true; } } @@ -421,7 +421,7 @@ static bool readLine() yyLinizerState->braceDepth--; } while ( yyLinizerState->line.isEmpty() ); - return TRUE; + return true; } /* @@ -431,8 +431,8 @@ static bool readLine() static void startLinizer() { yyLinizerState->braceDepth = 0; - yyLinizerState->inCComment = FALSE; - yyLinizerState->pendingRightBrace = FALSE; + yyLinizerState->inCComment = false; + yyLinizerState->pendingRightBrace = false; yyLine = &yyLinizerState->line; yyBraceDepth = &yyLinizerState->braceDepth; @@ -445,9 +445,9 @@ static void startLinizer() } /* - Returns TRUE if the start of the bottom line of yyProgram (and + Returns true if the start of the bottom line of yyProgram (and potentially the whole line) is part of a C-style comment; otherwise - returns FALSE. + returns false. */ static bool bottomLineStartsInCComment() { @@ -463,20 +463,20 @@ static bool bottomLineStartsInCComment() for ( int i = 0; i < BigRoof; i++ ) { if ( p == yyProgram->begin() ) - return FALSE; + return false; --p; if ( (*p).find(slashAster) != -1 || (*p).find(asterSlash) != -1 ) { TQString trimmed = trimmedCodeLine( *p ); if ( trimmed.find(slashAster) != -1 ) { - return TRUE; + return true; } else if ( trimmed.find(asterSlash) != -1 ) { - return FALSE; + return false; } } } - return FALSE; + return false; } /* @@ -515,15 +515,15 @@ static int indentWhenBottomLineStartsInCComment() /* A function called match...() modifies the linizer state. If it - returns TRUE, yyLine is the top line of the matched construct; + returns true, yyLine is the top line of the matched construct; otherwise, the linizer is left in an unknown state. A function called is...() keeps the linizer state intact. */ /* - Returns TRUE if the current line (and upwards) forms a braceless - control statement; otherwise returns FALSE. + Returns true if the current line (and upwards) forms a braceless + control statement; otherwise returns false. The first line of the following example is a "braceless control statement": @@ -536,10 +536,10 @@ static bool matchBracelessControlStatement() int delimDepth = 0; if ( yyLine->endsWith("else") ) - return TRUE; + return true; if ( !yyLine->endsWith(")") ) - return FALSE; + return false; for ( int i = 0; i < SmallRoof; i++ ) { int j = yyLine->length(); @@ -564,7 +564,7 @@ static bool matchBracelessControlStatement() "if ( x )" is not part of the statement "y". */ - return TRUE; + return true; } } if ( delimDepth == -1 ) { @@ -579,7 +579,7 @@ static bool matchBracelessControlStatement() if ( 1 + 2 ) */ - return FALSE; + return false; } break; case '{': @@ -592,19 +592,19 @@ static bool matchBracelessControlStatement() though. */ if ( ch != TQChar(';') || delimDepth == 0 ) - return FALSE; + return false; } } if ( !readLine() ) break; } - return FALSE; + return false; } /* - Returns TRUE if yyLine is an unfinished line; otherwise returns - FALSE. + Returns true if yyLine is an unfinished line; otherwise returns + false. In many places we'll use the terms "standalone line", "unfinished line" and "continuation line". The meaning of these should be @@ -618,12 +618,12 @@ static bool matchBracelessControlStatement() */ static bool isUnfinishedLine() { - bool unf = FALSE; + bool unf = false; YY_SAVE(); if ( yyLine->isEmpty() ) - return FALSE; + return false; TQChar lastCh = (*yyLine)[(int) yyLine->length() - 1]; if ( TQString("{};").find(lastCh) == -1 && !yyLine->endsWith("...") ) { @@ -640,7 +640,7 @@ static bool isUnfinishedLine() for ( int i = 1; i < 10; */ - unf = TRUE; + unf = true; } else if ( readLine() && yyLine->endsWith(";") && lastParen(*yyLine) == TQChar('(') ) { /* @@ -649,7 +649,7 @@ static bool isUnfinishedLine() for ( int i = 1; i < 10; */ - unf = TRUE; + unf = true; } } @@ -658,12 +658,12 @@ static bool isUnfinishedLine() } /* - Returns TRUE if yyLine is a continuation line; otherwise returns - FALSE. + Returns true if yyLine is a continuation line; otherwise returns + false. */ static bool isContinuationLine() { - bool cont = FALSE; + bool cont = false; YY_SAVE(); if ( readLine() ) @@ -992,11 +992,11 @@ static int indentForStandaloneLine() static void initializeIndenter() { literal = new TQRegExp( "([\"'])(?:\\\\.|[^\\\\])*\\1" ); - literal->setMinimal( TRUE ); + literal->setMinimal( true ); label = new TQRegExp( "^\\s*((?:case\\b([^:]|::)+|[a-zA-Z_0-9]+)(?:\\s+slots)?:)(?!:)" ); inlineCComment = new TQRegExp( "/\\*.*\\*/" ); - inlineCComment->setMinimal( TRUE ); + inlineCComment->setMinimal( true ); braceX = new TQRegExp( "^\\s*\\}\\s*(?:else|catch)\\b" ); iflikeKeyword = new TQRegExp( "\\b(?:catch|do|for|if|while)\\b" ); @@ -1136,7 +1136,7 @@ int main( int argc, char **argv ) } TQString code = fileContents( argv[1] ); - TQStringList program = TQStringList::split( '\n', code, TRUE ); + TQStringList program = TQStringList::split( '\n', code, true ); TQStringList p; TQString out; |
