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]
This commit is contained in:
carterl 2015-02-13 03:27:14 +01:00
parent 22816b08f7
commit f1dd53de02

View File

@ -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<HANDLE>(_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