Skip to content

Commit

Permalink
Misc: Warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Sep 10, 2024
1 parent d7ce028 commit ddcb0cb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/common/gsvector_sse.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ class alignas(16) GSVector4i

ALWAYS_INLINE bool rempty() const { return lt32(zwzw()).mask() != 0x00ff; }

ALWAYS_INLINE GSVector4i runion(const GSVector4i& v) const { return min_i32(v).upl64(max_i32(v).srl<8>()); }
ALWAYS_INLINE GSVector4i runion(const GSVector4i& v) const { return min_i32(v).blend32<0xc>(max_i32(v)); }

ALWAYS_INLINE GSVector4i rintersect(const GSVector4i& v) const { return sat_i32(v); }
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
Expand Down Expand Up @@ -1354,7 +1354,8 @@ class alignas(16) GSVector4i

ALWAYS_INLINE static GSVector4i loadnt(const void* p)
{
return GSVector4i(_mm_stream_load_si128(static_cast<const __m128i*>(p)));
// Should be const, but isn't...
return GSVector4i(_mm_stream_load_si128(const_cast<__m128i*>(static_cast<const __m128i*>(p))));
}

ALWAYS_INLINE static GSVector4i load32(const void* p) { return GSVector4i(_mm_loadu_si32(p)); }
Expand Down
2 changes: 1 addition & 1 deletion src/duckstation-qt/debuggerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void DebuggerWindow::setMemoryViewRegion(Bus::MemoryRegion region)
void* const mem_ptr = Bus::GetMemoryRegionPointer(region);
const bool mem_writable = Bus::IsMemoryRegionWritable(region);
const MemoryViewWidget::EditCallback edit_callback =
((region == Bus::MemoryRegion::RAM) ? edit_ram_callback : nullptr);
((region == Bus::MemoryRegion::RAM) ? static_cast<MemoryViewWidget::EditCallback>(edit_ram_callback) : nullptr);
m_ui.memoryView->setData(start, mem_ptr, end - start, mem_writable, edit_callback);

#define SET_REGION_RADIO_BUTTON(name, rb_region) \
Expand Down
2 changes: 2 additions & 0 deletions src/util/imgui_fullscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,8 @@ void ImGuiFullscreen::BeginMenuButtons(u32 num_items, float y_align, float x_pad
case ImGuiDir_Down:
ImGui::SetScrollY(std::min(ImGui::GetScrollY() + item_height, ImGui::GetScrollMaxY()));
break;
default:
break;
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/util/vulkan_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ class Error;
#include "vulkan_entry_points.h"

// We include vk_mem_alloc globally, so we don't accidentally include it before the vulkan header somewhere.
#ifdef __clang__
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
#pragma clang diagnostic ignored "-Wunused-function"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-function"
#elif defined(_MSC_VER)
#pragma warning(push, 0)
#endif
Expand All @@ -88,8 +92,10 @@ class Error;
#define VMA_STATS_STRING_ENABLED 0
#include "vulkan/vk_mem_alloc.h"

#ifdef __clang__
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#endif
Expand Down

0 comments on commit ddcb0cb

Please sign in to comment.