[Scummvm-cvs-logs] SF.net SVN: scummvm:[33235] scummvm/trunk/engines/tinsel

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Jul 23 12:27:25 CEST 2008


Revision: 33235
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33235&view=rev
Author:   fingolfin
Date:     2008-07-23 10:27:24 +0000 (Wed, 23 Jul 2008)

Log Message:
-----------
Got rid of some typedefs

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/actors.cpp
    scummvm/trunk/engines/tinsel/actors.h
    scummvm/trunk/engines/tinsel/anim.cpp
    scummvm/trunk/engines/tinsel/anim.h
    scummvm/trunk/engines/tinsel/background.cpp
    scummvm/trunk/engines/tinsel/background.h
    scummvm/trunk/engines/tinsel/handle.cpp
    scummvm/trunk/engines/tinsel/heapmem.cpp
    scummvm/trunk/engines/tinsel/heapmem.h

Modified: scummvm/trunk/engines/tinsel/actors.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/actors.cpp	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/actors.cpp	2008-07-23 10:27:24 UTC (rev 33235)
@@ -847,7 +847,7 @@
 /**
  * Store relevant information pertaining to currently existing actors.
  */
-int SaveActors(PSAVED_ACTOR sActorInfo) {
+int SaveActors(SAVED_ACTOR *sActorInfo) {
 	int	i, j;
 
 	for (i = 0, j = 0; i < NumActors; i++) {

Modified: scummvm/trunk/engines/tinsel/actors.h
===================================================================
--- scummvm/trunk/engines/tinsel/actors.h	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/actors.h	2008-07-23 10:27:24 UTC (rev 33235)
@@ -111,9 +111,8 @@
 	short		presRnum;	//!< the present reel number
 	short		presX, presY;
 };
-typedef SAVED_ACTOR *PSAVED_ACTOR;
 
-int SaveActors(PSAVED_ACTOR sActorInfo);
+int SaveActors(SAVED_ACTOR *sActorInfo);
 
 	
 void RestoreActorProcess(int id, INT_CONTEXT *pic);

Modified: scummvm/trunk/engines/tinsel/anim.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/anim.cpp	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/anim.cpp	2008-07-23 10:27:24 UTC (rev 33235)
@@ -59,7 +59,7 @@
  * Advance to next frame routine.
  * @param pAnim			Animation data structure
  */
-SCRIPTSTATE DoNextFrame(PANIM pAnim) {
+SCRIPTSTATE DoNextFrame(ANIM *pAnim) {
 	// get a pointer to the script
 	const ANI_SCRIPT *pAni = (const ANI_SCRIPT *)LockMem(pAnim->hScript);
 
@@ -227,7 +227,7 @@
  * @param hNewScript		Script of multipart frames
  * @param aniSpeed			Sets speed of animation in frames
  */
-void InitStepAnimScript(PANIM pAnim, OBJECT *pAniObj, SCNHANDLE hNewScript, int aniSpeed) {
+void InitStepAnimScript(ANIM *pAnim, OBJECT *pAniObj, SCNHANDLE hNewScript, int aniSpeed) {
 	OBJECT *pObj;			// multi-object list iterator
 
 	pAnim->aniDelta = 1;		// will animate on next call to NextAnimRate
@@ -247,7 +247,7 @@
  * Execute the next command in a animation script.
  * @param pAnim			Animation data structure
  */
-SCRIPTSTATE StepAnimScript(PANIM pAnim) {
+SCRIPTSTATE StepAnimScript(ANIM *pAnim) {
 	SCRIPTSTATE state;
 
 	if (--pAnim->aniDelta == 0) {
@@ -270,7 +270,7 @@
  * @param pAnim			Animation data structure
  * @param numFrames		Number of frames to skip
  */
-void SkipFrames(PANIM pAnim, int numFrames) {
+void SkipFrames(ANIM *pAnim, int numFrames) {
 	// get a pointer to the script
 	const ANI_SCRIPT *pAni = (const ANI_SCRIPT *)LockMem(pAnim->hScript);
 

Modified: scummvm/trunk/engines/tinsel/anim.h
===================================================================
--- scummvm/trunk/engines/tinsel/anim.h	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/anim.h	2008-07-23 10:27:24 UTC (rev 33235)
@@ -41,7 +41,6 @@
 	uint32 hScript;		//!< animation script handle
 	int scriptIndex;	//!< current position in animation script
 };
-typedef ANIM *PANIM;
 
 
 /*----------------------------------------------------------------------*\

Modified: scummvm/trunk/engines/tinsel/background.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/background.cpp	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/background.cpp	2008-07-23 10:27:24 UTC (rev 33235)
@@ -50,7 +50,7 @@
 
 void InitBackground(BACKGND *pBgnd) {
 	int i;			// playfield counter
-	PPLAYFIELD pPlayfield;	// pointer to current playfield
+	PLAYFIELD *pPlayfield;	// pointer to current playfield
 
 	// set current background
 	pCurBgnd = pBgnd;
@@ -87,7 +87,7 @@
  */
 
 void PlayfieldSetPos(int which, int newXpos, int newYpos) {
-	PPLAYFIELD pPlayfield;	// pointer to relavent playfield
+	PLAYFIELD *pPlayfield;	// pointer to relavent playfield
 
 	// make sure there is a background
 	assert(pCurBgnd != NULL);
@@ -114,7 +114,7 @@
  */
 
 void PlayfieldGetPos(int which, int *pXpos, int *pYpos) {
-	PPLAYFIELD pPlayfield;	// pointer to relavent playfield
+	PLAYFIELD *pPlayfield;	// pointer to relavent playfield
 
 	// make sure there is a background
 	assert(pCurBgnd != NULL);
@@ -136,7 +136,7 @@
  */
 
 OBJECT *GetPlayfieldList(int which) {
-	PPLAYFIELD pPlayfield;	// pointer to relavent playfield
+	PLAYFIELD *pPlayfield;	// pointer to relavent playfield
 
 	// make sure there is a background
 	assert(pCurBgnd != NULL);
@@ -159,7 +159,7 @@
 
 void DrawBackgnd(void) {
 	int i;			// playfield counter
-	PPLAYFIELD pPlay;	// playfield pointer
+	PLAYFIELD *pPlay;	// playfield pointer
 	int prevX, prevY;	// save interger part of position
 	Common::Point ptWin;	// window top left
 

Modified: scummvm/trunk/engines/tinsel/background.h
===================================================================
--- scummvm/trunk/engines/tinsel/background.h	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/background.h	2008-07-23 10:27:24 UTC (rev 33235)
@@ -53,9 +53,7 @@
 	short blkHeight;	//!< block height
 	SCNHANDLE hBlkBits;	//!< block bitmap handle
 };
-typedef BLOCK *PBLOCK;
 
-
 /** structure to define position of blocks, which block and which palette */
 struct BLK_INFO {
 	uint16 wBlkX;		//!< x position of this block
@@ -65,9 +63,7 @@
 	uint8 byBlkPal;		//!< which palette - index into "blkPals" for this block
 	int32 blkIndex;		//!< which block - index into "blocks"
 };
-typedef BLK_INFO *PBLK_INFO;
 
-
 /** background module structure - a module is a container for blocks */
 struct MODULE {
 	int modWidth;		//!< width of module
@@ -78,9 +74,7 @@
 	BLK_INFO *blkInfo;	//!< pointer to array of which block goes where
 						//!< NOTE: This array must be sorted on x position
 };
-typedef MODULE *PMODULE;
 
-
 /**
  * background module node structure - links a playfields modules together
  * and specifies each module position. It is done this way so that modules
@@ -92,9 +86,7 @@
 	char *onDispList;	//!< pointer to modules (block on object list) flags - should alloc 1 byte per block
 	Common::Point ptModPos;		//!< module world start position
 };
-typedef MOD_NODE *PMOD_NODE;
 
-
 /** background playfield structure - a playfield is a container for modules */
 struct PLAYFIELD {
 	MOD_NODE *pModNode;	//!< head of module node chain for this playfield
@@ -106,7 +98,6 @@
 	Common::Rect rcClip;	//!< clip rectangle for this playfield
 	bool bMoved;		//!< set when playfield has moved
 };
-typedef PLAYFIELD *PPLAYFIELD;
 
 /** multi-playfield background structure - a backgnd is a container of playfields */
 struct BACKGND {

Modified: scummvm/trunk/engines/tinsel/handle.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/handle.cpp	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/handle.cpp	2008-07-23 10:27:24 UTC (rev 33235)
@@ -57,7 +57,7 @@
 struct MEMHANDLE {
 	char szName[12];	//!< 00 - file name of graphics file
 	int32 filesize;		//!< 12 - file size and flags
-	PMEM_NODE pNode;	//!< 16 - memory node for the graphics
+	MEM_NODE *pNode;	//!< 16 - memory node for the graphics
 };
 
 

Modified: scummvm/trunk/engines/tinsel/heapmem.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/heapmem.cpp	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/heapmem.cpp	2008-07-23 10:27:24 UTC (rev 33235)
@@ -36,7 +36,7 @@
 MEM_NODE mnodeList[NUM_MNODES];
 
 // pointer to the linked list of free mnodes
-static PMEM_NODE pFreeMemNodes;
+static MEM_NODE *pFreeMemNodes;
 
 #ifdef DEBUG
 // diagnostic mnode counters
@@ -48,14 +48,14 @@
 static MEM_NODE heapSentinel;
 
 //
-static PMEM_NODE AllocMemNode(void);
+static MEM_NODE *AllocMemNode(void);
 
 
 /**
  * Initialises the memory manager.
  */
 void MemoryInit(void) {
-	PMEM_NODE pNode;
+	MEM_NODE *pNode;
 
 #ifdef DEBUG
 	// clear number of nodes in use
@@ -117,9 +117,9 @@
 /**
  * Allocate a mnode from the free list.
  */
-static PMEM_NODE AllocMemNode(void) {
+static MEM_NODE *AllocMemNode(void) {
 	// get the first free mnode
-	PMEM_NODE pMemNode = pFreeMemNodes;
+	MEM_NODE *pMemNode = pFreeMemNodes;
 
 	// make sure a mnode is available
 	assert(pMemNode); // Out of memory nodes
@@ -144,7 +144,7 @@
  * Return a mnode back to the free list.
  * @param pMemNode			Node of the memory object
  */
-void FreeMemNode(PMEM_NODE pMemNode) {
+void FreeMemNode(MEM_NODE *pMemNode) {
 	// validate mnode pointer
 	assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1);
 
@@ -168,8 +168,8 @@
  * @param bDiscard		When set - will discard blocks to fullfill the request
  */
 bool HeapCompact(long size, bool bDiscard) {
-	PMEM_NODE pHeap = &heapSentinel;
-	PMEM_NODE pPrev, pCur, pOldest;
+	MEM_NODE *pHeap = &heapSentinel;
+	MEM_NODE *pPrev, *pCur, *pOldest;
 	long largest;		// size of largest free block
 	uint32 oldest;		// time of the oldest discardable block
 
@@ -268,9 +268,9 @@
  * @param flags			Allocation attributes
  * @param size			Number of bytes to allocate
  */
-PMEM_NODE MemoryAlloc(int flags, long size) {
-	PMEM_NODE pHeap = &heapSentinel;
-	PMEM_NODE pNode;
+MEM_NODE *MemoryAlloc(int flags, long size) {
+	MEM_NODE *pHeap = &heapSentinel;
+	MEM_NODE *pNode;
 	bool bCompacted = true;	// set when heap has been compacted
 
 	// compact the heap if we are allocating fixed memory
@@ -297,13 +297,13 @@
 
 					if (flags & DWM_FIXED)
 						// lock the memory
-						return (PMEM_NODE)MemoryLock(pNode);
+						return (MEM_NODE *)MemoryLock(pNode);
 					else
 						// just return the node
 						return pNode;
 				} else {
 					// allocate a node for the remainder of the free block
-					PMEM_NODE pTemp = AllocMemNode();
+					MEM_NODE *pTemp = AllocMemNode();
 
 					// calc size of the free block
 					long freeSize = pNode->size - size;
@@ -326,7 +326,7 @@
 						if (flags & DWM_ZEROINIT)
 							memset(pNode->pBaseAddr, 0, size);
 
-						return (PMEM_NODE)MemoryLock(pNode);
+						return (MEM_NODE *)MemoryLock(pNode);
 					} else {
 						// place the free node before pNode
 						pTemp->pBaseAddr = pNode->pBaseAddr;
@@ -375,7 +375,7 @@
  * Discards the specified memory object.
  * @param pMemNode			Node of the memory object
  */
-void MemoryDiscard(PMEM_NODE pMemNode) {
+void MemoryDiscard(MEM_NODE *pMemNode) {
 	// validate mnode pointer
 	assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1);
 
@@ -387,7 +387,7 @@
 
 	if ((pMemNode->flags & DWM_DISCARDED) == 0) {
 		// allocate a free node to replace this node
-		PMEM_NODE pTemp = AllocMemNode();
+		MEM_NODE *pTemp = AllocMemNode();
 
 		// copy node data
 		memcpy(pTemp, pMemNode, sizeof(MEM_NODE));
@@ -423,8 +423,8 @@
  * Frees the specified memory object and invalidates its node.
  * @param pMemNode			Node of the memory object
  */
-void MemoryFree(PMEM_NODE pMemNode) {
-	PMEM_NODE pPrev, pNext;
+void MemoryFree(MEM_NODE *pMemNode) {
+	MEM_NODE *pPrev, *pNext;
 
 	// validate mnode pointer
 	assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1);
@@ -469,7 +469,7 @@
  * of the objects memory block.
  * @param pMemNode			Node of the memory object
  */
-void *MemoryLock(PMEM_NODE pMemNode) {
+void *MemoryLock(MEM_NODE *pMemNode) {
 	// validate mnode pointer
 	assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1);
 
@@ -493,8 +493,8 @@
  * @param size			New size of block
  * @param flags			How to reallocate the object
  */
-PMEM_NODE MemoryReAlloc(PMEM_NODE pMemNode, long size, int flags) {
-	PMEM_NODE pNew;
+MEM_NODE *MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
+	MEM_NODE *pNew;
 
 	// validate mnode pointer
 	assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1);
@@ -550,7 +550,7 @@
 
 	if (flags & DWM_FIXED)
 		// lock the memory
-		return (PMEM_NODE)MemoryLock(pMemNode);
+		return (MEM_NODE *)MemoryLock(pMemNode);
 	else
 		// just return the node
 		return pMemNode;
@@ -560,7 +560,7 @@
  * Unlocks a memory object.
  * @param pMemNode		Node of the memory object
  */
-void MemoryUnlock(PMEM_NODE pMemNode) {
+void MemoryUnlock(MEM_NODE *pMemNode) {
 	// validate mnode pointer
 	assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1);
 
@@ -578,8 +578,8 @@
  * Retrieves the mnode associated with the specified pointer to a memory object.
  * @param pMem			Address of memory object
  */
-PMEM_NODE MemoryHandle(void *pMem) {
-	PMEM_NODE pNode;
+MEM_NODE *MemoryHandle(void *pMem) {
+	MEM_NODE *pNode;
 	// search the DOS heap
 	for (pNode = heapSentinel.pNext; pNode != &heapSentinel; pNode = pNode->pNext) {
 		if (pNode->pBaseAddr == pMem)

Modified: scummvm/trunk/engines/tinsel/heapmem.h
===================================================================
--- scummvm/trunk/engines/tinsel/heapmem.h	2008-07-23 09:53:29 UTC (rev 33234)
+++ scummvm/trunk/engines/tinsel/heapmem.h	2008-07-23 10:27:24 UTC (rev 33235)
@@ -41,7 +41,6 @@
 	uint32 lruTime;		// time when memory object was last accessed
 	int flags;		// allocation attributes
 };
-typedef MEM_NODE *PMEM_NODE;
 
 // allocation flags for the MemoryAlloc function
 #define	DWM_FIXED	0x0001	// allocates fixed memory
@@ -71,35 +70,35 @@
 void MemoryStats(void);		// Shows the maximum number of mnodes used at once
 #endif
 
-PMEM_NODE MemoryAlloc(		// allocates the specified number of bytes from the heap
+MEM_NODE *MemoryAlloc(		// allocates the specified number of bytes from the heap
 	int flags,		// allocation attributes
 	long size);		// number of bytes to allocate
 
 void MemoryDiscard(		// discards the specified memory object
-	PMEM_NODE pMemNode);	// node of the memory object
+	MEM_NODE *pMemNode);	// node of the memory object
 
 int MemoryFlags(		// returns information about the specified memory object
-	PMEM_NODE pMemNode);	// node of the memory object
+	MEM_NODE *pMemNode);	// node of the memory object
 
 void MemoryFree(		// frees the specified memory object and invalidates its node
-	PMEM_NODE pMemNode);	// node of the memory object
+	MEM_NODE *pMemNode);	// node of the memory object
 
-PMEM_NODE MemoryHandle(		// Retrieves the mnode associated with the specified pointer to a memory object
+MEM_NODE *MemoryHandle(		// Retrieves the mnode associated with the specified pointer to a memory object
 	void *pMem);		// address of memory object
 
 void *MemoryLock(		// locks a memory object and returns a pointer to the first byte of the objects memory block
-	PMEM_NODE pMemNode);	// node of the memory object
+	MEM_NODE *pMemNode);	// node of the memory object
 
-PMEM_NODE MemoryReAlloc(	// changes the size or attributes of a specified memory object
-	PMEM_NODE pMemNode,	// node of the memory object
+MEM_NODE *MemoryReAlloc(	// changes the size or attributes of a specified memory object
+	MEM_NODE *pMemNode,	// node of the memory object
 	long size,		// new size of block
 	int flags);		// how to reallocate the object
 
 long MemorySize(		// returns the size, in bytes, of the specified memory object
-	PMEM_NODE pMemNode);	// node of the memory object
+	MEM_NODE *pMemNode);	// node of the memory object
 
 void MemoryUnlock(		// unlocks a memory object
-	PMEM_NODE pMemNode);	// node of the memory object
+	MEM_NODE *pMemNode);	// node of the memory object
 
 bool HeapCompact(		// Allocates the specified number of bytes from the specified heap
 	long size,		// number of bytes to free up


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