fixed clang warning about uninitialized values

This commit is contained in:
gabime
2018-03-17 14:08:10 +02:00
parent 200815892f
commit 18c99682a8
2 changed files with 7 additions and 3 deletions

View File

@@ -238,13 +238,17 @@ inline size_t filesize(FILE *f)
int fd = fileno(f);
// 64 bits(but not in osx or cygwin, where fstat64 is deprecated)
#if !defined(__FreeBSD__) && !defined(__APPLE__) && (defined(__x86_64__) || defined(__ppc64__)) && !defined(__CYGWIN__)
struct stat64 st;
struct stat64 st
{
};
if (fstat64(fd, &st) == 0)
{
return static_cast<size_t>(st.st_size);
}
#else // unix 32 bits or cygwin
struct stat st;
struct stat st
{
};
if (fstat(fd, &st) == 0)
{
return static_cast<size_t>(st.st_size);