[Scummvm-cvs-logs] SF.net SVN: scummvm:[51119] tools/branches/gsoc2010-decompiler/decompiler/ codegen.cpp

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Thu Jul 22 00:26:38 CEST 2010


Revision: 51119
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51119&view=rev
Author:   pidgeot
Date:     2010-07-21 22:26:37 +0000 (Wed, 21 Jul 2010)

Log Message:
-----------
Style fix.

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp

Modified: tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp	2010-07-21 22:21:18 UTC (rev 51118)
+++ tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp	2010-07-21 22:26:37 UTC (rev 51119)
@@ -145,39 +145,41 @@
 	do {
 		if (it->_codeGenData.find("\xC0" == 0))
 			processInst(*it);
-		else switch (it->_type) {
-		// We handle plain dups here because their behavior should be identical across instruction sets and this prevents implementation error.
-		case kDup:
-			{
-				std::stringstream s;
-				EntryPtr p = _stack.pop()->dup(s);
-				if (s.str().length() > 0)
+		else {
+			switch (it->_type) {
+			// We handle plain dups here because their behavior should be identical across instruction sets and this prevents implementation error.
+			case kDup:
+				{
+					std::stringstream s;
+					EntryPtr p = _stack.pop()->dup(s);
+					if (s.str().length() > 0)
+						addOutputLine(s.str());
+					_stack.push(p);
+					_stack.push(p);
+					break;
+				}
+			case kCondJump:
+			case kCondJumpRel:
+				{
+					processInst(*it);
+					std::stringstream s;
+					switch (_curGroup->_type) {
+					case kIfCond:
+						s << "if (" << _stack.pop() << ") {";
+						break;
+					case kWhileCond:
+						s << "while (" << _stack.pop() << ") {";
+						break;
+					case kDoWhileCond:
+						s << "} while (" << _stack.pop() << ")";
+						break;
+					}
 					addOutputLine(s.str());
-				_stack.push(p);
-				_stack.push(p);
+				}
 				break;
+				default:
+					processInst(*it);
 			}
-		case kCondJump:
-		case kCondJumpRel:
-			{
-				processInst(*it);
-				std::stringstream s;
-				switch (_curGroup->_type) {
-				case kIfCond:
-					s << "if (" << _stack.pop() << ") {";
-					break;
-				case kWhileCond:
-					s << "while (" << _stack.pop() << ") {";
-					break;
-				case kDoWhileCond:
-					s << "} while (" << _stack.pop() << ")";
-					break;
-				}
-				addOutputLine(s.str());
-			}
-			break;
-			default:
-				processInst(*it);
 		}
 	} while (it++ != _curGroup->_end);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list