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
11 changes: 6 additions & 5 deletions core/core.vcxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
<ClInclude Include="src\ui\window.hpp" />
<ClInclude Include="src\ui\window_manager.hpp" />
<ClInclude Include="src\unicode.hpp" />
<ClInclude Include="src\utilities\coroutine.hpp" />
<ClInclude Include="src\utilities\null_output.hpp" />
<ClInclude Include="src\utilities\xml.hpp" />
<ClInclude Include="src\utility.hpp" />
Expand Down Expand Up @@ -354,13 +355,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -397,7 +398,7 @@
<EnablePREfast>true</EnablePREfast>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/await /utf-8 /Zc:externConstexpr /Zc:throwingNew /Zc:__cplusplus</AdditionalOptions>
<AdditionalOptions>/utf-8 /Zc:externConstexpr /Zc:throwingNew /Zc:__cplusplus</AdditionalOptions>
<ExceptionHandling>Async</ExceptionHandling>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<LanguageStandard>stdcpplatest</LanguageStandard>
Expand Down Expand Up @@ -431,7 +432,7 @@
<EnablePREfast>true</EnablePREfast>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/await /utf-8 /Zc:externConstexpr /Zc:throwingNew /Zc:__cplusplus</AdditionalOptions>
<AdditionalOptions>/utf-8 /Zc:externConstexpr /Zc:throwingNew /Zc:__cplusplus</AdditionalOptions>
<OmitFramePointers />
<DisableSpecificWarnings>
</DisableSpecificWarnings>
Expand Down Expand Up @@ -640,4 +641,4 @@
</ItemGroup>
<GenerateVersionNumber File="$(IntDir)src\version.auto.hpp" />
</Target>
</Project>
</Project>
16 changes: 9 additions & 7 deletions core/src/addon/package_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "core.hpp"
#include "downloader.hpp"
#include "utilities/xml.hpp"
#include "utilities/coroutine.hpp"
#include "utility.hpp"

#include <windows.h>
Expand Down Expand Up @@ -594,9 +595,9 @@ std::future<void> windower::package_manager::update_sources(bool force)
{}

std::vector<downloader::file> files;
for (auto source : m_package_sources)
for (auto const& source : m_package_sources)
{
auto url = source.url;
auto url{source.url};
auto path = staging_path / source.guid;
if (url.empty() || url.back() != u8'/')
{
Expand Down Expand Up @@ -650,7 +651,7 @@ windower::package_manager::update_source(source source, bool force)

std::vector<downloader::file> files;
{
auto url = source.url;
auto url{source.url};
auto path = staging_path / source.guid;
if (url.empty() || url.back() != u8'/')
{
Expand Down Expand Up @@ -766,7 +767,7 @@ windower::package_manager::install_or_update(
std::vector<downloader::job> jobs;
for (auto const& p : packages)
{
auto root_url = p.root_url;
auto root_url{p.root_url};
if (root_url.empty() || root_url.back() != u8'/')
{
root_url.append(1, u8'/');
Expand All @@ -776,7 +777,8 @@ windower::package_manager::install_or_update(
for (auto const& file : p.files)
{
auto url = root_url + file.generic_u8string();
auto path = (staging_path / file).make_preferred();
auto path = staging_path / file;
path.make_preferred();
fs::create_directories(path.parent_path());
auto const time =
last_modified(m_installed_package_directory / file, force);
Expand All @@ -801,7 +803,7 @@ windower::package_manager::install_or_update(
it2->name + u8"\"";
if (windower::core::instance().settings.verbose_logging)
{
for (auto r : results)
for (auto const& r : results)
{
::check(r);
}
Expand All @@ -828,7 +830,7 @@ windower::package_manager::install_or_update(
}

std::lock_guard<std::mutex> lock{m_mutex};
for (auto r : results)
for (auto const& r : results)
{
auto path = m_installed_package_directory /
relative(r.file().path, staging_path);
Expand Down
5 changes: 2 additions & 3 deletions core/src/addon/scheduler.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@
#include <algorithm>
#include <atomic>
#include <chrono>
#include <coroutine>
#include <utility>
#include <vector>

#include <experimental/resumable>

bool windower::operator<=(wait_state const& lhs, wait_state const& rhs) noexcept
{
static_assert(
Expand All @@ -65,7 +64,7 @@ windower::task::task(task&& other) noexcept : m_coroutine{other.m_coroutine}
}

windower::task::task(
std::experimental::coroutine_handle<promise_type> coroutine) noexcept :
std::coroutine_handle<promise_type> coroutine) noexcept :
m_coroutine{coroutine}
{}

Expand Down
16 changes: 7 additions & 9 deletions core/src/addon/scheduler.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <atomic>
#include <chrono>
#include <coroutine>
#include <cstddef>
#include <exception>
#include <functional>
Expand All @@ -37,8 +38,6 @@
#include <tuple>
#include <vector>

#include <experimental/resumable>

namespace windower
{

Expand Down Expand Up @@ -75,18 +74,17 @@ class task
auto get_return_object() noexcept
{
return task{
std::experimental::coroutine_handle<promise_type>::from_promise(
*this)};
std::coroutine_handle<promise_type>::from_promise(*this)};
}

auto initial_suspend() noexcept
{
return std::experimental::suspend_always{};
return std::suspend_always{};
}

auto final_suspend() noexcept
{
return std::experimental::suspend_always{};
return std::suspend_always{};
}

void return_void() noexcept {}
Expand Down Expand Up @@ -118,7 +116,7 @@ class task
bool await_ready() const noexcept { return !m_condition; }

void
await_suspend(std::experimental::coroutine_handle<>) const noexcept
await_suspend(std::coroutine_handle<>) const noexcept
{}

bool await_resume() const noexcept { return m_condition; }
Expand Down Expand Up @@ -152,9 +150,9 @@ class task
void tag(void const*) const noexcept;

private:
std::experimental::coroutine_handle<promise_type> m_coroutine;
std::coroutine_handle<promise_type> m_coroutine;

explicit task(std::experimental::coroutine_handle<promise_type>) noexcept;
explicit task(std::coroutine_handle<promise_type>) noexcept;
};

class scheduler
Expand Down
1 change: 1 addition & 0 deletions core/src/command_handlers.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "core.hpp"
#include "errors/command_error.hpp"
#include "unicode.hpp"
#include "utilities/coroutine.hpp"
#include "utility.hpp"

#include <limits>
Expand Down
8 changes: 4 additions & 4 deletions core/src/downloader.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "core.hpp"
#include "handle.hpp"
#include "unicode.hpp"
#include "utilities/coroutine.hpp"
#include "version.hpp"

#include <windows.h>
Expand All @@ -35,6 +36,7 @@

#include <atomic>
#include <chrono>
#include <coroutine>
#include <cstdint>
#include <future>
#include <mutex>
Expand All @@ -43,8 +45,6 @@
#include <thread>
#include <utility>

#include <experimental/coroutine>

namespace
{

Expand Down Expand Up @@ -388,7 +388,7 @@ struct windower::downloader::job::impl
std::vector<result> const files;
std::mutex mutex;
std::atomic<bool> complete = false;
std::experimental::coroutine_handle<> resumable = nullptr;
std::coroutine_handle<> resumable = nullptr;
};

windower::downloader::job::awaiter::awaiter(job const& job) noexcept :
Expand All @@ -401,7 +401,7 @@ bool windower::downloader::job::awaiter::await_ready() const noexcept
}

void windower::downloader::job::awaiter::await_suspend(
std::experimental::coroutine_handle<> resumable) const
std::coroutine_handle<> resumable) const
{
std::lock_guard<std::mutex> lock{m_job.m_impl->mutex};
if (m_job.m_impl->complete)
Expand Down
5 changes: 2 additions & 3 deletions core/src/downloader.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <atomic>
#include <chrono>
#include <coroutine>
#include <cstdint>
#include <filesystem>
#include <future>
Expand All @@ -36,8 +37,6 @@
#include <string>
#include <thread>

#include <experimental/coroutine>

namespace windower
{

Expand Down Expand Up @@ -103,7 +102,7 @@ class downloader

bool await_ready() const noexcept;

void await_suspend(std::experimental::coroutine_handle<>) const;
void await_suspend(std::coroutine_handle<>) const;

std::vector<result> await_resume() const;

Expand Down
4 changes: 2 additions & 2 deletions core/src/hooks/ffximain.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@ void const* windower::ffximain::menu(
for (auto it = hooks::menu_ptr; it && it->data; std::advance(it, 1))
{
auto const name_ptr = static_cast<char8_t const*>(it->name);
auto const name_size = std::size(it->name);
auto constexpr name_size = std::size(it->name);
auto const type_ptr = static_cast<char8_t const*>(it->type);
auto const type_size = std::size(it->type);
auto constexpr type_size = std::size(it->type);

if (std::u8string_view{name_ptr, name_size} == name &&
std::u8string_view{type_ptr, type_size} == type)
Expand Down
2 changes: 1 addition & 1 deletion core/src/scanner.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class signature
inline namespace signature_literals
{

consteval signature operator"" _sig(char8_t const* string, std::size_t size)
consteval signature operator ""_sig(char8_t const* string, std::size_t size)
{
return signature{std::u8string_view{string, size}};
}
Expand Down
Loading
Loading