aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-10-26 16:01:12 +0000
committerMax Horn2009-10-26 16:01:12 +0000
commitb9534216edd6d95ec94ac342c8a612e7a59f9289 (patch)
treea343ff5aa69ee667a7c8e532517fd6ce1b9e5edb
parentb0b1ab70c3a5f71d2c62dcc178611ef51cb0428b (diff)
downloadscummvm-rg350-b9534216edd6d95ec94ac342c8a612e7a59f9289.tar.gz
scummvm-rg350-b9534216edd6d95ec94ac342c8a612e7a59f9289.tar.bz2
scummvm-rg350-b9534216edd6d95ec94ac342c8a612e7a59f9289.zip
TINSEL: Remove MemoryHandle(), some unneeded #includes and the return value of MemoryReAlloc()
svn-id: r45408
-rw-r--r--engines/tinsel/bmv.cpp1
-rw-r--r--engines/tinsel/handle.cpp4
-rw-r--r--engines/tinsel/heapmem.cpp22
-rw-r--r--engines/tinsel/heapmem.h5
-rw-r--r--engines/tinsel/savescn.cpp1
5 files changed, 3 insertions, 30 deletions
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index 23a9370018..6f5358760a 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -34,7 +34,6 @@
#include "tinsel/font.h"
#include "tinsel/graphics.h"
#include "tinsel/handle.h"
-#include "tinsel/heapmem.h"
#include "tinsel/multiobj.h"
#include "tinsel/sched.h"
#include "tinsel/strres.h"
diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index 87989a6edb..5ea273379c 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -170,9 +170,7 @@ void SetupHandleTable(void) {
#endif
else {
// allocate a discarded memory node for other files
- pH->_node = MemoryAlloc(
- DWM_DISCARDABLE | DWM_NOALLOC,
- pH->filesize & FSIZE_MASK);
+ pH->_node = MemoryAlloc(DWM_DISCARDABLE | DWM_NOALLOC, pH->filesize & FSIZE_MASK);
pH->_ptr = NULL;
// make sure memory allocated
diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp
index aaf2405c8a..bc4183ce35 100644
--- a/engines/tinsel/heapmem.cpp
+++ b/engines/tinsel/heapmem.cpp
@@ -430,7 +430,7 @@ void *MemoryLock(MEM_NODE *pMemNode) {
* @param size New size of block
* @param flags How to reallocate the object
*/
-MEM_NODE *MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
+void MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
MEM_NODE *pNew;
// validate mnode pointer
@@ -471,9 +471,6 @@ MEM_NODE *MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
// free the new node
FreeMemNode(pNew);
}
-
- // return the node
- return pMemNode;
}
/**
@@ -494,21 +491,4 @@ void MemoryUnlock(MEM_NODE *pMemNode) {
pMemNode->lruTime = DwGetCurrentTime();
}
-/**
- * Retrieves the mnode associated with the specified pointer to a memory object.
- * @param pMem Address of memory object
- */
-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)
- // found it
- return pNode;
- }
-
- // not found if we get to here
- return NULL;
-}
-
} // End of namespace Tinsel
diff --git a/engines/tinsel/heapmem.h b/engines/tinsel/heapmem.h
index 4d508edbba..c7631da8ce 100644
--- a/engines/tinsel/heapmem.h
+++ b/engines/tinsel/heapmem.h
@@ -69,13 +69,10 @@ void *MemoryAllocFixed(long size);
void MemoryDiscard( // discards the specified memory object
MEM_NODE *pMemNode); // node of the 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
MEM_NODE *pMemNode); // node of the memory object
-MEM_NODE *MemoryReAlloc( // changes the size or attributes of a specified memory object
+void 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
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index 16634b321b..ed845c59f7 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -33,7 +33,6 @@
#include "tinsel/faders.h" // FadeOutFast()
#include "tinsel/graphics.h" // ClearScreen()
#include "tinsel/handle.h"
-#include "tinsel/heapmem.h"
#include "tinsel/dialogs.h"
#include "tinsel/music.h"
#include "tinsel/pid.h"