Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cppwinrt/cmd_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ namespace cppwinrt
inline std::string get_module_path()
{
std::string path(100, '?');
DWORD actual_size{};

while (true)
{
actual_size = GetModuleFileNameA(nullptr, path.data(), 1 + static_cast<uint32_t>(path.size()));
DWORD actual_size = GetModuleFileNameA(nullptr, path.data(), 1 + static_cast<uint32_t>(path.size()));

if (actual_size < 1 + path.size())
{
Expand Down Expand Up @@ -603,7 +602,7 @@ namespace cppwinrt
first_arg = true;
*argument_count = 0;

for (;;)
while (true)
{
if (*p)
{
Expand All @@ -621,7 +620,7 @@ namespace cppwinrt
if (*p == '\0')
break;

for (;;)
while (true)
{
copy_character = true;

Expand Down
15 changes: 6 additions & 9 deletions cppwinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ namespace cppwinrt

static void write_generic_names(writer& w, std::pair<GenericParam, GenericParam> const& params)
{
bool first{ true };
bool first = true;

for (auto&& param : params)
{
Expand Down Expand Up @@ -2011,7 +2011,7 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>

w.write_each<write_interface_override_method>(info.type.MethodList(), name);
}
};
}
}

static void write_class_override_implements(writer& w, get_interfaces_t const& interfaces)
Expand All @@ -2035,21 +2035,18 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>

static void write_class_override_requires(writer& w, get_interfaces_t const& interfaces)
{
bool found{};

for (auto&& [name, info] : interfaces)
{
if (!info.overridable)
{
w.write(", %", name);
found = true;
}
}
}

static void write_class_override_defaults(writer& w, get_interfaces_t const& interfaces)
{
bool first{ true };
bool first = true;

for (auto&& [name, info] : interfaces)
{
Expand Down Expand Up @@ -2769,7 +2766,7 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>

static void write_class_requires(writer& w, TypeDef const& type)
{
bool first{ true };
bool first = true;

for (auto&& [interface_name, info] : get_interfaces(w, type))
{
Expand All @@ -2793,7 +2790,7 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>

static void write_fast_class_requires(writer& w, TypeDef const& type)
{
bool first{ true };
bool first = true;

for (auto&& [interface_name, info] : get_interfaces(w, type))
{
Expand All @@ -2817,7 +2814,7 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>

static void write_class_base(writer& w, TypeDef const& type)
{
bool first{ true };
bool first = true;

for (auto&& base : get_bases(type))
{
Expand Down
10 changes: 5 additions & 5 deletions cppwinrt/component_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace cppwinrt
}
}

bool first{ true };
bool first = true;

for (auto&& name : interfaces)
{
Expand All @@ -45,7 +45,7 @@ namespace cppwinrt

static void write_component_class_base(writer& w, TypeDef const& type)
{
bool first{ true };
bool first = true;

for (auto&& base : get_bases(type))
{
Expand Down Expand Up @@ -289,7 +289,7 @@ catch (...) { return winrt::to_hresult(); }
bind<write_consume_args>(signature));
}

void write_component_static_forwarder(writer& w, MethodDef const& method)
static void write_component_static_forwarder(writer& w, MethodDef const& method)
{
auto format = R"( auto %(%)
{
Expand Down Expand Up @@ -643,8 +643,8 @@ catch (...) { return winrt::to_hresult(); }
{
if (!info.base && info.is_default)
{
auto methods = info.type.MethodList();
offset += methods.second - methods.first;
auto [first, second] = info.type.MethodList();
offset += second - first;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion cppwinrt/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace cppwinrt
struct separator
{
writer& w;
bool first{ true };
bool first = true;

void operator()()
{
Expand Down
4 changes: 2 additions & 2 deletions cppwinrt/text_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ namespace cppwinrt
{
return [&](auto& writer)
{
bool first{ true };
bool first = true;

for (auto&& item : list)
{
Expand All @@ -484,7 +484,7 @@ namespace cppwinrt
{
return [&](auto& writer)
{
bool first{ true };
bool first = true;

for (auto&& item : list)
{
Expand Down
4 changes: 2 additions & 2 deletions natvis/cppwinrt_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie
{
auto winmd_path = path{ processPath };
auto probe_file = std::string{ typeName };
do
while (true)
{
winmd_path.replace_filename(probe_file + ".winmd");
MetadataDiagnostic(process, L"Looking for ", winmd_path);
Expand All @@ -115,7 +115,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie
break;
}
probe_file = probe_file.substr(0, pos);
} while (true);
}
}

TypeDef FindType(DkmProcess* process, std::string_view const& typeName)
Expand Down
2 changes: 1 addition & 1 deletion natvis/object_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ HRESULT object_visualizer::CreateEvaluationResult(_Deref_out_ DkmEvaluationResul
auto address = pPointerValueHome->Address();

com_ptr<DkmString> pValue;
DkmEvaluationResultFlags_t evalResultFlags = DkmEvaluationResultFlags::ReadOnly | DkmEvaluationResultFlags::Expandable;;
DkmEvaluationResultFlags_t evalResultFlags = DkmEvaluationResultFlags::ReadOnly | DkmEvaluationResultFlags::Expandable;
if (requires_refresh(address, m_pVisualizedExpression->InspectionContext()->EvaluationFlags()))
{
IF_FAIL_RET(DkmString::Create(L"<Refresh to view properties>", pValue.put()));
Expand Down
2 changes: 1 addition & 1 deletion prebuild/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace cppwinrt::strings {

std::string_view remainder = view;

while (remainder.size())
while (!remainder.empty())
{
auto const size = std::min(size_t{ 16'000 }, remainder.size());
auto const chunk = remainder.substr(0, size);
Expand Down
2 changes: 1 addition & 1 deletion strings/base_collections_input_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ WINRT_EXPORT namespace winrt::param
private:

interface_type m_interface;
bool m_owned{ true };
bool m_owned = true;
};

template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion strings/base_coroutine_foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace winrt::impl
Async const& async;
Windows::Foundation::AsyncStatus status = Windows::Foundation::AsyncStatus::Started;
int32_t failure = 0;
std::atomic<bool> suspending{ true };
std::atomic<bool> suspending = true;

void enable_cancellation(cancellable_promise* promise)
{
Expand Down
2 changes: 1 addition & 1 deletion strings/base_implements.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ namespace winrt::impl

uintptr_t const encoding = encode_weak_ref(weak_ref.get());

for (;;)
while (true)
{
if (m_references.compare_exchange_weak(count_or_pointer, encoding, std::memory_order_acq_rel, std::memory_order_relaxed))
{
Expand Down
2 changes: 1 addition & 1 deletion test/old_tests/UnitTests/handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void test_put(HANDLE * value)
REQUIRE(value != nullptr);
REQUIRE(*value == nullptr);

*value = CreateEvent(nullptr, true, true, nullptr);;
*value = CreateEvent(nullptr, true, true, nullptr);
}

TEST_CASE("handle, put")
Expand Down