mirror of
https://github.com/reactos/CMake.git
synced 2025-02-17 18:17:57 +00:00
Merge topic 'fix-msvc-warnings'
5bcfe98bd5 Source: Fix various compiler warnings in Visual Studio 2017 70e245f19e cmAlgorithms: add utility functions to get signed size of containers Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2757
This commit is contained in:
commit
ecf3c5c6f3
@ -396,6 +396,12 @@ constexpr
|
||||
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
int isize(const T& t)
|
||||
{
|
||||
return static_cast<int>(cm::size(t));
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
|
||||
|
||||
using std::cbegin;
|
||||
|
@ -407,7 +407,7 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source,
|
||||
cmMakefile* mf = static_cast<cmMakefile*>(arg);
|
||||
std::string barf = source;
|
||||
std::string const& result =
|
||||
mf->ExpandVariablesInString(barf, escapeQuotes, atOnly);
|
||||
mf->ExpandVariablesInString(barf, escapeQuotes != 0, atOnly != 0);
|
||||
return strdup(result.c_str());
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
|
||||
// Set permissions to writable
|
||||
if (cmSystemTools::GetPermissions(fileName.c_str(), mode)) {
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
writable = mode & S_IWRITE;
|
||||
writable = (mode & S_IWRITE) != 0;
|
||||
mode_t newMode = mode | S_IWRITE;
|
||||
#else
|
||||
writable = mode & S_IWUSR;
|
||||
|
@ -269,7 +269,7 @@ void cmVisualStudioGeneratorOptions::FixManifestUACFlags()
|
||||
|
||||
if (keyValue[1].front() == '\'' && keyValue[1].back() == '\'') {
|
||||
keyValue[1] =
|
||||
keyValue[1].substr(1, std::max<int>(0, keyValue[1].size() - 2));
|
||||
keyValue[1].substr(1, std::max(0, cm::isize(keyValue[1]) - 2));
|
||||
}
|
||||
|
||||
if (keyValue[0] == "level") {
|
||||
|
@ -50,7 +50,7 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& args,
|
||||
// Set permissions to writable
|
||||
if (cmSystemTools::GetPermissions(fileName.c_str(), mode)) {
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
writable = mode & S_IWRITE;
|
||||
writable = (mode & S_IWRITE) != 0;
|
||||
mode_t newMode = mode | S_IWRITE;
|
||||
#else
|
||||
writable = mode & S_IWUSR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user