Commit 4e832791 authored by hjk's avatar hjk Committed by hjk
Browse files

preprocessor: provide direct char* overloads for ByteArrayRef::operator==



Change-Id: I58de7e704bdbd3861a4a534d8080cc2a8399b7eb
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 9e3127a2
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment