[Scummvm-cvs-logs] scummvm master -> 5c504739bd16b4a3eecd57b117010baad0d3ef1d

bluegr md5 at scummvm.org
Wed Mar 9 22:34:47 CET 2011


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:
5c504739bd SCI: Removed unnecessary parameter from deallocate()


Commit: 5c504739bd16b4a3eecd57b117010baad0d3ef1d
    https://github.com/scummvm/scummvm/commit/5c504739bd16b4a3eecd57b117010baad0d3ef1d
Author: md5 (md5 at scummvm.org)
Date: 2011-03-09T13:33:26-08:00

Commit Message:
SCI: Removed unnecessary parameter from deallocate()

Changed paths:
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/seg_manager.h



diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index c75ceab..2be3184 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -63,7 +63,7 @@ void SegManager::resetSegMan() {
 	// Free memory
 	for (uint i = 0; i < _heap.size(); i++) {
 		if (_heap[i])
-			deallocate(i, false);
+			deallocate(i);
 	}
 
 	_heap.clear();
@@ -151,7 +151,7 @@ Script *SegManager::allocateScript(int script_nr, SegmentId *segid) {
 	return (Script *)mem;
 }
 
-void SegManager::deallocate(SegmentId seg, bool recursive) {
+void SegManager::deallocate(SegmentId seg) {
 	VERIFY(check(seg), "invalid seg id");
 
 	SegmentObj *mobj = _heap[seg];
@@ -159,8 +159,8 @@ void SegManager::deallocate(SegmentId seg, bool recursive) {
 	if (mobj->getType() == SEG_TYPE_SCRIPT) {
 		Script *scr = (Script *)mobj;
 		_scriptSegMap.erase(scr->getScriptNumber());
-		if (recursive && scr->_localsSegment)
-			deallocate(scr->_localsSegment, recursive);
+		if (scr->_localsSegment)
+			deallocate(scr->_localsSegment);
 	}
 
 	delete mobj;
@@ -176,8 +176,7 @@ bool SegManager::isHeapObject(reg_t pos) const {
 }
 
 void SegManager::deallocateScript(int script_nr) {
-	SegmentId seg = getScriptSegment(script_nr);
-	deallocate(seg, true);
+	deallocate(getScriptSegment(script_nr));
 }
 
 Script *SegManager::getScript(const SegmentId seg) {
@@ -864,7 +863,7 @@ bool SegManager::freeDynmem(reg_t addr) {
 	if (addr.segment < 1 || addr.segment >= _heap.size() || !_heap[addr.segment] || _heap[addr.segment]->getType() != SEG_TYPE_DYNMEM)
 		return false; // error
 
-	deallocate(addr.segment, true);
+	deallocate(addr.segment);
 
 	return true; // OK
 }
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 61fa2e2..58c88ca 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -477,7 +477,7 @@ private:
 
 private:
 	SegmentObj *allocSegment(SegmentObj *mem, SegmentId *segid);
-	void deallocate(SegmentId seg, bool recursive);
+	void deallocate(SegmentId seg);
 	void createClassTable();
 
 	SegmentId findFreeSegment() const;






More information about the Scummvm-git-logs mailing list