[debug] fix compile issues with WITH_DEBUG* builds

This commit is contained in:
akallabeth
2025-03-06 16:17:39 +01:00
parent aa4384a286
commit 075e2fa5c9
2 changed files with 38 additions and 5 deletions

View File

@@ -395,6 +395,19 @@ uint32_t sdlInput::prefToMask()
return mod;
}
#if defined(WITH_DEBUG_SDL_KBD_EVENTS)
static const char* sdl_scancode_name(Uint32 scancode)
{
for (const auto& cur : map)
{
if (cur.sdl == scancode)
return cur.sdl_name;
}
return "SDL_SCANCODE_UNKNOWN";
}
#endif
static Uint32 sdl_scancode_val(const char* scancodeName)
{
for (const auto& cur : map)
@@ -406,6 +419,30 @@ static Uint32 sdl_scancode_val(const char* scancodeName)
return SDL_SCANCODE_UNKNOWN;
}
#if defined(WITH_DEBUG_SDL_KBD_EVENTS)
static const char* sdl_rdp_scancode_name(UINT32 scancode)
{
for (const auto& cur : map)
{
if (cur.rdp == scancode)
return cur.rdp_name;
}
return "RDP_SCANCODE_UNKNOWN";
}
#endif
static UINT32 sdl_rdp_scancode_val(const char* scancodeName)
{
for (const auto& cur : map)
{
if (strcmp(cur.rdp_name, scancodeName) == 0)
return cur.rdp;
}
return RDP_SCANCODE_UNKNOWN;
}
static UINT32 sdl_scancode_to_rdp(Uint32 scancode)
{
UINT32 rdp = RDP_SCANCODE_UNKNOWN;

View File

@@ -99,9 +99,6 @@ static inline BOOL RLEDECOMPRESS(const BYTE* WINPR_RESTRICT pbSrcBuffer, UINT32
BYTE* WINPR_RESTRICT pbDestBuffer, UINT32 rowDelta, UINT32 width,
UINT32 height)
{
#if defined(WITH_DEBUG_CODECS)
char sbuffer[128] = { 0 };
#endif
const BYTE* pbSrc = pbSrcBuffer;
BYTE* pbDest = pbDestBuffer;
PIXEL temp = 0;
@@ -152,8 +149,7 @@ static inline BOOL RLEDECOMPRESS(const BYTE* WINPR_RESTRICT pbSrcBuffer, UINT32
code = ExtractCodeId(*pbSrc);
#if defined(WITH_DEBUG_CODECS)
WLog_VRB(TAG, "pbSrc=%p code=%s, rem=%" PRIuz, pbSrc,
rle_code_str_buffer(code, sbuffer, sizeof(sbuffer)), pbEnd - pbSrc);
WLog_VRB(TAG, "pbSrc=%p code=%s, rem=%" PRIuz, pbSrc, rle_code_str(code), pbEnd - pbSrc);
#endif
/* Handle Background Run Orders. */