From b3debfe68e0e215bac40c6641e3688bed95a187e Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Thu, 25 Sep 2003 07:01:58 +0000 Subject: [PATCH] simplify --- stepmania/PBProject/Installer/Processor.cpp | 31 +++++---------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/stepmania/PBProject/Installer/Processor.cpp b/stepmania/PBProject/Installer/Processor.cpp index ada1d7849b..49dd8c531c 100644 --- a/stepmania/PBProject/Installer/Processor.cpp +++ b/stepmania/PBProject/Installer/Processor.cpp @@ -73,12 +73,13 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) { CStringArray parts; - split(line, ":", parts); + split(line, ":", parts); + nextLine++; #pragma mark LABEL if (parts[0] == "LABEL") { - printf("%u: %s\n", nextLine, line.c_str()); + printf("%u: %s\n", nextLine - 1, line.c_str()); if (parts.size() != 2) goto error; if (mDoGoto && parts[1] == mLabel) @@ -86,17 +87,14 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) mDoGoto = false; mLabel = ""; } - mLabels[parts[1]] = ++nextLine; // set mLabel to be the next line + mLabels[parts[1]] = nextLine; return; } if (mDoGoto) - { - ++nextLine; return; - } - printf("%u: %s\n", nextLine, line.c_str()); + printf("%u: %s\n", nextLine - 1, line.c_str()); #pragma mark FILE if (parts[0] == "FILE") @@ -137,7 +135,6 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) (*mHandleFile)(file, dir, mPath, true); } - ++nextLine; return; } @@ -147,7 +144,6 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) if (parts.size() != 3) goto error; mVars[parts[2]] = (*mGetPath)(parts[1]); - ++nextLine; return; } @@ -156,7 +152,6 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) { if (parts.size() != 3) goto error; - ++nextLine; if (!ResolveConditional(parts[2])) return; CString path = ResolveVar(parts[1]); @@ -175,13 +170,11 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) if (parts.size() != 2) goto error; mIgnore.insert(ResolveVar(parts[1])); + return; } if (!mInstalling) - { - ++nextLine; return; - } #pragma mark GOTO if (parts[0] == "GOTO") @@ -199,7 +192,7 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) return; } mDoGoto = true; - mReturnStack.push(++nextLine); + mReturnStack.push(nextLine); return; } @@ -214,7 +207,6 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) mLabel = parts[3]; if (mLabel == "") { - ++nextLine; return; } mReturnStack.push(nextLine + 1); @@ -225,7 +217,6 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) return; } mDoGoto = true; - ++nextLine; return; } @@ -251,7 +242,6 @@ void Processor::ProcessLine(const CString& line, unsigned& nextLine) for (unsigned i=2; i