diff --git a/premake5.lua b/premake5.lua index c49201f6c1..0a36f5da31 100644 --- a/premake5.lua +++ b/premake5.lua @@ -113,12 +113,18 @@ filter("platforms:Linux") "rt", }) +filter({"platforms:Linux"}) + vectorextensions("AVX2") + filter({"platforms:Linux", "kind:*App"}) linkgroups("On") filter({"platforms:Linux", "language:C++", "toolset:gcc"}) disablewarnings({ - "unused-result" + "unused-result", + "deprecated-volatile", + "switch", + "deprecated-enum-enum-conversion", }) filter({"platforms:Linux", "toolset:gcc"}) @@ -135,7 +141,10 @@ filter({"platforms:Linux", "toolset:gcc"}) filter({"platforms:Linux", "language:C++", "toolset:clang"}) disablewarnings({ - "deprecated-register" + "deprecated-register", + "deprecated-volatile", + "switch", + "deprecated-enum-enum-conversion", }) filter({"platforms:Linux", "language:C++", "toolset:clang", "files:*.cc or *.cpp"}) buildoptions({ diff --git a/src/xenia/apu/audio_media_player.cc b/src/xenia/apu/audio_media_player.cc index f5d405b872..109862f7a1 100644 --- a/src/xenia/apu/audio_media_player.cc +++ b/src/xenia/apu/audio_media_player.cc @@ -13,8 +13,6 @@ #include "xenia/apu/xma_context.h" #include "xenia/base/logging.h" -#include - extern "C" { #if XE_COMPILER_MSVC #pragma warning(push) diff --git a/src/xenia/apu/conversion.h b/src/xenia/apu/conversion.h index b03f9ff469..915ace7595 100644 --- a/src/xenia/apu/conversion.h +++ b/src/xenia/apu/conversion.h @@ -35,7 +35,7 @@ static void _generic_sequential_6_BE_to_interleaved_6_LE( } } } -#if XE_COMPILER_CLANG_CL != 1 +#if XE_COMPILER_CLANG_CL != 1 && !XE_PLATFORM_LINUX // load_be_u32 unavailable on clang-cl XE_NOINLINE static void _movbe_sequential_6_BE_to_interleaved_6_LE( diff --git a/src/xenia/base/atomic.h b/src/xenia/base/atomic.h index 1f37d085d1..5ea64de82a 100644 --- a/src/xenia/base/atomic.h +++ b/src/xenia/base/atomic.h @@ -74,6 +74,15 @@ inline int32_t atomic_inc(volatile int32_t* value) { inline int32_t atomic_dec(volatile int32_t* value) { return __sync_sub_and_fetch(value, 1); } +inline int32_t atomic_or(volatile int32_t* value, int32_t nv) { + return __sync_or_and_fetch(value, nv); +} +inline int32_t atomic_and(volatile int32_t* value, int32_t nv) { + return __sync_and_and_fetch(value, nv); +} +inline int32_t atomic_xor(volatile int32_t* value, int32_t nv) { + return __sync_xor_and_fetch(value, nv); +} inline int32_t atomic_exchange(int32_t new_value, volatile int32_t* value) { return __sync_val_compare_and_swap(value, *value, new_value); diff --git a/src/xenia/base/console_app_main_posix.cc b/src/xenia/base/console_app_main_posix.cc index 29a3ae6abd..dd7019c2f7 100644 --- a/src/xenia/base/console_app_main_posix.cc +++ b/src/xenia/base/console_app_main_posix.cc @@ -23,7 +23,7 @@ extern "C" int main(int argc, char** argv) { } // Initialize logging. Needs parsed cvars. - xe::InitializeLogging(entry_info.name); + //xe::InitializeLogging(entry_info.name); std::vector args; for (int n = 0; n < argc; n++) { @@ -32,7 +32,7 @@ extern "C" int main(int argc, char** argv) { int result = entry_info.entry_point(args); - xe::ShutdownLogging(); + //xe::ShutdownLogging(); return result; } diff --git a/src/xenia/base/threading_posix.cc b/src/xenia/base/threading_posix.cc index 462282d462..f72f72d6f0 100644 --- a/src/xenia/base/threading_posix.cc +++ b/src/xenia/base/threading_posix.cc @@ -905,7 +905,7 @@ class PosixEvent : public PosixConditionHandle { ~PosixEvent() override = default; void Set() override { handle_.Signal(); } void Reset() override { handle_.Reset(); } - EventInfo Query() { + EventInfo Query() override { EventInfo result{}; assert_always(); return result; diff --git a/src/xenia/cpu/ppc/ppc_frontend.cc b/src/xenia/cpu/ppc/ppc_frontend.cc index dc60f2fb03..666bd7b790 100644 --- a/src/xenia/cpu/ppc/ppc_frontend.cc +++ b/src/xenia/cpu/ppc/ppc_frontend.cc @@ -57,15 +57,15 @@ Memory* PPCFrontend::memory() const { return processor_->memory(); } // Checks the state of the global lock and sets scratch to the current MSR // value. void CheckGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) { - auto global_mutex = reinterpret_cast(arg0); + auto global_mutex = reinterpret_cast(arg0); auto global_lock_count = reinterpret_cast(arg1); - std::lock_guard lock(*global_mutex); + std::lock_guard lock(*global_mutex); ppc_context->scratch = *global_lock_count ? 0 : 0x8000; } // Enters the global lock. Safe to recursion. void EnterGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) { - auto global_mutex = reinterpret_cast(arg0); + auto global_mutex = reinterpret_cast(arg0); auto global_lock_count = reinterpret_cast(arg1); global_mutex->lock(); xe::atomic_inc(global_lock_count); @@ -73,7 +73,7 @@ void EnterGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) { // Leaves the global lock. Safe to recursion. void LeaveGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) { - auto global_mutex = reinterpret_cast(arg0); + auto global_mutex = reinterpret_cast(arg0); auto global_lock_count = reinterpret_cast(arg1); auto new_lock_count = xe::atomic_dec(global_lock_count); assert_true(new_lock_count >= 0); diff --git a/src/xenia/cpu/ppc/ppc_translator.cc b/src/xenia/cpu/ppc/ppc_translator.cc index 1acbe0b899..d474f31dc6 100644 --- a/src/xenia/cpu/ppc/ppc_translator.cc +++ b/src/xenia/cpu/ppc/ppc_translator.cc @@ -151,7 +151,11 @@ void PPCTranslator::DumpHIR(GuestFunction* function, PPCHIRBuilder* builder) { { wchar_t tmpbuf[64]; +#ifdef XE_PLATFORM_WIN32 _snwprintf(tmpbuf, 64, L"%X", function->address()); +#else + swprintf(tmpbuf, 64, L"%X", function->address()); +#endif folder_path.append(&tmpbuf[0]); } diff --git a/src/xenia/cpu/processor.cc b/src/xenia/cpu/processor.cc index ebe5403e65..57fb63a504 100644 --- a/src/xenia/cpu/processor.cc +++ b/src/xenia/cpu/processor.cc @@ -447,7 +447,7 @@ bool Processor::Restore(ByteStream* stream) { std::vector to_delete; for (auto& it : thread_debug_infos_) { if (it.second->state == ThreadDebugInfo::State::kZombie) { - it.second->thread_handle = NULL; + it.second->thread_handle = 0; to_delete.push_back(it.first); } } @@ -502,7 +502,7 @@ void Processor::OnThreadDestroyed(uint32_t thread_id) { auto global_lock = global_critical_region_.Acquire(); auto it = thread_debug_infos_.find(thread_id); assert_true(it != thread_debug_infos_.end()); - it->second->thread_handle = NULL; + it->second->thread_handle = 0; thread_debug_infos_.erase(it); } diff --git a/src/xenia/cpu/xex_module.cc b/src/xenia/cpu/xex_module.cc index 509d7c492a..43520a0775 100644 --- a/src/xenia/cpu/xex_module.cc +++ b/src/xenia/cpu/xex_module.cc @@ -1136,10 +1136,14 @@ void XexModule::Precompile() { high_code); final_image_sha_.finalize(image_sha_bytes_); - char fmtbuf[16]; + char fmtbuf[20]; for (unsigned i = 0; i < 20; ++i) { +#ifdef XE_PLATFORM_WIN32 sprintf_s(fmtbuf, "%X", image_sha_bytes_[i]); +#else + sprintf(fmtbuf, "%X", image_sha_bytes_[i]); +#endif image_sha_str_ += &fmtbuf[0]; } diff --git a/src/xenia/debug/ui/debug_window.cc b/src/xenia/debug/ui/debug_window.cc index 2e1055cec8..d7dcec0fa7 100644 --- a/src/xenia/debug/ui/debug_window.cc +++ b/src/xenia/debug/ui/debug_window.cc @@ -309,7 +309,7 @@ void DebugWindow::DrawToolbar() { case cpu::ThreadDebugInfo::State::kAlive: case cpu::ThreadDebugInfo::State::kExited: case cpu::ThreadDebugInfo::State::kWaiting: - if (thread_info->thread_handle == NULL || thread_info->thread == NULL) { + if (!thread_info->thread_handle || thread_info->thread == nullptr) { thread_combo.Append("(invalid)"); } else { thread_combo.Append(thread_info->thread->thread_name()); diff --git a/src/xenia/gpu/draw_util.cc b/src/xenia/gpu/draw_util.cc index f3210ae506..29370b83a0 100644 --- a/src/xenia/gpu/draw_util.cc +++ b/src/xenia/gpu/draw_util.cc @@ -580,10 +580,17 @@ static inline void GetScissorTmpl(const RegisterFile& XE_RESTRICT regs, __m128i pa_sc_scissor = _mm_setr_epi32( pa_sc_screen_scissor_tl_tl_x, pa_sc_screen_scissor_tl_tl_y, pa_sc_screen_scissor_br_br_x, pa_sc_screen_scissor_br_br_y); +#if XE_PLATFORM_WIN32 __m128i xyoffsetadd = _mm_cvtsi64x_si128( static_cast(pa_sc_window_offset_window_x_offset) | (static_cast(pa_sc_window_offset_window_y_offset) << 32)); +#else + __m128i xyoffsetadd = _mm_cvtsi64_si128( + static_cast(pa_sc_window_offset_window_x_offset) | + (static_cast(pa_sc_window_offset_window_y_offset) + << 32)); +#endif xyoffsetadd = _mm_unpacklo_epi64(xyoffsetadd, xyoffsetadd); // chrispy: put this here to make it clear that the shift by 31 is extracting // this field diff --git a/src/xenia/gpu/draw_util.h b/src/xenia/gpu/draw_util.h index 4885db33b5..ce395185e0 100644 --- a/src/xenia/gpu/draw_util.h +++ b/src/xenia/gpu/draw_util.h @@ -100,7 +100,7 @@ constexpr bool IsPrimitivePolygonal(bool vgt_output_path_is_tessellation_enable, return (primitive_polygonal_table & (1U << static_cast(type))) != 0; } XE_FORCEINLINE -bool IsPrimitivePolygonal(const RegisterFile& regs) { +static bool IsPrimitivePolygonal(const RegisterFile& regs) { return IsPrimitivePolygonal( regs.Get().path_select == xenos::VGTOutputPath::kTessellationEnable, diff --git a/src/xenia/gpu/shared_memory.cc b/src/xenia/gpu/shared_memory.cc index a94aa053bc..1f1d3d756e 100644 --- a/src/xenia/gpu/shared_memory.cc +++ b/src/xenia/gpu/shared_memory.cc @@ -482,7 +482,7 @@ void SharedMemory::TryFindUploadRange(const uint32_t& block_first, } static bool UploadRange_DoBestScanForward(uint64_t v, uint32_t* out) { -#if XE_ARCH_AMD64 == 1 +#if XE_ARCH_AMD64 == 1 && XE_PLATFORM_WIN32 if (!v) { return false; } diff --git a/src/xenia/gpu/trace_player.cc b/src/xenia/gpu/trace_player.cc index c127d4c567..95c796ae81 100644 --- a/src/xenia/gpu/trace_player.cc +++ b/src/xenia/gpu/trace_player.cc @@ -89,7 +89,7 @@ void TracePlayer::PlayTrace(const uint8_t* trace_data, size_t trace_size, TracePlaybackMode playback_mode, bool clear_caches) { playing_trace_ = true; - graphics_system_->command_processor()->CallInThread([=]() { + graphics_system_->command_processor()->CallInThread([=, this]() { PlayTraceOnThread(trace_data, trace_size, playback_mode, clear_caches); }); } diff --git a/src/xenia/gpu/trace_viewer.cc b/src/xenia/gpu/trace_viewer.cc index fb139f3c70..22ba936b5a 100644 --- a/src/xenia/gpu/trace_viewer.cc +++ b/src/xenia/gpu/trace_viewer.cc @@ -899,9 +899,11 @@ void TraceViewer::DrawVertexFetcher(Shader* shader, } break; case xenos::VertexFormat::k_16_16_FLOAT: { auto e0 = LOADEL(uint32_t, 0); - ImGui::Text("%.2f", half_float::detail::uint16((e0 >> 16) & 0xFFFF)); + ImGui::Text("%.2f", static_cast(half_float::detail::uint16( + (e0 >> 16) & 0xFFFF))); ImGui::NextColumn(); - ImGui::Text("%.2f", half_float::detail::uint16((e0 >> 0) & 0xFFFF)); + ImGui::Text("%.2f", static_cast(half_float::detail::uint16( + (e0 >> 0) & 0xFFFF))); ImGui::NextColumn(); } break; case xenos::VertexFormat::k_32_32: @@ -972,13 +974,17 @@ void TraceViewer::DrawVertexFetcher(Shader* shader, case xenos::VertexFormat::k_16_16_16_16_FLOAT: { auto e0 = LOADEL(uint32_t, 0); auto e1 = LOADEL(uint32_t, 1); - ImGui::Text("%.2f", half_float::detail::uint16((e0 >> 16) & 0xFFFF)); + ImGui::Text("%.2f", static_cast(half_float::detail::uint16( + (e0 >> 16) & 0xFFFF))); ImGui::NextColumn(); - ImGui::Text("%.2f", half_float::detail::uint16((e0 >> 0) & 0xFFFF)); + ImGui::Text("%.2f", static_cast(half_float::detail::uint16( + (e0 >> 0) & 0xFFFF))); ImGui::NextColumn(); - ImGui::Text("%.2f", half_float::detail::uint16((e1 >> 16) & 0xFFFF)); + ImGui::Text("%.2f", static_cast(half_float::detail::uint16( + (e1 >> 16) & 0xFFFF))); ImGui::NextColumn(); - ImGui::Text("%.2f", half_float::detail::uint16((e1 >> 0) & 0xFFFF)); + ImGui::Text("%.2f", static_cast(half_float::detail::uint16( + (e1 >> 0) & 0xFFFF))); ImGui::NextColumn(); } break; case xenos::VertexFormat::k_32_32_32_32_FLOAT: diff --git a/src/xenia/kernel/util/native_list.h b/src/xenia/kernel/util/native_list.h index bf553a75fd..af581f8b1d 100644 --- a/src/xenia/kernel/util/native_list.h +++ b/src/xenia/kernel/util/native_list.h @@ -52,7 +52,7 @@ class NativeList { }; template static X_LIST_ENTRY* XeHostList(uint32_t ptr, VirtualTranslator context) { - return context->TranslateVirtual(ptr); + return context->template TranslateVirtual(ptr); } template static uint32_t XeGuestList(X_LIST_ENTRY* ptr, VirtualTranslator context) { @@ -193,7 +193,8 @@ struct X_TYPED_LIST : public X_LIST_ENTRY { inline ForwardIterator& operator++() { current_entry = - vt->TranslateVirtual(current_entry)->flink_ptr; + vt->template TranslateVirtual(current_entry) + ->flink_ptr; return *this; } inline bool operator!=(uint32_t other_ptr) const { @@ -202,7 +203,7 @@ struct X_TYPED_LIST : public X_LIST_ENTRY { inline TObject& operator*() { return *ListEntryObject( - vt->TranslateVirtual(current_entry)); + vt->template TranslateVirtual(current_entry)); } }; template @@ -236,15 +237,17 @@ struct X_TYPED_LIST : public X_LIST_ENTRY { } template bool empty(VirtualTranslator vt) const { - return vt->TranslateVirtual(flink_ptr) == this; + return vt->template TranslateVirtual(flink_ptr) == this; } template TObject* HeadObject(VirtualTranslator vt) { - return ListEntryObject(vt->TranslateVirtual(flink_ptr)); + return ListEntryObject( + vt->template TranslateVirtual(flink_ptr)); } template TObject* TailObject(VirtualTranslator vt) { - return ListEntryObject(vt->TranslateVirtual(blink_ptr)); + return ListEntryObject( + vt->template TranslateVirtual(blink_ptr)); } }; } // namespace util diff --git a/src/xenia/kernel/util/presence_string_builder.h b/src/xenia/kernel/util/presence_string_builder.h index 69e8cc13fa..098c33ee7f 100644 --- a/src/xenia/kernel/util/presence_string_builder.h +++ b/src/xenia/kernel/util/presence_string_builder.h @@ -77,4 +77,4 @@ class AttributeStringFormatter { } // namespace kernel } // namespace xe -#endif XENIA_KERNEL_UTIL_PRESENCE_STRING_BUILDER_H_ \ No newline at end of file +#endif // XENIA_KERNEL_UTIL_PRESENCE_STRING_BUILDER_H_ \ No newline at end of file diff --git a/src/xenia/kernel/xam/xam_content.cc b/src/xenia/kernel/xam/xam_content.cc index edaef5619d..63defba4a2 100644 --- a/src/xenia/kernel/xam/xam_content.cc +++ b/src/xenia/kernel/xam/xam_content.cc @@ -707,7 +707,7 @@ dword_result_t XamContentLaunchImageInternal_entry(lpvoid_t content_data_ptr, auto& loader_data = xam->loader_data(); loader_data.host_path = xe::path_to_utf8(host_path); - loader_data.launch_path = xex_path; + loader_data.launch_path = xex_path.value(); xam->SaveLoaderData(); diff --git a/src/xenia/kernel/xam/xam_info.cc b/src/xenia/kernel/xam/xam_info.cc index 5958bde1fd..1d65bdddcc 100644 --- a/src/xenia/kernel/xam/xam_info.cc +++ b/src/xenia/kernel/xam/xam_info.cc @@ -459,20 +459,19 @@ DECLARE_XAM_EXPORT1(XamQueryLiveHiveW, kNone, kStub); // http://www.noxa.org/blog/2011/02/28/building-an-xbox-360-emulator-part-3-feasibilityos/ // http://www.noxa.org/blog/2011/08/13/building-an-xbox-360-emulator-part-5-xex-files/ dword_result_t RtlSleep_entry(dword_t dwMilliseconds, dword_t bAlertable) { - LARGE_INTEGER delay{}; + uint64_t delay{}; // Convert the delay time to 100-nanosecond intervals - delay.QuadPart = dwMilliseconds == -1 - ? LLONG_MAX - : static_cast(-10000) * dwMilliseconds; + delay = dwMilliseconds == -1 ? LLONG_MAX + : static_cast(-10000) * dwMilliseconds; - X_STATUS result = xboxkrnl::KeDelayExecutionThread( - MODE::UserMode, bAlertable, (uint64_t*)&delay, nullptr); + X_STATUS result = xboxkrnl::KeDelayExecutionThread(MODE::UserMode, bAlertable, + &delay, nullptr); // If the delay was interrupted by an APC, keep delaying the thread while (bAlertable && result == X_STATUS_ALERTED) { result = xboxkrnl::KeDelayExecutionThread(MODE::UserMode, bAlertable, - (uint64_t*)&delay, nullptr); + &delay, nullptr); } return result == X_STATUS_SUCCESS ? X_STATUS_SUCCESS : X_STATUS_USER_APC; @@ -486,7 +485,7 @@ DECLARE_XAM_EXPORT1(SleepEx, kNone, kImplemented); // https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-sleep void Sleep_entry(dword_t dwMilliseconds) { - RtlSleep_entry(dwMilliseconds, FALSE); + RtlSleep_entry(dwMilliseconds, false); } DECLARE_XAM_EXPORT1(Sleep, kNone, kImplemented); @@ -601,28 +600,29 @@ DECLARE_XAM_EXPORT1(GetCurrentThreadId, kNone, kImplemented); qword_result_t XapiFormatTimeOut_entry(lpqword_t result, dword_t dwMilliseconds) { - LARGE_INTEGER delay{}; - - // Convert the delay time to 100-nanosecond intervals - delay.QuadPart = - dwMilliseconds == -1 ? 0 : static_cast(-10000) * dwMilliseconds; + if (dwMilliseconds == -1) { + return 0; + } - return (uint64_t)&delay; + *result = static_cast(-10000) * dwMilliseconds; + return result.host_address(); } DECLARE_XAM_EXPORT1(XapiFormatTimeOut, kNone, kImplemented); dword_result_t WaitForSingleObjectEx_entry(dword_t hHandle, dword_t dwMilliseconds, dword_t bAlertable) { - uint64_t* timeout = nullptr; - uint64_t timeout_ptr = XapiFormatTimeOut_entry(timeout, dwMilliseconds); + // TODO(Gliniak): Figure it out to be less janky. + uint64_t timeout; + uint64_t* timeout_ptr = reinterpret_cast( + static_cast(XapiFormatTimeOut_entry(&timeout, dwMilliseconds))); - X_STATUS result = xe::kernel::xboxkrnl::NtWaitForSingleObjectEx( - hHandle, 1, bAlertable, &timeout_ptr); + X_STATUS result = + xboxkrnl::NtWaitForSingleObjectEx(hHandle, 1, bAlertable, timeout_ptr); while (bAlertable && result == X_STATUS_ALERTED) { - result = xe::kernel::xboxkrnl::NtWaitForSingleObjectEx( - hHandle, 1, bAlertable, &timeout_ptr); + result = + xboxkrnl::NtWaitForSingleObjectEx(hHandle, 1, bAlertable, timeout_ptr); } RtlSetLastNTError_entry(result); diff --git a/src/xenia/kernel/xam/xam_ui.cc b/src/xenia/kernel/xam/xam_ui.cc index 9f123675e5..1791e5adc5 100644 --- a/src/xenia/kernel/xam/xam_ui.cc +++ b/src/xenia/kernel/xam/xam_ui.cc @@ -385,7 +385,7 @@ class ProfilePasscodeDialog : public XamDialog { if (ImGui::BeginPopupModal(title_.c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { if (description_.size()) { - ImGui::Text(description_.c_str()); + ImGui::Text("%s", description_.c_str()); } for (uint8_t i = 0; i < passcode_length; i++) { @@ -642,14 +642,12 @@ class GameAchievementsDialog final : public XamDialog { ImGui::PushFont(imgui_drawer()->GetTitleFont()); const auto primary_line_height = ImGui::GetTextLineHeight(); - ImGui::TextUnformatted( - fmt::format("{}", GetAchievementTitle(achievement_entry)).c_str()); + ImGui::Text("%s", GetAchievementTitle(achievement_entry).c_str()); ImGui::PopFont(); ImGui::PushTextWrapPos(ImGui::GetMainViewport()->Size.x * 0.5f); - ImGui::TextWrapped( - fmt::format("{}", GetAchievementDescription(achievement_entry)) - .c_str()); + ImGui::TextWrapped("%s", + GetAchievementDescription(achievement_entry).c_str()); ImGui::PopTextWrapPos(); ImGui::SetCursorPosY(start_drawing_pos.y + default_image_icon_size.x - @@ -872,7 +870,7 @@ class GamesInfoDialog final : public ui::ImGuiDialog { ImGui::SetCursorPosX(ImGui::GetCursorPosX() + textOffsetX); } - ImGui::Text(no_entries_message.c_str()); + ImGui::Text("%s", no_entries_message.c_str()); ImGui::PopFont(); } diff --git a/src/xenia/kernel/xobject.h b/src/xenia/kernel/xobject.h index 293182a960..0717c2bdcf 100644 --- a/src/xenia/kernel/xobject.h +++ b/src/xenia/kernel/xobject.h @@ -135,6 +135,8 @@ class XObject { case Type::Thread: case Type::Timer: return true; + default: + return false; } return false; } diff --git a/src/xenia/ui/imgui_guest_notification.cc b/src/xenia/ui/imgui_guest_notification.cc index 3c00fe2b01..110930ce6b 100644 --- a/src/xenia/ui/imgui_guest_notification.cc +++ b/src/xenia/ui/imgui_guest_notification.cc @@ -170,7 +170,7 @@ void AchievementNotificationWindow::OnDraw(ImGuiIO& io) { ImGui::SameLine(); if (notification_draw_progress_ > 0.5f) { - ImGui::TextColored(white_color, GetNotificationText().c_str()); + ImGui::TextColored(white_color, "%s", GetNotificationText().c_str()); } } // Restore previous style @@ -248,7 +248,7 @@ void XNotifyWindow::OnDraw(ImGuiIO& io) { ImGui::SameLine(); if (notification_draw_progress_ > 0.5f) { - ImGui::TextColored(white_color, GetDescription().c_str()); + ImGui::TextColored(white_color, "%s", GetDescription().c_str()); } } // Restore previous style diff --git a/src/xenia/ui/imgui_guest_notification.h b/src/xenia/ui/imgui_guest_notification.h index c5428215cd..6348709698 100644 --- a/src/xenia/ui/imgui_guest_notification.h +++ b/src/xenia/ui/imgui_guest_notification.h @@ -57,7 +57,7 @@ class ImGuiGuestNotification : public ImGuiNotification { const ImVec2 CalculateNotificationSize(ImVec2 text_size, float scale) override; - virtual void OnDraw(ImGuiIO& io) {} + virtual void OnDraw(ImGuiIO& io) override {} float notification_draw_progress_; diff --git a/src/xenia/ui/imgui_host_notification.cc b/src/xenia/ui/imgui_host_notification.cc index 142ca334fb..a0d85507c6 100644 --- a/src/xenia/ui/imgui_host_notification.cc +++ b/src/xenia/ui/imgui_host_notification.cc @@ -79,9 +79,9 @@ void HostNotificationWindow::OnDraw(ImGuiIO& io) { { ImGui::SetWindowFontScale(window_scale); - ImGui::Text(GetTitle().c_str()); + ImGui::Text("%s", GetTitle().c_str()); ImGui::Separator(); - ImGui::Text(GetDescription().c_str()); + ImGui::Text("%s", GetDescription().c_str()); } ImGui::End(); } diff --git a/src/xenia/ui/imgui_host_notification.h b/src/xenia/ui/imgui_host_notification.h index b6bbe04784..aed720b3ab 100644 --- a/src/xenia/ui/imgui_host_notification.h +++ b/src/xenia/ui/imgui_host_notification.h @@ -32,7 +32,7 @@ class ImGuiHostNotification : public ImGuiNotification { const ImVec2 CalculateNotificationSize(ImVec2 text_size, float scale) override; - virtual void OnDraw(ImGuiIO& io) {} + virtual void OnDraw(ImGuiIO& io) override {} }; class HostNotificationWindow final : ImGuiHostNotification { diff --git a/src/xenia/vfs/devices/xcontent_container_device.h b/src/xenia/vfs/devices/xcontent_container_device.h index 7faa6ea760..9c70d6c531 100644 --- a/src/xenia/vfs/devices/xcontent_container_device.h +++ b/src/xenia/vfs/devices/xcontent_container_device.h @@ -37,7 +37,7 @@ class XContentContainerDevice : public Device { ~XContentContainerDevice() override; - bool Initialize(); + bool Initialize() override; const std::string& name() const override { return name_; } uint32_t attributes() const override { return 0; } @@ -93,9 +93,9 @@ class XContentContainerDevice : public Device { // Initialize any container specific fields. virtual void SetupContainer() {}; - Entry* ResolvePath(const std::string_view path); + Entry* ResolvePath(const std::string_view path) override; void CloseFiles(); - void Dump(StringBuffer* string_buffer); + void Dump(StringBuffer* string_buffer) override; Result ReadHeaderAndVerify(FILE* header_file); void SetName(std::string name) { name_ = name; }