Fixed WITH_WINPR_VERBOSE_ASSERT compile flag

* Compile flag was not always set
* Fix broken WINPR_ASSERT usages detected
This commit is contained in:
Armin Novak 2021-07-28 09:09:07 +02:00 committed by akallabeth
parent d65d4ee4fb
commit 61b46adaf1
4 changed files with 12 additions and 13 deletions

View File

@ -932,6 +932,12 @@ if(BUILD_TESTING)
endif()
# WinPR
# We want to control the winpr assert for the whole project
option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON)
if (WITH_VERBOSE_WINPR_ASSERT)
add_definitions(-DWITH_VERBOSE_WINPR_ASSERT)
endif()
if (FREERDP_UNIFIED_BUILD)
add_subdirectory(winpr)
if (WITH_WAYLAND)
@ -946,12 +952,6 @@ if (FREERDP_UNIFIED_BUILD)
else()
find_package(WinPR 3 REQUIRED)
include_directories(${WinPR_INCLUDE_DIR})
# We want to control the winpr assert for the whole project
option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON)
if (WITH_VERBOSE_WINPR_ASSERT)
add_definitions(-DWITH_VERBOSE_WINPR_ASSERT)
endif()
endif()
# Include directories

View File

@ -2691,8 +2691,8 @@ int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData,
WINPR_ASSERT(rect->x % 64 == 0);
WINPR_ASSERT(rect->y % 64 == 0);
WINPR_ASSERT(rect->width % 64 == 0);
WINPR_ASSERT(rect->height % 64 == 0);
WINPR_ASSERT(rect->width <= 64);
WINPR_ASSERT(rect->height <= 64);
}
}
else
@ -2717,8 +2717,8 @@ int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData,
WINPR_ASSERT(r->x % 64 == 0);
WINPR_ASSERT(r->y % 64 == 0);
WINPR_ASSERT(r->width % 64 == 0);
WINPR_ASSERT(r->height % 64 == 0);
WINPR_ASSERT(r->width <= 64);
WINPR_ASSERT(r->height <= 64);
}
}
s = progressive->buffer;

View File

@ -330,7 +330,7 @@ static void test_peer_draw_icon(freerdp_peer* client, UINT32 x, UINT32 y)
WINPR_ASSERT(client);
context = (testPeerContext*)client->context;
WINPR_ASSERT(context);
WINPR_ASSERT(context->update);
WINPR_ASSERT(client->update);
if (client->update->dump_rfx)
return;

View File

@ -118,7 +118,7 @@ static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client)
rdpSettings* settings;
WINPR_ASSERT(client);
WINPR_ASSERT(client->context);
WINPR_ASSERT(client->rdpgfx);
context = client->rdpgfx;
WINPR_ASSERT(context);
@ -292,7 +292,6 @@ static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, UINT32 nu
rdpSettings* settings;
WINPR_ASSERT(client);
WINPR_ASSERT(client->context);
WINPR_ASSERT(rects || (numRects == 0));
settings = client->context.settings;