forked from qt-creator/qt-creator
C++: remove reserved names.
See [global.names] (17.6.4.3.2 in the C++11 spec.) Change-Id: I8434496dbe392b52d339d5f17cfaeee8dbd88995 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
12642cc49a
commit
703f36a4b8
@@ -391,14 +391,14 @@ private:
|
||||
|
||||
class CPLUSPLUS_EXPORT Snapshot
|
||||
{
|
||||
typedef QHash<QString, Document::Ptr> _Base;
|
||||
typedef QHash<QString, Document::Ptr> Base;
|
||||
|
||||
public:
|
||||
Snapshot();
|
||||
~Snapshot();
|
||||
|
||||
typedef _Base::const_iterator iterator;
|
||||
typedef _Base::const_iterator const_iterator;
|
||||
typedef Base::const_iterator iterator;
|
||||
typedef Base::const_iterator const_iterator;
|
||||
|
||||
int size() const; // ### remove
|
||||
bool isEmpty() const;
|
||||
@@ -428,7 +428,7 @@ private:
|
||||
void allIncludesForDocument_helper(const QString &fileName, QSet<QString> &result) const;
|
||||
|
||||
private:
|
||||
_Base _documents;
|
||||
Base _documents;
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
||||
@@ -99,11 +99,11 @@ Macro *Environment::macroAt(unsigned index) const
|
||||
return _macros[index];
|
||||
}
|
||||
|
||||
Macro *Environment::bind(const Macro &__macro)
|
||||
Macro *Environment::bind(const Macro ¯o)
|
||||
{
|
||||
Q_ASSERT(! __macro.name().isEmpty());
|
||||
Q_ASSERT(! macro.name().isEmpty());
|
||||
|
||||
Macro *m = new Macro (__macro);
|
||||
Macro *m = new Macro (macro);
|
||||
const QByteArray &name = m->name();
|
||||
m->_hashcode = hashCode(name.begin(), name.size());
|
||||
|
||||
|
||||
@@ -58,12 +58,12 @@ static const bool debug = ! qgetenv("QTC_LOOKUPCONTEXT_DEBUG").isEmpty();
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename _Tp>
|
||||
static QList<_Tp> removeDuplicates(const QList<_Tp> &results)
|
||||
template <typename T>
|
||||
static QList<T> removeDuplicates(const QList<T> &results)
|
||||
{
|
||||
QList<_Tp> uniqueList;
|
||||
QSet<_Tp> processed;
|
||||
foreach (const _Tp &r, results) {
|
||||
QList<T> uniqueList;
|
||||
QSet<T> processed;
|
||||
foreach (const T &r, results) {
|
||||
if (processed.contains(r))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -55,17 +55,17 @@
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
inline bool CPLUSPLUS_EXPORT pp_isalpha (int __ch)
|
||||
{ return std::isalpha ((unsigned char) __ch) != 0; }
|
||||
inline bool CPLUSPLUS_EXPORT pp_isalpha (int ch)
|
||||
{ return std::isalpha ((unsigned char) ch) != 0; }
|
||||
|
||||
inline bool CPLUSPLUS_EXPORT pp_isalnum (int __ch)
|
||||
{ return std::isalnum ((unsigned char) __ch) != 0; }
|
||||
inline bool CPLUSPLUS_EXPORT pp_isalnum (int ch)
|
||||
{ return std::isalnum ((unsigned char) ch) != 0; }
|
||||
|
||||
inline bool CPLUSPLUS_EXPORT pp_isdigit (int __ch)
|
||||
{ return std::isdigit ((unsigned char) __ch) != 0; }
|
||||
inline bool CPLUSPLUS_EXPORT pp_isdigit (int ch)
|
||||
{ return std::isdigit ((unsigned char) ch) != 0; }
|
||||
|
||||
inline bool CPLUSPLUS_EXPORT pp_isspace (int __ch)
|
||||
{ return std::isspace ((unsigned char) __ch) != 0; }
|
||||
inline bool CPLUSPLUS_EXPORT pp_isspace (int ch)
|
||||
{ return std::isspace ((unsigned char) ch) != 0; }
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
||||
|
||||
@@ -834,13 +834,13 @@ void Preprocessor::pushToken(Preprocessor::PPToken *tk)
|
||||
|
||||
void Preprocessor::lex(PPToken *tk)
|
||||
{
|
||||
_Lagain:
|
||||
again:
|
||||
if (m_state.m_tokenBuffer) {
|
||||
// There is a token buffer, so read from there.
|
||||
if (m_state.m_tokenBuffer->tokens.empty()) {
|
||||
// The token buffer is empty, so pop it, and start over.
|
||||
m_state.popTokenBuffer();
|
||||
goto _Lagain;
|
||||
goto again;
|
||||
}
|
||||
*tk = m_state.m_tokenBuffer->tokens.front();
|
||||
m_state.m_tokenBuffer->tokens.pop_front();
|
||||
@@ -859,17 +859,17 @@ _Lagain:
|
||||
// Adjust token's line number in order to take into account the environment reference.
|
||||
tk->lineno += m_state.m_lineRef - 1;
|
||||
|
||||
_Lclassify:
|
||||
reclassify:
|
||||
if (! m_state.m_inPreprocessorDirective) {
|
||||
if (tk->newline() && tk->is(T_POUND)) {
|
||||
handlePreprocessorDirective(tk);
|
||||
goto _Lclassify;
|
||||
goto reclassify;
|
||||
} else if (tk->newline() && skipping()) {
|
||||
ScopedBoolSwap s(m_state.m_inPreprocessorDirective, true);
|
||||
do {
|
||||
lex(tk);
|
||||
} while (isContinuationToken(*tk));
|
||||
goto _Lclassify;
|
||||
goto reclassify;
|
||||
} else if (tk->is(T_IDENTIFIER) && !isQtReservedWord(tk->tokenStart(), tk->bytes())) {
|
||||
m_state.updateIncludeGuardState(State::IncludeGuardStateHint_OtherToken);
|
||||
if (m_state.m_inCondition && tk->asByteArrayRef() == "defined") {
|
||||
@@ -877,7 +877,7 @@ _Lclassify:
|
||||
} else {
|
||||
synchronizeOutputLines(*tk);
|
||||
if (handleIdentifier(tk))
|
||||
goto _Lagain;
|
||||
goto again;
|
||||
}
|
||||
} else if (tk->isNot(T_COMMENT) && tk->isNot(T_EOF_SYMBOL)) {
|
||||
m_state.updateIncludeGuardState(State::IncludeGuardStateHint_OtherToken);
|
||||
|
||||
@@ -51,39 +51,39 @@
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
const char *pp_skip_blanks::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_blanks::operator () (const char *first, const char *last)
|
||||
{
|
||||
lines = 0;
|
||||
|
||||
for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
if (*__first == '\\') {
|
||||
const char *__begin = __first;
|
||||
++__begin;
|
||||
for (; first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
if (*first == '\\') {
|
||||
const char *begin = first;
|
||||
++begin;
|
||||
|
||||
if (__begin != __last && *__begin == '\n')
|
||||
++__first;
|
||||
if (begin != last && *begin == '\n')
|
||||
++first;
|
||||
else
|
||||
break;
|
||||
} else if (*__first == '\n' || !pp_isspace (*__first))
|
||||
} else if (*first == '\n' || !pp_isspace (*first))
|
||||
break;
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_whitespaces::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_whitespaces::operator () (const char *first, const char *last)
|
||||
{
|
||||
lines = 0;
|
||||
|
||||
for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
if (! pp_isspace (*__first))
|
||||
for (; first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
if (! pp_isspace (*first))
|
||||
break;
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_comment_or_divop::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_comment_or_divop::operator () (const char *first, const char *last)
|
||||
{
|
||||
enum {
|
||||
MAYBE_BEGIN,
|
||||
@@ -96,77 +96,77 @@ const char *pp_skip_comment_or_divop::operator () (const char *__first, const ch
|
||||
|
||||
lines = 0;
|
||||
|
||||
for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
for (; first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
switch (state) {
|
||||
default:
|
||||
break;
|
||||
|
||||
case MAYBE_BEGIN:
|
||||
if (*__first != '/')
|
||||
return __first;
|
||||
if (*first != '/')
|
||||
return first;
|
||||
|
||||
state = BEGIN;
|
||||
break;
|
||||
|
||||
case BEGIN:
|
||||
if (*__first == '*')
|
||||
if (*first == '*')
|
||||
state = IN_COMMENT;
|
||||
else if (*__first == '/')
|
||||
else if (*first == '/')
|
||||
state = IN_CXX_COMMENT;
|
||||
else
|
||||
return __first;
|
||||
return first;
|
||||
break;
|
||||
|
||||
case IN_COMMENT:
|
||||
if (*__first == '*')
|
||||
if (*first == '*')
|
||||
state = MAYBE_END;
|
||||
break;
|
||||
|
||||
case IN_CXX_COMMENT:
|
||||
if (*__first == '\n')
|
||||
return __first;
|
||||
if (*first == '\n')
|
||||
return first;
|
||||
break;
|
||||
|
||||
case MAYBE_END:
|
||||
if (*__first == '/')
|
||||
if (*first == '/')
|
||||
state = END;
|
||||
else if (*__first != '*')
|
||||
else if (*first != '*')
|
||||
state = IN_COMMENT;
|
||||
break;
|
||||
|
||||
case END:
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_identifier::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_identifier::operator () (const char *first, const char *last)
|
||||
{
|
||||
lines = 0;
|
||||
|
||||
for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
if (! pp_isalnum (*__first) && *__first != '_')
|
||||
for (; first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
if (! pp_isalnum (*first) && *first != '_')
|
||||
break;
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_number::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_number::operator () (const char *first, const char *last)
|
||||
{
|
||||
lines = 0;
|
||||
|
||||
for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
if (! pp_isalnum (*__first) && *__first != '.')
|
||||
for (; first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
if (! pp_isalnum (*first) && *first != '.')
|
||||
break;
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_string_literal::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_string_literal::operator () (const char *first, const char *last)
|
||||
{
|
||||
enum {
|
||||
BEGIN,
|
||||
@@ -177,25 +177,25 @@ const char *pp_skip_string_literal::operator () (const char *__first, const char
|
||||
|
||||
lines = 0;
|
||||
|
||||
for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
for (; first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
switch (state)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
|
||||
case BEGIN:
|
||||
if (*__first != '\"')
|
||||
return __first;
|
||||
if (*first != '\"')
|
||||
return first;
|
||||
state = IN_STRING;
|
||||
break;
|
||||
|
||||
case IN_STRING:
|
||||
if (! (*__first != '\n'))
|
||||
return __last;
|
||||
if (! (*first != '\n'))
|
||||
return last;
|
||||
|
||||
if (*__first == '\"')
|
||||
if (*first == '\"')
|
||||
state = END;
|
||||
else if (*__first == '\\')
|
||||
else if (*first == '\\')
|
||||
state = QUOTE;
|
||||
break;
|
||||
|
||||
@@ -204,14 +204,14 @@ const char *pp_skip_string_literal::operator () (const char *__first, const char
|
||||
break;
|
||||
|
||||
case END:
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_char_literal::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_char_literal::operator () (const char *first, const char *last)
|
||||
{
|
||||
enum {
|
||||
BEGIN,
|
||||
@@ -222,25 +222,25 @@ const char *pp_skip_char_literal::operator () (const char *__first, const char *
|
||||
|
||||
lines = 0;
|
||||
|
||||
for (; state != END && __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first) {
|
||||
for (; state != END && first != last; lines += (*first != '\n' ? 0 : 1), ++first) {
|
||||
switch (state)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
|
||||
case BEGIN:
|
||||
if (*__first != '\'')
|
||||
return __first;
|
||||
if (*first != '\'')
|
||||
return first;
|
||||
state = IN_STRING;
|
||||
break;
|
||||
|
||||
case IN_STRING:
|
||||
if (! (*__first != '\n'))
|
||||
return __last;
|
||||
if (! (*first != '\n'))
|
||||
return last;
|
||||
|
||||
if (*__first == '\'')
|
||||
if (*first == '\'')
|
||||
state = END;
|
||||
else if (*__first == '\\')
|
||||
else if (*first == '\\')
|
||||
state = QUOTE;
|
||||
break;
|
||||
|
||||
@@ -250,44 +250,44 @@ const char *pp_skip_char_literal::operator () (const char *__first, const char *
|
||||
}
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
const char *pp_skip_argument::operator () (const char *__first, const char *__last)
|
||||
const char *pp_skip_argument::operator () (const char *first, const char *last)
|
||||
{
|
||||
int depth = 0;
|
||||
lines = 0;
|
||||
|
||||
while (__first != __last) {
|
||||
if (!depth && (*__first == ')' || *__first == ',')) {
|
||||
while (first != last) {
|
||||
if (!depth && (*first == ')' || *first == ',')) {
|
||||
break;
|
||||
} else if (*__first == '(') {
|
||||
++depth, ++__first;
|
||||
} else if (*__first == ')') {
|
||||
--depth, ++__first;
|
||||
} else if (*__first == '\"') {
|
||||
__first = skip_string_literal (__first, __last);
|
||||
} else if (*first == '(') {
|
||||
++depth, ++first;
|
||||
} else if (*first == ')') {
|
||||
--depth, ++first;
|
||||
} else if (*first == '\"') {
|
||||
first = skip_string_literal (first, last);
|
||||
lines += skip_string_literal.lines;
|
||||
} else if (*__first == '\'') {
|
||||
__first = skip_char_literal (__first, __last);
|
||||
} else if (*first == '\'') {
|
||||
first = skip_char_literal (first, last);
|
||||
lines += skip_char_literal.lines;
|
||||
} else if (*__first == '/') {
|
||||
__first = skip_comment_or_divop (__first, __last);
|
||||
} else if (*first == '/') {
|
||||
first = skip_comment_or_divop (first, last);
|
||||
lines += skip_comment_or_divop.lines;
|
||||
} else if (pp_isalpha (*__first) || *__first == '_') {
|
||||
__first = skip_identifier (__first, __last);
|
||||
} else if (pp_isalpha (*first) || *first == '_') {
|
||||
first = skip_identifier (first, last);
|
||||
lines += skip_identifier.lines;
|
||||
} else if (pp_isdigit (*__first)) {
|
||||
__first = skip_number (__first, __last);
|
||||
} else if (pp_isdigit (*first)) {
|
||||
first = skip_number (first, last);
|
||||
lines += skip_number.lines;
|
||||
} else if (*__first == '\n') {
|
||||
++__first;
|
||||
} else if (*first == '\n') {
|
||||
++first;
|
||||
++lines;
|
||||
} else {
|
||||
++__first;
|
||||
++first;
|
||||
}
|
||||
}
|
||||
|
||||
return __first;
|
||||
return first;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user