[common,assistance] eliminate pedantic cast warnings

This commit is contained in:
akallabeth 2024-08-30 15:17:38 +02:00
parent 7c1fd71b7b
commit 3674c5c2f7
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
1 changed files with 23 additions and 5 deletions

View File

@ -1342,8 +1342,13 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile
if (ports != addresses)
return FALSE;
const UINT32 port = (UINT32)ArrayList_GetItem(file->MachinePorts, 0);
if (!freerdp_settings_set_uint32(settings, FreeRDP_ServerPort, port))
union
{
UINT32 port;
void* data;
} cnv;
cnv.data = ArrayList_GetItem(file->MachinePorts, 0);
if (!freerdp_settings_set_uint32(settings, FreeRDP_ServerPort, cnv.port))
return FALSE;
if (!freerdp_target_net_adresses_reset(settings, ports))
@ -1351,8 +1356,13 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile
for (size_t x = 0; x < ports; x++)
{
const UINT32 mport = (UINT32)ArrayList_GetItem(file->MachinePorts, x);
if (!freerdp_settings_set_pointer_array(settings, FreeRDP_TargetNetPorts, x, &mport))
union
{
UINT32 port;
void* data;
} cnv;
cnv.data = ArrayList_GetItem(file->MachinePorts, x);
if (!freerdp_settings_set_pointer_array(settings, FreeRDP_TargetNetPorts, x, &cnv.port))
return FALSE;
}
for (size_t i = 0; i < addresses; i++)
@ -1451,7 +1461,15 @@ void freerdp_assistance_print_file(rdpAssistanceFile* file, wLog* log, DWORD lev
const char* uri = NULL;
const char* addr = ArrayList_GetItem(file->MachineAddresses, x);
if (x < ArrayList_Count(file->MachinePorts))
port = (UINT32)ArrayList_GetItem(file->MachinePorts, x);
{
union
{
UINT32 port;
void* data;
} cnv;
cnv.data = ArrayList_GetItem(file->MachinePorts, x);
port = cnv.port;
}
if (x < ArrayList_Count(file->MachineUris))
uri = ArrayList_GetItem(file->MachineUris, x);