Fixed -Wshadow warnings

This commit is contained in:
akallabeth 2022-06-30 10:15:45 +02:00 committed by akallabeth
parent 39bd78d2fb
commit cb96e6143d
10 changed files with 65 additions and 67 deletions

View File

@ -113,9 +113,9 @@ static UINT ainput_send_input_event(AInputClientContext* context, UINT64 flags,
WINPR_ASSERT(callback);
{
char buffer[128] = { 0 };
char ebuffer[128] = { 0 };
WLog_VRB(TAG, "[%s] sending timestamp=0x%08" PRIx64 ", flags=%s, %" PRId32 "x%" PRId32,
__FUNCTION__, time, ainput_flags_to_string(flags, buffer, sizeof(buffer)), x, y);
__FUNCTION__, time, ainput_flags_to_string(flags, ebuffer, sizeof(ebuffer)), x, y);
}
/* Message type */

View File

@ -1085,9 +1085,10 @@ UINT rail_order_recv(LPVOID userdata, wStream* s)
if (error != CHANNEL_RC_OK)
{
char buffer[128] = { 0 };
char ebuffer[128] = { 0 };
WLog_Print(rail->log, WLOG_ERROR, "Failed to process rail %s PDU, length:%" PRIu16 "",
rail_get_order_type_string_full(orderType, buffer, sizeof(buffer)), orderLength);
rail_get_order_type_string_full(orderType, ebuffer, sizeof(ebuffer)),
orderLength);
}
Stream_Free(s, TRUE);

View File

@ -121,7 +121,6 @@ static DWORD WINAPI smartcard_context_thread(LPVOID arg)
if (element)
{
UINT error;
WINPR_ASSERT(smartcard);
if ((status = smartcard_irp_device_control_call(
@ -138,7 +137,6 @@ static DWORD WINAPI smartcard_context_thread(LPVOID arg)
{
smartcard_operation_free(&element->operation, TRUE);
WLog_ERR(TAG, "Queue_Enqueue failed!");
status = error;
break;
}
@ -469,15 +467,15 @@ static UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp)
}
else
{
UINT status;
UINT ustatus;
WLog_ERR(TAG, "Unexpected SmartCard IRP: MajorFunction %s, MinorFunction: 0x%08" PRIX32 "",
rdpdr_irp_string(irp->MajorFunction), irp->MinorFunction);
irp->IoStatus = (UINT32)STATUS_NOT_SUPPORTED;
if ((status = smartcard_complete_irp(smartcard, irp)))
if ((ustatus = smartcard_complete_irp(smartcard, irp)))
{
WLog_ERR(TAG, "Queue_Enqueue failed!");
return status;
return ustatus;
}
}

View File

@ -865,11 +865,6 @@ static int freerdp_client_command_line_post_filter(void* context, COMMAND_LINE_A
CommandLineSwitchCase(arg, "kerberos")
{
size_t count;
union
{
char** p;
const char** pc;
} ptr;
ptr.p = CommandLineParseCommaSeparatedValuesEx("kerberos", arg->Value, &count);
if (ptr.pc)

View File

@ -348,7 +348,7 @@ static BOOL pool_decode(YUV_CONTEXT* context, PTP_WORK_CALLBACK cb, const BYTE*
UINT32 nDstStep, const RECTANGLE_16* regionRects, UINT32 numRegionRects)
{
BOOL rc = FALSE;
UINT32 x, y;
UINT32 x;
UINT32 waitCount = 0;
primitives_t* prims = primitives_get();
@ -367,7 +367,7 @@ static BOOL pool_decode(YUV_CONTEXT* context, PTP_WORK_CALLBACK cb, const BYTE*
if (!context->useThreads || (primitives_flags(prims) & PRIM_FLAGS_HAVE_EXTGPU))
{
for (y = 0; y < numRegionRects; y++)
for (UINT32 y = 0; y < numRegionRects; y++)
{
const RECTANGLE_16* rect = &regionRects[y];
YUV_PROCESS_WORK_PARAM current =

View File

@ -495,7 +495,6 @@ static BOOL rdp_write_extended_info_packet(rdpRdp* rdp, wStream* s)
if (settings->EarlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE)
{
int rc;
WCHAR DynamicDSTTimeZoneKeyName[254] = { 0 };
LPWSTR ptr = DynamicDSTTimeZoneKeyName;

View File

@ -734,32 +734,34 @@ static BOOL freerdp_settings_int_buffer_copy(rdpSettings* _settings, const rdpSe
{
BOOL rc = FALSE;
UINT32 index;
const void* data;
size_t len;
if (!_settings || !settings)
return FALSE;
data = freerdp_settings_get_pointer(settings, FreeRDP_LoadBalanceInfo);
len = freerdp_settings_get_uint32(settings, FreeRDP_LoadBalanceInfoLength);
{
const void* data = freerdp_settings_get_pointer(settings, FreeRDP_LoadBalanceInfo);
const UINT32 len = freerdp_settings_get_uint32(settings, FreeRDP_LoadBalanceInfoLength);
if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_LoadBalanceInfo, data, len))
return FALSE;
data = freerdp_settings_get_pointer(settings, FreeRDP_ServerRandom);
len = freerdp_settings_get_uint32(settings, FreeRDP_ServerRandomLength);
}
{
const void* data = freerdp_settings_get_pointer(settings, FreeRDP_ServerRandom);
const UINT32 len = freerdp_settings_get_uint32(settings, FreeRDP_ServerRandomLength);
if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_ServerRandom, data, len))
return FALSE;
data = freerdp_settings_get_pointer(settings, FreeRDP_ClientRandom);
len = freerdp_settings_get_uint32(settings, FreeRDP_ClientRandomLength);
}
{
const void* data = freerdp_settings_get_pointer(settings, FreeRDP_ClientRandom);
const UINT32 len = freerdp_settings_get_uint32(settings, FreeRDP_ClientRandomLength);
if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_ClientRandom, data, len))
return FALSE;
data = freerdp_settings_get_pointer(settings, FreeRDP_ServerCertificate);
len = freerdp_settings_get_uint32(settings, FreeRDP_ServerCertificateLength);
}
{
const void* data = freerdp_settings_get_pointer(settings, FreeRDP_ServerCertificate);
const UINT32 len = freerdp_settings_get_uint32(settings, FreeRDP_ServerCertificateLength);
if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_ServerCertificate, data, len))
return FALSE;
}
if (settings->RdpServerCertificate)
{
rdpCertificate* cert = certificate_clone(settings->RdpServerCertificate);
@ -798,11 +800,14 @@ static BOOL freerdp_settings_int_buffer_copy(rdpSettings* _settings, const rdpSe
defArraySize))
goto out_fail;
{
const UINT32 count = freerdp_settings_get_uint32(settings, FreeRDP_MonitorDefArraySize);
const rdpMonitor* monitors = freerdp_settings_get_pointer(settings, FreeRDP_MonitorDefArray);
const rdpMonitor* monitors =
freerdp_settings_get_pointer(settings, FreeRDP_MonitorDefArray);
if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_MonitorDefArray, monitors, count))
goto out_fail;
}
if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_MonitorIds, NULL, 16))
goto out_fail;

View File

@ -270,7 +270,7 @@ BOOL rdpdr_write_iocompletion_header(wStream* out, UINT32 DeviceId, UINT32 Compl
void rdpdr_dump_received_packet(wStream* s, const char* custom)
{
const size_t pos = Stream_GetPosition(s);
const size_t gpos = Stream_GetPosition(s);
Stream_SetPosition(s, 0);
if (Stream_Length(s) >= 4)
{
@ -322,7 +322,7 @@ void rdpdr_dump_received_packet(wStream* s, const char* custom)
winpr_HexLogDump(log, WLOG_TRACE, Stream_Buffer(s), Stream_Length(s));
}
Stream_SetPosition(s, pos);
Stream_SetPosition(s, gpos);
}
void rdpdr_dump_send_packet(wStream* s, const char* custom)

View File

@ -925,12 +925,12 @@ static LONG smartcard_GetStatusChangeA_Call(scard_call_context* smartcard, wStre
for (index = 0; index < ret.cReaders; index++)
{
const SCARD_READERSTATEA* cur = &rgReaderStates[index];
ReaderState_Return* out = &ret.rgReaderStates[index];
ReaderState_Return* rout = &ret.rgReaderStates[index];
out->dwCurrentState = cur->dwCurrentState;
out->dwEventState = cur->dwEventState;
out->cbAtr = cur->cbAtr;
CopyMemory(&(out->rgbAtr), cur->rgbAtr, sizeof(out->rgbAtr));
rout->dwCurrentState = cur->dwCurrentState;
rout->dwEventState = cur->dwEventState;
rout->cbAtr = cur->cbAtr;
CopyMemory(&(rout->rgbAtr), cur->rgbAtr, sizeof(rout->rgbAtr));
}
status = smartcard_pack_get_status_change_return(out, &ret, TRUE);
@ -990,12 +990,12 @@ static LONG smartcard_GetStatusChangeW_Call(scard_call_context* smartcard, wStre
for (index = 0; index < ret.cReaders; index++)
{
const SCARD_READERSTATEW* cur = &rgReaderStates[index];
ReaderState_Return* out = &ret.rgReaderStates[index];
ReaderState_Return* rout = &ret.rgReaderStates[index];
out->dwCurrentState = cur->dwCurrentState;
out->dwEventState = cur->dwEventState;
out->cbAtr = cur->cbAtr;
CopyMemory(&(out->rgbAtr), cur->rgbAtr, sizeof(out->rgbAtr));
rout->dwCurrentState = cur->dwCurrentState;
rout->dwEventState = cur->dwEventState;
rout->cbAtr = cur->cbAtr;
CopyMemory(&(rout->rgbAtr), cur->rgbAtr, sizeof(rout->rgbAtr));
}
status = smartcard_pack_get_status_change_return(out, &ret, TRUE);

View File

@ -631,29 +631,29 @@ static BOOL shadow_client_logon(freerdp_peer* peer, const SEC_WINNT_AUTH_IDENTIT
{
if (identity->User)
{
int rc;
int r;
WINPR_ASSERT(identity->UserLength <= INT_MAX);
rc = ConvertFromUnicode(CP_UTF8, 0, identity->User, (int)identity->UserLength, &user, 0,
r = ConvertFromUnicode(CP_UTF8, 0, identity->User, (int)identity->UserLength, &user, 0,
NULL, NULL);
WINPR_ASSERT(rc > 0);
WINPR_ASSERT(r > 0);
}
if (identity->Domain)
{
int rc;
int r;
WINPR_ASSERT(identity->DomainLength <= INT_MAX);
rc = ConvertFromUnicode(CP_UTF8, 0, identity->Domain, (int)identity->DomainLength,
r = ConvertFromUnicode(CP_UTF8, 0, identity->Domain, (int)identity->DomainLength,
&domain, 0, NULL, NULL);
WINPR_ASSERT(rc > 0);
WINPR_ASSERT(r > 0);
}
if (identity->Password)
{
int rc;
int r;
WINPR_ASSERT(identity->PasswordLength <= INT_MAX);
rc = ConvertFromUnicode(CP_UTF8, 0, identity->Password, (int)identity->PasswordLength,
r = ConvertFromUnicode(CP_UTF8, 0, identity->Password, (int)identity->PasswordLength,
&password, 0, NULL, NULL);
WINPR_ASSERT(rc > 0);
WINPR_ASSERT(r > 0);
}
}
else