Skip to content

Commit f455050

Browse files
committed
Fix warnings in natvis project
1 parent d7c89b5 commit f455050

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

natvis/cppwinrt_visualizer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using namespace winrt;
1212
using namespace winmd::reader;
1313

1414
std::vector<std::string> db_files;
15-
std::unique_ptr<cache> db;
15+
std::unique_ptr<cache> db_cache;
1616

1717
void MetadataDiagnostic(DkmProcess* process, std::wstring const& status, std::filesystem::path const& path)
1818
{
@@ -105,7 +105,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie
105105

106106
if (std::find(db_files.begin(), db_files.end(), path_string) == db_files.end())
107107
{
108-
db->add_database(path_string, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); });
108+
db_cache->add_database(path_string, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); });
109109
db_files.push_back(path_string);
110110
}
111111
}
@@ -120,12 +120,12 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie
120120

121121
TypeDef FindType(DkmProcess* process, std::string_view const& typeName)
122122
{
123-
auto type = db->find(typeName);
123+
auto type = db_cache->find(typeName);
124124
if (!type)
125125
{
126126
auto processPath = process->Path()->Value();
127127
LoadMetadata(process, processPath, typeName);
128-
type = db->find(typeName);
128+
type = db_cache->find(typeName);
129129
if (!type)
130130
{
131131
NatvisDiagnostic(process,
@@ -137,7 +137,7 @@ TypeDef FindType(DkmProcess* process, std::string_view const& typeName)
137137

138138
TypeDef FindType(DkmProcess* process, std::string_view const& typeNamespace, std::string_view const& typeName)
139139
{
140-
auto type = db->find(typeNamespace, typeName);
140+
auto type = db_cache->find(typeNamespace, typeName);
141141
if (!type)
142142
{
143143
std::string fullName(typeNamespace);
@@ -165,7 +165,7 @@ cppwinrt_visualizer::cppwinrt_visualizer()
165165
db_files.push_back(file.path().string());
166166
}
167167
}
168-
db.reset(new cache(db_files, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); }));
168+
db_cache.reset(new cache(db_files, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); }));
169169
}
170170
catch (...)
171171
{
@@ -188,7 +188,7 @@ cppwinrt_visualizer::~cppwinrt_visualizer()
188188
{
189189
ClearTypeResolver();
190190
db_files.clear();
191-
db.reset();
191+
db_cache.reset();
192192
}
193193

194194
HRESULT cppwinrt_visualizer::EvaluateVisualizedExpression(

natvis/object_visualizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ HRESULT object_visualizer::GetItems(
671671

672672
auto pParent = pVisualizedExpression;
673673
auto childCount = std::min(m_propertyData.size() - StartIndex, (size_t)Count);
674-
for(auto i = 0; i < childCount; ++i)
674+
for(size_t i = 0; i < childCount; ++i)
675675
{
676676
auto& prop = m_propertyData[i + (size_t)StartIndex];
677677
com_ptr<DkmChildVisualizedExpression> pPropertyVisualized;

natvis/pch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
#define NOMINMAX
55

66
#include <windows.h>
7+
#pragma warning(push)
8+
#pragma warning(disable : 4471)
79
#include <vsdebugeng.h>
10+
#pragma warning(pop)
811
#include <vsdebugeng.templates.h>
912
#include <Dia2.h>
1013
#include "base_includes.h"

0 commit comments

Comments
 (0)