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.

This commit is contained in:
Steve Checkoway
2008-11-24 07:52:55 +00:00
parent 3a38e28fac
commit 0efbd42aa3
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -429,14 +429,14 @@ int RageFileObjDirect::WriteInternal( const void *pBuf, size_t iBytes )
int RageFileObjDirect::SeekInternal( int iOffset ) int RageFileObjDirect::SeekInternal( int iOffset )
{ {
return lseek( m_iFD, iOffset, SEEK_SET ); return (int)lseek( m_iFD, iOffset, SEEK_SET );
} }
int RageFileObjDirect::GetFileSize() const 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)) ); 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)) ); ASSERT_M( iRet != -1, ssprintf("\"%s\": %s", m_sPath.c_str(), strerror(errno)) );
lseek( m_iFD, iOldPos, SEEK_SET ); lseek( m_iFD, iOldPos, SEEK_SET );
return iRet; return iRet;
@@ -278,7 +278,7 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path )
else else
{ {
f.dir = (st.st_mode & S_IFDIR); f.dir = (st.st_mode & S_IFDIR);
f.size = st.st_size; f.size = (int)st.st_size;
f.hash = st.st_mtime; f.hash = st.st_mtime;
} }