From 08805dd9fedcb16a8581ff3153b112a0860e6289 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Mon, 2 Jan 2012 13:10:35 +0100 Subject: [PATCH] Fixed compiler errors with GCC --- lib/tokenize.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index c5b6119eb..d767463e9 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4019,18 +4019,18 @@ void Tokenizer::setVarId() } } -bool linkBrackets(Tokenizer* tokenizer, std::stack& type, std::stack& links, Token* token, char open, char close) +static bool linkBrackets(Tokenizer* tokenizer, std::stack& type, std::stack& links, Token* token, char open, char close) { - if (token->str().back() == open) { + if (token->str()[0] == open) { links.push(token); type.push(token); - } else if (token->str().back() == close) { + } else if (token->str()[0] == close) { if (links.empty()) { // Error, { and } don't match. tokenizer->syntaxError(token, open); return false; } - if (type.top()->str().back() != open) { + if (type.top()->str()[0] != open) { tokenizer->syntaxError(type.top(), type.top()->str()[0]); return false; } @@ -4053,7 +4053,7 @@ bool Tokenizer::createLinks() token->link(0); } - bool validSyntax = validSyntax = linkBrackets(this, type, links1, token, '{', '}'); + bool validSyntax = linkBrackets(this, type, links1, token, '{', '}'); if (!validSyntax) return false;