Skip to content

Commit 2ba1c40

Browse files
StandardFile: don't use auto where unnecessary
1 parent 1aa0f40 commit 2ba1c40

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Platforms/Basic/src/StandardFile.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ StandardFile::StandardFile(const FileOpenAttribs& OpenAttribs) :
3737
m_pFile{nullptr}
3838
{
3939
#if PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_WEB
40-
auto OpenModeStr = GetOpenModeStr();
41-
m_pFile = fopen(m_OpenAttribs.strFilePath, OpenModeStr.c_str());
40+
String OpenModeStr = GetOpenModeStr();
41+
m_pFile = fopen(m_OpenAttribs.strFilePath, OpenModeStr.c_str());
4242
if (m_pFile == nullptr)
4343
{
4444
LOG_ERROR_AND_THROW("Failed to open file ", m_OpenAttribs.strFilePath,
@@ -59,7 +59,7 @@ StandardFile::~StandardFile()
5959
bool StandardFile::Read(IDataBlob* pData)
6060
{
6161
VERIFY_EXPR(pData != nullptr);
62-
auto FileSize = GetSize();
62+
size_t FileSize = GetSize();
6363
pData->Resize(FileSize);
6464
return Read(pData->GetDataPtr(), pData->GetSize());
6565
}
@@ -69,7 +69,7 @@ bool StandardFile::Read(void* Data, size_t Size)
6969
VERIFY(m_pFile, "File is not opened");
7070
if (!m_pFile)
7171
return false;
72-
auto BytesRead = fread(Data, 1, Size, m_pFile);
72+
size_t BytesRead = fread(Data, 1, Size, m_pFile);
7373

7474
return BytesRead == Size;
7575
}
@@ -79,17 +79,17 @@ bool StandardFile::Write(const void* Data, size_t Size)
7979
VERIFY(m_pFile, "File is not opened");
8080
if (!m_pFile)
8181
return false;
82-
auto BytesWritten = fwrite(Data, 1, Size, m_pFile);
82+
size_t BytesWritten = fwrite(Data, 1, Size, m_pFile);
8383

8484
return BytesWritten == Size;
8585
}
8686

8787
size_t StandardFile::GetSize()
8888
{
8989
VERIFY(m_pFile, "File is not opened");
90-
auto OrigPos = ftell(m_pFile);
90+
long OrigPos = ftell(m_pFile);
9191
fseek(m_pFile, 0, SEEK_END);
92-
auto FileSize = ftell(m_pFile);
92+
long FileSize = ftell(m_pFile);
9393

9494
fseek(m_pFile, OrigPos, SEEK_SET);
9595
return FileSize;

0 commit comments

Comments
 (0)