STYLE: Fixed line-too-long. COMP: Fixed warnings about lossy conversions.
This commit is contained in:
parent
d5ff71a14e
commit
eee575283d
|
@ -347,7 +347,8 @@ HRESULT FindVisualStudioInstances(
|
|||
|
||||
//std::cout << "Found Visual Studio instance." << std::endl;
|
||||
//std::cout << " ROT entry name: " << it->first << std::endl;
|
||||
//std::cout << " ROT entry object: " << (IUnknown*) it->second << std::endl;
|
||||
//std::cout << " ROT entry object: "
|
||||
// << (IUnknown*) it->second << std::endl;
|
||||
//std::cout << " slnFile: " << slnFile << std::endl;
|
||||
//std::cout << " slnName: " << slnName << std::endl;
|
||||
}
|
||||
|
@ -381,7 +382,7 @@ int cmCallVisualStudioMacro::GetNumberOfRunningVisualStudioInstances(
|
|||
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
count = instances.size();
|
||||
count = static_cast<int>(instances.size());
|
||||
}
|
||||
|
||||
// Force release all COM pointers before CoUninitialize:
|
||||
|
@ -389,6 +390,8 @@ int cmCallVisualStudioMacro::GetNumberOfRunningVisualStudioInstances(
|
|||
|
||||
CoUninitialize();
|
||||
}
|
||||
#else
|
||||
(void)slnFile;
|
||||
#endif
|
||||
|
||||
return count;
|
||||
|
@ -449,6 +452,9 @@ int cmCallVisualStudioMacro::CallMacro(
|
|||
CoUninitialize();
|
||||
}
|
||||
#else
|
||||
(void)slnFile;
|
||||
(void)macro;
|
||||
(void)args;
|
||||
cmSystemTools::Error("cmCallVisualStudioMacro::CallMacro is not "
|
||||
"supported on this platform");
|
||||
#endif
|
||||
|
|
|
@ -1795,7 +1795,9 @@ void cmGlobalGenerator::FileReplacedDuringGenerate(const std::string& filename)
|
|||
this->FilesReplacedDuringGenerate.push_back(filename);
|
||||
}
|
||||
|
||||
void cmGlobalGenerator::GetFilesReplacedDuringGenerate(std::vector<std::string>& filenames)
|
||||
void
|
||||
cmGlobalGenerator
|
||||
::GetFilesReplacedDuringGenerate(std::vector<std::string>& filenames)
|
||||
{
|
||||
filenames.clear();
|
||||
std::copy(
|
||||
|
|
|
@ -79,7 +79,8 @@ std::string cmGlobalVisualStudio8Generator::GetUserMacrosDirectory()
|
|||
|
||||
// base begins with the VisualStudioProjectsLocation reg value...
|
||||
if (cmSystemTools::ReadRegistryValue(
|
||||
"HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\8.0;VisualStudioProjectsLocation",
|
||||
"HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\8.0;"
|
||||
"VisualStudioProjectsLocation",
|
||||
base))
|
||||
{
|
||||
cmSystemTools::ConvertToUnixSlashes(base);
|
||||
|
|
|
@ -69,7 +69,8 @@ std::string cmGlobalVisualStudio9Generator::GetUserMacrosDirectory()
|
|||
|
||||
// base begins with the VisualStudioProjectsLocation reg value...
|
||||
if (cmSystemTools::ReadRegistryValue(
|
||||
"HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;VisualStudioProjectsLocation",
|
||||
"HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;"
|
||||
"VisualStudioProjectsLocation",
|
||||
base))
|
||||
{
|
||||
cmSystemTools::ConvertToUnixSlashes(base);
|
||||
|
|
|
@ -380,9 +380,11 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
|
|||
LONG result = ERROR_SUCCESS;
|
||||
DWORD index = 0;
|
||||
|
||||
keyname = "Software\\Microsoft\\VisualStudio\\8.0\\vsmacros\\OtherProjects7";
|
||||
keyname =
|
||||
"Software\\Microsoft\\VisualStudio\\8.0\\vsmacros\\OtherProjects7";
|
||||
hkey = NULL;
|
||||
result = RegOpenKeyEx(HKEY_CURRENT_USER, keyname.c_str(), 0, KEY_READ, &hkey);
|
||||
result = RegOpenKeyEx(HKEY_CURRENT_USER, keyname.c_str(),
|
||||
0, KEY_READ, &hkey);
|
||||
if (ERROR_SUCCESS == result)
|
||||
{
|
||||
// Iterate the subkeys and look for the values of interest in each subkey:
|
||||
|
@ -394,7 +396,8 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
|
|||
lastWriteTime.dwHighDateTime = 0;
|
||||
lastWriteTime.dwLowDateTime = 0;
|
||||
|
||||
while (ERROR_SUCCESS == RegEnumKeyEx(hkey, index, subkeyname, &cch_subkeyname,
|
||||
while (ERROR_SUCCESS == RegEnumKeyEx(hkey, index, subkeyname,
|
||||
&cch_subkeyname,
|
||||
0, keyclass, &cch_keyclass, &lastWriteTime))
|
||||
{
|
||||
// Open the subkey and query the values of interest:
|
||||
|
@ -405,15 +408,18 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
|
|||
DWORD valueType = REG_SZ;
|
||||
CHAR data1[256];
|
||||
DWORD cch_data1 = sizeof(data1)/sizeof(data1[0]);
|
||||
RegQueryValueEx(hsubkey, "Path", 0, &valueType, (LPBYTE) &data1[0], &cch_data1);
|
||||
RegQueryValueEx(hsubkey, "Path", 0, &valueType,
|
||||
(LPBYTE) &data1[0], &cch_data1);
|
||||
|
||||
DWORD data2 = 0;
|
||||
DWORD cch_data2 = sizeof(data2);
|
||||
RegQueryValueEx(hsubkey, "Security", 0, &valueType, (LPBYTE) &data2, &cch_data2);
|
||||
RegQueryValueEx(hsubkey, "Security", 0, &valueType,
|
||||
(LPBYTE) &data2, &cch_data2);
|
||||
|
||||
DWORD data3 = 0;
|
||||
DWORD cch_data3 = sizeof(data3);
|
||||
RegQueryValueEx(hsubkey, "StorageFormat", 0, &valueType, (LPBYTE) &data3, &cch_data3);
|
||||
RegQueryValueEx(hsubkey, "StorageFormat", 0, &valueType,
|
||||
(LPBYTE) &data3, &cch_data3);
|
||||
|
||||
s2 = cmSystemTools::LowerCase(data1);
|
||||
cmSystemTools::ConvertToUnixSlashes(s2);
|
||||
|
@ -478,23 +484,28 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
|
|||
nextAvailableSubKeyName = ossNext.str();
|
||||
|
||||
|
||||
keyname = "Software\\Microsoft\\VisualStudio\\8.0\\vsmacros\\RecordingProject7";
|
||||
keyname =
|
||||
"Software\\Microsoft\\VisualStudio\\8.0\\vsmacros\\RecordingProject7";
|
||||
hkey = NULL;
|
||||
result = RegOpenKeyEx(HKEY_CURRENT_USER, keyname.c_str(), 0, KEY_READ, &hkey);
|
||||
result = RegOpenKeyEx(HKEY_CURRENT_USER, keyname.c_str(),
|
||||
0, KEY_READ, &hkey);
|
||||
if (ERROR_SUCCESS == result)
|
||||
{
|
||||
DWORD valueType = REG_SZ;
|
||||
CHAR data1[256];
|
||||
DWORD cch_data1 = sizeof(data1)/sizeof(data1[0]);
|
||||
RegQueryValueEx(hkey, "Path", 0, &valueType, (LPBYTE) &data1[0], &cch_data1);
|
||||
RegQueryValueEx(hkey, "Path", 0, &valueType,
|
||||
(LPBYTE) &data1[0], &cch_data1);
|
||||
|
||||
DWORD data2 = 0;
|
||||
DWORD cch_data2 = sizeof(data2);
|
||||
RegQueryValueEx(hkey, "Security", 0, &valueType, (LPBYTE) &data2, &cch_data2);
|
||||
RegQueryValueEx(hkey, "Security", 0, &valueType,
|
||||
(LPBYTE) &data2, &cch_data2);
|
||||
|
||||
DWORD data3 = 0;
|
||||
DWORD cch_data3 = sizeof(data3);
|
||||
RegQueryValueEx(hkey, "StorageFormat", 0, &valueType, (LPBYTE) &data3, &cch_data3);
|
||||
RegQueryValueEx(hkey, "StorageFormat", 0, &valueType,
|
||||
(LPBYTE) &data3, &cch_data3);
|
||||
|
||||
s2 = cmSystemTools::LowerCase(data1);
|
||||
cmSystemTools::ConvertToUnixSlashes(s2);
|
||||
|
@ -525,7 +536,8 @@ void WriteVSMacrosFileRegistryEntry(
|
|||
const std::string& nextAvailableSubKeyName,
|
||||
const std::string& macrosFile)
|
||||
{
|
||||
std::string keyname = "Software\\Microsoft\\VisualStudio\\8.0\\vsmacros\\OtherProjects7";
|
||||
std::string keyname =
|
||||
"Software\\Microsoft\\VisualStudio\\8.0\\vsmacros\\OtherProjects7";
|
||||
HKEY hkey = NULL;
|
||||
LONG result = RegOpenKeyEx(HKEY_CURRENT_USER, keyname.c_str(), 0,
|
||||
KEY_READ|KEY_WRITE, &hkey);
|
||||
|
@ -543,7 +555,7 @@ void WriteVSMacrosFileRegistryEntry(
|
|||
cmSystemTools::ReplaceString(s, "/", "\\");
|
||||
|
||||
result = RegSetValueEx(hsubkey, "Path", 0, REG_SZ, (LPBYTE) s.c_str(),
|
||||
strlen(s.c_str()) + 1);
|
||||
static_cast<DWORD>(strlen(s.c_str()) + 1));
|
||||
if (ERROR_SUCCESS != result)
|
||||
{
|
||||
std::cout << "error result 1: " << result << std::endl;
|
||||
|
@ -553,7 +565,8 @@ void WriteVSMacrosFileRegistryEntry(
|
|||
// Security value is always "1" for sample macros files (seems to be "2"
|
||||
// if you put the file somewhere outside the standard VSMacros folder)
|
||||
dw = 1;
|
||||
result = RegSetValueEx(hsubkey, "Security", 0, REG_DWORD, (LPBYTE) &dw, sizeof(DWORD));
|
||||
result = RegSetValueEx(hsubkey, "Security",
|
||||
0, REG_DWORD, (LPBYTE) &dw, sizeof(DWORD));
|
||||
if (ERROR_SUCCESS != result)
|
||||
{
|
||||
std::cout << "error result 2: " << result << std::endl;
|
||||
|
@ -562,7 +575,8 @@ void WriteVSMacrosFileRegistryEntry(
|
|||
|
||||
// StorageFormat value is always "0" for sample macros files
|
||||
dw = 0;
|
||||
result = RegSetValueEx(hsubkey, "StorageFormat", 0, REG_DWORD, (LPBYTE) &dw, sizeof(DWORD));
|
||||
result = RegSetValueEx(hsubkey, "StorageFormat",
|
||||
0, REG_DWORD, (LPBYTE) &dw, sizeof(DWORD));
|
||||
if (ERROR_SUCCESS != result)
|
||||
{
|
||||
std::cout << "error result 3: " << result << std::endl;
|
||||
|
@ -573,7 +587,8 @@ void WriteVSMacrosFileRegistryEntry(
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << "error creating subkey: " << nextAvailableSubKeyName << std::endl;
|
||||
std::cout << "error creating subkey: "
|
||||
<< nextAvailableSubKeyName << std::endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
RegCloseKey(hkey);
|
||||
|
|
Loading…
Reference in New Issue