forked from qt-creator/qt-creator
preprocessor: provide direct char* overloads for ByteArrayRef::operator==
Change-Id: I58de7e704bdbd3861a4a534d8080cc2a8399b7eb Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
@@ -58,6 +58,11 @@ public:
|
||||
bool operator!=(const QByteArray &other) const
|
||||
{ return !this->operator==(other); }
|
||||
|
||||
bool operator==(const char *other) const
|
||||
{ return qstrncmp(m_ref->constData() + m_offset, other, strlen(other)) == 0; }
|
||||
bool operator!=(const char *other) const
|
||||
{ return !this->operator==(other); }
|
||||
|
||||
bool startsWith(const char *ch) const;
|
||||
|
||||
int count(char c) const;
|
||||
|
||||
@@ -841,8 +841,6 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
|
||||
|
||||
bool Preprocessor::handleFunctionLikeMacro(PPToken *tk, const Macro *macro, QVector<PPToken> &body, bool addWhitespaceMarker)
|
||||
{
|
||||
static const QByteArray ppVaArgs("__VA_ARGS__");
|
||||
|
||||
QVector<QVector<PPToken> > actuals;
|
||||
PPToken idToken = *tk;
|
||||
if (!collectActualArguments(tk, &actuals)) {
|
||||
@@ -869,7 +867,7 @@ bool Preprocessor::handleFunctionLikeMacro(PPToken *tk, const Macro *macro, QVec
|
||||
}
|
||||
|
||||
QVector<PPToken> actualsForThisParam = actuals[j];
|
||||
if (id == ppVaArgs || (macro->isVariadic() && j + 1 == formals.size())) {
|
||||
if (id == "__VA_ARGS__" || (macro->isVariadic() && j + 1 == formals.size())) {
|
||||
unsigned lineno = 0;
|
||||
const char comma = ',';
|
||||
for (int k = j + 1; k < actuals.size(); ++k) {
|
||||
|
||||
Reference in New Issue
Block a user