[Scummvm-cvs-logs] SF.net SVN: scummvm:[41564] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Tue Jun 16 01:08:09 CEST 2009


Revision: 41564
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41564&view=rev
Author:   drmccoy
Date:     2009-06-15 23:08:09 +0000 (Mon, 15 Jun 2009)

Log Message:
-----------
Renamed various variables to better reflect their meaning

Modified Paths:
--------------
    scummvm/trunk/engines/gob/parse.cpp
    scummvm/trunk/engines/gob/parse.h

Modified: scummvm/trunk/engines/gob/parse.cpp
===================================================================
--- scummvm/trunk/engines/gob/parse.cpp	2009-06-15 23:07:55 UTC (rev 41563)
+++ scummvm/trunk/engines/gob/parse.cpp	2009-06-15 23:08:09 UTC (rev 41564)
@@ -96,8 +96,8 @@
 			case OP_LOAD_VAR_INT16:
 			case OP_LOAD_VAR_INT8:
 			case OP_LOAD_IMM_INT16:
-			case 23:
-			case 24:
+			case OP_LOAD_VAR_UINT32:
+			case OP_LOAD_VAR_UINT32_AS_INT16:
 				_vm->_global->_inter_execPtr += 2;
 				break;
 
@@ -225,8 +225,8 @@
 					strlen((char *) _vm->_global->_inter_execPtr) + 1;
 				break;
 
-			case 23: // uint32 variable load
-			case 24: // uint32 variable load as uint16
+			case OP_LOAD_VAR_UINT32:
+			case OP_LOAD_VAR_UINT32_AS_INT16:
 				debugN(5, "var_%d", _vm->_inter->load16());
 				break;
 
@@ -415,7 +415,7 @@
 
 	operation = *_vm->_global->_inter_execPtr++;
 	switch (operation) {
-	case 23:
+	case OP_LOAD_VAR_UINT32:
 	case OP_LOAD_VAR_STR:
 		temp = _vm->_inter->load16() * 4;
 		debugN(5, "&var_%d", temp);
@@ -457,11 +457,12 @@
 }
 
 int Parse::cmpHelper(byte *operPtr, int32 *valPtr) {
-	byte var_C = operPtr[-3];
+	byte type = operPtr[-3];
 	int cmpTemp = 0;
-	if (var_C == OP_LOAD_IMM_INT16) {
+
+	if (type == OP_LOAD_IMM_INT16) {
 		cmpTemp = (int)valPtr[-3] - (int)valPtr[-1];
-	} else if (var_C == OP_LOAD_IMM_STR) {
+	} else if (type == OP_LOAD_IMM_STR) {
 		if ((char *)decodePtr(valPtr[-3]) != _vm->_global->_inter_resStr) {
 			strcpy(_vm->_global->_inter_resStr, (char *)decodePtr(valPtr[-3]));
 			valPtr[-3] = encodePtr((byte *) _vm->_global->_inter_resStr, kResStr);
@@ -472,7 +473,7 @@
 	return cmpTemp;
 }
 
-bool Parse::getVarBase(uint32 &varBase, bool mindStop, uint16 *arg_0, uint16 *oper) {
+bool Parse::getVarBase(uint32 &varBase, bool mindStop, uint16 *size, uint16 *type) {
 	varBase = 0;
 
 	byte operation = *_vm->_global->_inter_execPtr;
@@ -484,10 +485,10 @@
 
 			varBase += _vm->_inter->load16() * 4;
 
-			if (arg_0)
-				*arg_0 = READ_LE_UINT16(_vm->_global->_inter_execPtr);
-			if (oper)
-				*oper = 14;
+			if (size)
+				*size = READ_LE_UINT16(_vm->_global->_inter_execPtr);
+			if (type)
+				*type = 14;
 
 			_vm->_global->_inter_execPtr += 2;
 
@@ -506,10 +507,10 @@
 
 			uint16 offset1 = _vm->_inter->load16();
 
-			if (arg_0)
-				*arg_0 = offset1;
-			if (oper)
-				*oper = 15;
+			if (size)
+				*size = offset1;
+			if (type)
+				*type = 15;
 
 			uint8 dimCount = *_vm->_global->_inter_execPtr++;
 			byte *dimArray = _vm->_global->_inter_execPtr;
@@ -540,7 +541,7 @@
 	return false;
 }
 
-int16 Parse::parseVarIndex(uint16 *arg_0, uint16 *arg_4) {
+int16 Parse::parseVarIndex(uint16 *size, uint16 *type) {
 	int16 temp2;
 	byte *arrDesc;
 	int16 dim;
@@ -551,15 +552,15 @@
 	int16 val;
 	uint32 varBase;
 
-	if (getVarBase(varBase, true, arg_0, arg_4))
+	if (getVarBase(varBase, true, size, type))
 		return varBase;
 
 	operation = *_vm->_global->_inter_execPtr++;
 
-	if (arg_0)
-		*arg_0 = 0;
-	if (arg_4)
-		*arg_4 = operation;
+	if (size)
+		*size = 0;
+	if (type)
+		*type = operation;
 
 	debugC(5, kDebugParser, "var parse = %d", operation);
 	switch (operation) {
@@ -596,8 +597,8 @@
 	case OP_LOAD_VAR_INT8:
 		return varBase + _vm->_inter->load16();
 
-	case 23:
-	case 24:
+	case OP_LOAD_VAR_UINT32:
+	case OP_LOAD_VAR_UINT32_AS_INT16:
 	case OP_LOAD_VAR_STR:
 		temp = _vm->_inter->load16() * 4;
 		debugC(5, kDebugParser, "oper = %d",
@@ -621,7 +622,7 @@
 	return _vm->_global->_inter_resVal;
 }
 
-int16 Parse::parseExpr(byte stopToken, byte *arg_2) {
+int16 Parse::parseExpr(byte stopToken, byte *type) {
 	int32 values[20];
 	byte operStack[20];
 	int32 prevPrevVal;
@@ -636,7 +637,7 @@
 	int16 temp2;
 	int16 offset;
 	int16 dim;
-	bool var_1A;
+	bool escape;
 	int16 stkPos;
 	int16 brackStart;
 	uint32 varBase;
@@ -724,12 +725,12 @@
 					strlen((char *) _vm->_global->_inter_execPtr) + 1;
 				break;
 
-			case 23:
+			case OP_LOAD_VAR_UINT32:
 				*operPtr = OP_LOAD_IMM_INT16;
 				*valPtr = READ_VARO_UINT32(varBase + _vm->_inter->load16() * 4);
 				break;
 
-			case 24:
+			case OP_LOAD_VAR_UINT32_AS_INT16:
 				*operPtr = OP_LOAD_IMM_INT16;
 				*valPtr = (int16) READ_VARO_UINT16(varBase + _vm->_inter->load16() * 4);
 				break;
@@ -849,7 +850,7 @@
 		if ((operation == stopToken) || (operation == OP_OR) ||
 				(operation == OP_AND) || (operation == OP_END_EXPR)) {
 			while (stkPos >= 2) {
-				var_1A = false;
+				escape = false;
 				if ((operPtr[-2] == OP_BEGIN_EXPR) &&
 						((operation == OP_END_EXPR) || (operation == stopToken))) {
 					operPtr[-2] = operPtr[-1];
@@ -1055,11 +1056,11 @@
 					}
 
 				default:
-					var_1A = true;
+					escape = true;
 					break;
 				}	// switch
 
-				if (var_1A)
+				if (escape)
 					break;
 			}	// while (stkPos >= 2)
 
@@ -1104,13 +1105,13 @@
 			if (operation != stopToken)
 				continue;
 
-			if (arg_2 != 0)
-				*arg_2 = operStack[0];
+			if (type != 0)
+				*type = operStack[0];
 
 			switch (operStack[0]) {
 			case OP_NOT:
-				if (arg_2 != 0)
-					*arg_2 ^= 1;
+				if (type != 0)
+					*type ^= 1;
 				break;
 
 			case OP_LOAD_IMM_INT16:
@@ -1122,14 +1123,14 @@
 					strcpy(_vm->_global->_inter_resStr, (char *) decodePtr(values[0]));
 				break;
 
-			case 23:
-			case 24:
+			case OP_LOAD_VAR_UINT32:
+			case OP_LOAD_VAR_UINT32_AS_INT16:
 				break;
 
 			default:
 				_vm->_global->_inter_resVal = 0;
-				if (arg_2 != 0)
-					*arg_2 = OP_LOAD_IMM_INT16;
+				if (type != 0)
+					*type = OP_LOAD_IMM_INT16;
 				break;
 			}
 			return 0;

Modified: scummvm/trunk/engines/gob/parse.h
===================================================================
--- scummvm/trunk/engines/gob/parse.h	2009-06-15 23:07:55 UTC (rev 41563)
+++ scummvm/trunk/engines/gob/parse.h	2009-06-15 23:08:09 UTC (rev 41564)
@@ -53,8 +53,8 @@
 	OP_LOAD_IMM_INT8 = 21,
 	OP_LOAD_IMM_STR = 22,
 
-	OP_LOAD_VAR_UINT32 = 23,		// ???
-	OP_LOAD_VAR_UINT32_AS_UINT16 = 24,		// ???
+	OP_LOAD_VAR_UINT32 = 23,
+	OP_LOAD_VAR_UINT32_AS_INT16 = 24,
 	OP_LOAD_VAR_STR = 25,
 
 	OP_ARRAY_UINT32 = 26,
@@ -98,9 +98,9 @@
 	void printExpr(char stopToken);
 	void printVarIndex(void);
 
-	int16 parseVarIndex(uint16 *arg_0 = 0, uint16 *arg_4 = 0);
+	int16 parseVarIndex(uint16 *size = 0, uint16 *type = 0);
 	int16 parseValExpr(byte stopToken = 99);
-	int16 parseExpr(byte stopToken, byte *resultPtr);
+	int16 parseExpr(byte stopToken, byte *type);
 
 	Parse(GobEngine *vm);
 	virtual ~Parse() {}
@@ -121,7 +121,7 @@
 
 	int cmpHelper(byte *operPtr, int32 *valPtr);
 
-	bool getVarBase(uint32 &varBase, bool mindStop = false, uint16 *arg_0 = 0, uint16 *oper = 0);
+	bool getVarBase(uint32 &varBase, bool mindStop = false, uint16 *size = 0, uint16 *type = 0);
 };
 
 } // End of namespace Gob


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