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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Jan 14 00:58:25 CET 2010


Revision: 47295
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47295&view=rev
Author:   fingolfin
Date:     2010-01-13 23:58:25 +0000 (Wed, 13 Jan 2010)

Log Message:
-----------
SCI: Use prefix increment instead of postfix on iterators (more efficient); also correct code formatting issues

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/resource.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-01-13 23:57:53 UTC (rev 47294)
+++ scummvm/trunk/engines/sci/console.cpp	2010-01-13 23:58:25 UTC (rev 47295)
@@ -766,7 +766,7 @@
 				if (++cnt % 4 == 0)
 					DebugPrintf("\n");
 			}
-			itr++;
+			++itr;
 		}
 		DebugPrintf("\n");
 

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-01-13 23:57:53 UTC (rev 47294)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-01-13 23:58:25 UTC (rev 47295)
@@ -309,7 +309,7 @@
 			}
 			return file;
 		}
-		it ++;
+		++it;
 	}
 	// adding a new file
 	file = new Common::File;
@@ -468,7 +468,7 @@
 		else if (Common::File::exists("RESOURCE.AUD"))
 			addSource(src, kSourceAudioVolume, "RESOURCE.AUD", 0);
 
-		itr++;
+		++itr;
 	}
 
 	return 1;
@@ -576,14 +576,14 @@
 	ResourceMap::iterator itr = _resMap.begin();
 	while (itr != _resMap.end()) {
 		delete itr->_value;
-		itr ++;
+		++itr;
 	}
 	freeResourceSources();
 
 	Common::List<Common::File *>::iterator it = _volumeFiles.begin();
 	while (it != _volumeFiles.end()) {
 		delete *it;
-		it ++;
+		++it;
 	}
 }
 
@@ -622,8 +622,8 @@
 		res = *it;
 		debug("\t%s: %d bytes", res->id.toString().c_str(), res->size);
 		mem += res->size;
-		entries ++;
-		it ++;
+		++entries;
+		++it;
 	}
 
 	debug("Total: %d entries, %d bytes (mgr says %d)", entries, mem, _memoryLRU);
@@ -648,7 +648,7 @@
 	while (itr != _resMap.end()) {
 		if ((itr->_value->id.type == type) && ((mapNumber == -1) || (itr->_value->id.number == mapNumber)))
 			resources->push_back(itr->_value->id);
-		itr++;
+		++itr;
 	}
 
 	return resources;
@@ -984,7 +984,7 @@
 	const char *szResType;
 	ResourceSource *psrcPatch;
 
-	for (int i = kResourceTypeView; i < kResourceTypeInvalid; i ++) {
+	for (int i = kResourceTypeView; i < kResourceTypeInvalid; ++i) {
 		files.clear();
 		szResType = getResourceTypeName((ResourceType)i);
 		// SCI0 naming - type.nnn
@@ -995,7 +995,7 @@
 		mask = "*.";
 		mask += resourceTypeSuffixes[i];
 		SearchMan.listMatchingMembers(files, mask);
-		for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); x++) {
+		for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
 			bool bAdd = false;
 			name = (*x)->getName();
 			// SCI1 scheme
@@ -1027,7 +1027,7 @@
 	Common::ArchiveMemberList files;
 	SearchMan.listMatchingMembers(files, "*.wav");
 
-	for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); x++) {
+	for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
 		Common::String name = (*x)->getName();
 
 		if (isdigit(name[0])) {


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