CPack: Fix dashboard errors and warnings (#11575)
...revealed by the Nightly dashboard runs last night. Use "size_t" instead of "std::size_t" so that it compiles with Visual Studio 6, too. Fix warnings about shadowed "tmp" local variable and ordering of member variables vs. lines of code in the constructor initializer list.
This commit is contained in:
parent
ad0f73573f
commit
a74bd470a4
|
@ -185,7 +185,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::stringstream objectFiles;
|
std::stringstream objectFiles;
|
||||||
for(std::size_t i = 0; i < wixSources.size(); ++i)
|
for(size_t i = 0; i < wixSources.size(); ++i)
|
||||||
{
|
{
|
||||||
const std::string& sourceFilename = wixSources[i];
|
const std::string& sourceFilename = wixSources[i];
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
|
||||||
install_root.pop_back();
|
install_root.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::size_t i = 1; i < install_root.size(); ++i)
|
for(size_t i = 1; i < install_root.size(); ++i)
|
||||||
{
|
{
|
||||||
directoryDefinitions.BeginElement("Directory");
|
directoryDefinitions.BeginElement("Directory");
|
||||||
|
|
||||||
|
@ -300,16 +300,16 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::stringstream tmp;
|
std::stringstream ss;
|
||||||
tmp << "INSTALL_PREFIX_" << i;
|
ss << "INSTALL_PREFIX_" << i;
|
||||||
directoryDefinitions.AddAttribute("Id", tmp.str());
|
directoryDefinitions.AddAttribute("Id", ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
directoryDefinitions.AddAttribute("Name", install_root[i]);
|
directoryDefinitions.AddAttribute("Name", install_root[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t directoryCounter = 0;
|
size_t directoryCounter = 0;
|
||||||
std::size_t fileCounter = 0;
|
size_t fileCounter = 0;
|
||||||
|
|
||||||
std::string fileDefinitionsFilename =
|
std::string fileDefinitionsFilename =
|
||||||
cpackTopLevel + "/files.wxs";
|
cpackTopLevel + "/files.wxs";
|
||||||
|
@ -345,7 +345,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
|
||||||
featureDefinitions.EndElement();
|
featureDefinitions.EndElement();
|
||||||
fileDefinitions.EndElement();
|
fileDefinitions.EndElement();
|
||||||
|
|
||||||
for(std::size_t i = 1; i < install_root.size(); ++i)
|
for(size_t i = 1; i < install_root.size(); ++i)
|
||||||
{
|
{
|
||||||
directoryDefinitions.EndElement();
|
directoryDefinitions.EndElement();
|
||||||
}
|
}
|
||||||
|
@ -431,13 +431,13 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
|
||||||
cmWIXSourceWriter& directoryDefinitions,
|
cmWIXSourceWriter& directoryDefinitions,
|
||||||
cmWIXSourceWriter& fileDefinitions,
|
cmWIXSourceWriter& fileDefinitions,
|
||||||
cmWIXSourceWriter& featureDefinitions,
|
cmWIXSourceWriter& featureDefinitions,
|
||||||
std::size_t& directoryCounter,
|
size_t& directoryCounter,
|
||||||
std::size_t& fileCounter)
|
size_t& fileCounter)
|
||||||
{
|
{
|
||||||
cmsys::Directory dir;
|
cmsys::Directory dir;
|
||||||
dir.Load(topdir.c_str());
|
dir.Load(topdir.c_str());
|
||||||
|
|
||||||
for(std::size_t i = 0; i < dir.GetNumberOfFiles(); ++i)
|
for(size_t i = 0; i < dir.GetNumberOfFiles(); ++i)
|
||||||
{
|
{
|
||||||
std::string fileName = dir.GetFile(static_cast<unsigned long>(i));
|
std::string fileName = dir.GetFile(static_cast<unsigned long>(i));
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,8 @@ private:
|
||||||
cmWIXSourceWriter& directoryDefinitions,
|
cmWIXSourceWriter& directoryDefinitions,
|
||||||
cmWIXSourceWriter& fileDefinitions,
|
cmWIXSourceWriter& fileDefinitions,
|
||||||
cmWIXSourceWriter& featureDefinitions,
|
cmWIXSourceWriter& featureDefinitions,
|
||||||
std::size_t& directoryCounter,
|
size_t& directoryCounter,
|
||||||
std::size_t& fileCounter);
|
size_t& fileCounter);
|
||||||
|
|
||||||
bool RequireOption(const std::string& name, std::string& value) const;
|
bool RequireOption(const std::string& name, std::string& value) const;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ void cmWIXRichTextFormatWriter::AddText(const std::string& text)
|
||||||
{
|
{
|
||||||
typedef unsigned char rtf_byte_t;
|
typedef unsigned char rtf_byte_t;
|
||||||
|
|
||||||
for(std::size_t i = 0; i < text.size(); ++i)
|
for(size_t i = 0; i < text.size(); ++i)
|
||||||
{
|
{
|
||||||
rtf_byte_t c = rtf_byte_t(text[i]);
|
rtf_byte_t c = rtf_byte_t(text[i]);
|
||||||
|
|
||||||
|
|
|
@ -150,9 +150,9 @@ void cmWIXSourceWriter::WriteXMLDeclaration()
|
||||||
file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
|
file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXSourceWriter::Indent(std::size_t count)
|
void cmWIXSourceWriter::Indent(size_t count)
|
||||||
{
|
{
|
||||||
for(std::size_t i = 0; i < count; ++i)
|
for(size_t i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
file << " ";
|
file << " ";
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ std::string cmWIXSourceWriter::EscapeAttributeValue(
|
||||||
result.reserve(value.size());
|
result.reserve(value.size());
|
||||||
|
|
||||||
char c = 0;
|
char c = 0;
|
||||||
for(std::size_t i = 0 ; i < value.size(); ++i)
|
for(size_t i = 0 ; i < value.size(); ++i)
|
||||||
{
|
{
|
||||||
c = value[i];
|
c = value[i];
|
||||||
switch(c)
|
switch(c)
|
||||||
|
|
|
@ -51,17 +51,17 @@ private:
|
||||||
|
|
||||||
void WriteXMLDeclaration();
|
void WriteXMLDeclaration();
|
||||||
|
|
||||||
void Indent(std::size_t count);
|
void Indent(size_t count);
|
||||||
|
|
||||||
static std::string EscapeAttributeValue(const std::string& value);
|
static std::string EscapeAttributeValue(const std::string& value);
|
||||||
|
|
||||||
std::ofstream file;
|
cmCPackLog* Logger;
|
||||||
|
|
||||||
std::vector<std::string> elements;
|
std::ofstream file;
|
||||||
|
|
||||||
State state;
|
State state;
|
||||||
|
|
||||||
cmCPackLog* Logger;
|
std::vector<std::string> elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue