chore: 修复 Debug 配置编译警告

This commit is contained in:
Xu 2025-08-27 10:58:46 +08:00 committed by Xu
commit 664e0f4c8a
3 changed files with 10 additions and 3 deletions

View file

@ -272,8 +272,8 @@ void CursorDrawer::Draw(ID3D11Texture2D* backBuffer, POINT drawOffset) noexcept
UINT destLeft = UINT(std::max(0l, viewportRect.left - cursorRect.left));
UINT destTop = UINT(std::max(0l, viewportRect.top - cursorRect.top));
assert(destLeft + srcBox.right - srcBox.left <= cursorSize.cx);
assert(destTop + srcBox.bottom - srcBox.top <= cursorSize.cy);
assert(LONG(destLeft + srcBox.right - srcBox.left) <= cursorSize.cx);
assert(LONG(destTop + srcBox.bottom - srcBox.top) <= cursorSize.cy);
d3dDC->CopySubresourceRegion(_tempCursorTexture.get(),
0, destLeft, destTop, 0, backBuffer, 0, &srcBox);

View file

@ -1,5 +1,12 @@
#pragma once
#if defined(_DEBUG) && defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-compare"
#endif
#include <spdlog/spdlog.h>
#if defined(_DEBUG) && defined(__clang__)
#pragma clang diagnostic pop
#endif
#include <fmt/printf.h>
// std::source_location 中的函数名包含整个签名过于冗长,我们只需记录函数名,

View file

@ -30,7 +30,7 @@ protected:
static LRESULT CALLBACK _WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
if (msg == WM_NCCREATE) {
WindowBaseT* that = (WindowBaseT*)(((CREATESTRUCT*)lParam)->lpCreateParams);
//assert(that && !that->_hWnd);
assert(that && !that->_hWnd);
that->_hWnd = hWnd;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)that);
} else if (T* that = (T*)GetWindowLongPtr(hWnd, GWLP_USERDATA)) {