forked from teamnwah/openmw-tes3coop
Book parser: Fix comparison between signed and unsigned integer expressions
This commit is contained in:
parent
51cd2678ae
commit
4b1df64fba
2 changed files with 8 additions and 12 deletions
|
@ -21,7 +21,7 @@ namespace MWGui
|
|||
{
|
||||
/* BookTextParser */
|
||||
BookTextParser::BookTextParser(const std::string & text)
|
||||
: mIndex(-1), mText(text), mIgnoreNewlineTags(true), mIgnoreLineEndings(true)
|
||||
: mIndex(0), mText(text), mIgnoreNewlineTags(true), mIgnoreLineEndings(true)
|
||||
{
|
||||
MWScript::InterpreterContext interpreterContext(NULL, MWWorld::Ptr()); // empty arguments, because there is no locals or actor
|
||||
mText = Interpreter::fixDefinesBook(mText, interpreterContext);
|
||||
|
@ -47,16 +47,8 @@ namespace MWGui
|
|||
|
||||
BookTextParser::Events BookTextParser::next()
|
||||
{
|
||||
while (1)
|
||||
while (mIndex < mText.size())
|
||||
{
|
||||
++mIndex;
|
||||
|
||||
if (mIndex >= mText.size())
|
||||
{
|
||||
flushBuffer();
|
||||
return Event_EOF;
|
||||
}
|
||||
|
||||
char ch = mText[mIndex];
|
||||
if (ch == '<')
|
||||
{
|
||||
|
@ -93,6 +85,7 @@ namespace MWGui
|
|||
mIgnoreNewlineTags = false;
|
||||
}
|
||||
|
||||
++mIndex;
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
@ -106,8 +99,11 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
++mIndex;
|
||||
}
|
||||
|
||||
flushBuffer();
|
||||
return Event_EOF;
|
||||
}
|
||||
|
||||
void BookTextParser::flushBuffer()
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace MWGui
|
|||
void parseTag(std::string tag);
|
||||
|
||||
private:
|
||||
int mIndex;
|
||||
size_t mIndex;
|
||||
std::string mText;
|
||||
std::string mReadyText;
|
||||
|
||||
|
|
Loading…
Reference in a new issue