[Scummvm-cvs-logs] SF.net SVN: scummvm: [22184] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Apr 26 07:37:02 CEST 2006


Revision: 22184
Author:   fingolfin
Date:     2006-04-26 07:35:53 -0700 (Wed, 26 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22184&view=rev

Log Message:
-----------
Use File::size to determine the size of a file, instead of doing a seek(0, SEEK_END)

Modified Paths:
--------------
    scummvm/trunk/common/unzip.cpp
    scummvm/trunk/engines/simon/sound.cpp
Modified: scummvm/trunk/common/unzip.cpp
===================================================================
--- scummvm/trunk/common/unzip.cpp	2006-04-26 14:05:34 UTC (rev 22183)
+++ scummvm/trunk/common/unzip.cpp	2006-04-26 14:35:53 UTC (rev 22184)
@@ -256,13 +256,10 @@
 	uLong uMaxBack=0xffff; /* maximum size of global comment */
 	uLong uPosFound=0;
 
-	fin.seek(0, SEEK_END);
+	uSizeFile = fin.size();
 	if (fin.ioFailed())
 		return 0;
 
-
-	uSizeFile = fin.pos();
-
 	if (uMaxBack>uSizeFile)
 		uMaxBack = uSizeFile;
 

Modified: scummvm/trunk/engines/simon/sound.cpp
===================================================================
--- scummvm/trunk/engines/simon/sound.cpp	2006-04-26 14:05:34 UTC (rev 22183)
+++ scummvm/trunk/engines/simon/sound.cpp	2006-04-26 14:35:53 UTC (rev 22184)
@@ -109,8 +109,7 @@
 	}
 
 	// only needed for mp3
-	_file->seek(0, SEEK_END);
-	_offsets[res] = _file->pos();
+	_offsets[res] = _file->size();
 }
 
 BaseSound::BaseSound(Audio::Mixer *mixer, File *file, uint32 *offsets, bool bigendian) {
@@ -317,9 +316,7 @@
 		// for simon2 mac/amiga, only read index file
 		file->open("voices.idx");
 		if (file->isOpen() == true) {
-			file->seek(0, SEEK_END);
-			int end = file->pos();
-			file->seek(0, SEEK_SET);
+			int end = file->size();
 			_filenums = (uint16 *)malloc((end / 6 + 1) * 2);
 			_offsets = (uint32 *)malloc((end / 6 + 1) * 4);
 


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