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

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Wed Jul 14 02:16:43 CEST 2010


Revision: 50858
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50858&view=rev
Author:   pidgeot
Date:     2010-07-14 00:16:42 +0000 (Wed, 14 Jul 2010)

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

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/codegen.h
    tools/branches/gsoc2010-decompiler/decompiler/graph.h

Modified: tools/branches/gsoc2010-decompiler/decompiler/codegen.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/codegen.h	2010-07-13 23:46:17 UTC (rev 50857)
+++ tools/branches/gsoc2010-decompiler/decompiler/codegen.h	2010-07-14 00:16:42 UTC (rev 50858)
@@ -49,8 +49,8 @@
 typedef boost::intrusive_ptr<StackEntry> EntryPtr;
 
 namespace boost {
-	inline void intrusive_ptr_add_ref(StackEntry *p);
-	inline void intrusive_ptr_release(StackEntry *p);
+inline void intrusive_ptr_add_ref(StackEntry *p);
+inline void intrusive_ptr_release(StackEntry *p);
 } // End of namespace boost
 
 /**
@@ -59,9 +59,9 @@
 class StackEntry {
 private:
 	long _refCount; ///< Reference count used for boost::intrusive_ptr.
-  friend void ::boost::intrusive_ptr_add_ref(StackEntry *p); ///< Allow access by reference counting methods in boost namespace.
-  friend void ::boost::intrusive_ptr_release(StackEntry *p); ///< Allow access by reference counting methods in boost namespace.
-	
+	friend void ::boost::intrusive_ptr_add_ref(StackEntry *p); ///< Allow access by reference counting methods in boost namespace.
+	friend void ::boost::intrusive_ptr_release(StackEntry *p); ///< Allow access by reference counting methods in boost namespace.
+
 public:
 	StackEntryType _type;
 
@@ -87,7 +87,7 @@
 	 * @return A StackEntry corresponding to a duplicate of this entry.
 	 */
 	virtual EntryPtr dup(std::ostream &output);
-	
+
 	/**
 	 * Output a stack entry to an std::ostream.
 	 *
@@ -102,21 +102,21 @@
 
 
 namespace boost {
-	/**
-	 * Add a reference to a pointer to a StackEntry.
-	 */
-	inline void intrusive_ptr_add_ref(StackEntry *p) {
-		++(p->_refCount);
-	}
+/**
+ * Add a reference to a pointer to a StackEntry.
+ */
+inline void intrusive_ptr_add_ref(StackEntry *p) {
+	++(p->_refCount);
+}
 
-	/**
-	 * Remove a reference from a pointer to a StackEntry.
-	 */
-	inline void intrusive_ptr_release(StackEntry *p) {
-		if (--(p->_refCount) == 0)
-			delete p;
-	}
+/**
+ * Remove a reference from a pointer to a StackEntry.
+ */
+inline void intrusive_ptr_release(StackEntry *p) {
+	if (--(p->_refCount) == 0)
+		delete p;
 }
+} // End of namespace boost
 
 
 /**
@@ -147,7 +147,7 @@
 	IntEntry(uint32 val, bool isSigned) : _isSigned(isSigned) {
 		_val = (int32)val;
 		_type = seInt;
-	}	
+	}
 
 	virtual std::ostream &print(std::ostream &output) const {
 		if (_isSigned)
@@ -157,7 +157,9 @@
 		return output;
 	}
 
-	virtual EntryPtr dup() { return new IntEntry(_val, _isSigned); }
+	virtual EntryPtr dup() {
+		return new IntEntry(_val, _isSigned);
+	}
 };
 
 /**
@@ -177,7 +179,9 @@
 		_type = seVar;
 	};
 
-	virtual std::ostream &print(std::ostream &output) const { return output << _varName; }
+	virtual std::ostream &print(std::ostream &output) const {
+		return output << _varName;
+	}
 };
 
 /**
@@ -190,7 +194,7 @@
 	std::string _op;  ///< The operator for this entry.
 
 public:
-	/** 
+	/**
 	 * Constructor for BinaryOpEntry.
 	 *
 	 * @param lhs Stack entry representing the left side of the operator.
@@ -201,7 +205,9 @@
 		_type = seBinOp;
 	}
 
-	virtual std::ostream &print(std::ostream &output) const { return output << _lhs << " " << _op << " " << _rhs; }
+	virtual std::ostream &print(std::ostream &output) const {
+		return output << "(" << _lhs << " " << _op << " " << _rhs << ")";
+	}
 };
 
 /**
@@ -223,7 +229,9 @@
 		_type = seUnaryOp;
 	}
 
-	virtual std::ostream &print(std::ostream &output) const { return output << _op << _operand; }
+	virtual std::ostream &print(std::ostream &output) const {
+		return output << _op << _operand;
+	}
 };
 
 /**
@@ -242,7 +250,9 @@
 	DupEntry(int idx) : _idx(idx) {
 		_type = seDup;
 	}
-	virtual std::ostream &print(std::ostream &output) const { return output << "dup[" << _idx << "]"; }
+	virtual std::ostream &print(std::ostream &output) const {
+		return output << "dup[" << _idx << "]";
+	}
 };
 
 /**
@@ -283,14 +293,14 @@
 	 * Constructor for CodeGenerator.
 	 *
 	 * @param engine Pointer to the Engine used for the script.
- 	 * @param output The std::ostream to output the code to.
+	 * @param output The std::ostream to output the code to.
 	 */
 	CodeGenerator(Engine *engine, std::ostream &output);
 
 	/**
 	 * Generates code from the provided graph and outputs it to stdout.
 	 *
- 	 * @param g The annotated graph of the script.
+	 * @param g The annotated graph of the script.
 	 */
 	void generate(const Graph &g);
 };

Modified: tools/branches/gsoc2010-decompiler/decompiler/graph.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/graph.h	2010-07-13 23:46:17 UTC (rev 50857)
+++ tools/branches/gsoc2010-decompiler/decompiler/graph.h	2010-07-14 00:16:42 UTC (rev 50858)
@@ -56,8 +56,8 @@
 typedef boost::intrusive_ptr<Group> GroupPtr;
 
 namespace boost {
-	inline void intrusive_ptr_add_ref(Group *p);
-	inline void intrusive_ptr_release(Group *p);
+inline void intrusive_ptr_add_ref(Group *p);
+inline void intrusive_ptr_release(Group *p);
 } // End of namespace boost
 
 /**
@@ -172,21 +172,21 @@
 };
 
 namespace boost {
-	/**
-	 * Add a reference to a pointer.
-	 */
-	inline void intrusive_ptr_add_ref(Group *p) {
-		++(p->_refCount);
-	}
+/**
+ * Add a reference to a pointer.
+ */
+inline void intrusive_ptr_add_ref(Group *p) {
+	++(p->_refCount);
+}
 
-	/**
-	 * Remove a reference from a pointer.
-	 */
-	inline void intrusive_ptr_release(Group *p) {
-		if (--(p->_refCount) == 0)
-			delete p;
-	}
+/**
+ * Remove a reference from a pointer.
+ */
+inline void intrusive_ptr_release(Group *p) {
+	if (--(p->_refCount) == 0)
+		delete p;
 }
+}
 
 /**
  * Type representing properties containing a pointer to a Group.


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