[Scummvm-cvs-logs] SF.net SVN: scummvm:[50439] scummvm/trunk/engines/sci/engine

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jun 28 14:28:13 CEST 2010


Revision: 50439
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50439&view=rev
Author:   fingolfin
Date:     2010-06-28 12:28:12 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
SCI: Make various SegManager const

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.h

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2010-06-28 12:27:48 UTC (rev 50438)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2010-06-28 12:28:12 UTC (rev 50439)
@@ -168,7 +168,7 @@
 	return 1;
 }
 
-bool SegManager::isHeapObject(reg_t pos) {
+bool SegManager::isHeapObject(reg_t pos) const {
 	const Object *obj = getObject(pos);
 	if (obj == NULL || (obj && obj->isFreed()))
 		return false;
@@ -194,36 +194,36 @@
 	return (Script *)_heap[seg];
 }
 
-Script *SegManager::getScriptIfLoaded(const SegmentId seg) {
+Script *SegManager::getScriptIfLoaded(const SegmentId seg) const {
 	if (seg < 1 || (uint)seg >= _heap.size() || !_heap[seg] || _heap[seg]->getType() != SEG_TYPE_SCRIPT)
 		return 0;
 	return (Script *)_heap[seg];
 }
 
-SegmentId SegManager::findSegmentByType(int type) {
+SegmentId SegManager::findSegmentByType(int type) const {
 	for (uint i = 0; i < _heap.size(); i++)
 		if (_heap[i] && _heap[i]->getType() == type)
 			return i;
 	return 0;
 }
 
-SegmentObj *SegManager::getSegmentObj(SegmentId seg) {
+SegmentObj *SegManager::getSegmentObj(SegmentId seg) const {
 	if (seg < 1 || (uint)seg >= _heap.size() || !_heap[seg])
 		return 0;
 	return _heap[seg];
 }
 
-SegmentType SegManager::getSegmentType(SegmentId seg) {
+SegmentType SegManager::getSegmentType(SegmentId seg) const {
 	if (seg < 1 || (uint)seg >= _heap.size() || !_heap[seg])
 		return SEG_TYPE_INVALID;
 	return _heap[seg]->getType();
 }
 
-SegmentObj *SegManager::getSegment(SegmentId seg, SegmentType type) {
+SegmentObj *SegManager::getSegment(SegmentId seg, SegmentType type) const {
 	return getSegmentType(seg) == type ? _heap[seg] : NULL;
 }
 
-Object *SegManager::getObject(reg_t pos) {
+Object *SegManager::getObject(reg_t pos) const {
 	SegmentObj *mobj = getSegmentObj(pos.segment);
 	Object *obj = NULL;
 

Modified: scummvm/trunk/engines/sci/engine/seg_manager.h
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.h	2010-06-28 12:27:48 UTC (rev 50438)
+++ scummvm/trunk/engines/sci/engine/seg_manager.h	2010-06-28 12:28:12 UTC (rev 50439)
@@ -161,7 +161,7 @@
 	 * @param seg	ID of the script segment to check for
 	 * @return		A pointer to the Script object, or NULL
 	 */
-	Script *getScriptIfLoaded(SegmentId seg);
+	Script *getScriptIfLoaded(SegmentId seg) const;
 
 	// 2. Clones
 
@@ -387,33 +387,33 @@
 	 * @param type	The type of the segment to find
 	 * @return		The segment number, or -1 if the segment wasn't found
 	 */
-	SegmentId findSegmentByType(int type);
+	SegmentId findSegmentByType(int type) const;
 
 	// TODO: document this
-	SegmentObj *getSegmentObj(SegmentId seg);
+	SegmentObj *getSegmentObj(SegmentId seg) const;
 
 	// TODO: document this
-	SegmentType getSegmentType(SegmentId seg);
+	SegmentType getSegmentType(SegmentId seg) const;
 
 	// TODO: document this
-	SegmentObj *getSegment(SegmentId seg, SegmentType type);
+	SegmentObj *getSegment(SegmentId seg, SegmentType type) const;
 
 	/**
 	 * Retrieves an object from the specified location
 	 * @param[in] offset	Location (segment, offset) of the object
 	 * @return				The object in question, or NULL if there is none
 	 */
-	Object *getObject(reg_t pos);
+	Object *getObject(reg_t pos) const;
 
 	/**
 	 * Checks whether a heap address contains an object
 	 * @parm obj The address to check
 	 * @return True if it is an object, false otherwise
 	 */
-	bool isObject(reg_t obj) { return getObject(obj) != NULL; }
+	bool isObject(reg_t obj) const { return getObject(obj) != NULL; }
 
 	// TODO: document this
-	bool isHeapObject(reg_t pos);
+	bool isHeapObject(reg_t pos) const;
 
 	/**
 	 * Determines the name of an object


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