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

kjdf at users.sourceforge.net kjdf at users.sourceforge.net
Fri Jun 19 23:15:55 CEST 2009


Revision: 41689
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41689&view=rev
Author:   kjdf
Date:     2009-06-19 21:15:55 +0000 (Fri, 19 Jun 2009)

Log Message:
-----------
decompiler: fixed signedness bug introduced by fixing warnings :)

Modified Paths:
--------------
    tools/branches/gsoc2009-decompiler/decompiler/misc.h
    tools/branches/gsoc2009-decompiler/decompiler/reader.h

Modified: tools/branches/gsoc2009-decompiler/decompiler/misc.h
===================================================================
--- tools/branches/gsoc2009-decompiler/decompiler/misc.h	2009-06-19 21:09:59 UTC (rev 41688)
+++ tools/branches/gsoc2009-decompiler/decompiler/misc.h	2009-06-19 21:15:55 UTC (rev 41689)
@@ -51,4 +51,11 @@
 	return (uint16) ret;
 }
 
+int16 read_le_int16(ifstream &f) {
+	int ret = 0;
+	ret |= f.get();
+	ret |= f.get() << 8;
+	return (int16) ret;
+}
+
 #endif

Modified: tools/branches/gsoc2009-decompiler/decompiler/reader.h
===================================================================
--- tools/branches/gsoc2009-decompiler/decompiler/reader.h	2009-06-19 21:09:59 UTC (rev 41688)
+++ tools/branches/gsoc2009-decompiler/decompiler/reader.h	2009-06-19 21:15:55 UTC (rev 41689)
@@ -56,7 +56,7 @@
 			}
 			case 'o': { // offset, fixed to be counted from the beginning of instruction
 				int len = _format[++i] - '0';
-				int w = len + read_le_uint16(f);
+				int w = len + read_le_int16(f);
 				arguments.push_back((int16) w);
 				ssret << ' ' << (w>=0?"+":"") << w;
 				break;


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