[Scummvm-cvs-logs] scummvm master -> 9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e

lordhoto lordhoto at gmail.com
Sun Jun 8 17:57:35 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9e4dfe556e CRUISE: Directly use assert.


Commit: 9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e
    https://github.com/scummvm/scummvm/commit/9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2014-06-08T17:57:02+02:00

Commit Message:
CRUISE: Directly use assert.

This fixes an ASSERT macro redefinition when compiling the Symbian port.
See bug #6622 "SYMBIAN: CRUISE: warning: `ASSERT' redefined".

Changed paths:
    engines/cruise/background.cpp
    engines/cruise/cruise_main.cpp
    engines/cruise/cruise_main.h
    engines/cruise/ctp.cpp
    engines/cruise/dataLoader.cpp
    engines/cruise/function.cpp
    engines/cruise/menu.cpp
    engines/cruise/object.cpp
    engines/cruise/overlay.cpp
    engines/cruise/perso.cpp
    engines/cruise/saveload.cpp
    engines/cruise/script.cpp
    engines/cruise/stack.cpp



diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 921c621..4cf52f6 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -178,7 +178,7 @@ int loadBackground(const char *name, int idx) {
 			break;
 
 		default:
-			ASSERT(0);
+			assert(0);
 		}
 
 		gfxModuleData_setPal256(palScreen[idx]);
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index d7f5871..c3b6cd0 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -427,7 +427,7 @@ void resetFileEntry(int32 entryNumber) {
 }
 
 uint8 *mainProc14(uint16 overlay, uint16 idx) {
-	ASSERT(0);
+	assert(0);
 
 	return NULL;
 }
@@ -1359,7 +1359,7 @@ void closeAllMenu() {
 		menuTable[1] = NULL;
 	}
 	if (linkedMsgList) {
-		ASSERT(0);
+		assert(0);
 //					freeMsgList(linkedMsgList);
 	}
 
@@ -1514,7 +1514,7 @@ int CruiseEngine::processInput() {
 					menuTable[0] = NULL;
 
 					if (linkedMsgList) {
-						ASSERT(0);
+						assert(0);
 						//					freeMsgList(linkedMsgList);
 					}
 
@@ -1918,7 +1918,7 @@ void CruiseEngine::mainLoop() {
 		processAnimation();
 
 		if (remdo) {
-			// ASSERT(0);
+			// assert(0);
 			/*    main3 = 0;
 			 * var24 = 0;
 			 * var23 = 0;
@@ -1927,7 +1927,7 @@ void CruiseEngine::mainLoop() {
 		}
 
 		if (cmdLine[0]) {
-			ASSERT(0);
+			assert(0);
 			/*        redrawStrings(0,&cmdLine,8);
 
 			        waitForPlayerInput();
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index caaaad2..f9d0e2f 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -62,9 +62,6 @@ enum MouseButton {
 /*#define DUMP_SCRIPT
 #define DUMP_OBJECT*/
 
-#define ASSERT_PTR assert
-#define ASSERT assert
-
 enum ResType {
 	OBJ_TYPE_LINE = 0,
 	OBJ_TYPE_MASK = 1,
diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp
index 074132d..9515b55 100644
--- a/engines/cruise/ctp.cpp
+++ b/engines/cruise/ctp.cpp
@@ -244,7 +244,7 @@ int initCt(const char *ctpName) {
 	}
 
 	// get the path-finding coordinates
-	ASSERT((segementSizeTable[0] % 4) == 0);
+	assert((segementSizeTable[0] % 4) == 0);
 	for (int i = 0; i < segementSizeTable[0] / 4; i++) {
 		ctp_routeCoords[i][0] = (int16)READ_BE_UINT16(dataPointer);
 		dataPointer += 2;
@@ -253,7 +253,7 @@ int initCt(const char *ctpName) {
 	}
 
 	// get the path-finding line informations (indexing the routeCoords array)
-	ASSERT((segementSizeTable[1] % 20) == 0);
+	assert((segementSizeTable[1] % 20) == 0);
 	for (int i = 0; i < segementSizeTable[1] / 20; i++) {
 		for (int j = 0; j < 10; j++) {
 			ctp_routes[i][j] = (int16)READ_BE_UINT16(dataPointer);
@@ -262,7 +262,7 @@ int initCt(const char *ctpName) {
 	}
 
 	// read polygons
-	ASSERT((segementSizeTable[2] % 80) == 0);
+	assert((segementSizeTable[2] % 80) == 0);
 	for (int i = 0; i < segementSizeTable[2] / 80; i++) {
 		for (int j = 0; j < 40; j++) {
 			ctp_walkboxTable[i][j] = (int16)READ_BE_UINT16(dataPointer);
@@ -277,14 +277,14 @@ int initCt(const char *ctpName) {
 	} else {
 		// get the walkbox type
 		// Type: 0x00 - non walkable, 0x01 - walkable, 0x02 - exit zone
-		ASSERT((segementSizeTable[3] % 2) == 0);
+		assert((segementSizeTable[3] % 2) == 0);
 		for (int i = 0; i < segementSizeTable[3] / 2; i++) {
 			walkboxColor[i] = (int16)READ_BE_UINT16(dataPointer);
 			dataPointer += 2;
 		}
 
 		// change indicator, walkbox type can change, i.e. blocked by object (values are either 0x00 or 0x01)
-		ASSERT((segementSizeTable[4] % 2) == 0);
+		assert((segementSizeTable[4] % 2) == 0);
 		for (int i = 0; i < segementSizeTable[4] / 2; i++) {
 			walkboxState[i] = (int16)READ_BE_UINT16(dataPointer);
 			dataPointer += 2;
@@ -292,14 +292,14 @@ int initCt(const char *ctpName) {
 	}
 
 	//
-	ASSERT((segementSizeTable[5] % 2) == 0);
+	assert((segementSizeTable[5] % 2) == 0);
 	for (int i = 0; i < segementSizeTable[5] / 2; i++) {
 		walkboxColorIndex[i] = (int16)READ_BE_UINT16(dataPointer);
 		dataPointer += 2;
 	}
 
 	//
-	ASSERT((segementSizeTable[6] % 2) == 0);
+	assert((segementSizeTable[6] % 2) == 0);
 	for (int i = 0; i < segementSizeTable[6] / 2; i++) {
 		walkboxZoom[i] = (int16)READ_BE_UINT16(dataPointer);
 		dataPointer += 2;
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index c55818a..7a1258d 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -225,7 +225,7 @@ fileTypeEnum getFileType(const char *name) {
 		newFileType = type_FNT;
 	}
 
-	ASSERT(newFileType != type_UNK);
+	assert(newFileType != type_UNK);
 
 	return newFileType;
 }
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 8833efc..b9a074b 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -1608,7 +1608,7 @@ int16 Op_GetNodeX() {
 
 	int result = getNode(nodeInfo, node);
 
-	ASSERT(result == 0);
+	assert(result == 0);
 
 	return nodeInfo[0];
 }
@@ -1620,7 +1620,7 @@ int16 Op_GetNodeY() {
 
 	int result = getNode(nodeInfo, node);
 
-	ASSERT(result == 0);
+	assert(result == 0);
 
 	return nodeInfo[1];
 }
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index 0a49720..c72192f 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -39,7 +39,7 @@ menuStruct *createMenu(int X, int Y, const char *menuName) {
 	menuStruct *entry;
 
 	entry = (menuStruct *) MemAlloc(sizeof(menuStruct));
-	ASSERT(entry);
+	assert(entry);
 
 	entry->x = X - 160 / 2;
 	entry->y = Y;
@@ -69,7 +69,7 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
 					if (!strcmp(var_6->string, menuText)) {
 						pNewElement = var_6;
 						pSubStruct = (menuElementSubStruct *)allocAndZero(sizeof(menuElementSubStruct));
-						ASSERT(pSubStruct);
+						assert(pSubStruct);
 
 						pSubStruct->pNext = NULL;
 						pSubStruct->ovlIdx = ovlIdx;
@@ -99,9 +99,9 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
 		}
 
 		pNewElement = (menuElementStruct *)allocAndZero(sizeof(menuElementStruct));
-		ASSERT(pNewElement);
+		assert(pNewElement);
 		pSubStruct = (menuElementSubStruct *)allocAndZero(sizeof(menuElementSubStruct));
-		ASSERT(pSubStruct);
+		assert(pSubStruct);
 
 		pNewElement->string = menuText;
 		pNewElement->next = NULL;
@@ -266,7 +266,7 @@ int playerMenu(int menuX, int menuY) {
 		freeDisk();
 
 		menuTable[0] = createMenu(menuX, menuY, _vm->langString(ID_PLAYER_MENU));
-		ASSERT(menuTable[0]);
+		assert(menuTable[0]);
 
 		//addSelectableMenuEntry(0, 3, menuTable[0], 1, -1, "Save game disk");
 		if (userEnabled) {
diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp
index 664627b..845fc34 100644
--- a/engines/cruise/object.cpp
+++ b/engines/cruise/object.cpp
@@ -163,14 +163,14 @@ void setObjectPosition(int16 ovlIdx, int16 objIdx, int16 param3, int16 param4) {
 			break;
 		}
 		default: {
-			ASSERT(0);
+			assert(0);
 		}
 		}
 
 		break;
 	}
 	default: {
-		ASSERT(0);
+		assert(0);
 	}
 	}
 }
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 386a11f..f7df741 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -295,7 +295,7 @@ int loadOverlay(const char *scriptName) {
 	}
 
 	if (ovlData->numMsgRelHeader) {	// link data
-		ASSERT(sizeof(linkDataStruct) == 0x22);
+		assert(sizeof(linkDataStruct) == 0x22);
 
 		ovlData->arrayMsgRelHeader = (linkDataStruct *) mallocAndZero(ovlData->numMsgRelHeader * sizeof(linkDataStruct));
 
@@ -626,7 +626,7 @@ int loadOverlay(const char *scriptName) {
 		sprintf(nameBundle, "%s-objs.txt", scriptName);
 
 		fHandle = fopen(nameBundle, "w+");
-		ASSERT(fHandle);
+		assert(fHandle);
 
 		for (int i = 0; i < ovlData->numMsgRelHeader; i++) {
 			linkDataStruct *var_34;
diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp
index 66c9718..ff33eca 100644
--- a/engines/cruise/perso.cpp
+++ b/engines/cruise/perso.cpp
@@ -237,7 +237,7 @@ void processActorWalk(MovementEntry &resx_y, int16 *inc_droite, int16 *inc_droit
 void affiche_chemin(int16 persoIdx, MovementEntry &data) {
 	persoStruct *pPerso = persoTable[persoIdx];
 
-	ASSERT(pPerso);
+	assert(pPerso);
 
 	processActorWalk(data, &pPerso->inc_droite, &pPerso->inc_droite0,
 	                 &pPerso->inc_chemin, pPerso->coordinates, pPerso->solution,
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index a9fc622..8d66e82 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -284,7 +284,7 @@ static void syncOverlays2(Common::Serializer &s) {
 
 				if (ovlRestoreData[i]._sBssSize) {
 					ovlRestoreData[i]._pBss = (uint8 *) mallocAndZero(ovlRestoreData[i]._sBssSize);
-					ASSERT(ovlRestoreData[i]._pBss);
+					assert(ovlRestoreData[i]._pBss);
 
 					s.syncBytes(ovlRestoreData[i]._pBss, ovlRestoreData[i]._sBssSize);
 				}
@@ -293,7 +293,7 @@ static void syncOverlays2(Common::Serializer &s) {
 
 				if (ovlRestoreData[i]._sNumObj) {
 					ovlRestoreData[i]._pObj = (objectParams *) mallocAndZero(ovlRestoreData[i]._sNumObj * sizeof(objectParams));
-					ASSERT(ovlRestoreData[i]._pObj);
+					assert(ovlRestoreData[i]._pObj);
 
 					for (int j = 0; j < ovlRestoreData[i]._sNumObj; j++) {
 						s.syncAsSint16LE(ovlRestoreData[i]._pObj[j].X);
@@ -915,7 +915,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
 
 	while (currentcellHead) {
 		if (currentcellHead->type == 5) {
-			ASSERT(0);
+			assert(0);
 #if 0
 			uint8 *ptr = mainProc14(currentcellHead->overlay, currentcellHead->idx);
 			if (ptr)
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index eae2041..1f30871 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -170,7 +170,7 @@ int32 opcodeType1()	{
 			if (var_6 == 5) {
 				ptr = overlayTable[byte2].ovlData->data4Ptr + var_C;
 			} else {
-				ASSERT(0);
+				assert(0);
 			}
 		} else {
 			ptr = scriptDataPtrTable[var_6] + var_C;
@@ -249,7 +249,7 @@ int32 opcodeType2() {
 			if (!overlayTable[overlay].ovlData) {
 				return (-4);
 			}
-			ASSERT(0);
+			assert(0);
 		}
 
 		adresse += offset;
diff --git a/engines/cruise/stack.cpp b/engines/cruise/stack.cpp
index e4ecf72..52a7a84 100644
--- a/engines/cruise/stack.cpp
+++ b/engines/cruise/stack.cpp
@@ -44,7 +44,7 @@ int16 popVar() {
 
 	positionInStack--;
 
-	ASSERT(scriptStack[positionInStack].type == STACK_SHORT);
+	assert(scriptStack[positionInStack].type == STACK_SHORT);
 
 	return (scriptStack[positionInStack].data.shortVar);
 }
@@ -66,7 +66,7 @@ void *popPtr() {
 
 	positionInStack--;
 
-	ASSERT(scriptStack[positionInStack].type == STACK_PTR);
+	assert(scriptStack[positionInStack].type == STACK_PTR);
 
 	return (scriptStack[positionInStack].data.ptrVar);
 }






More information about the Scummvm-git-logs mailing list