Fix warnings in fgrcc.cxx
The braces fix is apparently needed to avoid warnings due to a compiler bug, or at least missing feature (cf. [1] and [2]). The other one in std::accumulate() seems legitimate. [1] http://en.cppreference.com/w/cpp/container/array [2] https://stackoverflow.com/questions/14178264/c11-correct-stdarray-initialization
This commit is contained in:
parent
42821d6a63
commit
ed9f985f92
1 changed files with 12 additions and 8 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <type_traits> // std::underlying_type
|
||||
#include <stdexcept>
|
||||
#include <cstdlib>
|
||||
#include <cstddef> // std::size_t
|
||||
#include <clocale>
|
||||
#include <cstring>
|
||||
#include <cerrno>
|
||||
|
@ -136,14 +137,17 @@ bool ResourceDeclaration::isCompressed() const
|
|||
|
||||
// Initialization of static members
|
||||
const std::array<string, 2> ResourceBuilderXMLVisitor::_tagTypeStr = {
|
||||
"start", "end" };
|
||||
{"start",
|
||||
"end"}
|
||||
};
|
||||
const std::array<string, 5> ResourceBuilderXMLVisitor::_parserStateStr = {
|
||||
"before 'FGRCC' element",
|
||||
"inside 'FGRCC' element",
|
||||
"inside 'qresource' element",
|
||||
"inside 'file' element",
|
||||
"after 'FGRCC' element"
|
||||
};
|
||||
{"before 'FGRCC' element",
|
||||
"inside 'FGRCC' element",
|
||||
"inside 'qresource' element",
|
||||
"inside 'file' element",
|
||||
"after 'FGRCC' element"
|
||||
}
|
||||
};
|
||||
|
||||
ResourceBuilderXMLVisitor::ResourceBuilderXMLVisitor(const SGPath& rootDir)
|
||||
: _rootDir(rootDir)
|
||||
|
@ -707,7 +711,7 @@ using simgear::EmbeddedResourceManager;\n";
|
|||
|
||||
// Print the total size of resources
|
||||
std::size_t staticMemoryUsedByResources = std::accumulate(
|
||||
resSizeInBytes.begin(), resSizeInBytes.end(), 0);
|
||||
resSizeInBytes.begin(), resSizeInBytes.end(), std::size_t(0));
|
||||
LOG("static memory used by resources (total): " <<
|
||||
prettyPrintNbOfBytes(staticMemoryUsedByResources));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue