aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/metrics.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-02-21 13:39:36 -0800
committerGitHub <noreply@github.com>2017-02-21 13:39:36 -0800
commit7d4df89c1dfff0b2bad0165ac4579f6352935a94 (patch)
tree8b87d29fb74fb24984d5aff9b021f14d95afb5ab /toolsrc/src/metrics.cpp
parentd9462fdf490d3396cac58b1a935b1b8a982b3a72 (diff)
parentb921dce5fc17bd4c1c206b79eb0a7b8758dcf5bf (diff)
downloadvcpkg-7d4df89c1dfff0b2bad0165ac4579f6352935a94.tar.gz
vcpkg-7d4df89c1dfff0b2bad0165ac4579f6352935a94.zip
Merge branch 'master' into master
Diffstat (limited to 'toolsrc/src/metrics.cpp')
-rw-r--r--toolsrc/src/metrics.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp
index 263d6eb74..4ac43c5c6 100644
--- a/toolsrc/src/metrics.cpp
+++ b/toolsrc/src/metrics.cpp
@@ -32,7 +32,7 @@ namespace vcpkg
static std::string GenerateRandomUUID()
{
- int partSizes[] = {8, 4, 4, 4, 12};
+ int partSizes[] = { 8, 4, 4, 4, 12 };
char uuid[37];
memset(uuid, 0, sizeof(uuid));
int num;
@@ -101,7 +101,7 @@ namespace vcpkg
// Note: this treats incoming Strings as Latin-1
static constexpr const char hex[16] = {
'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
encoded.append("\\u00");
encoded.push_back(hex[ch / 16]);
encoded.push_back(hex[ch % 16]);
@@ -229,8 +229,10 @@ true
{
LONG err;
- struct RAII_HKEY {
+ struct RAII_HKEY
+ {
HKEY hkey = nullptr;
+
~RAII_HKEY()
{
if (hkey != nullptr)
@@ -244,7 +246,7 @@ true
return L"{}";
}
- std::array<wchar_t,128> buffer;
+ std::array<wchar_t, 128> buffer;
DWORD lType = 0;
DWORD dwBufferSize = static_cast<DWORD>(buffer.size() * sizeof(wchar_t));
err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", nullptr, &lType, reinterpret_cast<LPBYTE>(buffer.data()), &dwBufferSize);
@@ -356,8 +358,7 @@ true
if (bResults)
{
DWORD availableData = 0, readData = 0, totalData = 0;
-
- while ((bResults = WinHttpQueryDataAvailable(hRequest, &availableData)) && availableData > 0)
+ while ((bResults = WinHttpQueryDataAvailable(hRequest, &availableData)) == TRUE && availableData > 0)
{
responseBuffer.resize(responseBuffer.size() + availableData);