From 2a8327e57fdc84080f29919a8c9d6657dddd14c0 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Tue, 3 Mar 2009 09:58:43 +0100 Subject: [PATCH] Obsoleted code. --- src/libs/cplusplus/pp-engine.cpp | 26 +++++++------------------- src/libs/cplusplus/pp-engine.h | 5 ----- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 695a9f6bf5f..3ae95007ef6 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -492,24 +492,6 @@ QByteArray Preprocessor::operator()(const QByteArray &filename, return preprocessed; } -QByteArray Preprocessor::operator()(const QByteArray &source) -{ - QByteArray preprocessed; - preprocess(source, &preprocessed); - return preprocessed; -} - -void Preprocessor::preprocess(const QByteArray &filename, - const QByteArray &source, - QByteArray *result) -{ - const QByteArray previousFile = env.currentFile; - - env.currentFile = filename; - preprocess(source, result); - env.currentFile = previousFile; -} - void Preprocessor::expand(const QByteArray &source, QByteArray *result) { _expand(source, result); @@ -536,13 +518,17 @@ Preprocessor::State Preprocessor::createStateFromSource(const QByteArray &source return state; } -void Preprocessor::preprocess(const QByteArray &source, QByteArray *result) +void Preprocessor::preprocess(const QByteArray &fileName, const QByteArray &source, + QByteArray *result) { QByteArray *previousResult = _result; _result = result; pushState(createStateFromSource(source)); + const QByteArray previousFileName = env.currentFile; + env.currentFile = fileName; + const unsigned previousCurrentLine = env.currentLine; env.currentLine = 0; @@ -716,6 +702,8 @@ void Preprocessor::preprocess(const QByteArray &source, QByteArray *result) } popState(); + + env.currentFile = previousFileName; env.currentLine = previousCurrentLine; _result = previousResult; } diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index b07e58187b7..21e3638954e 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -138,8 +138,6 @@ public: QByteArray operator()(const QByteArray &filename, const QByteArray &source); - QByteArray operator()(const QByteArray &source); - private: enum { MAX_LEVEL = 512 }; @@ -171,9 +169,6 @@ private: const QByteArray &source, QByteArray *result); - void preprocess(const QByteArray &source, - QByteArray *result); - void expand(const QByteArray &source, QByteArray *result); void expand(const char *first, const char *last, QByteArray *result); -- GitLab