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

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Fri May 28 13:14:58 CEST 2010


Revision: 49291
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49291&view=rev
Author:   pidgeot
Date:     2010-05-28 11:14:58 +0000 (Fri, 28 May 2010)

Log Message:
-----------
Fix formatting

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/disassembler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/disassembler.h
    tools/branches/gsoc2010-decompiler/decompiler/instruction.h
    tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.cpp
    tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h
    tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp
    tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h

Modified: tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/decompiler.cpp	2010-05-28 11:14:58 UTC (rev 49291)
@@ -48,7 +48,7 @@
 			("input-file", po::value<std::string>(), "Input file");
 
 		po::positional_options_description fileArg;
-		fileArg.add("input-file", -1);	
+		fileArg.add("input-file", -1);
 
 		po::variables_map vm;
 		try {

Modified: tools/branches/gsoc2010-decompiler/decompiler/disassembler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/disassembler.cpp	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/disassembler.cpp	2010-05-28 11:14:58 UTC (rev 49291)
@@ -37,17 +37,14 @@
 	char buf[1024];
 	int length;
 
-	for (size_t i = 0; i < _insts.size(); i++)
-	{
+	for (size_t i = 0; i < _insts.size(); i++) {
 		Instruction inst = _insts[i];
 		length = sprintf(buf, "%08x: %s ",inst._address, inst._name.c_str());
-		for (size_t j = 0; j < inst._params.size(); j++)
-		{
+		for (size_t j = 0; j < inst._params.size(); j++) {
 			Parameter p = inst._params[j];
 			if (j != 0)
 				length += sprintf(&buf[length], ", ");
-			switch(p._type)
-			{
+			switch(p._type) {
 				case kSByte:
 					length += sprintf(&buf[length], "%d", p._sbyte);
 					break;

Modified: tools/branches/gsoc2010-decompiler/decompiler/disassembler.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/disassembler.h	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/disassembler.h	2010-05-28 11:14:58 UTC (rev 49291)
@@ -36,15 +36,15 @@
 protected:
 	Common::File _f; ///<Used to perform file I/O.
 	std::vector<Instruction> _insts; ///<Container for disassembled instructions.
-	uint32 _addressBase; ///<Base address where the script starts.		
+	uint32 _addressBase; ///<Base address where the script starts.
 
 public:
 	Disassembler();
 	virtual ~Disassembler() {}
 
 	/**
-	 * Open a file for disassembly.		
-	 * @param filename The file to disassemble. 
+	 * Open a file for disassembly.
+	 * @param filename The file to disassemble.
 	 */
 	void open(const char *filename);
 

Modified: tools/branches/gsoc2010-decompiler/decompiler/instruction.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-05-28 11:14:58 UTC (rev 49291)
@@ -31,7 +31,7 @@
 /**
  * Enumeration for categorizing the different kinds of instructions.
  */
-enum InstType { 
+enum InstType {
 	kArithmetic, ///<Arithmetic instruction (+, -, *, etc.).
 	kBoolean, ///<Boolean instruction (AND, OR, etc.).
 	kCall, ///<Regular function call.
@@ -42,7 +42,7 @@
 	kReturn, ///<Return from regular function call.
 	kSpecial, ///<Special functions.
 	kStack, ///<Stack allocation or deallocation (altering stack pointer).
-	kStore ///<Store value from stack in memory. 
+	kStore ///<Store value from stack in memory.
 };
 
 /**
@@ -62,7 +62,7 @@
  * Structure for representing a parameter.
  */
 struct Parameter {
-  ParamType _type; ///<Type of the parameter.
+	ParamType _type; ///<Type of the parameter.
 	union {
 		int8 _sbyte;
 		uint8 _byte;

Modified: tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.cpp	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.cpp	2010-05-28 11:14:58 UTC (rev 49291)
@@ -76,7 +76,7 @@
 			p._uint = _f.readUint32BE();
 			_address += 4;
 			break;
-		// Common::File doesn't have readFloat methods, but since the valueis stored in a union, we just need to read the right bytes into memory.
+		// Common::File doesn't have readFloat methods, but since the value is stored in a union, we just need to read the right bytes into memory.
 		case 'f': //Single-precision float, little-endian
 			p._type = kFloat;
 			p._uint = _f.readUint32LE();

Modified: tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h	2010-05-28 11:14:58 UTC (rev 49291)
@@ -37,7 +37,7 @@
 	 * @param inst Pointer to the instruction to associate the parameters with.
 	 * @param typeString NUL-terminated string describing the type of each parameter.
 	 */
-	void readParams(Instruction *inst, char *typeString);
+	virtual void readParams(Instruction *inst, char *typeString);
 };
 
 #define INC_ADDR _address++;

Modified: tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.cpp	2010-05-28 11:14:58 UTC (rev 49291)
@@ -22,14 +22,12 @@
 
 #include "unknown_opcode.h"
 
-UnknownOpcodeException::UnknownOpcodeException(uint32 address, uint8 opcode)
-{
+UnknownOpcodeException::UnknownOpcodeException(uint32 address, uint8 opcode) {
 	_address = address;
 	_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/unknown_opcode.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h	2010-05-28 10:53:03 UTC (rev 49290)
+++ tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h	2010-05-28 11:14:58 UTC (rev 49291)
@@ -30,8 +30,7 @@
 /**
  * Exception representing an unknown opcode.
  */
-class UnknownOpcodeException : public std::exception
-{
+class UnknownOpcodeException : public std::exception {
 	uint32 _address; ///<Address where the invalid opcode was found.
 	uint8 _opcode; ///<The value of the invalid opcode.
 	char _buf[255];	///<Buffer for formatting the error message.


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