From f1dd53de020ee2f408629c313d637cab1165ace5 Mon Sep 17 00:00:00 2001 From: carterl Date: Fri, 13 Feb 2015 03:27:14 +0100 Subject: [PATCH] Silence warnings of MinGW builds. 1. Remove initializers of out parameters: warning: missing initializer for member '_SYSTEM_INFO::dwPageSize' [-Wmissing-field-initializers] 2. Rename a local variable: warning: declaration of 'size' shadows a member of 'this' [-Wshadow] --- posix.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/posix.cc b/posix.cc index 63b37c37..43a6d15e 100644 --- a/posix.cc +++ b/posix.cc @@ -148,13 +148,13 @@ void fmt::File::close() { fmt::LongLong fmt::File::size() const { #ifdef _WIN32 - LARGE_INTEGER size = {}; + LARGE_INTEGER filesize; HANDLE handle = reinterpret_cast(_get_osfhandle(fd_)); - if (!FMT_SYSTEM(GetFileSizeEx(handle, &size))) + if (!FMT_SYSTEM(GetFileSizeEx(handle, &filesize))) throw WindowsError(GetLastError(), "cannot get file size"); - FMT_STATIC_ASSERT(sizeof(fmt::LongLong) >= sizeof(size.QuadPart), + FMT_STATIC_ASSERT(sizeof(fmt::LongLong) >= sizeof(filesize.QuadPart), "return type of File::size is not large enough"); - return size.QuadPart; + return filesize.QuadPart; #else typedef struct stat Stat; Stat file_stat = Stat(); @@ -243,7 +243,7 @@ fmt::BufferedFile fmt::File::fdopen(const char *mode) { long fmt::getpagesize() { #ifdef _WIN32 - SYSTEM_INFO si = {}; + SYSTEM_INFO si; GetSystemInfo(&si); return si.dwPageSize; #else