From 804805d35a87c2acc9425d1762ad26b1ba2ec9ac Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Wed, 29 Jul 2015 09:04:03 -0600 Subject: Silenced and fixed many warning messages across multiple files. --- src/OSSupport/File.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/OSSupport/File.cpp') diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index 6327b3505..03cddc408 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -156,7 +156,7 @@ int cFile::Read (void * iBuffer, size_t iNumBytes) return -1; } - return (int)fread(iBuffer, 1, (size_t)iNumBytes, m_File); // fread() returns the portion of Count parameter actually read, so we need to send iNumBytes as Count + return static_cast(fread(iBuffer, 1, static_cast(iNumBytes), m_File)); // fread() returns the portion of Count parameter actually read, so we need to send iNumBytes as Count } @@ -172,7 +172,7 @@ int cFile::Write(const void * iBuffer, size_t iNumBytes) return -1; } - int res = (int)fwrite(iBuffer, 1, (size_t)iNumBytes, m_File); // fwrite() returns the portion of Count parameter actually written, so we need to send iNumBytes as Count + int res = static_cast(fwrite(iBuffer, 1, static_cast(iNumBytes), m_File)); // fwrite() returns the portion of Count parameter actually written, so we need to send iNumBytes as Count return res; } @@ -236,7 +236,7 @@ long cFile::GetSize(void) const return -1; } long res = Tell(); - if (fseek(m_File, (long)CurPos, SEEK_SET) != 0) + if (fseek(m_File, static_cast(CurPos), SEEK_SET) != 0) { return -1; } @@ -272,7 +272,7 @@ int cFile::ReadRestOfFile(AString & a_Contents) // HACK: This depends on the internal knowledge that AString's data() function returns the internal buffer directly a_Contents.assign(DataSize, '\0'); - return Read((void *)a_Contents.data(), DataSize); + return Read(reinterpret_cast(const_cast(a_Contents.data())), DataSize); } @@ -366,7 +366,7 @@ long cFile::GetSize(const AString & a_FileName) struct stat st; if (stat(a_FileName.c_str(), &st) == 0) { - return (int)st.st_size; + return static_cast(st.st_size); } return -1; } -- cgit v1.2.3