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

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Fri Jun 18 00:28:24 CEST 2010


Revision: 49955
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49955&view=rev
Author:   pidgeot
Date:     2010-06-17 22:28:23 +0000 (Thu, 17 Jun 2010)

Log Message:
-----------
Formatting fixes

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/control_flow.h
    tools/branches/gsoc2010-decompiler/decompiler/disassembler.h
    tools/branches/gsoc2010-decompiler/decompiler/engine.h
    tools/branches/gsoc2010-decompiler/decompiler/graph.h
    tools/branches/gsoc2010-decompiler/decompiler/instruction.h
    tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h
    tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.h
    tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h
    tools/branches/gsoc2010-decompiler/decompiler/test/disassembler_test.h
    tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h

Modified: tools/branches/gsoc2010-decompiler/decompiler/control_flow.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/control_flow.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/control_flow.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -38,24 +38,28 @@
 
 	/**
 	 * Finds a graph vertex through an instruction.
+	 *
 	 * @param inst The instruction to find the vertex for.
 	 */
 	GraphVertex find(Instruction inst);
 
 	/**
 	 * Finds a graph vertex through an instruction iterator.
+	 *
 	 * @param it The iterator to find the vertex for.
 	 */
 	GraphVertex find(InstIterator it);
 
 	/**
 	 * Finds a graph vertex through an address.
+	 *
 	 * @param address The address to find the vertex for.
 	 */
 	GraphVertex find(uint32 address);
 
 	/**
 	 * Merges two graph vertices. g2 will be merged into g1.
+	 *
 	 * @param g1 The first vertex to merge.
 	 * @param g2 The second vertex to merge.
 	 */
@@ -63,7 +67,8 @@
 
 	/**
 	 * Sets the stack level for all instructions, using depth-first search.
-	 * @param g The GraphVertex to search from.
+	 *
+	 * @param g     The GraphVertex to search from.
 	 * @param level The stack level when g is reached.
 	 */
 	void setStackLevel(GraphVertex g, int level);
@@ -71,13 +76,15 @@
 public:
 	/**
 	 * Gets the current control flow graph.
+	 *
 	 * @returns The current control flow graph.
 	 */
 	const Graph &getGraph() { return _g; };
 
 	/**
 	 * Constructor for the control flow graph.
-	 * @param insts std::vector containing the instructions to analyze control flow for.
+	 *
+	 * @param insts  std::vector containing the instructions to analyze control flow for.
 	 * @param engine Pointer to the Engine used for the script.
 	 */
 	ControlFlow(std::vector<Instruction> &insts, Engine *engine);
@@ -89,6 +96,8 @@
 
 	/**
 	 * Performs control flow analysis.
+	 *
+	 * @returns The control flow graph after analysis.
 	 */
 	const Graph &analyze();
 };

Modified: tools/branches/gsoc2010-decompiler/decompiler/disassembler.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/disassembler.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/disassembler.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -42,6 +42,7 @@
 
 	/**
 	 * Performs disassembly.
+	 *
 	 * @throws UnknownOpcodeException on unknown opcode.
 	 */
 	virtual void doDisassemble() throw(UnknownOpcodeException) = 0;

Modified: tools/branches/gsoc2010-decompiler/decompiler/engine.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/engine.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/engine.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -34,12 +34,14 @@
 
 	/**
 	 * Retrieve the disassembler for the engine.
+	 *
 	 * @return Pointer to a Disassembler for the engine.
 	 */
 	virtual Disassembler *getDisassembler() const = 0;
 
 	/**
 	 * Decode a jump-instruction to get the destination address.
+	 *
 	 * @param it Iterator pointing to the instruction to decode.
 	 */
 	virtual uint32 getDestAddress(InstIterator it) const = 0;

Modified: tools/branches/gsoc2010-decompiler/decompiler/graph.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/graph.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/graph.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -49,8 +49,9 @@
 
 	/**
 	 * Constructor for Group.
+	 *
 	 * @param start First instruction in the group.
-	 * @param end Last instruction in the group.
+	 * @param end   Last instruction in the group.
 	 */
 	Group(InstIterator start, InstIterator end) {
 		_start = start;
@@ -60,8 +61,9 @@
 
 	/**
 	 * Output a group to an std::ostream as a graphviz label.
+	 *
 	 * @param output The std::ostream to output to.
-	 * @param group The Group to output.
+	 * @param group  The Group to output.
 	 * @return The std::ostream used for output.
 	 */
 	friend std::ostream& operator<< (std::ostream &output, Group &group) {
@@ -90,23 +92,59 @@
 	}
 };
 
-typedef boost::property<boost::vertex_name_t, Group> GroupProperty;                                   ///< Type representing properties containing a Group.
-typedef boost::property<boost::vertex_index_t, int, GroupProperty> GraphProperty;                     ///< Type representing properties containing an index, followed by a GroupProperty.
-typedef boost::adjacency_list<boost::vecS, boost::listS, boost::bidirectionalS, GraphProperty> Graph; ///< Type used for the code flow graph.
-typedef Graph::vertex_descriptor GraphVertex;                                                         ///< Type representing a vertex in the graph.
-typedef Graph::vertex_iterator VertexIterator;                                                        ///< Type representing an iterator for vertices.
-typedef Graph::edge_descriptor GraphEdge;                                                             ///< Type representing an edge in the graph.
-typedef Graph::out_edge_iterator OutEdgeIterator;                                                     ///< Type representing an iterator for outgoing edges.
-typedef Graph::in_edge_iterator InEdgeIterator;                                                       ///< Type representing an iterator for ingoing edges.
-typedef std::pair<OutEdgeIterator, OutEdgeIterator> EdgeRange;                                        ///< Type representing a range of edges from boost::out_edges.
+/**
+ * Type representing properties containing a Group.
+ */
+typedef boost::property<boost::vertex_name_t, Group> GroupProperty;
 
 /**
+ * Type representing properties containing an index, followed by a GroupProperty.
+ */
+typedef boost::property<boost::vertex_index_t, int, GroupProperty> GraphProperty;
+
+/**
+ * Type used for the code flow graph.
+ */
+typedef boost::adjacency_list<boost::vecS, boost::listS, boost::bidirectionalS, GraphProperty> Graph;
+
+/**
+ * Type representing a vertex in the graph.
+ */
+typedef Graph::vertex_descriptor GraphVertex;
+
+/**
+ * Type representing an iterator for vertices.
+ */
+typedef Graph::vertex_iterator VertexIterator;
+
+/**
+ * Type representing an edge in the graph.
+ */
+typedef Graph::edge_descriptor GraphEdge;
+
+/**
+ * Type representing an iterator for outgoing edges.
+ */
+typedef Graph::out_edge_iterator OutEdgeIterator;
+
+/**
+ * Type representing an iterator for ingoing edges.
+ */
+typedef Graph::in_edge_iterator InEdgeIterator;
+
+/**
+ * Type representing a range of edges from boost::out_edges.
+ */
+typedef std::pair<OutEdgeIterator, OutEdgeIterator> EdgeRange;
+
+/**
  * Type used to set properties for dot output.
  */
 struct GraphProperties {
 
 	/**
 	 * Called by write_graphviz from Boost.Graph to print properties of the graph.
+	 *
 	 * @param out The std::ostream write_graphviz is writing to.
 	 */
 	void operator()(std::ostream& out) const {

Modified: tools/branches/gsoc2010-decompiler/decompiler/instruction.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/instruction.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -70,6 +70,7 @@
 
 	/**
 	 * Gets an int32 stored in the _value variant.
+	 *
 	 * @return The int32 stored in the _value variant.
 	 * @throws boost::bad_get if the variant is not storing an int32.
 	 */
@@ -77,6 +78,7 @@
 
 	/**
 	 * Gets an uint32 stored in the _value variant.
+	 *
 	 * @return The uint32 stored in the _value variant.
 	 * @throws boost::bad_get if the variant is not storing an uint32.
 	 */
@@ -84,6 +86,7 @@
 
 	/**
 	 * Gets an std::string stored in the _value variant.
+	 *
 	 * @return The std::string stored in the _value variant.
 	 * @throws boost::bad_get if the variant is not storing an std::string.
 	 */
@@ -101,6 +104,9 @@
 	std::vector<Parameter> _params; ///< Array of parameters used for the instruction.
 };
 
+/**
+ * Type representing an iterator over Instructions.
+ */
 typedef std::vector<Instruction>::iterator InstIterator;
 
 #endif

Modified: tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/objectFactory.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -43,10 +43,18 @@
 class ObjectFactory {
 private:
 
-	typedef BaseType *(*CreateFunc)();                     ///<Function pointer to the object creation function.
-	typedef std::map<std::string, CreateFunc> RegistryMap; ///<Type used to store registered entries.
-	RegistryMap _registry;                                 ///<Map from an identifier to a creation function.
+	/**
+	 * Function pointer to the object creation function.
+	 */
+	typedef BaseType *(*CreateFunc)();
 
+	/**
+	 * Type used to store registered entries.
+	 */
+	typedef std::map<std::string, CreateFunc> RegistryMap;
+
+	RegistryMap _registry; ///<Map from an identifier to a creation function.
+
 public:
 	/**
 	 * Register a new entry.

Modified: tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/scummv6/disassembler.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -40,9 +40,10 @@
 
 	/**
 	 * Determines the actual stack effect of an opcode with a variable stack effect.
-	 * @param it Iterator pointing to the instruction to be fixed.
+	 *
+	 * @param it        Iterator pointing to the instruction to be fixed.
 	 * @param popBefore Number of pops prior to the variable-length list.
-	 * @param popAfter Number of pops after the variable-length list.
+	 * @param popAfter  Number of pops after the variable-length list.
 	 * @param pushTotal Number of values pushed from the instruction.
 	 */
 	void fixStackEffect(InstIterator &it, int popBefore, int popAfter, int pushTotal);

Modified: tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/simple_disassembler.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -35,7 +35,7 @@
 	/**
 	 * Read parameters and associate them with an instruction.
 	 *
-	 * @param inst Pointer to the instruction to associate the parameters with.
+	 * @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);
@@ -43,7 +43,7 @@
 	/**
 	 * Reads data for a single parameter.
 	 *
-	 * @param p Pointer to the destination Parameter structure.
+	 * @param p    Pointer to the destination Parameter structure.
 	 * @param type Character describing the type of the parameter.
 	 */
 	virtual void readParameter(Parameter *p, char type);

Modified: tools/branches/gsoc2010-decompiler/decompiler/test/disassembler_test.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/test/disassembler_test.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/test/disassembler_test.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -139,8 +139,7 @@
 	//This test requires room-9-202.dmp from Sam & Max: Hit The Road.
 	//f010dc659264674a2b6da298acd0b88b *room-9-202.dmp
 	void testScummv6StackChangeFixRoom9202() {
-		try
-		{
+		try {
 			Scumm::v6::Disassembler s;
 			s.open("decompiler/test/room-9-202.dmp");
 			std::vector<Instruction> insts = s.disassemble();
@@ -155,8 +154,7 @@
 	//This test requires script-30.dmp from Sam & Max: Hit The Road.
 	//6e48faca13e1f6df9341567608962744 *script-30.dmp
 	void testScummv6StackChangeFixScript30() {
-		try
-		{
+		try {
 			Scumm::v6::Disassembler s;
 			s.open("decompiler/test/script-30.dmp");
 			std::vector<Instruction> insts = s.disassemble();

Modified: tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h	2010-06-17 22:12:38 UTC (rev 49954)
+++ tools/branches/gsoc2010-decompiler/decompiler/unknown_opcode.h	2010-06-17 22:28:23 UTC (rev 49955)
@@ -40,7 +40,7 @@
 	 * Constructor for UnknownOpcodeException.
 	 *
 	 * @param address Address where the invalid opcode was found.
-	 * @param opcode The value of the invalid opcode.
+	 * @param opcode  The value of the invalid opcode.
 	 */
 	UnknownOpcodeException(uint32 address, uint8 opcode);
 


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