diff --git a/channels/ainput/client/ainput_main.c b/channels/ainput/client/ainput_main.c index 751e09880..dc8b481f7 100644 --- a/channels/ainput/client/ainput_main.c +++ b/channels/ainput/client/ainput_main.c @@ -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 */ diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index e08542243..7bc5bdff5 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -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); diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index ca1bbae5a..9edef8f6d 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -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; } } diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 5d2520836..7ba060016 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -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) diff --git a/libfreerdp/codec/yuv.c b/libfreerdp/codec/yuv.c index 62392468f..bf6853b79 100644 --- a/libfreerdp/codec/yuv.c +++ b/libfreerdp/codec/yuv.c @@ -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 = ®ionRects[y]; YUV_PROCESS_WORK_PARAM current = diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 59751c3dd..773b87aa6 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -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; diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 17088503f..b873f86de 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -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); - 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); - 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); - 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); - if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_ServerCertificate, data, len)) - return FALSE; - + { + 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; + } + { + 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; + } + { + 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; + } + { + 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 UINT32 count = freerdp_settings_get_uint32(settings, FreeRDP_MonitorDefArraySize); + 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_MonitorDefArray, monitors, count)) + goto out_fail; + } if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_MonitorIds, NULL, 16)) goto out_fail; diff --git a/libfreerdp/utils/rdpdr_utils.c b/libfreerdp/utils/rdpdr_utils.c index fa87841ac..b6df954db 100644 --- a/libfreerdp/utils/rdpdr_utils.c +++ b/libfreerdp/utils/rdpdr_utils.c @@ -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) diff --git a/libfreerdp/utils/smartcard_call.c b/libfreerdp/utils/smartcard_call.c index d04b9b440..f13109a6f 100644 --- a/libfreerdp/utils/smartcard_call.c +++ b/libfreerdp/utils/smartcard_call.c @@ -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); diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 53c887052..921a70290 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -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, - NULL, NULL); - WINPR_ASSERT(rc > 0); + r = ConvertFromUnicode(CP_UTF8, 0, identity->User, (int)identity->UserLength, &user, 0, + NULL, NULL); + 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, - &domain, 0, NULL, NULL); - WINPR_ASSERT(rc > 0); + r = ConvertFromUnicode(CP_UTF8, 0, identity->Domain, (int)identity->DomainLength, + &domain, 0, NULL, NULL); + 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, - &password, 0, NULL, NULL); - WINPR_ASSERT(rc > 0); + r = ConvertFromUnicode(CP_UTF8, 0, identity->Password, (int)identity->PasswordLength, + &password, 0, NULL, NULL); + WINPR_ASSERT(r > 0); } } else