1
0

Properly fix cFile Warnings

This commit is contained in:
tycho 2015-05-19 13:33:34 +01:00
parent fa4fb75e03
commit 6cccd2aabb
2 changed files with 11 additions and 11 deletions

View File

@ -180,7 +180,7 @@ int cFile::Write(const void * iBuffer, size_t iNumBytes)
int cFile::Seek (int iPosition)
long cFile::Seek (int iPosition)
{
ASSERT(IsOpen());
@ -193,7 +193,7 @@ int cFile::Seek (int iPosition)
{
return -1;
}
return (int)ftell(m_File);
return ftell(m_File);
}
@ -201,7 +201,7 @@ int cFile::Seek (int iPosition)
ssize_t cFile::Tell (void) const
long cFile::Tell (void) const
{
ASSERT(IsOpen());
@ -217,7 +217,7 @@ ssize_t cFile::Tell (void) const
ssize_t cFile::GetSize(void) const
long cFile::GetSize(void) const
{
ASSERT(IsOpen());
@ -226,7 +226,7 @@ ssize_t cFile::GetSize(void) const
return -1;
}
ssize_t CurPos = Tell();
long CurPos = Tell();
if (CurPos < 0)
{
return -1;
@ -235,7 +235,7 @@ ssize_t cFile::GetSize(void) const
{
return -1;
}
ssize_t res = Tell();
long res = Tell();
if (fseek(m_File, (long)CurPos, SEEK_SET) != 0)
{
return -1;
@ -361,7 +361,7 @@ bool cFile::IsFile(const AString & a_Path)
ssize_t cFile::GetSize(const AString & a_FileName)
long cFile::GetSize(const AString & a_FileName)
{
struct stat st;
if (stat(a_FileName.c_str(), &st) == 0)

View File

@ -87,13 +87,13 @@ public:
int Write(const void * iBuffer, size_t iNumBytes);
/** Seeks to iPosition bytes from file start, returns old position or -1 for failure; asserts if not open */
int Seek (int iPosition);
long Seek (int iPosition);
/** Returns the current position (bytes from file start) or -1 for failure; asserts if not open */
ssize_t Tell (void) const;
long Tell (void) const;
/** Returns the size of file, in bytes, or -1 for failure; asserts if not open */
ssize_t GetSize(void) const;
long GetSize(void) const;
/** Reads the file from current position till EOF into an AString; returns the number of bytes read or -1 for error */
int ReadRestOfFile(AString & a_Contents);
@ -119,7 +119,7 @@ public:
static bool IsFile(const AString & a_Path);
/** Returns the size of the file, or a negative number on error */
static ssize_t GetSize(const AString & a_FileName);
static long GetSize(const AString & a_FileName);
/** Creates a new folder with the specified name. Returns true if successful. Path may be relative or absolute */
static bool CreateFolder(const AString & a_FolderPath);