From 0efbd42aa3310c9bc9f96cc8c6f97b9cdebac228 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 24 Nov 2008 07:52:55 +0000 Subject: [PATCH] Make explicit the conversion from 64 bits to 32 bits. In the case of files, perhaps we should be using an appropriate type such as off_t rather than int. I am not sure if anyone would actually want to use files larger than 2 GB with SM, but it seems possible while using .smzip. --- stepmania/src/RageFileDriverDirect.cpp | 6 +++--- stepmania/src/RageFileDriverDirectHelpers.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageFileDriverDirect.cpp b/stepmania/src/RageFileDriverDirect.cpp index 36964bc4e8..1740937824 100644 --- a/stepmania/src/RageFileDriverDirect.cpp +++ b/stepmania/src/RageFileDriverDirect.cpp @@ -429,14 +429,14 @@ int RageFileObjDirect::WriteInternal( const void *pBuf, size_t iBytes ) int RageFileObjDirect::SeekInternal( int iOffset ) { - return lseek( m_iFD, iOffset, SEEK_SET ); + return (int)lseek( m_iFD, iOffset, SEEK_SET ); } int RageFileObjDirect::GetFileSize() const { - const int iOldPos = lseek( m_iFD, 0, SEEK_CUR ); + const int iOldPos = (int)lseek( m_iFD, 0, SEEK_CUR ); ASSERT_M( iOldPos != -1, ssprintf("\"%s\": %s", m_sPath.c_str(), strerror(errno)) ); - const int iRet = lseek( m_iFD, 0, SEEK_END ); + const int iRet = (int)lseek( m_iFD, 0, SEEK_END ); ASSERT_M( iRet != -1, ssprintf("\"%s\": %s", m_sPath.c_str(), strerror(errno)) ); lseek( m_iFD, iOldPos, SEEK_SET ); return iRet; diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index 91f4a33880..d3dfb05f73 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -278,7 +278,7 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path ) else { f.dir = (st.st_mode & S_IFDIR); - f.size = st.st_size; + f.size = (int)st.st_size; f.hash = st.st_mtime; }