summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-06 14:29:31 +0000
committerKitware Robot <kwrobot@kitware.com>2018-04-06 10:29:38 -0400
commit607b0ac2f3be1cbe7a0d8acbc711836935d5e3d6 (patch)
tree4a80d4330d28dc8d42aa3e44a936c13799bc1e0e /Source
parent5454b41e1b95d154c4f6a0c1f191a4e794765d95 (diff)
parentacda926a047c5958af32fd6f88dd184f5d769319 (diff)
downloadcmake-607b0ac2f3be1cbe7a0d8acbc711836935d5e3d6.tar.gz
Merge topic 'minor-cleanups'
acda926a04 Replace some uses of sprintf with std::to_string 418541035f cmCTestCurl: Fix UploadFile declared parameter names 1519628e60 cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned 2f87d00803 cmMacroCommand: Fix format string to match type of argument b0676cc5d4 Add in-class initialization of some members 966dba5b68 cmAlgorithms: Remove unnecessary typename keyword 12a145534a gitignore: Ignore a .vs directory in the source tree Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1932
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestCurl.h2
-rw-r--r--Source/cmAlgorithms.h2
-rw-r--r--Source/cmCacheManager.cxx18
-rw-r--r--Source/cmConfigureFileCommand.h6
-rw-r--r--Source/cmCoreTryCompile.h2
-rw-r--r--Source/cmExportLibraryDependenciesCommand.h2
-rw-r--r--Source/cmExternalMakefileProjectGenerator.h2
-rw-r--r--Source/cmInstallFilesCommand.h2
-rw-r--r--Source/cmMacroCommand.cxx2
-rw-r--r--Source/cmStateSnapshot.cxx19
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h4
-rw-r--r--Source/cmTargetPropCommandBase.h2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h2
14 files changed, 34 insertions, 35 deletions
diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
index 427a392329..86d9489958 100644
--- a/Source/CTest/cmCTestCurl.h
+++ b/Source/CTest/cmCTestCurl.h
@@ -16,7 +16,7 @@ class cmCTestCurl
public:
cmCTestCurl(cmCTest*);
~cmCTestCurl();
- bool UploadFile(std::string const& url, std::string const& file,
+ bool UploadFile(std::string const& local_file, std::string const& url,
std::string const& fields, std::string& response);
bool HttpRequest(std::string const& url, std::string const& fields,
std::string& response);
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 3380b78ca5..244dc1ce4c 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -311,7 +311,7 @@ struct RemoveDuplicatesAPI<Range, T*>
template <typename Range>
typename Range::const_iterator cmRemoveDuplicates(Range& r)
{
- typedef typename ContainerAlgorithms::RemoveDuplicatesAPI<Range> API;
+ typedef ContainerAlgorithms::RemoveDuplicatesAPI<Range> API;
typedef typename API::value_type T;
std::vector<T> unique;
unique.reserve(r.size());
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 85ac985416..13407e57ea 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -8,6 +8,7 @@
#include <sstream>
#include <stdio.h>
#include <string.h>
+#include <string>
#include "cmGeneratedFileStream.h"
#include "cmMessenger.h"
@@ -243,19 +244,18 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
}
// before writing the cache, update the version numbers
// to the
- char temp[1024];
- sprintf(temp, "%d", cmVersion::GetMinorVersion());
- this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp,
- "Minor version of cmake used to create the "
+ this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION",
+ std::to_string(cmVersion::GetMajorVersion()).c_str(),
+ "Major version of cmake used to create the "
"current loaded cache",
cmStateEnums::INTERNAL);
- sprintf(temp, "%d", cmVersion::GetMajorVersion());
- this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp,
- "Major version of cmake used to create the "
+ this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION",
+ std::to_string(cmVersion::GetMinorVersion()).c_str(),
+ "Minor version of cmake used to create the "
"current loaded cache",
cmStateEnums::INTERNAL);
- sprintf(temp, "%d", cmVersion::GetPatchVersion());
- this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp,
+ this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION",
+ std::to_string(cmVersion::GetPatchVersion()).c_str(),
"Patch version of cmake used to create the "
"current loaded cache",
cmStateEnums::INTERNAL);
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index cff934b481..5603c505ca 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -32,9 +32,9 @@ private:
std::string InputFile;
std::string OutputFile;
- bool CopyOnly;
- bool EscapeQuotes;
- bool AtOnly;
+ bool CopyOnly = false;
+ bool EscapeQuotes = false;
+ bool AtOnly = false;
};
#endif
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index 6f35a540f4..ae714a63a3 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -46,7 +46,7 @@ protected:
std::string BinaryDirectory;
std::string OutputFile;
std::string FindErrorMessage;
- bool SrcFileSignature;
+ bool SrcFileSignature = false;
private:
std::vector<std::string> WarnCMP0067;
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
index bf5e9bc544..8414866a0f 100644
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ b/Source/cmExportLibraryDependenciesCommand.h
@@ -27,7 +27,7 @@ public:
private:
std::string Filename;
- bool Append;
+ bool Append = false;
void ConstFinalPass() const;
};
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index 5cc6442e79..d48abca789 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -62,7 +62,7 @@ protected:
///! Contains the names of the global generators support by this generator.
std::vector<std::string> SupportedGlobalGenerators;
///! the global generator which creates the makefiles
- const cmGlobalGenerator* GlobalGenerator;
+ const cmGlobalGenerator* GlobalGenerator = nullptr;
std::string Name;
};
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index 19f2559021..a52f45e058 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -48,7 +48,7 @@ protected:
private:
std::vector<std::string> FinalArgs;
- bool IsFilesForm;
+ bool IsFilesForm = false;
std::string Destination;
std::vector<std::string> Files;
};
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 07943e3440..6f4b930f1b 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -93,7 +93,7 @@ bool cmMacroHelperCommand::InvokeInitialPass(
argVs.reserve(expandedArgs.size());
char argvName[60];
for (unsigned int j = 0; j < expandedArgs.size(); ++j) {
- sprintf(argvName, "${ARGV%i}", j);
+ sprintf(argvName, "${ARGV%u}", j);
argVs.push_back(argvName);
}
// Invoke all the functions that were collected in the block.
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 479ecd228d..0d97c3345d 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -6,7 +6,7 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
-#include <stdio.h>
+#include <string>
#include "cmAlgorithms.h"
#include "cmDefinitions.h"
@@ -328,15 +328,14 @@ void cmStateSnapshot::SetDefaultDefinitions()
this->SetDefinition("CMAKE_HOST_SOLARIS", "1");
#endif
- char temp[1024];
- sprintf(temp, "%d", cmVersion::GetMinorVersion());
- this->SetDefinition("CMAKE_MINOR_VERSION", temp);
- sprintf(temp, "%d", cmVersion::GetMajorVersion());
- this->SetDefinition("CMAKE_MAJOR_VERSION", temp);
- sprintf(temp, "%d", cmVersion::GetPatchVersion());
- this->SetDefinition("CMAKE_PATCH_VERSION", temp);
- sprintf(temp, "%d", cmVersion::GetTweakVersion());
- this->SetDefinition("CMAKE_TWEAK_VERSION", temp);
+ this->SetDefinition("CMAKE_MAJOR_VERSION",
+ std::to_string(cmVersion::GetMajorVersion()));
+ this->SetDefinition("CMAKE_MINOR_VERSION",
+ std::to_string(cmVersion::GetMinorVersion()));
+ this->SetDefinition("CMAKE_PATCH_VERSION",
+ std::to_string(cmVersion::GetPatchVersion()));
+ this->SetDefinition("CMAKE_TWEAK_VERSION",
+ std::to_string(cmVersion::GetTweakVersion()));
this->SetDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
this->SetDefinition("CMAKE_FILES_DIRECTORY",
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index a2f3ecd4d4..54f8cf4b8f 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -43,7 +43,7 @@ private:
void LinkLibraryTypeSpecifierWarning(int left, int right);
static const char* LinkLibraryTypeNames[3];
- cmTarget* Target;
+ cmTarget* Target = nullptr;
enum ProcessingState
{
ProcessingLinkLibraries,
@@ -55,7 +55,7 @@ private:
ProcessingKeywordPrivateInterface
};
- ProcessingState CurrentProcessingState;
+ ProcessingState CurrentProcessingState = ProcessingLinkLibraries;
bool HandleLibrary(const std::string& lib, cmTargetLinkLibraryType llt);
};
diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h
index 3c736fc0d5..943285df15 100644
--- a/Source/cmTargetPropCommandBase.h
+++ b/Source/cmTargetPropCommandBase.h
@@ -28,7 +28,7 @@ public:
protected:
std::string Property;
- cmTarget* Target;
+ cmTarget* Target = nullptr;
virtual void HandleInterfaceContent(cmTarget* tgt,
const std::vector<std::string>& content,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1817153d60..7c1d9481b7 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -368,8 +368,8 @@ void cmVisualStudio10TargetGenerator::Generate()
if (this->NsightTegra) {
this->WriteString("<PropertyGroup Label=\"NsightTegraProject\">\n", 1);
- const int nsightTegraMajorVersion = this->NsightTegraVersion[0];
- const int nsightTegraMinorVersion = this->NsightTegraVersion[1];
+ const unsigned int nsightTegraMajorVersion = this->NsightTegraVersion[0];
+ const unsigned int nsightTegraMinorVersion = this->NsightTegraVersion[1];
if (nsightTegraMajorVersion >= 2) {
this->WriteString("<NsightTegraProjectRevisionNumber>", 2);
if (nsightTegraMajorVersion > 3 ||
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 4df03b6108..3c53d1b063 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -204,7 +204,7 @@ private:
bool MSTools;
bool Managed;
bool NsightTegra;
- int NsightTegraVersion[4];
+ unsigned int NsightTegraVersion[4];
bool TargetCompileAsWinRT;
cmGlobalVisualStudio10Generator* const GlobalGenerator;
cmGeneratedFileStream* BuildFileStream;