Skip to content

Commit 664e0f4

Browse files
committed
chore: 修复 Debug 配置编译警告
1 parent 1e7c571 commit 664e0f4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/Magpie.Core/CursorDrawer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ void CursorDrawer::Draw(ID3D11Texture2D* backBuffer, POINT drawOffset) noexcept
272272
UINT destLeft = UINT(std::max(0l, viewportRect.left - cursorRect.left));
273273
UINT destTop = UINT(std::max(0l, viewportRect.top - cursorRect.top));
274274

275-
assert(destLeft + srcBox.right - srcBox.left <= cursorSize.cx);
276-
assert(destTop + srcBox.bottom - srcBox.top <= cursorSize.cy);
275+
assert(LONG(destLeft + srcBox.right - srcBox.left) <= cursorSize.cx);
276+
assert(LONG(destTop + srcBox.bottom - srcBox.top) <= cursorSize.cy);
277277

278278
d3dDC->CopySubresourceRegion(_tempCursorTexture.get(),
279279
0, destLeft, destTop, 0, backBuffer, 0, &srcBox);

src/Shared/Logger.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#pragma once
2+
#if defined(_DEBUG) && defined(__clang__)
3+
#pragma clang diagnostic push
4+
#pragma clang diagnostic ignored "-Wsign-compare"
5+
#endif
26
#include <spdlog/spdlog.h>
7+
#if defined(_DEBUG) && defined(__clang__)
8+
#pragma clang diagnostic pop
9+
#endif
310
#include <fmt/printf.h>
411

512
// std::source_location 中的函数名包含整个签名过于冗长,我们只需记录函数名,

tools/WindowCase/WindowBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class WindowBaseT {
3030
static LRESULT CALLBACK _WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
3131
if (msg == WM_NCCREATE) {
3232
WindowBaseT* that = (WindowBaseT*)(((CREATESTRUCT*)lParam)->lpCreateParams);
33-
//assert(that && !that->_hWnd);
33+
assert(that && !that->_hWnd);
3434
that->_hWnd = hWnd;
3535
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)that);
3636
} else if (T* that = (T*)GetWindowLongPtr(hWnd, GWLP_USERDATA)) {

0 commit comments

Comments
 (0)