Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ceb73b72
Commit
ceb73b72
authored
Dec 02, 2008
by
Roberto Raggi
Browse files
Reduced the number of generated #line directives.
parent
df7aacd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/rpp/pp-engine.cpp
View file @
ceb73b72
...
...
@@ -515,8 +515,7 @@ void pp::operator()(const QByteArray &source, QByteArray *result)
while
(
true
)
{
if
(
env
.
currentLine
!=
_dot
->
lineno
)
{
if
(
env
.
currentLine
>
_dot
->
lineno
)
{
result
->
append
(
'\n'
);
result
->
append
(
'#'
);
result
->
append
(
"
\n
# "
);
result
->
append
(
QByteArray
::
number
(
_dot
->
lineno
));
result
->
append
(
' '
);
result
->
append
(
'"'
);
...
...
@@ -564,16 +563,6 @@ void pp::operator()(const QByteArray &source, QByteArray *result)
}
else
{
if
(
_dot
->
joined
)
result
->
append
(
"
\\\n
"
);
else
if
(
_dot
->
newline
)
{
result
->
append
(
'\n'
);
result
->
append
(
'#'
);
result
->
append
(
QByteArray
::
number
(
_dot
->
lineno
));
result
->
append
(
' '
);
result
->
append
(
'"'
);
result
->
append
(
env
.
current_file
);
result
->
append
(
'"'
);
result
->
append
(
'\n'
);
}
else
if
(
_dot
->
whitespace
)
result
->
append
(
' '
);
...
...
@@ -861,11 +850,14 @@ void pp::processDefine(TokenIterator firstToken, TokenIterator lastToken)
if
(
isQtWord
)
macro
.
definition
=
macroId
;
else
{
// ### make me fast!
const
char
*
startOfDefinition
=
startOfToken
(
*
tk
);
const
char
*
endOfDefinition
=
startOfToken
(
*
lastToken
);
macro
.
definition
.
append
(
startOfDefinition
,
endOfDefinition
-
startOfDefinition
);
macro
.
definition
.
replace
(
"
\\\n
"
,
" "
);
macro
.
definition
.
replace
(
'\n'
,
' '
);
macro
.
definition
=
macro
.
definition
.
trimmed
();
}
env
.
bind
(
macro
);
...
...
src/plugins/cpptools/rpp/pp-macro-expander.cpp
View file @
ceb73b72
...
...
@@ -69,8 +69,7 @@ const char *MacroExpander::operator () (const char *__first, const char *__last,
{
if
(
*
__first
==
'\n'
)
{
__result
->
append
(
'\n'
);
__result
->
append
(
'#'
);
__result
->
append
(
"
\n
# "
);
__result
->
append
(
QByteArray
::
number
(
env
.
currentLine
));
__result
->
append
(
' '
);
__result
->
append
(
'"'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment