Skip to content

Commit

Permalink
Fixes to silence clang errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dasaav-dsv committed Apr 27, 2024
1 parent e58c785 commit 6089fa5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/coresystem/file/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ class resource_request {
}

private:
std::unique_ptr<file_request> file;
CS::CSResourceRepository repository;
std::wstring resource;
std::unique_ptr<file_request> file;
FD4::FD4ResCap* res_cap = nullptr;
mutable std::atomic_flag is_ready = ATOMIC_FLAG_INIT;
struct resource_request_task : public CS::CSEzTask {
Expand Down
21 changes: 12 additions & 9 deletions source/coresystem/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ namespace fs = std::filesystem;
LIBER_SINGLETON_INSTANCE(CS::CSFileImp);
LIBER_SINGLETON_INSTANCE(CS::CSFD4MoWwisebankRepositoryImp);

#define LIBER_RESOURCE_EXTENSION(EXT) \
{ fs::path(LIBER_STRINGIFY(.##EXT)), \
liber::symbol<LIBER_STRINGIFY( \
#define LIBER_RESOURCE_EXTENSION(EXT) \
{ fs::path("." LIBER_STRINGIFY(EXT)), \
liber::symbol<LIBER_STRINGIFY( \
CS::CSFile::make_##EXT##_file_cap)>::get() },

const auto& get_extension_map() {
Expand Down Expand Up @@ -147,8 +147,8 @@ void file_request::file_request_task::eztask_execute(FD4::FD4TaskData*) {
load_file_cap(request.path, request.loader, load_bnk);
return;
}
if (!load_bnk && !existing->ready()
|| load_bnk && !is_bank_ready(existing))
if ((!load_bnk && !existing->ready())
|| (load_bnk && !is_bank_ready(existing)))
return;
break;
case file_request::UNLOAD:
Expand All @@ -161,10 +161,11 @@ void file_request::file_request_task::eztask_execute(FD4::FD4TaskData*) {
request.task.reset();
};

#define LIBER_RESOURCE_REPOSITORY(NAME) \
case CS::CSResourceRepository::NAME: \
res_repository = *reinterpret_cast<uintptr_t*>( \
liber::symbol<LIBER_STRINGIFY(CS::##NAME##Imp::instance)>::get()); \
#define LIBER_RESOURCE_REPOSITORY(NAME) \
case CS::CSResourceRepository::NAME: \
res_repository = *reinterpret_cast<uintptr_t*>( \
liber::symbol<"CS::" LIBER_STRINGIFY( \
NAME) "Imp::instance">::get()); \
break;

void from::resource_request::resource_request_task::eztask_execute(
Expand All @@ -183,6 +184,8 @@ void from::resource_request::resource_request_task::eztask_execute(
case CS::CSResourceRepository::CSGparamRepository:
holder_offset += 0x18;
break;
default:
break;
}
FD4::FD4ResCapHolder* res_cap_holder =
reinterpret_cast<FD4::FD4ResCapHolder*>(res_repository + holder_offset);
Expand Down
4 changes: 2 additions & 2 deletions source/coresystem/file_wwise.inl
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ void override_wwise_loader_once() {
MemoryBarrier();
void** overwritten_vtable = old_vtable;
std::copy_n(old_vtable, 7, new_vtable);
new_vtable[1] = load_wem_override;
new_vtable[2] = load_bnk_override;
new_vtable[1] = (void*)&load_wem_override;
new_vtable[2] = (void*)&load_bnk_override;
success = overwritten_vtable
== InterlockedCompareExchangePointer(
reinterpret_cast<void**>(&old_vtable), new_vtable,
Expand Down

0 comments on commit 6089fa5

Please sign in to comment.