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

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Wed Dec 15 00:00:42 CET 2010


Revision: 54914
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54914&view=rev
Author:   jvprat
Date:     2010-12-14 23:00:42 +0000 (Tue, 14 Dec 2010)

Log Message:
-----------
TOOLS: Fix some formatting (mainly indentation)

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/engine.h
    tools/branches/gsoc2010-decompiler/decompiler/instruction.h
    tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/kyra/engine.cpp
    tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h
    tools/branches/gsoc2010-decompiler/decompiler/refcounted.h
    tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp
    tools/branches/gsoc2010-decompiler/decompiler/value.h

Modified: tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp	2010-12-14 23:00:42 UTC (rev 54914)
@@ -43,7 +43,7 @@
 #define ENGINE(id, description, engineClass) engines[std::string(id)] = description; engineFactory.addEntry<engineClass>(std::string(id));
 
 int main(int argc, char** argv) {
-	try	{
+	try {
 		std::map<std::string, std::string> engines;
 		ObjectFactory<std::string, Engine> engineFactory;
 

Modified: tools/branches/gsoc2010-decompiler/decompiler/engine.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/engine.h	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/engine.h	2010-12-14 23:00:42 UTC (rev 54914)
@@ -52,7 +52,6 @@
 	/**
 	 * Constructor for Function.
 	 *
-
 	 * @param startIt Index of the first instruction in the function.
 	 * @param endIt Index of the instruction immediately after the function, similar to end() on STL containers.
 	 */

Modified: tools/branches/gsoc2010-decompiler/decompiler/instruction.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-12-14 23:00:42 UTC (rev 54914)
@@ -92,16 +92,16 @@
 
 	virtual std::ostream &print(std::ostream &output) const;
 
-  virtual bool isJump() const;
-  virtual bool isCondJump() const;
-  virtual bool isUncondJump() const;
-  virtual bool isStackOp() const;
+	virtual bool isJump() const;
+	virtual bool isCondJump() const;
+	virtual bool isUncondJump() const;
+	virtual bool isStackOp() const;
 	virtual bool isFuncCall() const;
 	virtual bool isReturn() const;
 	virtual bool isKernelCall() const;
 	virtual bool isLoad() const;
 	virtual bool isStore() const;
-  virtual uint32 getDestAddress() const;
+	virtual uint32 getDestAddress() const;
 
 	virtual void processInst(ValueStack &stack, Engine *engine, CodeGenerator *codeGen) = 0;
 

Modified: tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp	2010-12-14 23:00:42 UTC (rev 54914)
@@ -25,8 +25,7 @@
 
 #include <boost/format.hpp>
 
-FunctionData::FunctionData(std::string name, std::string metadata)
-{
+FunctionData::FunctionData(std::string name, std::string metadata) {
 	_name = name;
 	_metadata = metadata;
 }
@@ -346,7 +345,7 @@
 
 	if (minTextOffset != 0xFFFF) {
 		uint16 numStrings = minTextOffset / 2;
-#define posString(x) (char*)&_textChunk._data[READ_BE_UINT16(&((uint16 *)_textChunk._data)[(x)])]
+#define posString(x) (char *)&_textChunk._data[READ_BE_UINT16(&((uint16 *)_textChunk._data)[(x)])]
 		for (uint16 i = 0; i < numStrings; ++i) {
 			std::stringstream s;
 			s << "\"" << posString(i) << "\"";
@@ -503,71 +502,71 @@
 			break;
 		case 17:
 			switch (parameter) {
-				case 0:
-					OPCODE_MD("eval_band", kBinaryOpInst, -1, false, false, false, "&&");
-					break;
-				case 1:
-					OPCODE_MD("eval_bor", kBinaryOpInst, -1, false, false, false, "||");
-					break;
-				case 2:
-					OPCODE_MD("eval_eq", kBinaryOpInst, -1, false, false, false, "==");
-					break;
-				case 3:
-					OPCODE_MD("eval_neq", kBinaryOpInst, -1, false, false, false, "!=");
-					break;
-				case 4:
-					OPCODE_MD("eval_leq", kBinaryOpInst, -1, false, false, false, "<=");
-					break;
-				case 5:
-					OPCODE_MD("eval_lt", kBinaryOpInst, -1, false, false, false, "<");
-					break;
-				case 6:
-					OPCODE_MD("eval_geq", kBinaryOpInst, -1, false, false, false, ">=");
-					break;
-				case 7:
-					OPCODE_MD("eval_gt", kBinaryOpInst, -1, false, false, false, ">");
-					break;
-				case 8:
-					OPCODE_MD("eval_add", kBinaryOpInst, -1, false, false, false, "+");
-					break;
-				case 9:
-					OPCODE_MD("eval_sub", kBinaryOpInst, -1, false, false, false, "-");
-					break;
-				case 10:
-					OPCODE_MD("eval_mult", kBinaryOpInst, -1, false, false, false, "*");
-					break;
-				case 11:
-					OPCODE_MD("eval_div", kBinaryOpInst, -1, false, false, false, "/");
-					break;
-				case 12:
-					OPCODE_MD("eval_shr", kBinaryOpInst, -1, false, false, false, ">>");
-					break;
-				case 13:
-					OPCODE_MD("eval_shl", kBinaryOpInst, -1, false, false, false, "<<");
-					break;
-				case 14:
-					OPCODE_MD("eval_land", kBinaryOpInst, -1, false, false, false, "&");
-					break;
-				case 15:
-					OPCODE_MD("eval_lor", kBinaryOpInst, -1, false, false, false, "|");
-					break;
-				case 16:
-					OPCODE_MD("eval_mod", kBinaryOpInst, -1, false, false, false, "%");
-					break;
-				case 17:
-					OPCODE_MD("eval_xor", kBinaryOpInst, -1, false, false, false, "^");
-					break;
-				default:
-					// Error: invalid parameter halts execution
-					throw UnknownOpcodeException(address, opcode);
-					break;
+			case 0:
+				OPCODE_MD("eval_band", kBinaryOpInst, -1, false, false, false, "&&");
+				break;
+			case 1:
+				OPCODE_MD("eval_bor", kBinaryOpInst, -1, false, false, false, "||");
+				break;
+			case 2:
+				OPCODE_MD("eval_eq", kBinaryOpInst, -1, false, false, false, "==");
+				break;
+			case 3:
+				OPCODE_MD("eval_neq", kBinaryOpInst, -1, false, false, false, "!=");
+				break;
+			case 4:
+				OPCODE_MD("eval_leq", kBinaryOpInst, -1, false, false, false, "<=");
+				break;
+			case 5:
+				OPCODE_MD("eval_lt", kBinaryOpInst, -1, false, false, false, "<");
+				break;
+			case 6:
+				OPCODE_MD("eval_geq", kBinaryOpInst, -1, false, false, false, ">=");
+				break;
+			case 7:
+				OPCODE_MD("eval_gt", kBinaryOpInst, -1, false, false, false, ">");
+				break;
+			case 8:
+				OPCODE_MD("eval_add", kBinaryOpInst, -1, false, false, false, "+");
+				break;
+			case 9:
+				OPCODE_MD("eval_sub", kBinaryOpInst, -1, false, false, false, "-");
+				break;
+			case 10:
+				OPCODE_MD("eval_mult", kBinaryOpInst, -1, false, false, false, "*");
+				break;
+			case 11:
+				OPCODE_MD("eval_div", kBinaryOpInst, -1, false, false, false, "/");
+				break;
+			case 12:
+				OPCODE_MD("eval_shr", kBinaryOpInst, -1, false, false, false, ">>");
+				break;
+			case 13:
+				OPCODE_MD("eval_shl", kBinaryOpInst, -1, false, false, false, "<<");
+				break;
+			case 14:
+				OPCODE_MD("eval_land", kBinaryOpInst, -1, false, false, false, "&");
+				break;
+			case 15:
+				OPCODE_MD("eval_lor", kBinaryOpInst, -1, false, false, false, "|");
+				break;
+			case 16:
+				OPCODE_MD("eval_mod", kBinaryOpInst, -1, false, false, false, "%");
+				break;
+			case 17:
+				OPCODE_MD("eval_xor", kBinaryOpInst, -1, false, false, false, "^");
+				break;
+			default:
+				// Error: invalid parameter halts execution
+				throw UnknownOpcodeException(address, opcode);
+				break;
 			}
 			break;
 		case 18:
 			OPCODE("setRetAndJmp", kKernelCallInst, -2, false, false, false);
 			break;
 		default:
-			throw UnknownOpcodeException(i*2, code);
+			throw UnknownOpcodeException(i * 2, code);
 		}
 #undef OPCODE
 #undef OPCODE_MD
@@ -606,4 +605,3 @@
 		lastWasPushPos = ((*it)->_name.compare("pushPos") == 0);
 	}
 }
-

Modified: tools/branches/gsoc2010-decompiler/decompiler/kyra/engine.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/kyra/engine.cpp	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/kyra/engine.cpp	2010-12-14 23:00:42 UTC (rev 54914)
@@ -66,7 +66,7 @@
 }
 
 void Kyra::Kyra2LoadInstruction::processInst(ValueStack &stack, Engine *engine, CodeGenerator *codeGen) {
-	Kyra2CodeGenerator* cg = (Kyra2CodeGenerator *)codeGen;
+	Kyra2CodeGenerator *cg = (Kyra2CodeGenerator *)codeGen;
 	switch (_opcode) {
 	case 2:
 		// If something has been called previously in this group, don't output retval variable
@@ -102,7 +102,7 @@
 }
 
 void Kyra::Kyra2StoreInstruction::processInst(ValueStack &stack, Engine *engine, CodeGenerator *codeGen) {
-	Kyra2CodeGenerator* cg = (Kyra2CodeGenerator *)codeGen;
+	Kyra2CodeGenerator *cg = (Kyra2CodeGenerator *)codeGen;
 	switch (_opcode) {
 	case 8:
 		{
@@ -165,7 +165,7 @@
 }
 
 void Kyra::Kyra2CallInstruction::processInst(ValueStack &stack, Engine *engine, CodeGenerator *codeGen) {
-	Kyra2CodeGenerator* cg = (Kyra2CodeGenerator *)codeGen;
+	Kyra2CodeGenerator *cg = (Kyra2CodeGenerator *)codeGen;
 	cg->_argList.clear();
 	Function f = engine->_functions.find(_params[0]->getUnsigned())->second;
 	for (size_t i = 0; i < f._metadata.length(); i++)
@@ -185,7 +185,7 @@
 }
 
 void Kyra::Kyra2KernelCallInstruction::processInst(ValueStack &stack, Engine *engine, CodeGenerator *codeGen) {
-	Kyra2CodeGenerator* cg = (Kyra2CodeGenerator *)codeGen;
+	Kyra2CodeGenerator *cg = (Kyra2CodeGenerator *)codeGen;
 	if (_opcode != 14)
 		return;
 	cg->_argList.clear();
@@ -197,7 +197,7 @@
 	// Leave call on stack if this is a condition, or other calls follow in same group
 	if (cg->_curGroup->_type == kIfCondGroupType || cg->_curGroup->_type == kWhileCondGroupType || cg->_curGroup->_type == kDoWhileCondGroupType || _address != cg->findLastCall()->_address) {
 		return;
-	}	else if (!returnsValue) {
+	} else if (!returnsValue) {
 		std::stringstream stream;
 		stream << stack.pop() << ";";
 		cg->addOutputLine(stream.str());

Modified: tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h	2010-12-14 23:00:42 UTC (rev 54914)
@@ -53,7 +53,7 @@
 	 */
 	typedef std::map<KeyType, CreateFunc> RegistryMap;
 
-	RegistryMap _registry; ///<Map from an identifier to a creation function.
+	RegistryMap _registry; ///< Map from an identifier to a creation function.
 
 public:
 	/**

Modified: tools/branches/gsoc2010-decompiler/decompiler/refcounted.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/refcounted.h	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/refcounted.h	2010-12-14 23:00:42 UTC (rev 54914)
@@ -34,14 +34,14 @@
  * Provides a base implementation of reference counting for use with boost::intrusive_ptr.
  */
 class RefCounted {
-	private:
-		long _refCount; ///< Reference count used for boost::intrusive_ptr.
-	  friend void ::boost::intrusive_ptr_add_ref(RefCounted *p); ///< Allow access by reference counting methods in boost namespace.
-		friend void ::boost::intrusive_ptr_release(RefCounted *p); ///< Allow access by reference counting methods in boost namespace.
+private:
+	long _refCount; ///< Reference count used for boost::intrusive_ptr.
+	friend void ::boost::intrusive_ptr_add_ref(RefCounted *p); ///< Allow access by reference counting methods in boost namespace.
+	friend void ::boost::intrusive_ptr_release(RefCounted *p); ///< Allow access by reference counting methods in boost namespace.
 
-	protected:
-		RefCounted() : _refCount(0) { }
-		virtual ~RefCounted() { }
+protected:
+	RefCounted() : _refCount(0) { }
+	virtual ~RefCounted() { }
 };
 
 namespace boost {

Modified: tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp	2010-12-14 23:00:42 UTC (rev 54914)
@@ -27,7 +27,7 @@
 	_opcode = opcode;
 }
 
-const char* UnknownOpcodeException::what() throw() {
+const char *UnknownOpcodeException::what() throw() {
 	sprintf(_buf, "Unknown opcode (address: %08x, opcode: %02x)", _address, _opcode);
 	return _buf;
 }

Modified: tools/branches/gsoc2010-decompiler/decompiler/value.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/value.h	2010-12-14 22:59:39 UTC (rev 54913)
+++ tools/branches/gsoc2010-decompiler/decompiler/value.h	2010-12-14 23:00:42 UTC (rev 54914)
@@ -293,7 +293,7 @@
  */
 class ArrayValue : public VarValue {
 protected:
-		const ValueList _idxs; ///< std::deque of values representing the indexes used (left-to-right).
+	const ValueList _idxs; ///< std::deque of values representing the indexes used (left-to-right).
 
 public:
 	/**


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