[warnings] remove unused variables

This commit is contained in:
akallabeth 2024-09-12 09:18:46 +02:00
parent 898cb5782c
commit c9b0c9ecd5
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
12 changed files with 20 additions and 37 deletions

View File

@ -828,21 +828,18 @@ static UINT
cliprdr_client_format_data_response(CliprdrClientContext* context,
const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
{
wStream* s = NULL;
cliprdrPlugin* cliprdr = NULL;
WINPR_ASSERT(context);
WINPR_ASSERT(formatDataResponse);
cliprdr = (cliprdrPlugin*)context->handle;
cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle;
WINPR_ASSERT(cliprdr);
const UINT32 mask =
freerdp_settings_get_uint32(context->rdpcontext->settings, FreeRDP_ClipboardFeatureMask);
WINPR_ASSERT((mask & (CLIPRDR_FLAG_LOCAL_TO_REMOTE | CLIPRDR_FLAG_LOCAL_TO_REMOTE_FILES)) != 0);
WINPR_ASSERT(
(freerdp_settings_get_uint32(context->rdpcontext->settings, FreeRDP_ClipboardFeatureMask) &
(CLIPRDR_FLAG_LOCAL_TO_REMOTE | CLIPRDR_FLAG_LOCAL_TO_REMOTE_FILES)) != 0);
s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, formatDataResponse->common.msgFlags,
formatDataResponse->common.dataLen);
wStream* s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, formatDataResponse->common.msgFlags,
formatDataResponse->common.dataLen);
if (!s)
{

View File

@ -147,10 +147,6 @@ static UINT write_printjob(rdpPrintJob* printjob, const BYTE* data, size_t size)
*/
static UINT printer_cups_write_printjob(rdpPrintJob* printjob, const BYTE* data, size_t size)
{
rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*)printjob;
WINPR_ASSERT(cups_printjob);
return write_printjob(printjob, data, size);
}

View File

@ -1166,8 +1166,6 @@ static void sdl_post_final_disconnect(freerdp* instance)
if (!instance->context)
return;
auto context = get_context(instance->context);
}
/* RDP main loop.

View File

@ -55,7 +55,7 @@ void tf_OnChannelConnectedEventHandler(void* context, const ChannelConnectedEven
clip->custom = context;
}
else
freerdp_client_OnChannelConnectedEventHandler(context, e);
freerdp_client_OnChannelConnectedEventHandler(&tf->common, e);
}
void tf_OnChannelDisconnectedEventHandler(void* context, const ChannelDisconnectedEventArgs* e)
@ -75,5 +75,5 @@ void tf_OnChannelDisconnectedEventHandler(void* context, const ChannelDisconnect
clip->custom = NULL;
}
else
freerdp_client_OnChannelDisconnectedEventHandler(context, e);
freerdp_client_OnChannelDisconnectedEventHandler(&tf->common, e);
}

View File

@ -788,9 +788,6 @@ void xf_minimize(xfContext* xfc)
rdpContext* context = (rdpContext*)xfc;
WINPR_ASSERT(context);
rdpSettings* settings = context->settings;
WINPR_ASSERT(settings);
/*
when debugging, ungrab keyboard when toggling fullscreen
to allow keyboard usage on the debugger

View File

@ -433,9 +433,6 @@ BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, Window win
WINPR_ASSERT(xfc);
WINPR_ASSERT(xfc->common.context.settings);
rdpInput* input = xfc->common.context.input;
WINPR_ASSERT(input);
if (!freerdp_settings_get_bool(xfc->common.context.settings, FreeRDP_MouseMotion))
{
if ((state & (Button1Mask | Button2Mask | Button3Mask)) == 0)

View File

@ -254,9 +254,6 @@ int xf_input_init(xfContext* xfc, Window window)
WINPR_ASSERT(xfc);
rdpSettings* settings = xfc->common.context.settings;
WINPR_ASSERT(settings);
xfc->firstDist = -1.0;
xfc->z_vector = 0;
xfc->px_vector = 0;

View File

@ -634,8 +634,7 @@ static DWORD client_cli_accept_certificate(freerdp* instance)
const rdpSettings* settings = instance->context->settings;
WINPR_ASSERT(settings);
const BOOL fromStdin =
freerdp_settings_get_bool(instance->context->settings, FreeRDP_CredentialsFromStdin);
const BOOL fromStdin = freerdp_settings_get_bool(settings, FreeRDP_CredentialsFromStdin);
if (fromStdin)
return 0;

View File

@ -427,6 +427,8 @@ static BOOL freerdp_assistance_parse_attr(const char** opt, size_t* plength, con
const int rc = _snprintf(bkey, sizeof(bkey), "%s=\"", key);
WINPR_ASSERT(rc > 0);
WINPR_ASSERT((size_t)rc < sizeof(bkey));
if ((rc <= 0) || (rc >= sizeof(bkey)))
return FALSE;
char* p = strstr(tag, bkey);
if (!p)
@ -527,6 +529,8 @@ static char* freerdp_assistance_contains_element(char* input, size_t ilen, const
const int rc = _snprintf(bkey, sizeof(bkey), "<%s", key);
WINPR_ASSERT(rc > 0);
WINPR_ASSERT((size_t)rc < sizeof(bkey));
if ((rc < 0) || (rc >= sizeof(bkey)))
return NULL;
char* tag = strstr(input, bkey);
if (!tag || (tag > input + ilen))
@ -566,6 +570,8 @@ static char* freerdp_assistance_contains_element(char* input, size_t ilen, const
const int erc = _snprintf(ekey, sizeof(ekey), "</%s>", key);
WINPR_ASSERT(erc > 0);
WINPR_ASSERT((size_t)erc < sizeof(ekey));
if ((erc <= 0) || (erc >= sizeof(ekey)))
return NULL;
const size_t offset = start - tag;
dend = end = strrstr(start, ilen - offset, ekey);
if (end)

View File

@ -321,12 +321,9 @@ static BOOL rts_read_auth_verifier(wStream* s, auth_verifier_co_t* auth,
if (!rts_read_auth_verifier_no_checks(s, auth, header, &pos, silent))
return FALSE;
{
const size_t expected = header->frag_length - header->auth_length - 8;
WINPR_ASSERT(pos + auth->auth_pad_length == expected);
}
return TRUE;
const size_t expected = header->frag_length - header->auth_length - 8;
WINPR_ASSERT(pos + auth->auth_pad_length == expected);
return pos + auth->auth_pad_length == expected;
}
static BOOL rts_read_auth_verifier_with_stub(wStream* s, auth_verifier_co_t* auth,

View File

@ -755,9 +755,6 @@ static state_run_t rdp_peer_handle_state_active(freerdp_peer* client)
WINPR_ASSERT(client);
WINPR_ASSERT(client->context);
rdpRdp* rdp = client->context->rdp;
WINPR_ASSERT(rdp);
if (!client->connected)
{
/**

View File

@ -450,6 +450,8 @@ LONG WINAPI Emulate_SCardIsValidContext(SmartcardEmulationContext* smartcard, SC
{
SCardContext* value = HashTable_GetItemValue(smartcard->contexts, (const void*)hContext);
WINPR_ASSERT(value); /* Must be valid after Emulate_SCardIsValidContext */
if (!value)
return SCARD_F_INTERNAL_ERROR;
}
WLog_Print(smartcard->log, smartcard->log_default_level,